CTL_STATUS_t sca3000_initialize_spi(CTL_ACCELEROMETER_t *self,
                                    CTL_SPI_DEVICE_t *dev,
                                    SCA3000_DEVICE_t variant);

sca3000_initialize_spi initializes the accelerometer interface self with methods to communicate with an SCA3000 accelerometer on the SPI bus associated with dev. The particular SCA3000 device variant is specified by variant. The protocol for device dev is set to 1 MHz, 8-bit SPI mode 0.

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

Return Value

sca3000_initialize_spi returns a standard status code.

Thread Safety

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

See Also