Демонстрационная прошивка отладочного комплекта МТС NB-IoT
lis3dh_driver.h
См. документацию.
1 #ifndef LIS3DH_DRIVER_H_INCLUDED
2 #define LIS3DH_DRIVER_H_INCLUDED
3 
4 #include "i2c_api.h"
5 
6 #include "stdint.h"
7 
21 #define INVERT_XY_AXES
22 
23 #define LIS3DH_READ_BIT (1<<7)
24 #define LIS3DH_ADDR_INC_BIT (1<<6)
25 
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
38 
46 #define LIS3DH_FULLSCALE_2g 0x00
47 #define LIS3DH_FULLSCALE_4g 0x01
48 #define LIS3DH_FULLSCALE_8g 0x02
49 #define LIS3DH_FULLSCALE_16g 0x03
50 
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
65 
69 #define LIS3DH_SEQ_READ_BIT (1<<7)
70 
76 uint8_t LIS3DH_ReadSignature(uint8_t i2c_addr);
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);
87 
93 #endif /* LIS3DH_DRIVER_H_INCLUDED */
LIS3DH_ReadXYZ
void LIS3DH_ReadXYZ(uint8_t i2c_addr, int16_t *X, int16_t *Y, int16_t *Z)
Прочесть значения ускорений по осям
Definition: lis3dh_driver.c:67
LIS3DH_ReadSignature
uint8_t LIS3DH_ReadSignature(uint8_t i2c_addr)
Прочесть индентификационный код акселерометра
Definition: lis3dh_driver.c:23
i2c_api.h
LIS3DH_EnableXYZ
void LIS3DH_EnableXYZ(uint8_t i2c_addr, uint8_t data_rate, uint8_t fullscale, uint8_t hi_res)
Сконфигурировать параметры работы акселерометра
Definition: lis3dh_driver.c:28