Abstract device register interface.

The types and functions in <ctl_transport.h> provide a high-level means to read and write device registers independent of the physical way in which the device is connected and addressed.

This interface is mostly used in the CrossWorks Target Library for devices connected by SPI or I2C, as many sensors and LCD controllers are. Some sensors, such as the ADXL345, offer both I2C and SPI interfaces, selectable using a signal. However, the high-level view of the device registers and their function remain the same in both modes, and using an abstract register interface offered by CTL_TRANSPORT_t frees the high-level code from concerning itself exactly how registers are read and written.

API Summary

CTL_TRANSPORT_BUS_t Private transport data
CTL_TRANSPORT_t Abstract register interface
ctl_transport_initialize_i2c Initialize an I2C transport interface
ctl_transport_initialize_spi Initialize an SPI transport interface
ctl_transport_read_16b_register Read 16-bit register over transport
ctl_transport_read_24b_register Read 24-bit register over transport
ctl_transport_read_32b_register Read 32-bit register over transport
ctl_transport_read_8b_register Read 8-bit register over transport
ctl_transport_read_registers Read multiple registers over transport
ctl_transport_write_16b_register Write 16-bit register over transport
ctl_transport_write_24b_register Write 24-bit register over transport
ctl_transport_write_32b_register Write 32-bit register over transport
ctl_transport_write_8b_register Write 8-bit register over transport
ctl_transport_write_registers Write multiple registers over transport
ctl_transport_rmw_16b_register Modify 16-bit register over transport
ctl_transport_rmw_24b_register Modify 24-bit register over transport
ctl_transport_rmw_32b_register Modify 32-bit register over transport
ctl_transport_rmw_8b_register Modify 8-bit register over transport
ctl_transport_lock Acquire exclusive transport lock
ctl_transport_read_registers_fail Immediately fail a read from a transport
ctl_transport_read_registers_i2c Read multiple registers from an I2C transport
ctl_transport_unlock Release exclusive transport lock
ctl_transport_write_registers_fail Immediately fail a write to a transport
ctl_transport_write_registers_i2c Write multiple registers to an I2C transport