![]() |
Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
|
This file provides a set of functions needed to drive the lsm6dso32 enhanced inertial module. More...

Modules | |
| LSM6DSO32_Interfaces_Functions | |
| This section provide a set of functions used to read and write a generic register of the device. MANDATORY: return 0 -> no Error. | |
| LSM6DSO32_Sensitivity | |
| These functions convert raw-data into engineering units. | |
| LSM6DSO32_Data_Generation | |
| This section groups all the functions concerning data generation. | |
| LSM6DSO32_common | |
| This section groups common useful functions. | |
| LSM6DSO32_filters | |
| This section group all the functions concerning the filters configuration. | |
| LSM6DSO32_interrupt_pins | |
| This section groups all the functions that manage interrupt pins. | |
| LSM6DSO32_Wake_Up_event | |
| This section groups all the functions that manage the Wake Up event generation. | |
| Activity/Inactivity_detection | |
| This section groups all the functions concerning activity/inactivity detection. | |
| LSM6DSO32_tap_generator | |
| This section groups all the functions that manage the tap and double tap event generation. | |
| LSM6DSO32_DEN_functionality | |
| This section groups all the functions concerning DEN functionality. | |
| LSM6DSO32_Pedometer | |
| This section groups all the functions that manage pedometer. | |
| LSM6DSO32_significant_motion | |
| This section groups all the functions that manage the significant motion detection. | |
| LSM6DSO32_Sensor_hub | |
| This section groups all the functions that manage the sensor hub. | |
Enumerations | |
| enum | OFFSET_TYPE { HWOFFSET = 0 , SWOFFSET = 1 , RESET_HWOFFSET = 2 } |
| Specifies the type of offset compensation to be used. More... | |
Functions | |
| int32_t | lsm6dso32_xl_full_scale_set (stmdev_ctx_t *ctx, lsm6dso32_fs_xl_t val) |
| Accelerometer full-scale selection.[set]. | |
| int32_t | lsm6dso32_xl_full_scale_get (stmdev_ctx_t *ctx, lsm6dso32_fs_xl_t *val) |
| Accelerometer full-scale selection.[get]. | |
| int32_t | lsm6dso32_xl_data_rate_set (stmdev_ctx_t *ctx, lsm6dso32_odr_xl_t val) |
| Accelerometer UI data rate and power mode selection.[set]. | |
| int32_t | lsm6dso32_xl_data_rate_get (stmdev_ctx_t *ctx, lsm6dso32_odr_xl_t *val) |
| Accelerometer UI data rate selection.[get]. | |
| int32_t | lsm6dso32_gy_full_scale_set (stmdev_ctx_t *ctx, lsm6dso32_fs_g_t val) |
| Gyroscope UI chain full-scale selection.[set]. | |
| int32_t | lsm6dso32_gy_full_scale_get (stmdev_ctx_t *ctx, lsm6dso32_fs_g_t *val) |
| Gyroscope UI chain full-scale selection.[get]. | |
| int32_t | lsm6dso32_gy_data_rate_set (stmdev_ctx_t *ctx, lsm6dso32_odr_g_t val) |
| Gyroscope UI data rate selection.[set]. | |
| int32_t | lsm6dso32_gy_data_rate_get (stmdev_ctx_t *ctx, lsm6dso32_odr_g_t *val) |
| Gyroscope UI data rate selection.[get]. | |
| int32_t | lsm6dso32_block_data_update_set (stmdev_ctx_t *ctx, uint8_t val) |
| Block data update.[set]. | |
| int32_t | lsm6dso32_block_data_update_get (stmdev_ctx_t *ctx, uint8_t *val) |
| Block data update.[get]. | |
| int32_t | lsm6dso32_xl_offset_weight_set (stmdev_ctx_t *ctx, lsm6dso32_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]. | |
| int32_t | lsm6dso32_xl_offset_weight_get (stmdev_ctx_t *ctx, lsm6dso32_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]. | |
| int32_t | lsm6dso32_all_sources_get (stmdev_ctx_t *ctx, lsm6dso32_all_sources_t *val) |
| Read all the interrupt flag of the device.[get]. | |
| int32_t | lsm6dso32_status_reg_get (stmdev_ctx_t *ctx, lsm6dso32_status_reg_t *val) |
| The STATUS_REG register is read by the primary interface.[get]. | |
| int32_t | lsm6dso32_xl_flag_data_ready_get (stmdev_ctx_t *ctx, uint8_t *val) |
| Accelerometer new data available.[get]. | |
| int32_t | lsm6dso32_gy_flag_data_ready_get (stmdev_ctx_t *ctx, uint8_t *val) |
| Gyroscope new data available.[get]. | |
| int32_t | lsm6dso32_temp_flag_data_ready_get (stmdev_ctx_t *ctx, uint8_t *val) |
| Temperature new data available.[get]. | |
| int32_t | lsm6dso32_xl_usr_offset_x_set (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_x_get (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_y_set (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_y_get (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_z_set (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_z_get (stmdev_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]. | |
| int32_t | lsm6dso32_xl_usr_offset_set (stmdev_ctx_t *ctx, uint8_t val) |
| Enables user offset on out.[set]. | |
| int32_t | lsm6dso32_xl_usr_offset_get (stmdev_ctx_t *ctx, uint8_t *val) |
| User offset on out flag.[get]. | |
| int32_t | lsm6dso32_sdo_sa0_mode_set (stmdev_ctx_t *ctx, lsm6dso32_sdo_pu_en_t val) |
| Connect/Disconnect SDO/SA0 internal pull-up.[set]. | |
| int32_t | lsm6dso32_sdo_sa0_mode_get (stmdev_ctx_t *ctx, lsm6dso32_sdo_pu_en_t *val) |
| Connect/Disconnect SDO/SA0 internal pull-up.[get]. | |
| int32_t | lsm6dso32_spi_mode_set (stmdev_ctx_t *ctx, lsm6dso32_sim_t val) |
| SPI Serial Interface Mode selection.[set]. | |
| int32_t | lsm6dso32_spi_mode_get (stmdev_ctx_t *ctx, lsm6dso32_sim_t *val) |
| SPI Serial Interface Mode selection.[get]. | |
| int32_t | lsm6dso32_i2c_interface_set (stmdev_ctx_t *ctx, lsm6dso32_i2c_disable_t val) |
| Disable / Enable I2C interface.[set]. | |
| int32_t | lsm6dso32_i2c_interface_get (stmdev_ctx_t *ctx, lsm6dso32_i2c_disable_t *val) |
| Disable / Enable I2C interface.[get]. | |
| int32_t | lsm6dso32_i3c_disable_set (stmdev_ctx_t *ctx, lsm6dso32_i3c_disable_t val) |
| I3C Enable/Disable communication protocol[.set]. | |
| int32_t | lsm6dso32_i3c_disable_get (stmdev_ctx_t *ctx, lsm6dso32_i3c_disable_t *val) |
| I3C Enable/Disable communication protocol.[get]. | |
| int32_t | imuP_write (void *handle, uint8_t reg_addr, const uint8_t *buf, uint16_t len) |
| SPI write function for the primary IMU (LSM6DSO32). | |
| int32_t | imuP_read (void *handle, uint8_t reg_addr, uint8_t *buf, uint16_t len) |
| SPI read function for the primary IMU (LSM6DSO32). | |
| int32_t | imuB_write (void *handle, uint8_t reg_addr, const uint8_t *buf, uint16_t len) |
| SPI write function for the backup IMU (LSM6DSO32). | |
| int32_t | imuB_read (void *handle, uint8_t reg_addr, uint8_t *buf, uint16_t len) |
| SPI read function for the backup IMU (LSM6DSO32). | |
| int8_t | init_imup (stmdev_ctx_t *imu, lsm6dso32_fs_xl_t acc_full_scale, lsm6dso32_fs_g_t gyro_full_scale, lsm6dso32_odr_xl_t acc_output_data_rate, lsm6dso32_odr_g_t gyro_output_data_rate) |
| Initializes the primary IMU (LSM6DSO32). | |
| int8_t | init_imuB (stmdev_ctx_t *imu, lsm6dso32_fs_xl_t acc_full_scale, lsm6dso32_fs_g_t gyro_full_scale, lsm6dso32_odr_xl_t acc_output_data_rate, lsm6dso32_odr_g_t gyro_output_data_rate) |
| Initializes the backup IMU (LSM6DSO32). | |
| int8_t | calibrateIMU (stmdev_ctx_t *imu, uint16_t iterationNum, OFFSET_TYPE type) |
| Calibrates the IMU by calculating sensor offsets. | |
| int32_t | imuP_read_2 (void *handle, uint8_t reg_addr, uint8_t *buf, uint16_t len) |
| SPI read function for the primary IMU (LSM6DSO32). | |
This file provides a set of functions needed to drive the lsm6dso32 enhanced inertial module.
This section groups all the functions concerning main serial interface management (not auxiliary)
| enum OFFSET_TYPE |
Specifies the type of offset compensation to be used.
This enumeration is used to distinguish between hardware-based, software-based, or resetting the hardware offset.
Definition at line 60 of file utilities.h.
| int8_t calibrateIMU | ( | stmdev_ctx_t * | imu, |
| uint16_t | iterationNum, | ||
| OFFSET_TYPE | type | ||
| ) |
Calibrates the IMU by calculating sensor offsets.
Reads the accelerometer and gyroscope for a specified number of iterations while the device is stationary to determine the bias/offset. It then writes these offsets to the IMU's hardware registers to be automatically subtracted from future measurements.
| [in,out] | imu | Pointer to the stmdev_ctx_t driver context. |
| [in] | iterationNum | The number of samples to average for calibration. |
| [in] | type | The type of calibration to perform (e.g., HWOFFSET). |
Definition at line 366 of file utilities.c.
References lsm6dso32_status_reg_t::gda, HWOFFSET, lsm6dso32_acceleration_raw_get(), lsm6dso32_angular_rate_raw_get(), lsm6dso32_from_fs16_to_mg(), lsm6dso32_from_fs2000_to_mdps(), lsm6dso32_from_lsb_to_celsius(), LSM6DSO32_LSb_16mg, LSM6DSO32_LSb_1mg, lsm6dso32_status_reg_get(), lsm6dso32_temperature_raw_get(), lsm6dso32_xl_offset_weight_set(), lsm6dso32_xl_usr_offset_set(), lsm6dso32_xl_usr_offset_x_set(), lsm6dso32_xl_usr_offset_y_set(), lsm6dso32_xl_usr_offset_z_set(), RESET_HWOFFSET, lsm6dso32_reg_t::status_reg, lsm6dso32_status_reg_t::tda, and lsm6dso32_status_reg_t::xlda.
Referenced by main().


| int32_t imuB_read | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| uint8_t * | buf, | ||
| uint16_t | len | ||
| ) |
SPI read function for the backup IMU (LSM6DSO32).
This function is designed to be passed as a function pointer to the STMicroelectronics IMU driver library. It handles SPI bus transactions.
| [in] | handle | Unused handle pointer, for driver compatibility. |
| [in] | reg_addr | The 7-bit register address to read from. The read bit is set automatically. |
| [out] | buf | Pointer to the buffer where read data will be stored. |
| [in] | len | The number of bytes to read. |
Definition at line 582 of file utilities.c.
References HAL_ERROR, HAL_OK, and hspi3.
Referenced by init_imuB().

| int32_t imuB_write | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| const uint8_t * | buf, | ||
| uint16_t | len | ||
| ) |
SPI write function for the backup IMU (LSM6DSO32).
This function is designed to be passed as a function pointer to the STMicroelectronics IMU driver library. It handles SPI bus transactions.
| [in] | handle | Unused handle pointer, for driver compatibility. |
| [in] | reg_addr | The 7-bit register address to write to. |
| [in] | buf | Pointer to the data buffer to be written. |
| [in] | len | The number of bytes to write. |
Definition at line 563 of file utilities.c.
References HAL_ERROR, HAL_OK, and hspi3.
Referenced by init_imuB().

| int32_t imuP_read | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| uint8_t * | buf, | ||
| uint16_t | len | ||
| ) |
SPI read function for the primary IMU (LSM6DSO32).
This function is designed to be passed as a function pointer to the STMicroelectronics IMU driver library. It handles SPI bus transactions.
| [in] | handle | Unused handle pointer, for driver compatibility. |
| [in] | reg_addr | The 7-bit register address to read from. The read bit is set automatically. |
| [out] | buf | Pointer to the buffer where read data will be stored. |
| [in] | len | The number of bytes to read. |
Definition at line 52 of file utilities.c.
References HAL_ERROR, HAL_OK, and hspi2.
Referenced by init_imup().

| int32_t imuP_read_2 | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| uint8_t * | buf, | ||
| uint16_t | len | ||
| ) |
SPI read function for the primary IMU (LSM6DSO32).
This function is designed to be passed as a function pointer to the STMicroelectronics IMU driver library. It handles SPI bus transactions. It does the same thing as imuP_read but using a different Hal function
| [in] | handle | Unused handle pointer, for driver compatibility. |
| [in] | reg_addr | The 7-bit register address to read from. The read bit is set automatically. |
| [out] | buf | Pointer to the buffer where read data will be stored. |
| [in] | len | The number of bytes to read. |
Definition at line 71 of file utilities.c.
| int32_t imuP_write | ( | void * | handle, |
| uint8_t | reg_addr, | ||
| const uint8_t * | buf, | ||
| uint16_t | len | ||
| ) |
SPI write function for the primary IMU (LSM6DSO32).
This function is designed to be passed as a function pointer to the STMicroelectronics IMU driver library. It handles SPI bus transactions.
| [in] | handle | Unused handle pointer, for driver compatibility. |
| [in] | reg_addr | The 7-bit register address to write to. |
| [in] | buf | Pointer to the data buffer to be written. |
| [in] | len | The number of bytes to write. |
Definition at line 33 of file utilities.c.
References HAL_ERROR, HAL_OK, and hspi2.
Referenced by init_imup().

| int8_t init_imuB | ( | stmdev_ctx_t * | imu, |
| lsm6dso32_fs_xl_t | acc_full_scale, | ||
| lsm6dso32_fs_g_t | gyro_full_scale, | ||
| lsm6dso32_odr_xl_t | acc_output_data_rate, | ||
| lsm6dso32_odr_g_t | gyro_output_data_rate | ||
| ) |
Initializes the backup IMU (LSM6DSO32).
Configures the IMU with the specified full-scale ranges and output data rates. Performs a device ID check and reset.
| [in,out] | imu | Pointer to the stmdev_ctx_t driver context structure. |
| [in] | acc_full_scale | Desired accelerometer full-scale range. |
| [in] | gyro_full_scale | Desired gyroscope full-scale range. |
| [in] | acc_output_data_rate | Desired accelerometer output data rate (ODR). |
| [in] | gyro_output_data_rate | Desired gyroscope output data rate (ODR). |
Definition at line 665 of file utilities.c.
References HAL_ERROR, HAL_OK, hspi3, imuB_read(), imuB_write(), lsm6dso32_block_data_update_set(), lsm6dso32_device_id_get(), lsm6dso32_gy_data_rate_set(), lsm6dso32_gy_full_scale_set(), LSM6DSO32_I3C_DISABLE, lsm6dso32_i3c_disable_set(), LSM6DSO32_ID, lsm6dso32_reset_get(), lsm6dso32_reset_set(), lsm6dso32_xl_data_rate_set(), lsm6dso32_xl_full_scale_set(), and PROPERTY_ENABLE.
Referenced by main().


| int8_t init_imup | ( | stmdev_ctx_t * | imu, |
| lsm6dso32_fs_xl_t | acc_full_scale, | ||
| lsm6dso32_fs_g_t | gyro_full_scale, | ||
| lsm6dso32_odr_xl_t | acc_output_data_rate, | ||
| lsm6dso32_odr_g_t | gyro_output_data_rate | ||
| ) |
Initializes the primary IMU (LSM6DSO32).
Configures the IMU with the specified full-scale ranges and output data rates. Performs a device ID check and reset.
| [in,out] | imu | Pointer to the stmdev_ctx_t driver context structure. |
| [in] | acc_full_scale | Desired accelerometer full-scale range. |
| [in] | gyro_full_scale | Desired gyroscope full-scale range. |
| [in] | acc_output_data_rate | Desired accelerometer output data rate (ODR). |
| [in] | gyro_output_data_rate | Desired gyroscope output data rate (ODR). |
Definition at line 193 of file utilities.c.
References HAL_ERROR, HAL_OK, hspi2, imuP_read(), imuP_write(), lsm6dso32_block_data_update_set(), lsm6dso32_device_id_get(), lsm6dso32_gy_data_rate_set(), lsm6dso32_gy_full_scale_set(), LSM6DSO32_I3C_DISABLE, lsm6dso32_i3c_disable_set(), LSM6DSO32_ID, lsm6dso32_reset_get(), lsm6dso32_reset_set(), lsm6dso32_xl_data_rate_set(), lsm6dso32_xl_full_scale_set(), and PROPERTY_ENABLE.
Referenced by main().


| int32_t lsm6dso32_all_sources_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_all_sources_t * | val | ||
| ) |
Read all the interrupt flag of the device.[get].
| ctx | read / write interface definitions |
| val | registers ALL_INT_SRC; WAKE_UP_SRC; TAP_SRC; D6D_SRC; STATUS_REG; EMB_FUNC_STATUS; FSM_STATUS_A/B |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 778 of file lsm6dso32_reg.c.
References lsm6dso32_all_sources_t::all_int_src, lsm6dso32_all_sources_t::d6d_src, lsm6dso32_all_sources_t::emb_func_status, lsm6dso32_all_sources_t::fsm_status_a, lsm6dso32_all_sources_t::fsm_status_b, LSM6DSO32_ALL_INT_SRC, LSM6DSO32_D6D_SRC, LSM6DSO32_EMB_FUNC_STATUS, LSM6DSO32_EMBEDDED_FUNC_BANK, LSM6DSO32_FSM_STATUS_A, LSM6DSO32_FSM_STATUS_B, lsm6dso32_mem_bank_set(), lsm6dso32_read_reg(), LSM6DSO32_STATUS_REG, LSM6DSO32_TAP_SRC, LSM6DSO32_USER_BANK, LSM6DSO32_WAKE_UP_SRC, lsm6dso32_all_sources_t::status_reg, lsm6dso32_all_sources_t::tap_src, and lsm6dso32_all_sources_t::wake_up_src.

| int32_t lsm6dso32_block_data_update_get | ( | stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Block data update.[get].
| ctx | read / write interface definitions |
| val | change the values of bdu in reg CTRL3_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 695 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl3_c_t::bdu, LSM6DSO32_CTRL3_C, and lsm6dso32_read_reg().

| int32_t lsm6dso32_block_data_update_set | ( | stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Block data update.[set].
| ctx | read / write interface definitions |
| val | change the values of bdu in reg CTRL3_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 670 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl3_c_t::bdu, LSM6DSO32_CTRL3_C, lsm6dso32_read_reg(), and lsm6dso32_write_reg().
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_gy_data_rate_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_odr_g_t * | val | ||
| ) |
Gyroscope UI data rate selection.[get].
| ctx | read / write interface definitions |
| val | Get the values of odr_g in reg CTRL2_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 574 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl7_g_t::g_hm_mode, LSM6DSO32_CTRL2_G, LSM6DSO32_CTRL7_G, LSM6DSO32_GY_ODR_104Hz_HIGH_PERF, LSM6DSO32_GY_ODR_104Hz_NORMAL_MD, LSM6DSO32_GY_ODR_12Hz5_HIGH_PERF, LSM6DSO32_GY_ODR_12Hz5_LOW_PW, LSM6DSO32_GY_ODR_1667Hz_HIGH_PERF, LSM6DSO32_GY_ODR_208Hz_HIGH_PERF, LSM6DSO32_GY_ODR_208Hz_NORMAL_MD, LSM6DSO32_GY_ODR_26Hz_HIGH_PERF, LSM6DSO32_GY_ODR_26Hz_LOW_PW, LSM6DSO32_GY_ODR_3333Hz_HIGH_PERF, LSM6DSO32_GY_ODR_417Hz_HIGH_PERF, LSM6DSO32_GY_ODR_52Hz_HIGH_PERF, LSM6DSO32_GY_ODR_52Hz_LOW_PW, LSM6DSO32_GY_ODR_6667Hz_HIGH_PERF, LSM6DSO32_GY_ODR_833Hz_HIGH_PERF, LSM6DSO32_GY_ODR_OFF, lsm6dso32_read_reg(), and lsm6dso32_ctrl2_g_t::odr_g.

| int32_t lsm6dso32_gy_data_rate_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_odr_g_t | val | ||
| ) |
Gyroscope UI data rate selection.[set].
| ctx | read / write interface definitions |
| val | change the values of odr_g in reg CTRL2_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 526 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl7_g_t::g_hm_mode, LSM6DSO32_CTRL2_G, LSM6DSO32_CTRL7_G, LSM6DSO32_GY_ODR_OFF, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl2_g_t::odr_g.
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_gy_flag_data_ready_get | ( | stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Gyroscope new data available.[get].
| ctx | read / write interface definitions |
| val | change the values of gda in reg STATUS_REG |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 887 of file lsm6dso32_reg.c.
References lsm6dso32_status_reg_t::gda, lsm6dso32_read_reg(), and LSM6DSO32_STATUS_REG.

| int32_t lsm6dso32_gy_full_scale_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_fs_g_t * | val | ||
| ) |
Gyroscope UI chain full-scale selection.[get].
| ctx | read / write interface definitions |
| val | Get the values of fs_g in reg CTRL2_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 480 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl2_g_t::fs_g, LSM6DSO32_1000dps, LSM6DSO32_125dps, LSM6DSO32_2000dps, LSM6DSO32_250dps, LSM6DSO32_500dps, LSM6DSO32_CTRL2_G, and lsm6dso32_read_reg().

| int32_t lsm6dso32_gy_full_scale_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_fs_g_t | val | ||
| ) |
Gyroscope UI chain full-scale selection.[set].
| ctx | read / write interface definitions |
| val | change the values of fs_g in reg CTRL2_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 455 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl2_g_t::fs_g, LSM6DSO32_CTRL2_G, lsm6dso32_read_reg(), and lsm6dso32_write_reg().
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_i2c_interface_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_i2c_disable_t * | val | ||
| ) |
Disable / Enable I2C interface.[get].
| ctx | read / write interface definitions |
| val | Get the values of i2c_disable in reg CTRL4_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2910 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl4_c_t::i2c_disable, LSM6DSO32_CTRL4_C, LSM6DSO32_I2C_DISABLE, LSM6DSO32_I2C_ENABLE, and lsm6dso32_read_reg().

| int32_t lsm6dso32_i2c_interface_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_i2c_disable_t | val | ||
| ) |
Disable / Enable I2C interface.[set].
| ctx | read / write interface definitions |
| val | change the values of i2c_disable in reg CTRL4_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2884 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl4_c_t::i2c_disable, LSM6DSO32_CTRL4_C, lsm6dso32_read_reg(), and lsm6dso32_write_reg().

| int32_t lsm6dso32_i3c_disable_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_i3c_disable_t * | val | ||
| ) |
I3C Enable/Disable communication protocol.[get].
| ctx | read / write interface definitions |
| val | change the values of i3c_disable in reg CTRL9_XL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2985 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl9_xl_t::i3c_disable, LSM6DSO32_CTRL9_XL, LSM6DSO32_I3C_BUS_AVB, LSM6DSO32_I3C_DISABLE, LSM6DSO32_I3C_ENABLE_T_1ms, LSM6DSO32_I3C_ENABLE_T_25ms, LSM6DSO32_I3C_ENABLE_T_2us, LSM6DSO32_I3C_ENABLE_T_50us, and lsm6dso32_read_reg().

| int32_t lsm6dso32_i3c_disable_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_i3c_disable_t | val | ||
| ) |
I3C Enable/Disable communication protocol[.set].
| ctx | read / write interface definitions |
| val | change the values of i3c_disable in reg CTRL9_XL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2944 of file lsm6dso32_reg.c.
References lsm6dso32_i3c_bus_avb_t::i3c_bus_avb_sel, lsm6dso32_ctrl9_xl_t::i3c_disable, LSM6DSO32_CTRL9_XL, LSM6DSO32_I3C_BUS_AVB, lsm6dso32_read_reg(), and lsm6dso32_write_reg().
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_sdo_sa0_mode_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_sdo_pu_en_t * | val | ||
| ) |
Connect/Disconnect SDO/SA0 internal pull-up.[get].
| ctx | read / write interface definitions |
| val | Get the values of sdo_pu_en in reg PIN_CTRL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2791 of file lsm6dso32_reg.c.
References LSM6DSO32_PIN_CTRL, LSM6DSO32_PULL_UP_CONNECT, LSM6DSO32_PULL_UP_DISC, lsm6dso32_read_reg(), and lsm6dso32_pin_ctrl_t::sdo_pu_en.

| int32_t lsm6dso32_sdo_sa0_mode_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_sdo_pu_en_t | val | ||
| ) |
Connect/Disconnect SDO/SA0 internal pull-up.[set].
| ctx | read / write interface definitions |
| val | change the values of sdo_pu_en in reg PIN_CTRL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2766 of file lsm6dso32_reg.c.
References LSM6DSO32_PIN_CTRL, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_pin_ctrl_t::sdo_pu_en.

| int32_t lsm6dso32_spi_mode_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_sim_t * | val | ||
| ) |
SPI Serial Interface Mode selection.[get].
| ctx | read / write interface definitions |
| val | Get the values of sim in reg CTRL3_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2849 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL3_C, lsm6dso32_read_reg(), LSM6DSO32_SPI_3_WIRE, LSM6DSO32_SPI_4_WIRE, and lsm6dso32_ctrl3_c_t::sim.

| int32_t lsm6dso32_spi_mode_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_sim_t | val | ||
| ) |
SPI Serial Interface Mode selection.[set].
| ctx | read / write interface definitions |
| val | change the values of sim in reg CTRL3_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 2825 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL3_C, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl3_c_t::sim.

| int32_t lsm6dso32_status_reg_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_status_reg_t * | val | ||
| ) |
The STATUS_REG register is read by the primary interface.[get].
| ctx | read / write interface definitions |
| val | register STATUS_REG |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 849 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), and LSM6DSO32_STATUS_REG.
Referenced by calibrateIMU().


| int32_t lsm6dso32_temp_flag_data_ready_get | ( | stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Temperature new data available.[get].
| ctx | read / write interface definitions |
| val | change the values of tda in reg STATUS_REG |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 907 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), LSM6DSO32_STATUS_REG, and lsm6dso32_status_reg_t::tda.

| int32_t lsm6dso32_xl_data_rate_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_odr_xl_t * | val | ||
| ) |
Accelerometer UI data rate selection.[get].
| ctx | read / write interface definitions |
| val | Get the data rate and the power mode of the accelerometer |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 316 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL1_XL, LSM6DSO32_CTRL5_C, LSM6DSO32_CTRL6_C, LSM6DSO32_FUNC_CFG_ACCESS, lsm6dso32_read_reg(), LSM6DSO32_XL_ODR_104Hz_HIGH_PERF, LSM6DSO32_XL_ODR_104Hz_NORMAL_MD, LSM6DSO32_XL_ODR_104Hz_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_12Hz5_HIGH_PERF, LSM6DSO32_XL_ODR_12Hz5_LOW_PW, LSM6DSO32_XL_ODR_12Hz5_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_1667Hz_HIGH_PERF, LSM6DSO32_XL_ODR_208Hz_HIGH_PERF, LSM6DSO32_XL_ODR_208Hz_NORMAL_MD, LSM6DSO32_XL_ODR_208Hz_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_26Hz_HIGH_PERF, LSM6DSO32_XL_ODR_26Hz_LOW_PW, LSM6DSO32_XL_ODR_26Hz_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_3333Hz_HIGH_PERF, LSM6DSO32_XL_ODR_417Hz_HIGH_PERF, LSM6DSO32_XL_ODR_52Hz_HIGH_PERF, LSM6DSO32_XL_ODR_52Hz_LOW_PW, LSM6DSO32_XL_ODR_52Hz_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_6667Hz_HIGH_PERF, LSM6DSO32_XL_ODR_6Hz5_LOW_PW, LSM6DSO32_XL_ODR_6Hz5_ULTRA_LOW_PW, LSM6DSO32_XL_ODR_833Hz_HIGH_PERF, LSM6DSO32_XL_ODR_OFF, lsm6dso32_ctrl1_xl_t::odr_xl, lsm6dso32_ctrl6_c_t::xl_hm_mode, and lsm6dso32_ctrl5_c_t::xl_ulp_en.

| int32_t lsm6dso32_xl_data_rate_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_odr_xl_t | val | ||
| ) |
Accelerometer UI data rate and power mode selection.[set].
| ctx | read / write interface definitions |
| val | Change the data rate and the power mode of the accelerometer |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 242 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL1_XL, LSM6DSO32_CTRL5_C, LSM6DSO32_CTRL6_C, LSM6DSO32_FUNC_CFG_ACCESS, lsm6dso32_read_reg(), lsm6dso32_write_reg(), LSM6DSO32_XL_ODR_OFF, lsm6dso32_ctrl1_xl_t::odr_xl, lsm6dso32_ctrl6_c_t::xl_hm_mode, and lsm6dso32_ctrl5_c_t::xl_ulp_en.
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_xl_flag_data_ready_get | ( | stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
Accelerometer new data available.[get].
| ctx | read / write interface definitions |
| val | change the values of xlda in reg STATUS_REG |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 867 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), LSM6DSO32_STATUS_REG, and lsm6dso32_status_reg_t::xlda.

| int32_t lsm6dso32_xl_full_scale_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_fs_xl_t * | val | ||
| ) |
Accelerometer full-scale selection.[get].
| ctx | read / write interface definitions |
| val | Get the values of fs_xl in reg CTRL1_XL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 199 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl1_xl_t::fs_xl, LSM6DSO32_16g, LSM6DSO32_32g, LSM6DSO32_4g, LSM6DSO32_8g, LSM6DSO32_CTRL1_XL, and lsm6dso32_read_reg().

| int32_t lsm6dso32_xl_full_scale_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_fs_xl_t | val | ||
| ) |
Accelerometer full-scale selection.[set].
| ctx | read / write interface definitions |
| val | change the values of fs_xl in reg CTRL1_XL |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 172 of file lsm6dso32_reg.c.
References lsm6dso32_ctrl1_xl_t::fs_xl, LSM6DSO32_CTRL1_XL, lsm6dso32_read_reg(), and lsm6dso32_write_reg().
Referenced by init_imuB(), and init_imup().


| int32_t lsm6dso32_xl_offset_weight_get | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_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].
| ctx | read / write interface definitions |
| val | Get the values of usr_off_w in reg CTRL6_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 742 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL6_C, LSM6DSO32_LSb_16mg, LSM6DSO32_LSb_1mg, lsm6dso32_read_reg(), and lsm6dso32_ctrl6_c_t::usr_off_w.

| int32_t lsm6dso32_xl_offset_weight_set | ( | stmdev_ctx_t * | ctx, |
| lsm6dso32_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].
| ctx | read / write interface definitions |
| val | change the values of usr_off_w in reg CTRL6_C |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 716 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL6_C, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl6_c_t::usr_off_w.
Referenced by calibrateIMU().


| int32_t lsm6dso32_xl_usr_offset_get | ( | stmdev_ctx_t * | ctx, |
| uint8_t * | val | ||
| ) |
User offset on out flag.[get].
| ctx | read / write interface definitions |
| val | values of usr_off_on_out in reg CTRL7_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1071 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL7_G, lsm6dso32_read_reg(), and lsm6dso32_ctrl7_g_t::usr_off_on_out.

| int32_t lsm6dso32_xl_usr_offset_set | ( | stmdev_ctx_t * | ctx, |
| uint8_t | val | ||
| ) |
Enables user offset on out.[set].
| ctx | read / write interface definitions |
| val | change the values of usr_off_on_out in reg CTRL7_G |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1047 of file lsm6dso32_reg.c.
References LSM6DSO32_CTRL7_G, lsm6dso32_read_reg(), lsm6dso32_write_reg(), and lsm6dso32_ctrl7_g_t::usr_off_on_out.
Referenced by calibrateIMU().


| int32_t lsm6dso32_xl_usr_offset_x_get | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that stores data read |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 949 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), and LSM6DSO32_X_OFS_USR.

| int32_t lsm6dso32_xl_usr_offset_x_set | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that contains data to write |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 929 of file lsm6dso32_reg.c.
References lsm6dso32_write_reg(), and LSM6DSO32_X_OFS_USR.
Referenced by calibrateIMU().


| int32_t lsm6dso32_xl_usr_offset_y_get | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that stores data read |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 989 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), and LSM6DSO32_Y_OFS_USR.

| int32_t lsm6dso32_xl_usr_offset_y_set | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that contains data to write |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 969 of file lsm6dso32_reg.c.
References lsm6dso32_write_reg(), and LSM6DSO32_Y_OFS_USR.
Referenced by calibrateIMU().


| int32_t lsm6dso32_xl_usr_offset_z_get | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that stores data read |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1029 of file lsm6dso32_reg.c.
References lsm6dso32_read_reg(), and LSM6DSO32_Z_OFS_USR.

| int32_t lsm6dso32_xl_usr_offset_z_set | ( | stmdev_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].
| ctx | read / write interface definitions |
| buff | buffer that contains data to write |
| interface | status (MANDATORY: return 0 -> no Error) |
Definition at line 1009 of file lsm6dso32_reg.c.
References lsm6dso32_write_reg(), and LSM6DSO32_Z_OFS_USR.
Referenced by calibrateIMU().

