17.6.3.3.1 Function i2c_master_read_packet_wait()
Reads data packet from slave.
enum status_code i2c_master_read_packet_wait( struct i2c_master_module *const module, struct i2c_master_packet *const packet)
Reads a data packet from the specified slave address on the I2C bus and sends a stop condition when finished.
Data direction | Parameter name | Description |
---|---|---|
[in, out] |
module |
Pointer to software module struct |
[in, out] |
packet |
Pointer to I2C packet to transfer |
Returns
Status of reading packet.
Return value | Description |
---|---|
STATUS_OK |
The packet was read successfully |
STATUS_ERR_TIMEOUT |
If no response was given within specified timeout period |
STATUS_ERR_DENIED |
If error on bus |
STATUS_ERR_PACKET_COLLISION |
If arbitration is lost |
STATUS_ERR_BAD_ADDRESS |
If slave is busy, or no slave acknowledged the address |