NetBurner 3.0
Advanced NetBurner I2C Functions

Functions

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. More...
 
uint8_t Multi_I2CStop (uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
 This function ends communication and releases control of the I2C bus. This function puts your NetBurner board into idle/slave mode. More...
 
uint8_t Multi_I2CSend (uint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
 This function sends a single byte in master mode on the I2C bus. More...
 
uint8_t Multi_I2CRead (puint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
 This function reads a single byte in master mode from the I2C bus. More...
 

Detailed Description

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.

Function Documentation

◆ Multi_I2CRead()

uint8_t Multi_I2CRead ( puint8_t  val,
uint32_t  ticks_to_wait = I2C_RX_TX_TIMEOUT 
)

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
valA pointer to a byte location to store the read value.
ticks_to_waitThe number of system time ticks before a timeout occurs.
Returns
i2cMultiReturnValues
See also
Multi_I2CStart()
Multi_I2CStop()
Multi_I2CSend()

◆ Multi_I2CSend()

uint8_t Multi_I2CSend ( uint8_t  val,
uint32_t  ticks_to_wait = I2C_RX_TX_TIMEOUT 
)

This function sends a single byte in master mode on the I2C bus.

Parameters
valThe byte to send.
ticks_to_waitThe 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
addrThe 7-bit address of the slave device we wish to communicate with on the bus.
Read_Not_WriteTrue to read, false to write. Note: You can use I2C_START_READ or I2C_START_WRITE as values.
ticks_to_waitThe 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()

uint8_t Multi_I2CStop ( uint32_t  ticks_to_wait = I2C_RX_TX_TIMEOUT)

This function ends communication and releases control of the I2C bus. This function puts your NetBurner board into idle/slave mode.

Parameters
ticks_to_waitHow long to wait to ensure the bus has been released.
Returns
i2cMultiReturnValues
See also
Multi_I2CStart()
Multi_I2CSend()
Multi_I2CRead()