iicps: xiicps_polled_master_example.c File Reference

| iicps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions | Variables
xiicps_polled_master_example.c File Reference

## Overview

A design example of using the device in polled mode as master.

The example uses buffer size 132. Please set the send buffer of the Aardvark device to be continuous 64 bytes from 0x00 to 0x3F.

     MODIFICATION HISTORY:

     Ver   Who Date     Changes

     1.00a jz  01/30/10 First release

## Functions
int | IicPsMasterPolledExample (u16 DeviceId)
| This function sends data and expects to receive data from slave as modular of 64. More...
int | main (void)
| Main function to call the polled master example. More...

## Variables
XIicPs | Iic
| Instance of the IIC Device. More...
u8 | SendBuffer [TEST_BUFFER_SIZE]
| Buffer for Transmitting Data. More...
u8 | RecvBuffer [TEST_BUFFER_SIZE]
| Buffer for Receiving Data. More...

## Function Documentation

int IicPsMasterPolledExample | ( | u16 | DeviceId | ) |

This function sends data and expects to receive data from slave as modular of 64.

This function uses interrupt-driven mode of the device.

Parameters

  DeviceId | is the Device ID of the IicPs Device and is the XPAR_<IICPS_instance>_DEVICE_ID value from xparameters.h

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

References XIicPs_Config::BaseAddress, RecvBuffer, SendBuffer, XIicPs_BusIsBusy(), XIicPs_CfgInitialize(), XIicPs_LookupConfig(), XIicPs_MasterRecvPolled(), XIicPs_MasterSendPolled(), XIicPs_SelfTest(), and XIicPs_SetSClk().

Referenced by main().

int main | ( | void |  | ) |

Main function to call the polled master example.

Parameters

  None. |

Returns
  XST_SUCCESS if successful, XST_FAILURE if unsuccessful.

Note
  None.

References IicPsMasterPolledExample().

## Variable Documentation

XIicPs Iic

Instance of the IIC Device.

u8 RecvBuffer[TEST_BUFFER_SIZE]

Buffer for Receiving Data.

Referenced by IicPsMasterIntrExample(), IicPsMasterPolledExample(), IicPsSlaveIntrExample(), and IicPsSlavePolledExample().

u8 SendBuffer[TEST_BUFFER_SIZE]

Buffer for Transmitting Data.

Referenced by IicPsMasterIntrExample(), IicPsMasterPolledExample(), IicPsSlaveIntrExample(), and IicPsSlavePolledExample().