Function rc_i2c_read_words#

Function Documentation#

int rc_i2c_read_words(int bus, uint8_t regAddr, size_t count, uint16_t *data)#

Reads multiple words (16 bytes each) from a device register.

        This sends the device address and register address to be read
        from before reading the response, works for most i2c devices.

Parameters:
  • bus[in] The bus

  • regAddr[in] The register address

  • count[in] Number of 16-bit words to read, NOT number of bytes to read

  • data[out] The data pointer to write response to.

Returns:

0 on success or -1 on failure