Synopsis
CTL_STATUS_t mcp23016_initialize_i2c(CTL_PARALLEL_BUS_t *self,
                                     CTL_I2C_BUS_t *bus,
                                     int addr);
Description

mcp23016_initialize_i2c initializes the parallel bus driver self with methods to control an MCP23016 attached to I2C bus bus at 8-bit I2C address addr. The MCP23016 is initialized to all-input mode. The parallel bus self inherits any mutex associated with the bus bus.

Once the parallel bus interface is initialized, you can use all standard parallel bus methods from the sensor API on the interface.

Return Value

mcp23016_initialize_i2c returns a standard status code.

Thread Safety

mcp23016_initialize_i2c is thread-safe if a mutex is associated with the I2C bus bus.

See Also

<ctl_bus.h>