The following functions are used for advanced communications on using the I2C bus. These functions are useful if the user wishes to talk to a device that does not follow the Phillips I2C standard. One example is an EEPROM that first must be addressed and then read from with no restart in between.
Data must be sent or received a byte at a time. Also user must check function returns to verify the status of the bus before performing the next option.
◆ Multi_I2CRead()
This function reads a single byte in master mode from the I2C bus.
Does not handle No ACK of last byte, which needs to have a I2C_SET_NO_ACK called before the last read.
- Parameters
-
val | A pointer to a byte location to store the read value. |
ticks_to_wait | The number of system time ticks before a timeout occurs. |
- Returns
- i2cMultiReturnValues
- See also
- Multi_I2CStart()
-
Multi_I2CStop()
-
Multi_I2CSend()
◆ Multi_I2CSend()
This function sends a single byte in master mode on the I2C bus.
- Parameters
-
val | The byte to send. |
ticks_to_wait | The number of system time ticks before a timeout occurs. |
- Returns
- i2cMultiReturnValues
- See also
- Multi_I2CStart()
-
Multi_I2CStop()
-
Multi_I2CRead()
◆ Multi_I2CStart()
uint8_t Multi_I2CStart |
( |
uint8_t |
addr, |
|
|
bool |
Read_Not_Write, |
|
|
uint32_t |
ticks_to_wait = I2C_START_TIMEOUT |
|
) |
| |
This function is used to obtain an I2C bus and start communication in master mode.
- Parameters
-
addr | The 7-bit address of the slave device we wish to communicate with on the bus. |
Read_Not_Write | True to read, false to write. Note: You can use I2C_START_READ or I2C_START_WRITE as values. |
ticks_to_wait | The amount of time we will wait for a start transmission to complete this time includes waiting for a busy bus to become active plus the time it takes to receive an an ACK from the slave device. |
- Returns
- i2cMultiReturnValues
- See also
- Multi_I2CStop()
-
Multi_I2CSend()
-
Multi_I2CRead()
◆ Multi_I2CStop()
This function ends communication and releases control of the I2C bus. This function puts your NetBurner board into idle/slave mode.
- Parameters
-
ticks_to_wait | How long to wait to ensure the bus has been released. |
- Returns
- i2cMultiReturnValues
- See also
- Multi_I2CStart()
-
Multi_I2CSend()
-
Multi_I2CRead()