Skip to content

Commit 1e6a6e0

Browse files
authored
Merge pull request #1 from cparata/master
First version of LSM6DSOX driver
2 parents 515c743 + d00c52d commit 1e6a6e0

File tree

7 files changed

+15633
-0
lines changed

7 files changed

+15633
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
11
# LSM6DSOX
22
Arduino library to support the LSM6DSOX 3D accelerometer and 3D gyroscope
3+
4+
## API
5+
6+
This sensor uses I2C or SPI to communicate.
7+
For I2C it is then required to create a TwoWire interface before accessing to the sensors:
8+
9+
dev_i2c = new TwoWire(I2C_SDA, I2C_SCL);
10+
dev_i2c->begin();
11+
12+
For SPI it is then required to create a SPI interface before accessing to the sensors:
13+
14+
dev_spi = new SPIClass(SPI_MOSI, SPI_MISO, SPI_SCK);
15+
dev_spi->begin();
16+
17+
An instance can be created and enbaled when the I2C bus is used following the procedure below:
18+
19+
AccGyr = new LSM6DSOXSensor(dev_i2c);
20+
AccGyr->Enable_X();
21+
AccGyr->Enable_G();
22+
23+
An instance can be created and enbaled when the SPI bus is used following the procedure below:
24+
25+
AccGyr = new LSM6DSOXSensor(dev_spi, CS_PIN);
26+
AccGyr->Enable_X();
27+
AccGyr->Enable_G();
28+
29+
The access to the sensor values is done as explained below:
30+
31+
Read accelerometer and gyroscope.
32+
33+
AccGyr->Get_X_Axes(accelerometer);
34+
AccGyr->Get_G_Axes(gyroscope);
35+
36+
## Documentation
37+
38+
You can find the source files at
39+
https://github.com/stm32duino/LSM6DSOX
40+
41+
The LSM6DSOX datasheet is available at
42+
https://www.st.com/content/st_com/en/products/mems-and-sensors/inemo-inertial-modules/lsm6dsox.html

keywords.txt

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#######################################
2+
# Syntax Coloring Map For LSM6DSOX
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
LSM6DSOXSensor KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
ReadID KEYWORD2
16+
Enable_X KEYWORD2
17+
Disable_X KEYWORD2
18+
Get_X_Sensitivity KEYWORD2
19+
Get_X_ODR KEYWORD2
20+
Set_X_ODR KEYWORD2
21+
Get_X_FS KEYWORD2
22+
Set_X_FS KEYWORD2
23+
Get_X_AxesRaw KEYWORD2
24+
Get_X_Axes KEYWORD2
25+
Enable_G KEYWORD2
26+
Disable_G KEYWORD2
27+
Get_G_Sensitivity KEYWORD2
28+
Get_G_ODR KEYWORD2
29+
Set_G_ODR KEYWORD2
30+
Get_G_FS KEYWORD2
31+
Set_G_FS KEYWORD2
32+
Get_G_AxesRaw KEYWORD2
33+
Get_G_Axes KEYWORD2
34+
Read_Reg KEYWORD2
35+
Write_Reg KEYWORD2
36+
Set_Interrupt_Latch KEYWORD2
37+
Enable_Free_Fall_Detection KEYWORD2
38+
Disable_Free_Fall_Detection KEYWORD2
39+
Set_Free_Fall_Threshold KEYWORD2
40+
Set_Free_Fall_Duration KEYWORD2
41+
Enable_Pedometer KEYWORD2
42+
Disable_Pedometer KEYWORD2
43+
Get_Step_Count KEYWORD2
44+
Step_Counter_Reset KEYWORD2
45+
Enable_Tilt_Detection KEYWORD2
46+
Disable_Tilt_Detection KEYWORD2
47+
Enable_Wake_Up_Detection KEYWORD2
48+
Disable_Wake_Up_Detection KEYWORD2
49+
Set_Wake_Up_Threshold KEYWORD2
50+
Set_Wake_Up_Duration KEYWORD2
51+
Enable_Single_Tap_Detection KEYWORD2
52+
Disable_Single_Tap_Detection KEYWORD2
53+
Enable_Double_Tap_Detection KEYWORD2
54+
Disable_Double_Tap_Detection KEYWORD2
55+
Set_Tap_Threshold KEYWORD2
56+
Set_Tap_Shock_Time KEYWORD2
57+
Set_Tap_Quiet_Time KEYWORD2
58+
Set_Tap_Duration_Time KEYWORD2
59+
Enable_6D_Orientation KEYWORD2
60+
Disable_6D_Orientation KEYWORD2
61+
Set_6D_Orientation_Threshold KEYWORD2
62+
Get_6D_Orientation_XL KEYWORD2
63+
Get_6D_Orientation_XH KEYWORD2
64+
Get_6D_Orientation_YL KEYWORD2
65+
Get_6D_Orientation_YH KEYWORD2
66+
Get_6D_Orientation_ZL KEYWORD2
67+
Get_6D_Orientation_ZH KEYWORD2
68+
Get_X_DRDY_Status KEYWORD2
69+
Get_X_Event_Status KEYWORD2
70+
Set_X_SelfTest KEYWORD2
71+
Get_G_DRDY_Status KEYWORD2
72+
Set_G_SelfTest KEYWORD2
73+
Get_FIFO_Num_Samples KEYWORD2
74+
Get_FIFO_Full_Status KEYWORD2
75+
Set_FIFO_INT1_FIFO_Full KEYWORD2
76+
Set_FIFO_Watermark_Level KEYWORD2
77+
Set_FIFO_Stop_On_Fth KEYWORD2
78+
Set_FIFO_Mode KEYWORD2
79+
Get_FIFO_Tag KEYWORD2
80+
Get_FIFO_Data KEYWORD2
81+
Get_FIFO_X_Axes KEYWORD2
82+
Set_FIFO_X_BDR KEYWORD2
83+
Get_FIFO_G_Axes KEYWORD2
84+
Set_FIFO_G_BDR KEYWORD2
85+
86+
#######################################
87+
# Constants (LITERAL1)
88+
#######################################
89+
90+
LSM6DSOX_OK LITERAL1
91+
LSM6DSOX_ERROR LITERAL1
92+
LSM6DSOX_INT1_PIN LITERAL1
93+
LSM6DSOX_INT2_PIN LITERAL1
94+
LSM6DSOX_ACC_SENSITIVITY_FS_2G LITERAL1
95+
LSM6DSOX_ACC_SENSITIVITY_FS_4G LITERAL1
96+
LSM6DSOX_ACC_SENSITIVITY_FS_8G LITERAL1
97+
LSM6DSOX_ACC_SENSITIVITY_FS_16G LITERAL1
98+
LSM6DSOX_GYRO_SENSITIVITY_FS_125DPS LITERAL1
99+
LSM6DSOX_GYRO_SENSITIVITY_FS_250DPS LITERAL1
100+
LSM6DSOX_GYRO_SENSITIVITY_FS_500DPS LITERAL1
101+
LSM6DSOX_GYRO_SENSITIVITY_FS_1000DPS LITERAL1
102+
LSM6DSOX_GYRO_SENSITIVITY_FS_2000DPS LITERAL1
103+

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=STM32duino LSM6DSOX
2+
version=1.0.0
3+
author=SRA
4+
maintainer=stm32duino
5+
sentence=Ultra Low Power inertial measurement unit.
6+
paragraph=This library provides Arduino support for the Ultra Low Power LSM6DSOX for STM32 boards.
7+
category=Sensors
8+
url=https://github.com/stm32duino/LSM6DSOX
9+
architectures=stm32, avr, sam

0 commit comments

Comments
 (0)