Synopsis
CTL_STATUS_t mcp23x08_initialize_spi(CTL_PARALLEL_BUS_t *bus,
                                     CTL_SPI_DEVICE_t *dev);
Description

mcp23x08_initialize_spi initializes the parallel bus driver self with methods to control an MCP23S08 on the SPI bus associated with dev. The MCP23S08 is initialized to all-input mode. The parallel bus self inherits any mutex associated with the SPI bus that dev is attached to.

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

Return Value

mcp23x08_initialize_spi returns a standard status code.

Thread Safety

mcp23x08_initialize_spi is thread-safe if a mutex is associated with the SPI bus that dev is attached to.

See Also

<ctl_bus.h>