Overview

Driver for STMicroelectronics LIS3LV02DL 3-axis accelerometer in SPI or I2C mode.

Resources

All correct at time of writing, but as always, manufacturers love to move things around on their website.

Web page

http://www.st.com/web/catalog/sense_power/FM89/SC444/PF127514

Datasheet

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00091417.pdf

Test hardware

This code has been tested using an Olimex STM32-LCD which has an on-board LIS3LV02DL:

http://www.olimex.com/Products/ARM/ST/STM32-LCD/

Specification
Parameter Supported settings
Bandwidth (Hz) 40, 160, 640, 2560
Range (g) ±2, ±6
Communication up to 400 kHz (I2C) and 8 MHz (SPI)

API Summary

Macros
LIS3LV02DL_I2C_ADDR LIS3LV02DL 8-bit I2C address
Functions
lis3lv02dl_initialize_i2c Initialize sensor on I2C bus
lis3lv02dl_initialize_spi Initialize sensor on SPI bus