CTL_STATUS_t lis3lv02dl_initialize_spi(CTL_ACCELEROMETER_t *self, CTL_SPI_DEVICE_t *spi);
lis3lv02dl_initialize_spi initializes the accelerometer interface self with methods to communicate with a LIS3VL02DL accelerometer on the SPI bus associated with dev. The protocol for device dev is set to 1 MHz, 8-bit SPI mode 0. The maximum clock speed supported by the LIS3LV02DL in SPI mode is 8 MHz: you can increase the clock speed from the initial 1 MHz using ctl_spi_set_speed.
Once the accelerometer interface is initialized, you can use all standard accelerometer methods from the sensor API on the interface.
lis3lv02dl_initialize_spi returns a standard status code.
lis3lv02dl_initialize_spi is thread-safe if the transport transport is thread-safe. Typically, for SPI and I2C transports, you ensure thread safety by associating a mutex with the bus used by the transport.