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
Dependents: X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3
This file provides a set of functions needed to drive the lis2dw12 enhanced inertial module. More...
Modules | |
LIS2DW12_Interfaces_Functions | |
This section provide a set of functions used to read and write a generic register of the device. | |
LIS2DW12_Sensitivity | |
These functions convert raw-data into engineering units. | |
LIS2DW12_Data_Generation | |
This section groups all the functions concerning data generation. | |
LIS2DW12_Data_Output | |
This section groups all the data output functions. | |
LIS2DW12_Common | |
This section groups common useful functions. | |
LIS2DW12_Filters | |
This section group all the functions concerning the filters configuration. | |
LIS2DW12_Serial_Interface | |
This section groups all the functions concerning main serial interface management (not auxiliary) | |
LIS2DW12_Interrupt_Pins | |
This section groups all the functions that manage interrupt pins. | |
LIS2DW12_Wake_Up_Event | |
This section groups all the functions that manage the Wake Up event generation. | |
/Inactivity_Detection | |
This section groups all the functions concerning activity/inactivity detection. | |
LIS2DW12_Tap_Generator | |
This section groups all the functions that manage the tap and double tap event generation. | |
(6D/4D) | |
This section groups all the functions concerning six position detection (6D). | |
LIS2DW12_Free_Fall | |
This section group all the functions concerning the free fall detection. | |
LIS2DW12_Fifo | |
This section group all the functions concerning the fifo usage. | |
LIS2DW12_sensors_common_types | |
LIS2DW12_Infos | |
LIS2DW12_Register_Union | |
This union group all the registers that has a bitfield description. | |
Functions | |
int32_t | lis2dw12_read_reg (lis2dw12_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
Read generic device register. | |
int32_t | lis2dw12_write_reg (lis2dw12_ctx_t *ctx, uint8_t reg, uint8_t *data, uint16_t len) |
Write generic device register. | |
int32_t | lis2dw12_power_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_mode_t val) |
Select accelerometer operating modes. | |
int32_t | lis2dw12_power_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_mode_t *val) |
Select accelerometer operating modes. | |
int32_t | lis2dw12_data_rate_set (lis2dw12_ctx_t *ctx, lis2dw12_odr_t val) |
Accelerometer data rate selection. | |
int32_t | lis2dw12_data_rate_get (lis2dw12_ctx_t *ctx, lis2dw12_odr_t *val) |
Accelerometer data rate selection. | |
int32_t | lis2dw12_block_data_update_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Block data update. | |
int32_t | lis2dw12_block_data_update_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Block data update. | |
int32_t | lis2dw12_full_scale_set (lis2dw12_ctx_t *ctx, lis2dw12_fs_t val) |
Accelerometer full-scale selection. | |
int32_t | lis2dw12_full_scale_get (lis2dw12_ctx_t *ctx, lis2dw12_fs_t *val) |
Accelerometer full-scale selection. | |
int32_t | lis2dw12_status_reg_get (lis2dw12_ctx_t *ctx, lis2dw12_status_t *val) |
The STATUS_REG register of the device. | |
int32_t | lis2dw12_flag_data_ready_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Accelerometer new data available. | |
int32_t | lis2dw12_all_sources_get (lis2dw12_ctx_t *ctx, lis2dw12_all_sources_t *val) |
Read all the interrupt/status flag of the device. | |
int32_t | lis2dw12_usr_offset_x_set (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_usr_offset_x_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_usr_offset_y_set (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_usr_offset_y_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_usr_offset_z_set (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_usr_offset_z_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W. | |
int32_t | lis2dw12_offset_weight_set (lis2dw12_ctx_t *ctx, lis2dw12_usr_off_w_t val) |
Weight of XL user offset bits of registers X_OFS_USR, Y_OFS_USR, Z_OFS_USR. | |
int32_t | lis2dw12_offset_weight_get (lis2dw12_ctx_t *ctx, lis2dw12_usr_off_w_t *val) |
Weight of XL user offset bits of registers X_OFS_USR, Y_OFS_USR, Z_OFS_USR. | |
int32_t | lis2dw12_temperature_raw_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Temperature data output register (r). | |
int32_t | lis2dw12_acceleration_raw_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Linear acceleration output register. | |
int32_t | lis2dw12_device_id_get (lis2dw12_ctx_t *ctx, uint8_t *buff) |
Device Who am I. | |
int32_t | lis2dw12_auto_increment_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Register address automatically incremented during multiple byte access with a serial interface. | |
int32_t | lis2dw12_auto_increment_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Register address automatically incremented during multiple byte access with a serial interface. | |
int32_t | lis2dw12_reset_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Software reset. | |
int32_t | lis2dw12_reset_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Software reset. | |
int32_t | lis2dw12_boot_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Reboot memory content. | |
int32_t | lis2dw12_boot_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Reboot memory content. | |
int32_t | lis2dw12_self_test_set (lis2dw12_ctx_t *ctx, lis2dw12_st_t val) |
Sensor self-test enable. | |
int32_t | lis2dw12_self_test_get (lis2dw12_ctx_t *ctx, lis2dw12_st_t *val) |
Sensor self-test enable. | |
int32_t | lis2dw12_data_ready_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_drdy_pulsed_t val) |
Data-ready pulsed / letched mode. | |
int32_t | lis2dw12_data_ready_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_drdy_pulsed_t *val) |
Data-ready pulsed / letched mode. | |
int32_t | lis2dw12_filter_path_set (lis2dw12_ctx_t *ctx, lis2dw12_fds_t val) |
Accelerometer filtering path for outputs. | |
int32_t | lis2dw12_filter_path_get (lis2dw12_ctx_t *ctx, lis2dw12_fds_t *val) |
Accelerometer filtering path for outputs. | |
int32_t | lis2dw12_filter_bandwidth_set (lis2dw12_ctx_t *ctx, lis2dw12_bw_filt_t val) |
Accelerometer cutoff filter frequency. | |
int32_t | lis2dw12_filter_bandwidth_get (lis2dw12_ctx_t *ctx, lis2dw12_bw_filt_t *val) |
Accelerometer cutoff filter frequency. | |
int32_t | lis2dw12_reference_mode_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Enable HP filter reference mode. | |
int32_t | lis2dw12_reference_mode_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Enable HP filter reference mode. | |
int32_t | lis2dw12_spi_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_sim_t val) |
SPI Serial Interface Mode selection. | |
int32_t | lis2dw12_spi_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_sim_t *val) |
SPI Serial Interface Mode selection. | |
int32_t | lis2dw12_i2c_interface_set (lis2dw12_ctx_t *ctx, lis2dw12_i2c_disable_t val) |
Disable / Enable I2C interface. | |
int32_t | lis2dw12_i2c_interface_get (lis2dw12_ctx_t *ctx, lis2dw12_i2c_disable_t *val) |
Disable / Enable I2C interface. | |
int32_t | lis2dw12_cs_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_cs_pu_disc_t val) |
Disconnect CS pull-up. | |
int32_t | lis2dw12_cs_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_cs_pu_disc_t *val) |
Disconnect CS pull-up. | |
int32_t | lis2dw12_pin_polarity_set (lis2dw12_ctx_t *ctx, lis2dw12_h_lactive_t val) |
Interrupt active-high/low. | |
int32_t | lis2dw12_pin_polarity_get (lis2dw12_ctx_t *ctx, lis2dw12_h_lactive_t *val) |
Interrupt active-high/low. | |
int32_t | lis2dw12_int_notification_set (lis2dw12_ctx_t *ctx, lis2dw12_lir_t val) |
Latched/pulsed interrupt. | |
int32_t | lis2dw12_int_notification_get (lis2dw12_ctx_t *ctx, lis2dw12_lir_t *val) |
Latched/pulsed interrupt. | |
int32_t | lis2dw12_pin_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_pp_od_t val) |
Push-pull/open drain selection on interrupt pads. | |
int32_t | lis2dw12_pin_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_pp_od_t *val) |
Push-pull/open drain selection on interrupt pads. | |
int32_t | lis2dw12_pin_int1_route_set (lis2dw12_ctx_t *ctx, lis2dw12_ctrl4_int1_pad_ctrl_t *val) |
Select the signal that need to route on int1 pad. | |
int32_t | lis2dw12_pin_int1_route_get (lis2dw12_ctx_t *ctx, lis2dw12_ctrl4_int1_pad_ctrl_t *val) |
Select the signal that need to route on int1 pad. | |
int32_t | lis2dw12_pin_int2_route_set (lis2dw12_ctx_t *ctx, lis2dw12_ctrl5_int2_pad_ctrl_t *val) |
Select the signal that need to route on int2 pad. | |
int32_t | lis2dw12_pin_int2_route_get (lis2dw12_ctx_t *ctx, lis2dw12_ctrl5_int2_pad_ctrl_t *val) |
Select the signal that need to route on int2 pad. | |
int32_t | lis2dw12_all_on_int1_set (lis2dw12_ctx_t *ctx, uint8_t val) |
All interrupt signals become available on INT1 pin. | |
int32_t | lis2dw12_all_on_int1_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
All interrupt signals become available on INT1 pin. | |
int32_t | lis2dw12_wkup_threshold_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Threshold for wakeup.1 LSB = FS_XL / 64. | |
int32_t | lis2dw12_wkup_threshold_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Threshold for wakeup.1 LSB = FS_XL / 64. | |
int32_t | lis2dw12_wkup_dur_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Wake up duration event.1LSb = 1 / ODR. | |
int32_t | lis2dw12_wkup_dur_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Wake up duration event.1LSb = 1 / ODR. | |
int32_t | lis2dw12_wkup_feed_data_set (lis2dw12_ctx_t *ctx, lis2dw12_usr_off_on_wu_t val) |
Data sent to wake-up interrupt function. | |
int32_t | lis2dw12_wkup_feed_data_get (lis2dw12_ctx_t *ctx, lis2dw12_usr_off_on_wu_t *val) |
Data sent to wake-up interrupt function. | |
int32_t | lis2dw12_act_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_sleep_on_t val) |
Config activity / inactivity or stationary / motion detection. | |
int32_t | lis2dw12_act_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_sleep_on_t *val) |
Config activity / inactivity or stationary / motion detection. | |
int32_t | lis2dw12_act_sleep_dur_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Duration to go in sleep mode (1 LSb = 512 / ODR). | |
int32_t | lis2dw12_act_sleep_dur_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Duration to go in sleep mode (1 LSb = 512 / ODR). | |
int32_t | lis2dw12_tap_threshold_x_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_threshold_x_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_threshold_y_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_threshold_y_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_axis_priority_set (lis2dw12_ctx_t *ctx, lis2dw12_tap_prior_t val) |
Selection of axis priority for TAP detection. | |
int32_t | lis2dw12_tap_axis_priority_get (lis2dw12_ctx_t *ctx, lis2dw12_tap_prior_t *val) |
Selection of axis priority for TAP detection. | |
int32_t | lis2dw12_tap_threshold_z_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_threshold_z_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Threshold for tap recognition. | |
int32_t | lis2dw12_tap_detection_on_z_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Enable Z direction in tap recognition. | |
int32_t | lis2dw12_tap_detection_on_z_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Enable Z direction in tap recognition. | |
int32_t | lis2dw12_tap_detection_on_y_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Enable Y direction in tap recognition. | |
int32_t | lis2dw12_tap_detection_on_y_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Enable Y direction in tap recognition. | |
int32_t | lis2dw12_tap_detection_on_x_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Enable X direction in tap recognition. | |
int32_t | lis2dw12_tap_detection_on_x_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Enable X direction in tap recognition. | |
int32_t | lis2dw12_tap_shock_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Maximum duration is the maximum time of an overthreshold signal detection to be recognized as a tap event. | |
int32_t | lis2dw12_tap_shock_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Maximum duration is the maximum time of an overthreshold signal detection to be recognized as a tap event. | |
int32_t | lis2dw12_tap_quiet_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Quiet time is the time after the first detected tap in which there must not be any overthreshold event. | |
int32_t | lis2dw12_tap_quiet_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Quiet time is the time after the first detected tap in which there must not be any overthreshold event. | |
int32_t | lis2dw12_tap_dur_set (lis2dw12_ctx_t *ctx, uint8_t val) |
When double tap recognition is enabled, this register expresses the maximum time between two consecutive detected taps to determine a double tap event. | |
int32_t | lis2dw12_tap_dur_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
When double tap recognition is enabled, this register expresses the maximum time between two consecutive detected taps to determine a double tap event. | |
int32_t | lis2dw12_tap_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_single_double_tap_t val) |
Single/double-tap event enable. | |
int32_t | lis2dw12_tap_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_single_double_tap_t *val) |
Single/double-tap event enable. | |
int32_t | lis2dw12_tap_src_get (lis2dw12_ctx_t *ctx, lis2dw12_tap_src_t *val) |
Read the tap / double tap source register. | |
int32_t | lis2dw12_6d_threshold_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Threshold for 4D/6D function. | |
int32_t | lis2dw12_6d_threshold_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Threshold for 4D/6D function. | |
int32_t | lis2dw12_4d_mode_set (lis2dw12_ctx_t *ctx, uint8_t val) |
4D orientation detection enable. | |
int32_t | lis2dw12_4d_mode_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
4D orientation detection enable. | |
int32_t | lis2dw12_6d_src_get (lis2dw12_ctx_t *ctx, lis2dw12_sixd_src_t *val) |
Read the 6D tap source register. | |
int32_t | lis2dw12_6d_feed_data_set (lis2dw12_ctx_t *ctx, lis2dw12_lpass_on6d_t val) |
Data sent to 6D interrupt function. | |
int32_t | lis2dw12_6d_feed_data_get (lis2dw12_ctx_t *ctx, lis2dw12_lpass_on6d_t *val) |
Data sent to 6D interrupt function. | |
int32_t | lis2dw12_ff_dur_set (lis2dw12_ctx_t *ctx, uint8_t val) |
Wake up duration event(1LSb = 1 / ODR). | |
int32_t | lis2dw12_ff_dur_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Wake up duration event(1LSb = 1 / ODR). | |
int32_t | lis2dw12_ff_threshold_set (lis2dw12_ctx_t *ctx, lis2dw12_ff_ths_t val) |
Free fall threshold setting. | |
int32_t | lis2dw12_ff_threshold_get (lis2dw12_ctx_t *ctx, lis2dw12_ff_ths_t *val) |
Free fall threshold setting. | |
int32_t | lis2dw12_fifo_watermark_set (lis2dw12_ctx_t *ctx, uint8_t val) |
FIFO watermark level selection. | |
int32_t | lis2dw12_fifo_watermark_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
FIFO watermark level selection. | |
int32_t | lis2dw12_fifo_mode_set (lis2dw12_ctx_t *ctx, lis2dw12_fmode_t val) |
FIFO mode selection. | |
int32_t | lis2dw12_fifo_mode_get (lis2dw12_ctx_t *ctx, lis2dw12_fmode_t *val) |
FIFO mode selection. | |
int32_t | lis2dw12_fifo_data_level_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
Number of unread samples stored in FIFO. | |
int32_t | lis2dw12_fifo_ovr_flag_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
FIFO overrun status. | |
int32_t | lis2dw12_fifo_wtm_flag_get (lis2dw12_ctx_t *ctx, uint8_t *val) |
FIFO threshold status flag. |
Detailed Description
This file provides a set of functions needed to drive the lis2dw12 enhanced inertial module.
Function Documentation
int32_t lis2dw12_4d_mode_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
4D orientation detection enable.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of 4d_en in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2504 of file lis2dw12_reg.c.
int32_t lis2dw12_4d_mode_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
4D orientation detection enable.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of 4d_en in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2482 of file lis2dw12_reg.c.
int32_t lis2dw12_6d_feed_data_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_lpass_on6d_t * | val | ||
) |
Data sent to 6D interrupt function.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of lpass_on6d in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2559 of file lis2dw12_reg.c.
int32_t lis2dw12_6d_feed_data_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_lpass_on6d_t | val | ||
) |
Data sent to 6D interrupt function.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of lpass_on6d in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2537 of file lis2dw12_reg.c.
int32_t lis2dw12_6d_src_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_sixd_src_t * | val | ||
) |
Read the 6D tap source register.
[get]
- Parameters:
-
ctx read / write interface definitions val union of registers from SIXD_SRC
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2523 of file lis2dw12_reg.c.
int32_t lis2dw12_6d_threshold_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Threshold for 4D/6D function.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of 6d_ths in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2463 of file lis2dw12_reg.c.
int32_t lis2dw12_6d_threshold_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Threshold for 4D/6D function.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of 6d_ths in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2442 of file lis2dw12_reg.c.
int32_t lis2dw12_acceleration_raw_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Linear acceleration output register.
The value is expressed as a 16-bit word in two’s complement.[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 708 of file lis2dw12_reg.c.
int32_t lis2dw12_act_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_sleep_on_t * | val | ||
) |
Config activity / inactivity or stationary / motion detection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of sleep_on in reg WAKE_UP_THS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1820 of file lis2dw12_reg.c.
int32_t lis2dw12_act_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_sleep_on_t | val | ||
) |
Config activity / inactivity or stationary / motion detection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of sleep_on / stationary in reg WAKE_UP_THS / WAKE_UP_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1789 of file lis2dw12_reg.c.
int32_t lis2dw12_act_sleep_dur_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Duration to go in sleep mode (1 LSb = 512 / ODR).
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of sleep_dur in reg WAKE_UP_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1877 of file lis2dw12_reg.c.
int32_t lis2dw12_act_sleep_dur_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Duration to go in sleep mode (1 LSb = 512 / ODR).
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of sleep_dur in reg WAKE_UP_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1856 of file lis2dw12_reg.c.
int32_t lis2dw12_all_on_int1_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
All interrupt signals become available on INT1 pin.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of int2_on_int1 in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1610 of file lis2dw12_reg.c.
int32_t lis2dw12_all_on_int1_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
All interrupt signals become available on INT1 pin.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of int2_on_int1 in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1589 of file lis2dw12_reg.c.
int32_t lis2dw12_all_sources_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_all_sources_t * | val | ||
) |
Read all the interrupt/status flag of the device.
[get]
- Parameters:
-
ctx read / write interface definitions val registers STATUS_DUP, WAKE_UP_SRC, TAP_SRC, SIXD_SRC, ALL_INT_SRC
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 507 of file lis2dw12_reg.c.
int32_t lis2dw12_auto_increment_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Register address automatically incremented during multiple byte access with a serial interface.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of if_add_inc in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 773 of file lis2dw12_reg.c.
int32_t lis2dw12_auto_increment_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Register address automatically incremented during multiple byte access with a serial interface.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of if_add_inc in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 751 of file lis2dw12_reg.c.
int32_t lis2dw12_block_data_update_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Block data update.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of bdu in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 398 of file lis2dw12_reg.c.
int32_t lis2dw12_block_data_update_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Block data update.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of bdu in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 377 of file lis2dw12_reg.c.
int32_t lis2dw12_boot_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Reboot memory content.
Reload the calibration parameters.[get]
- Parameters:
-
ctx read / write interface definitions val change the values of boot in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 854 of file lis2dw12_reg.c.
int32_t lis2dw12_boot_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Reboot memory content.
Reload the calibration parameters.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of boot in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 833 of file lis2dw12_reg.c.
int32_t lis2dw12_cs_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_cs_pu_disc_t * | val | ||
) |
Disconnect CS pull-up.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of cs_pu_disc in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1297 of file lis2dw12_reg.c.
int32_t lis2dw12_cs_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_cs_pu_disc_t | val | ||
) |
Disconnect CS pull-up.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of cs_pu_disc in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1276 of file lis2dw12_reg.c.
int32_t lis2dw12_data_rate_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_odr_t * | val | ||
) |
Accelerometer data rate selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of odr in reg CTRL1
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 314 of file lis2dw12_reg.c.
int32_t lis2dw12_data_rate_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_odr_t | val | ||
) |
Accelerometer data rate selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of odr in reg CTRL1
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 285 of file lis2dw12_reg.c.
int32_t lis2dw12_data_ready_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_drdy_pulsed_t * | val | ||
) |
Data-ready pulsed / letched mode.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of drdy_pulsed in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 950 of file lis2dw12_reg.c.
int32_t lis2dw12_data_ready_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_drdy_pulsed_t | val | ||
) |
Data-ready pulsed / letched mode.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of drdy_pulsed in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 927 of file lis2dw12_reg.c.
int32_t lis2dw12_device_id_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Device Who am I.
[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 735 of file lis2dw12_reg.c.
int32_t lis2dw12_ff_dur_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Wake up duration event(1LSb = 1 / ODR).
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of ff_dur in reg WAKE_UP_DUR /F REE_FALL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2634 of file lis2dw12_reg.c.
int32_t lis2dw12_ff_dur_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Wake up duration event(1LSb = 1 / ODR).
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of ff_dur in reg WAKE_UP_DUR /F REE_FALL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2603 of file lis2dw12_reg.c.
int32_t lis2dw12_ff_threshold_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ff_ths_t * | val | ||
) |
Free fall threshold setting.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of ff_ths in reg FREE_FALL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2678 of file lis2dw12_reg.c.
int32_t lis2dw12_ff_threshold_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ff_ths_t | val | ||
) |
Free fall threshold setting.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of ff_ths in reg FREE_FALL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2656 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_data_level_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Number of unread samples stored in FIFO.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of diff in reg FIFO_SAMPLES
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2838 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fmode_t * | val | ||
) |
FIFO mode selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of fmode in reg FIFO_CTRL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2800 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fmode_t | val | ||
) |
FIFO mode selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fmode in reg FIFO_CTRL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2779 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_ovr_flag_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
FIFO overrun status.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of fifo_ovr in reg FIFO_SAMPLES
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2856 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_watermark_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
FIFO watermark level selection.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of fth in reg FIFO_CTRL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2760 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_watermark_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
FIFO watermark level selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fth in reg FIFO_CTRL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2738 of file lis2dw12_reg.c.
int32_t lis2dw12_fifo_wtm_flag_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
FIFO threshold status flag.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of fifo_fth in reg FIFO_SAMPLES
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2874 of file lis2dw12_reg.c.
int32_t lis2dw12_filter_bandwidth_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_bw_filt_t * | val | ||
) |
Accelerometer cutoff filter frequency.
Valid for low and high pass filter.[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of bw_filt in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1084 of file lis2dw12_reg.c.
int32_t lis2dw12_filter_bandwidth_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_bw_filt_t | val | ||
) |
Accelerometer cutoff filter frequency.
Valid for low and high pass filter.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of bw_filt in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1060 of file lis2dw12_reg.c.
int32_t lis2dw12_filter_path_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fds_t * | val | ||
) |
Accelerometer filtering path for outputs.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of fds in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1023 of file lis2dw12_reg.c.
int32_t lis2dw12_filter_path_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fds_t | val | ||
) |
Accelerometer filtering path for outputs.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fds in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 993 of file lis2dw12_reg.c.
int32_t lis2dw12_flag_data_ready_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Accelerometer new data available.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of drdy in reg STATUS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 488 of file lis2dw12_reg.c.
int32_t lis2dw12_full_scale_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fs_t * | val | ||
) |
Accelerometer full-scale selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of fs in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 438 of file lis2dw12_reg.c.
int32_t lis2dw12_full_scale_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_fs_t | val | ||
) |
Accelerometer full-scale selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of fs in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 417 of file lis2dw12_reg.c.
int32_t lis2dw12_i2c_interface_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_i2c_disable_t * | val | ||
) |
Disable / Enable I2C interface.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of i2c_disable in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1246 of file lis2dw12_reg.c.
int32_t lis2dw12_i2c_interface_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_i2c_disable_t | val | ||
) |
Disable / Enable I2C interface.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of i2c_disable in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1224 of file lis2dw12_reg.c.
int32_t lis2dw12_int_notification_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_lir_t * | val | ||
) |
Latched/pulsed interrupt.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of lir in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1412 of file lis2dw12_reg.c.
int32_t lis2dw12_int_notification_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_lir_t | val | ||
) |
Latched/pulsed interrupt.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of lir in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1390 of file lis2dw12_reg.c.
int32_t lis2dw12_offset_weight_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_usr_off_w_t * | val | ||
) |
Weight of XL user offset bits of registers X_OFS_USR, Y_OFS_USR, Z_OFS_USR.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of usr_off_w in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 650 of file lis2dw12_reg.c.
int32_t lis2dw12_offset_weight_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_usr_off_w_t | val | ||
) |
Weight of XL user offset bits of registers X_OFS_USR, Y_OFS_USR, Z_OFS_USR.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of usr_off_w in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 627 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_int1_route_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ctrl4_int1_pad_ctrl_t * | val | ||
) |
Select the signal that need to route on int1 pad.
[get]
- Parameters:
-
ctx read / write interface definitions val register CTRL4_INT1_PAD_CTRL.
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1524 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_int1_route_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ctrl4_int1_pad_ctrl_t * | val | ||
) |
Select the signal that need to route on int1 pad.
[set]
- Parameters:
-
ctx read / write interface definitions val register CTRL4_INT1_PAD_CTRL.
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1492 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_int2_route_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ctrl5_int2_pad_ctrl_t * | val | ||
) |
Select the signal that need to route on int2 pad.
[get]
- Parameters:
-
ctx read / write interface definitions val register CTRL5_INT2_PAD_CTRL
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1573 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_int2_route_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_ctrl5_int2_pad_ctrl_t * | val | ||
) |
Select the signal that need to route on int2 pad.
[set]
- Parameters:
-
ctx read / write interface definitions val register CTRL5_INT2_PAD_CTRL.
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1541 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_pp_od_t * | val | ||
) |
Push-pull/open drain selection on interrupt pads.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of pp_od in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1463 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_pp_od_t | val | ||
) |
Push-pull/open drain selection on interrupt pads.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of pp_od in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1442 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_polarity_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_h_lactive_t * | val | ||
) |
Interrupt active-high/low.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of h_lactive in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1360 of file lis2dw12_reg.c.
int32_t lis2dw12_pin_polarity_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_h_lactive_t | val | ||
) |
Interrupt active-high/low.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of h_lactive in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1338 of file lis2dw12_reg.c.
int32_t lis2dw12_power_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_mode_t * | val | ||
) |
Select accelerometer operating modes.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of mode / lp_mode in reg CTRL1 and low_noise in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 203 of file lis2dw12_reg.c.
int32_t lis2dw12_power_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_mode_t | val | ||
) |
Select accelerometer operating modes.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of mode / lp_mode in reg CTRL1 and low_noise in reg CTRL6
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 172 of file lis2dw12_reg.c.
int32_t lis2dw12_read_reg | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data, | ||
uint16_t | len | ||
) |
Read generic device register.
- Parameters:
-
ctx read / write interface definitions(ptr) reg register to read data pointer to buffer that store the data read(ptr) len number of consecutive register to read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 67 of file lis2dw12_reg.c.
int32_t lis2dw12_reference_mode_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Enable HP filter reference mode.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of hp_ref_mode in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1141 of file lis2dw12_reg.c.
int32_t lis2dw12_reference_mode_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enable HP filter reference mode.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of hp_ref_mode in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1120 of file lis2dw12_reg.c.
int32_t lis2dw12_reset_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Software reset.
Restore the default values in user registers.[get]
- Parameters:
-
ctx read / write interface definitions val change the values of soft_reset in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 814 of file lis2dw12_reg.c.
int32_t lis2dw12_reset_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Software reset.
Restore the default values in user registers.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of soft_reset in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 792 of file lis2dw12_reg.c.
int32_t lis2dw12_self_test_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_st_t * | val | ||
) |
Sensor self-test enable.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of st in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 895 of file lis2dw12_reg.c.
int32_t lis2dw12_self_test_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_st_t | val | ||
) |
Sensor self-test enable.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of st in reg CTRL3
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 873 of file lis2dw12_reg.c.
int32_t lis2dw12_spi_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_sim_t * | val | ||
) |
SPI Serial Interface Mode selection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of sim in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1194 of file lis2dw12_reg.c.
int32_t lis2dw12_spi_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_sim_t | val | ||
) |
SPI Serial Interface Mode selection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of sim in reg CTRL2
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1173 of file lis2dw12_reg.c.
int32_t lis2dw12_status_reg_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_status_t * | val | ||
) |
The STATUS_REG register of the device.
[get]
- Parameters:
-
ctx read / write interface definitions val union of registers from STATUS to
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 473 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_axis_priority_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_tap_prior_t * | val | ||
) |
Selection of axis priority for TAP detection.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of tap_prior in reg TAP_THS_Y
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2011 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_axis_priority_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_tap_prior_t | val | ||
) |
Selection of axis priority for TAP detection.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_prior in reg TAP_THS_Y
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1989 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_x_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Enable X direction in tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_x_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2195 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_x_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enable X direction in tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_x_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2174 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_y_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Enable Y direction in tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_y_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2155 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_y_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enable Y direction in tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_y_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2134 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_z_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Enable Z direction in tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_z_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2115 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_detection_on_z_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Enable Z direction in tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_z_en in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2094 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_dur_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
When double tap recognition is enabled, this register expresses the maximum time between two consecutive detected taps to determine a double tap event.
The default value of these bits is 0000b which corresponds to 16*ODR_XL time. If the DUR[3:0] bits are set to a different value, 1LSB corresponds to 32*ODR_XL time.[get]
- Parameters:
-
ctx read / write interface definitions val change the values of latency in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2342 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_dur_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
When double tap recognition is enabled, this register expresses the maximum time between two consecutive detected taps to determine a double tap event.
The default value of these bits is 0000b which corresponds to 16*ODR_XL time. If the DUR[3:0] bits are set to a different value, 1LSB corresponds to 32*ODR_XL time.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of latency in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2316 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_mode_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_single_double_tap_t * | val | ||
) |
Single/double-tap event enable.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of single_double_tap in reg WAKE_UP_THS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2383 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_mode_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_single_double_tap_t | val | ||
) |
Single/double-tap event enable.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of single_double_tap in reg WAKE_UP_THS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2361 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_quiet_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Quiet time is the time after the first detected tap in which there must not be any overthreshold event.
The default value of these bits is 00b which corresponds to 2*ODR_XL time. If the QUIET[1:0] bits are set to a different value, 1LSB corresponds to 4*ODR_XL time.[get]
- Parameters:
-
ctx read / write interface definitions val change the values of quiet in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2292 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_quiet_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Quiet time is the time after the first detected tap in which there must not be any overthreshold event.
The default value of these bits is 00b which corresponds to 2*ODR_XL time. If the QUIET[1:0] bits are set to a different value, 1LSB corresponds to 4*ODR_XL time.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of quiet in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2267 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_shock_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Maximum duration is the maximum time of an overthreshold signal detection to be recognized as a tap event.
The default value of these bits is 00b which corresponds to 4*ODR_XL time. If the SHOCK[1:0] bits are set to a different value, 1LSB corresponds to 8*ODR_XL time.[get]
- Parameters:
-
ctx read / write interface definitions val change the values of shock in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2244 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_shock_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Maximum duration is the maximum time of an overthreshold signal detection to be recognized as a tap event.
The default value of these bits is 00b which corresponds to 4*ODR_XL time. If the SHOCK[1:0] bits are set to a different value, 1LSB corresponds to 8*ODR_XL time.[set]
- Parameters:
-
ctx read / write interface definitions val change the values of shock in reg INT_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2218 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_src_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_tap_src_t * | val | ||
) |
Read the tap / double tap source register.
[get]
- Parameters:
-
ctx read / write interface definitions lis2dw12_tap_src,: union of registers from TAP_SRC to
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2414 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_x_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Threshold for tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsx in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1930 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_x_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Threshold for tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsx in reg TAP_THS_X
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1909 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_y_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Threshold for tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsy in reg TAP_THS_Y
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1970 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_y_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Threshold for tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsy in reg TAP_THS_Y
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1949 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_z_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Threshold for tap recognition.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsz in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2075 of file lis2dw12_reg.c.
int32_t lis2dw12_tap_threshold_z_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Threshold for tap recognition.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of tap_thsz in reg TAP_THS_Z
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 2053 of file lis2dw12_reg.c.
int32_t lis2dw12_temperature_raw_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Temperature data output register (r).
L and H registers together express a 16-bit word in two’s complement.[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 692 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_x_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 542 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_x_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer X-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 525 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_y_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 576 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_y_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Y-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 559 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_z_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[get]
- Parameters:
-
ctx read / write interface definitions buff buffer that stores data read
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 610 of file lis2dw12_reg.c.
int32_t lis2dw12_usr_offset_z_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | buff | ||
) |
Accelerometer Z-axis user offset correction expressed in two’s complement, weight depends on bit USR_OFF_W.
The value must be in the range [-127 127].[set]
- Parameters:
-
ctx read / write interface definitions buff buffer that contains data to write
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 593 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_dur_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Wake up duration event.1LSb = 1 / ODR.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of wake_dur in reg WAKE_UP_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1703 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_dur_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Wake up duration event.1LSb = 1 / ODR.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of wake_dur in reg WAKE_UP_DUR
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1682 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_feed_data_get | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_usr_off_on_wu_t * | val | ||
) |
Data sent to wake-up interrupt function.
[get]
- Parameters:
-
ctx read / write interface definitions val Get the values of usr_off_on_wu in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1744 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_feed_data_set | ( | lis2dw12_ctx_t * | ctx, |
lis2dw12_usr_off_on_wu_t | val | ||
) |
Data sent to wake-up interrupt function.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of usr_off_on_wu in reg CTRL_REG7
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1722 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_threshold_get | ( | lis2dw12_ctx_t * | ctx, |
uint8_t * | val | ||
) |
Threshold for wakeup.1 LSB = FS_XL / 64.
[get]
- Parameters:
-
ctx read / write interface definitions val change the values of wk_ths in reg WAKE_UP_THS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1663 of file lis2dw12_reg.c.
int32_t lis2dw12_wkup_threshold_set | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | val | ||
) |
Threshold for wakeup.1 LSB = FS_XL / 64.
[set]
- Parameters:
-
ctx read / write interface definitions val change the values of wk_ths in reg WAKE_UP_THS
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 1642 of file lis2dw12_reg.c.
int32_t lis2dw12_write_reg | ( | lis2dw12_ctx_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data, | ||
uint16_t | len | ||
) |
Write generic device register.
- Parameters:
-
ctx read / write interface definitions(ptr) reg register to write data pointer to data to write in register reg(ptr) len number of consecutive register to write
- Return values:
-
interface status (MANDATORY: return 0 -> no Error)
Definition at line 85 of file lis2dw12_reg.c.
Generated on Thu Jul 14 2022 10:48:26 by
