librpipI2cConfigRead

uint32_tĀ librpipI2cConfigRead(uint32_t id, uint32_t* flags);

Description

Gets the configuration for 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
    A pointer to a unit32_t to hold the configuration flags currently set.

Returns

0 on failure or 1 on success.

Example

Enable PEC (Packet error checksums) on I2C bus 1 and then read the config back to make sure it really worked:

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