1 #ifndef LIS3DH_DRIVER_H_INCLUDED
2 #define LIS3DH_DRIVER_H_INCLUDED
21 #define INVERT_XY_AXES
23 #define LIS3DH_READ_BIT (1<<7)
24 #define LIS3DH_ADDR_INC_BIT (1<<6)
30 #define LIS3DH_PWDN 0x00
31 #define LIS3DH_1Hz 0x01
32 #define LIS3DH_10Hz 0x02
33 #define LIS3DH_25Hz 0x03
34 #define LIS3DH_50Hz 0x04
35 #define LIS3DH_100Hz 0x05
36 #define LIS3DH_200Hz 0x06
37 #define LIS3DH_400Hz 0x07
46 #define LIS3DH_FULLSCALE_2g 0x00
47 #define LIS3DH_FULLSCALE_4g 0x01
48 #define LIS3DH_FULLSCALE_8g 0x02
49 #define LIS3DH_FULLSCALE_16g 0x03
58 #define LIS3DH_REG_WHOAMI 0x0F
59 #define LIS3SH_REG_CTRL_REG1 0x20
60 #define LIS3DH_REG_CTRL_REG3 0x22
61 #define LIS3DH_REG_CTRL_REG4 0x23
62 #define LIS3DH_REG_CTRL_REG6 0x25
63 #define LIS3DH_REG_STATUS_REG 0x27
64 #define LIS3DH_XYZ_DATA_ADDR 0x28
69 #define LIS3DH_SEQ_READ_BIT (1<<7)
77 uint8_t LIS3DH_XYZ_DataReady(uint8_t i2c_addr);
81 void LIS3DH_ReadXYZ(uint8_t i2c_addr,int16_t *X,int16_t *Y,int16_t *Z);
85 void LIS3DH_EnableXYZ(uint8_t i2c_addr,uint8_t data_rate,uint8_t fullscale,uint8_t hi_res);
86 void LIS3DH_EnableDRDYonINT2(uint8_t i2c_addr);