![]() |
iic
Xilinx SDK Drivers API Documentation
|
This file consists of a Interrupt mode design example which uses the Xilinx IIC device and XIic driver to exercise the 10-bit Address functionality of the IIC device.
The XIic_MasterSend() API is used to transmit the data and XIic_MasterRecv() API is used to receive the data.
The example is tested on ML300/ML310/ML403/ML501 Xilinx boards.
The IIC devices that are present on the Xilinx boards donot support the 10-bit functionality. This example has been tested with an off board external IIC Master device and the IIC device configured as a Slave.
This code assumes that no Operating System is being used.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a mta 03/01/06 Created. 2.00a ktn 11/17/09 Updated to use the HAL APIs and replaced call to XIic_Initialize API with XIic_LookupConfig and XIic_CfgInitialize. Made minor modifications as per coding guidelines. 3.4 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028.
Functions | |
| int | IicTenBitAddrExample () |
| This function writes and reads the data as a slave. More... | |
| int | TenBitAddrWriteData (u16 ByteCount) |
| This function writes a buffer of bytes to the IIC bus when the IIC master initiates a read operation. More... | |
| int | TenBitAddrReadData (u8 *BufferPtr, u16 ByteCount) |
| This function reads a buffer of bytes when the IIC Master on the bus writes data to the slave device. More... | |
| int | main (void) |
| Main function to call the IIC Slave example. More... | |
| int IicTenBitAddrExample | ( | ) |
This function writes and reads the data as a slave.
The IIC master on the bus initiates the transfers.
| None. |
References XIic_LookupConfig().
Referenced by main().
| int main | ( | void | ) |
Main function to call the IIC Slave example.
| None. |
References IicTenBitAddrExample().
| int TenBitAddrReadData | ( | u8 * | BufferPtr, |
| u16 | ByteCount | ||
| ) |
This function reads a buffer of bytes when the IIC Master on the bus writes data to the slave device.
| BufferPtr | contains the address of the data buffer to be filled. |
| ByteCount | contains the number of bytes in the buffer to be read. |
| int TenBitAddrWriteData | ( | u16 | ByteCount | ) |
This function writes a buffer of bytes to the IIC bus when the IIC master initiates a read operation.
| ByteCount | contains the number of bytes in the buffer to be written. |