4.22. I2C Module
4.22.1. Module Files
4.22.2. Detailed Description
The driver consists of READ functions and WRITE functions. In all cases,
slaveAddress are the seven bits of the I2C slave address.
There are two cases for READ:
I2C_Read(): implements the usual way of reading. First a write operation is made after the START condition, to write the address (
readAddress) to read from. Then a REPEATED START condition issued on the bus and
nrBytesare read. The result is stored in the data pointed by
I2C_ReadDirect(): a START condition is issued on the bus and
nrBytesare read directly. The result is stored in the data pointed by
Similarly, there are two cases for WRITE:
I2C_WriteDirect(): a START condition is issued on the bus and
nrBytesare written directly. The data to be written is pointed by
I2C_Write(): like the preceding function, a START condition is issued on the bus and bytes are written. The difference is that
nrBytes+1are written: first
writeAddressis written, then the data to be written pointed by
writeData. This function is symmetric to
I2C_Read(), where first the register address to access is written.
Two DMA functions are also implemented, similar to the functions where
the register address is written first before read or write.
dmaGroupANotification() is called after the bytes are written to or
read from I2C to deactivate the corresponding DMA transfers.
Currently the DMA functions lack transaction control: in case the I2C
transaction does not finish or take place, this is not signaled to the