Del via


I2CMaster_Open Function

Header: #include <applibs/i2c.h>

Opens and configures an I2C master interface for exclusive use by an application, and returns a file descriptor used to perform operations on the interface.

int I2CMaster_Open(I2C_InterfaceId id);

Parameters

  • id The ID of the I2C interface to open.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EACCES: access to the I2C interface is not permitted; verify that the interface exists and is in the I2cMaster field of the application manifest.

Any other errno may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.

Return value

Returns the file descriptor of the I2C interface, or -1 for failure, in which case errno is set to the error value.

Application manifest requirements

To access an I2c interface, your application must identify it in the I2cMaster field of the application manifest.