Function xensiv_pasco2_plat_i2c_transfer(void *, uint16_t, const uint8_t *, size_t, uint8_t *, size_t)

Function Documentation

int32_t xensiv_pasco2_plat_i2c_transfer(void *ctx, uint16_t dev_addr, const uint8_t *tx_buffer, size_t tx_len, uint8_t *rx_buffer, size_t rx_len)

Target platform-specific function to perform I2C write/read transfer. Synchronously writes a block of data and optionally receive a block of data.

Note

Can be NULL to indicate no read access.

Parameters
  • ctx[in] Target platform object

  • dev_addr[in] device address (7-bit)

  • tx_buffer[in] I2C send data

  • tx_len[in] I2C send data size

  • rx_buffer[in] I2C receive data

  • rx_len[in] I2C receive data size

Returns

XENSIV_PASCO2_OK if the I2C transfer was successful; an error indicating what went wrong otherwise