librpipI2cConfigWrite

uint32_tĀ librpipI2cConfigWrite(uint32_t id, uint32_t flags);

Description

Configures an I2C bus master.

Parameters

  • uint32_t id
    The I2C bus to configure. The I2C bus needs to have been detected during theĀ librpipInit().
  • uint32_t flags
    LIBRPIP_I2C_FLAG_* configuration flags to set or 0 for none.

Returns

0 on failure or 1 on success.

Example

Enable PEC (Packet error checksums) on I2C bus 1:

uint32_t feature_set;
feature_set = librpipInit(LIBRPIP_BOARD_DETECT, LIBRPIP_FLAG_DEBUG_ON, 0);
if(feature_set & LIBRPIP_FEATURE_I2C1) { 
        librpipI2cConfigWrite(1, LIBRPIP_I2C_FLAG_PEC);
}