Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
This file provides a set of functions needed to drive the lsm6dsox enhanced inertial module. More...
Modules | |
LSM6DSOX_Interfaces_Functions | |
This section provide a set of functions used to read and write a generic register of the device. | |
LSM6DSOX_Private_functions | |
Section collect all the utility functions needed by APIs. | |
LSM6DSOX_Sensitivity | |
These functions convert raw-data into engineering units. | |
LSM6DSOX_Data_Generation | |
This section groups all the functions concerning data generation. | |
Functions | |
int32_t | lsm6dsox_xl_full_scale_set (lsm6dsox_ctx_t *ctx, lsm6dsox_fs_xl_t val) |
Accelerometer full-scale selection. | |
int32_t | lsm6dsox_xl_full_scale_get (lsm6dsox_ctx_t *ctx, lsm6dsox_fs_xl_t *val) |
Accelerometer full-scale selection. | |
int32_t | lsm6dsox_xl_data_rate_set (lsm6dsox_ctx_t *ctx, lsm6dsox_odr_xl_t val) |
Accelerometer UI data rate selection. | |
int32_t | lsm6dsox_xl_data_rate_get (lsm6dsox_ctx_t *ctx, lsm6dsox_odr_xl_t *val) |
Accelerometer UI data rate selection. | |
int32_t | lsm6dsox_gy_full_scale_set (lsm6dsox_ctx_t *ctx, lsm6dsox_fs_g_t val) |
Gyroscope UI chain full-scale selection. | |
int32_t | lsm6dsox_gy_full_scale_get (lsm6dsox_ctx_t *ctx, lsm6dsox_fs_g_t *val) |
Gyroscope UI chain full-scale selection. | |
int32_t | lsm6dsox_gy_data_rate_set (lsm6dsox_ctx_t *ctx, lsm6dsox_odr_g_t val) |
Gyroscope UI data rate selection. | |
int32_t | lsm6dsox_gy_data_rate_get (lsm6dsox_ctx_t *ctx, lsm6dsox_odr_g_t *val) |
Gyroscope UI data rate selection. | |
int32_t | lsm6dsox_block_data_update_set (lsm6dsox_ctx_t *ctx, uint8_t val) |
Block data update. | |
int32_t | lsm6dsox_block_data_update_get (lsm6dsox_ctx_t *ctx, uint8_t *val) |
Block data update. | |
int32_t | lsm6dsox_xl_offset_weight_set (lsm6dsox_ctx_t *ctx, lsm6dsox_usr_off_w_t val) |
Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h). | |
int32_t | lsm6dsox_xl_offset_weight_get (lsm6dsox_ctx_t *ctx, lsm6dsox_usr_off_w_t *val) |
Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h). | |
int32_t | lsm6dsox_xl_power_mode_set (lsm6dsox_ctx_t *ctx, lsm6dsox_xl_hm_mode_t val) |
Accelerometer power mode. | |
int32_t | lsm6dsox_xl_power_mode_get (lsm6dsox_ctx_t *ctx, lsm6dsox_xl_hm_mode_t *val) |
Accelerometer power mode. | |
int32_t | lsm6dsox_gy_power_mode_set (lsm6dsox_ctx_t *ctx, lsm6dsox_g_hm_mode_t val) |
Operating mode for gyroscope. | |
int32_t | lsm6dsox_gy_power_mode_get (lsm6dsox_ctx_t *ctx, lsm6dsox_g_hm_mode_t *val) |
Operating mode for gyroscope. | |
int32_t | lsm6dsox_status_reg_get (lsm6dsox_ctx_t *ctx, lsm6dsox_status_reg_t *val) |
The STATUS_REG register is read by the primary interface. | |
int32_t | lsm6dsox_xl_flag_data_ready_get (lsm6dsox_ctx_t *ctx, uint8_t *val) |
Accelerometer new data available. | |
int32_t | lsm6dsox_gy_flag_data_ready_get (lsm6dsox_ctx_t *ctx, uint8_t *val) |
Gyroscope new data available. | |
int32_t | lsm6dsox_temp_flag_data_ready_get (lsm6dsox_ctx_t *ctx, uint8_t *val) |
Temperature new data available. | |
int32_t | lsm6dsox_xl_usr_offset_x_set (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_x_get (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_y_set (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_y_get (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_z_set (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_z_get (lsm6dsox_ctx_t *ctx, uint8_t *buff) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h). | |
int32_t | lsm6dsox_xl_usr_offset_set (lsm6dsox_ctx_t *ctx, uint8_t val) |
Enables user offset on out. | |
int32_t | lsm6dsox_xl_usr_offset_get (lsm6dsox_ctx_t *ctx, uint8_t *val) |
User offset on out flag. |
Detailed Description
This file provides a set of functions needed to drive the lsm6dsox enhanced inertial module.
Function Documentation
int32_t lsm6dsox_block_data_update_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Block data update.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of bdu in reg CTRL3_C
Definition at line 787 of file lsm6dsox_reg.c.
int32_t lsm6dsox_block_data_update_set | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t | val | ||
) |
Block data update.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of bdu in reg CTRL3_C
Definition at line 767 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_data_rate_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_odr_g_t * | val | ||
) |
Gyroscope UI data rate selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of odr_g in reg CTRL2_G
Definition at line 713 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_data_rate_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_odr_g_t | val | ||
) |
Gyroscope UI data rate selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of odr_g in reg CTRL2_G
Definition at line 530 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_flag_data_ready_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Gyroscope new data available.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of gda in reg STATUS_REG
Definition at line 1003 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_full_scale_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_fs_g_t * | val | ||
) |
Gyroscope UI chain full-scale selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of fs_g in reg CTRL2_G
Definition at line 493 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_full_scale_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_fs_g_t | val | ||
) |
Gyroscope UI chain full-scale selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fs_g in reg CTRL2_G
Definition at line 472 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_power_mode_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_g_hm_mode_t * | val | ||
) |
Operating mode for gyroscope.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of g_hm_mode in reg CTRL7_G
Definition at line 943 of file lsm6dsox_reg.c.
int32_t lsm6dsox_gy_power_mode_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_g_hm_mode_t | val | ||
) |
Operating mode for gyroscope.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of g_hm_mode in reg CTRL7_G
Definition at line 922 of file lsm6dsox_reg.c.
int32_t lsm6dsox_status_reg_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_status_reg_t * | val | ||
) |
The STATUS_REG register is read by the primary interface.
[get]
- Parameters:
-
ctx read / write interface definitions val register STATUS_REG
Definition at line 971 of file lsm6dsox_reg.c.
int32_t lsm6dsox_temp_flag_data_ready_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Temperature new data available.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tda in reg STATUS_REG
Definition at line 1021 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_data_rate_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_odr_xl_t * | val | ||
) |
Accelerometer UI data rate selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of odr_xl in reg CTRL1_XL
Definition at line 414 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_data_rate_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_odr_xl_t | val | ||
) |
Accelerometer UI data rate selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of odr_xl in reg CTRL1_XL
Definition at line 234 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_flag_data_ready_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Accelerometer new data available.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of xlda in reg STATUS_REG
Definition at line 985 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_full_scale_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_fs_xl_t * | val | ||
) |
Accelerometer full-scale selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of fs_xl in reg CTRL1_XL
Definition at line 200 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_full_scale_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_fs_xl_t | val | ||
) |
Accelerometer full-scale selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fs_xl in reg CTRL1_XL
Definition at line 179 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_offset_weight_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_usr_off_w_t * | val | ||
) |
Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h).
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of usr_off_w in reg CTRL6_C
Definition at line 828 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_offset_weight_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_usr_off_w_t | val | ||
) |
Weight of XL user offset bits of registers X_OFS_USR (73h), Y_OFS_USR (74h), Z_OFS_USR (75h).
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of usr_off_w in reg CTRL6_C
Definition at line 806 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_power_mode_get | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_xl_hm_mode_t * | val | ||
) |
Accelerometer power mode.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of xl_hm_mode in reg CTRL6_C
Definition at line 887 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_power_mode_set | ( | lsm6dsox_ctx_t * | ctx, |
lsm6dsox_xl_hm_mode_t | val | ||
) |
Accelerometer power mode.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of xl_hm_mode in reg CTRL6_C
Definition at line 858 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | val | ||
) |
User offset on out flag.
[get]
- Parameters:
-
ctx read / write interface definitions val values of usr_off_on_out in reg CTRL7_G
Definition at line 1155 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_set | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enables user offset on out.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of usr_off_on_out in reg CTRL7_G
Definition at line 1135 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_x_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
Definition at line 1057 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_x_set | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
Definition at line 1041 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_y_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
Definition at line 1089 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_y_set | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
Definition at line 1073 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_z_get | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
Definition at line 1121 of file lsm6dsox_reg.c.
int32_t lsm6dsox_xl_usr_offset_z_set | ( | lsm6dsox_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on USR_OFF_W in CTRL6_C (15h).
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
Definition at line 1105 of file lsm6dsox_reg.c.
Generated on Tue Jul 12 2022 20:15:23 by
