Showing changes from revision #1 to #2:
Added | Removed | Changed
int HAL_IICTransfer(int bus, unsigned int n, iic_transfer transfer[static n])
Entry | |
---|---|
bus | Bus number to operate on |
n | Number of iic_transfers |
transfer[] | iic_transfer list |
Exit | |
---|---|
- | Return code |
This is an internal call for OS use only and should not be used by user software. User software that wishes to perform IIC transfers should use the OS_IICOp SWI.
Initiates an IIC transfer. The transfer shall progress in the background if bit 4 of HAL_IICType is set, in which case the normal return should be IICSTATUS_INPROGRESS. The OS will call HAL_IICMonitorTransfer each time an interrupt occurs – this will allow the HAL to progress through the transfer if it’s not totally automatic. If the transfer happens in the foreground, return values are as for HAL_IICMonitorTransfer.
If an IIC transfer is currently in progress, the call may return BUSY and the caller should retry later – although if background transfers are supported it may queue the transfer and return INPROGRESS. If another master is driving the bus, it should silently wait until the bus is free (in the background or foreground as appropriate). If we lose arbitration, the transfer should be retried when the bus becomes free.
transfer[] is an array of n transfer descriptors. Each descriptor describes part of the transfer. See the iic_transfer documentation for more details.
If background transfers are in use, the transfer[] array and the data blocks must remain available in unpaged memory for the duration of the transfer.
HAL_IICTransfer is re-entrant, but may return IICSTATUS_BUSY if re-entered.