![]() |
iic
Vitis Drivers API Documentation
|
Implements IIC low-level send and receive helpers.
This file contains low-level driver functions that can be used to access the device in normal and dynamic controller mode. Refer to the hardware device specification for more details of the device operation.
MODIFICATION HISTORY:
Ver Who Date Changes
1.01b jhl 05/13/02 First release 1.01b jhl 10/14/02 Corrected bug in the receive function, the setup of the interrupt status mask was not being done in the loop such that a read would sometimes fail on the last byte because the transmit error which should have been ignored was being used. This would leave an extra byte in the FIFO and the bus throttled such that the next operation would also fail. Also updated the receive function to not disable the device after the last byte until after the bus transitions to not busy which is more consistent with the expected behavior. 1.01c ecm 12/05/02 new rev 1.02a mta 03/09/06 Implemented Repeated Start in the Low Level Driver. 1.03a mta 04/04/06 Implemented Dynamic IIC core routines. 1.03a ecm 06/15/06 Fixed the hang in low_level_eeprom_test with -O0 Added polling loops for BNB to allow the slave to respond correctly. Also added polling loop prior to reset in _Recv. 1.13a wgr 03/22/07 Converted to new coding style. 1.13b ecm 11/29/07 added BB polling loops to the DynSend and DynRecv routines to handle the race condition with BNB in IISR. 2.00a sdm 10/22/09 Converted all register accesses to 32 bit access. Updated to use the HAL APIs/macros. Some of the macros have been renamed to remove _m from the name and Some of the macros have been renamed to be consistent, see the xiic_i.h and xiic_l.h files for further information. 2.02a sdm 10/08/10 Updated to disable the device at the end of the transfer, only when addressed as slave in XIic_Send for CR565373. 2.04a sdm 07/22/11 Removed a compiler warning by adding parenthesis around & at line 479. 2.08a adk 29/07/13 In Low level driver In repeated start condition the Direction of Tx bit must be disabled in Receive condition It Fixes the CR:685759 Changes are done in the function XIic_Recv. 3.2 sk 11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425. Changed the prototypes of RecvData, SendData, DynRecvData, DynSendData APIs. 3.2 sd 18/02/16 In Low level driver in repeated start condition NACK for last byte is added. Changes are done in XIic_Recv for CR# 862303 3.3 sk 06/17/16 Added bus busy checks for slave send/recv and master send/recv. 3.3 als 06/27/16 Added Low-level XIic_CheckIsBusBusy API. 3.3 als 06/27/16 Added low-level XIic_WaitBusFree API. 3.4 nk 16/11/16 Reduced sleeping time in Bus-busy check. 3.5 sd 08/29/18 Fix bus busy check for the NACK case. 3.15 vlt 04/20/26 Added TX_ERROR check after last byte in SendData() and DynSendData() to detect NACK on the last byte. 3.16 tb 09/22/26 Align Doxygen comments with AMD documentation standards
Functions | |
| unsigned | XIic_Recv (UINTPTR BaseAddress, u8 Address, u8 *BufferPtr, unsigned ByteCount, u8 Option) |
| Receives data as a master on the IIC bus. More... | |
| unsigned | XIic_Send (UINTPTR BaseAddress, u8 Address, u8 *BufferPtr, unsigned ByteCount, u8 Option) |
| Sends data as a master on the IIC bus. More... | |
| unsigned | XIic_DynRecv (UINTPTR BaseAddress, u8 Address, u8 *BufferPtr, u8 ByteCount) |
| Receives data as a master on the IIC bus. More... | |
| unsigned | XIic_DynSend (UINTPTR BaseAddress, u16 Address, u8 *BufferPtr, u8 ByteCount, u8 Option) |
| Sends data as a master on the IIC bus. More... | |
| int | XIic_DynInit (UINTPTR BaseAddress) |
| Initializes the IIC core for dynamic functionality. More... | |
| u32 | XIic_CheckIsBusBusy (UINTPTR BaseAddress) |
| Checks whether the I2C bus is busy or free. More... | |
| u32 | XIic_WaitBusFree (UINTPTR BaseAddress) |
| Waits until the I2C bus is free or a timeout occurs. More... | |