3-axis MEMS ultra low power accelerometer
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3
lis2dw12_reg.h File Reference
This file contains all the functions prototypes for the lis2dw12_reg.c driver. More...
Go to the source code of this file.
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 contains all the functions prototypes for the lis2dw12_reg.c driver.
- Attention:
© COPYRIGHT(c) 2018 STMicroelectronics
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file lis2dw12_reg.h.
Generated on Thu Jul 14 2022 10:48:26 by 1.7.2