Sync version of read register value from I2C slave.
int32_t i2c_m_sync_cmd_read( struct i2c_m_sync_desc * i2c, uint8_t reg, uint8_t * buffer, uint8_t length )
This function will read a byte value from a specified register in the I2C slave device and then wait for this operation to be done.
The sequence of this routine is sta->address(write)->ack->reg address->ack->resta->address(read)->ack->reg value->nack->stt
Type: struct i2c_m_sync_desc Struct *
An I2C descriptor, which is used to communicate through I2C
Type: uint8_t
The internal address/register of the I2C slave device
Type: uint8_t *
The buffer to hold the read data from the I2C slave device
Type: uint8_t
The length (in bytes) to read from the I2C slave device
Type: int32_t
Whether successfully read from the device
The passed parameters were invalid or read fail
Reading from register is completed successfully