iNEMO inertial module: 3D accelerometer and 3D gyroscope.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Embed: (wiki syntax)

« Back to documentation index

LSM6DSOXSensor Class Reference

LSM6DSOXSensor Class Reference

Abstract class of an LSM6DSOX Inertial Measurement Unit (IMU) 6 axes sensor. More...

#include <LSM6DSOXSensor.h>

Public Member Functions

 LSM6DSOXSensor (SPI *spi, PinName cs_pin, PinName int1_pin=NC, PinName int2_pin=NC, SPI_type_t spi_type=SPI4W)
 Constructor.
 LSM6DSOXSensor (DevI2C *i2c, uint8_t address=LSM6DSOX_I2C_ADD_H, PinName int1_pin=NC, PinName int2_pin=NC)
 Constructor.
virtual int init (void *init)
 Initializing the component.
virtual int read_id (uint8_t *id)
 Read component ID.
virtual int get_x_axes (int32_t *acceleration)
 Get the LSM6DSOX accelerometer sensor axes.
virtual int get_g_axes (int32_t *angular_rate)
 Get the LSM6DSOX gyroscope sensor axes.
virtual int get_x_sensitivity (float *sensitivity)
 Get the LSM6DSOX accelerometer sensor sensitivity.
virtual int get_g_sensitivity (float *sensitivity)
 Get the LSM6DSOX gyroscope sensor sensitivity.
virtual int get_x_axes_raw (int16_t *value)
 Get the LSM6DSOX accelerometer sensor raw axes.
virtual int get_g_axes_raw (int16_t *value)
 Get the LSM6DSOX gyroscope sensor raw axes.
virtual int get_x_odr (float *odr)
 Get the LSM6DSOX accelerometer sensor output data rate.
virtual int get_g_odr (float *odr)
 Get the LSM6DSOX gyroscope sensor output data rate.
virtual int set_x_odr (float odr)
 Set the LSM6DSOX accelerometer sensor output data rate.
virtual int set_x_odr_with_mode (float odr, LSM6DSOX_ACC_Operating_Mode_t mode)
 Set the LSM6DSOX accelerometer sensor output data rate with operating mode.
virtual int set_g_odr (float odr)
 Set the LSM6DSOX gyroscope sensor output data rate.
virtual int set_g_odr_with_mode (float odr, LSM6DSOX_GYRO_Operating_Mode_t mode)
 Set the LSM6DSOX gyroscope sensor output data rate with operating mode.
virtual int get_x_fs (float *full_scale)
 Get the LSM6DSOX accelerometer sensor full scale.
virtual int get_g_fs (float *full_scale)
 Get the LSM6DSOX gyroscope sensor full scale.
virtual int set_x_fs (float full_scale)
 Set the LSM6DSOX accelerometer sensor full scale.
virtual int set_g_fs (float full_scale)
 Set the LSM6DSOX gyroscope sensor full scale.
int enable_x (void)
 Enable the LSM6DSOX accelerometer sensor.
int enable_g (void)
 Enable the LSM6DSOX gyroscope sensor.
int disable_x (void)
 Disable the LSM6DSOX accelerometer sensor.
int disable_g (void)
 Disable the LSM6DSOX gyroscope sensor.
int enable_free_fall_detection (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT1_PIN)
 Enable free fall detection.
int disable_free_fall_detection (void)
 Disable free fall detection.
int set_free_fall_threshold (uint8_t thr)
 Set free fall threshold.
int set_free_fall_duration (uint8_t dur)
 Set free fall duration.
int enable_pedometer (void)
 Enable pedometer.
int disable_pedometer (void)
 Disable pedometer.
int get_step_counter (uint16_t *step_count)
 Get step count.
int reset_step_counter (void)
 Enable step counter reset.
int enable_tilt_detection (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT1_PIN)
 Enable tilt detection.
int disable_tilt_detection (void)
 Disable tilt detection.
int enable_wake_up_detection (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT2_PIN)
 Enable wake up detection.
int disable_wake_up_detection (void)
 Disable wake up detection.
int set_wake_up_threshold (uint8_t thr)
 Set wake up threshold.
int set_wake_up_duration (uint8_t dur)
 Set wake up duration.
int enable_single_tap_detection (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT1_PIN)
 Enable single tap detection.
int disable_single_tap_detection (void)
 Disable single tap detection.
int enable_double_tap_detection (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT1_PIN)
 Enable double tap detection.
int disable_double_tap_detection (void)
 Disable double tap detection.
int set_tap_threshold (uint8_t thr)
 Set tap threshold.
int set_tap_shock_time (uint8_t time)
 Set tap shock time.
int set_tap_quiet_time (uint8_t time)
 Set tap quiet time.
int set_tap_duration_time (uint8_t time)
 Set tap duration time.
int enable_6d_orientation (LSM6DSOX_Interrupt_Pin_t pin=LSM6DSOX_INT1_PIN)
 Enable 6D orientation detection.
int disable_6d_orientation (void)
 Disable 6D orientation detection.
int set_6d_orientation_threshold (uint8_t thr)
 Set 6D orientation threshold.
int get_6d_orientation_xl (uint8_t *xl)
 Get the status of XLow orientation.
int get_6d_orientation_xh (uint8_t *xh)
 Get the status of XHigh orientation.
int get_6d_orientation_yl (uint8_t *yl)
 Get the status of YLow orientation.
int get_6d_orientation_yh (uint8_t *yh)
 Get the status of YHigh orientation.
int get_6d_orientation_zl (uint8_t *zl)
 Get the status of ZLow orientation.
int get_6d_orientation_zh (uint8_t *zh)
 Get the status of ZHigh orientation.
int get_event_status (LSM6DSOX_Event_Status_t *status)
 Get the status of all hardware events.
int read_reg (uint8_t reg, uint8_t *data)
 Get the LSM6DSOX register value.
int write_reg (uint8_t reg, uint8_t data)
 Set the LSM6DSOX register value.
int set_interrupt_latch (uint8_t status)
 Set the interrupt latch.
int get_x_drdy_status (uint8_t *status)
 Get the LSM6DSOX ACC data ready bit value.
int set_x_self_test (uint8_t status)
 Set self test.
int get_g_drdy_status (uint8_t *status)
 Get the LSM6DSOX GYRO data ready bit value.
int set_g_self_test (uint8_t status)
 Set self test.
int get_fifo_num_samples (uint16_t *num_samples)
 Get the LSM6DSOX FIFO number of samples.
int get_fifo_full_status (uint8_t *status)
 Get the LSM6DSOX FIFO full status.
int set_fifo_int1_fifo_full (uint8_t status)
 Set the LSM6DSOX FIFO full interrupt on INT1 pin.
int set_fifo_watermark_level (uint16_t watermark)
 Set the LSM6DSOX FIFO watermark level.
int set_fifo_stop_on_fth (uint8_t status)
 Set the LSM6DSOX FIFO stop on watermark.
int set_fifo_mode (uint8_t mode)
 Set the LSM6DSOX FIFO mode.
int get_fifo_tag (uint8_t *tag)
 Get the LSM6DSOX FIFO tag.
int get_fifo_data (uint8_t *data)
 Get the LSM6DSOX FIFO raw data.
int get_fifo_x_axes (int32_t *acceleration)
 Get the LSM6DSOX FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg].
int set_fifo_x_bdr (float bdr)
 Set the LSM6DSOX FIFO accelero BDR value.
int get_fifo_g_axes (int32_t *angular_velocity)
 Get the LSM6DSOX FIFO gyro single sample (16-bit data per 3 axes) and calculate angular velocity [mDPS].
int set_fifo_g_bdr (float bdr)
 Set the LSM6DSOX FIFO gyro BDR value.
int get_mlc_status (LSM6DSOX_MLC_Status_t *status)
 Get the LSM6DSOX MLC status.
int get_mlc_output (uint8_t *output)
 Get the LSM6DSOX MLC output.
void attach_int1_irq (void(*fptr)(void))
 Attaching an interrupt handler to the INT1 interrupt.
void enable_int1_irq (void)
 Enabling the INT1 interrupt handling.
void disable_int1_irq (void)
 Disabling the INT1 interrupt handling.
void attach_int2_irq (void(*fptr)(void))
 Attaching an interrupt handler to the INT2 interrupt.
void enable_int2_irq (void)
 Enabling the INT2 interrupt handling.
void disable_int2_irq (void)
 Disabling the INT2 interrupt handling.
uint8_t io_read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
 Utility function to read data.
uint8_t io_write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
 Utility function to write data.

Detailed Description

Abstract class of an LSM6DSOX Inertial Measurement Unit (IMU) 6 axes sensor.

Definition at line 119 of file LSM6DSOXSensor.h.


Constructor & Destructor Documentation

LSM6DSOXSensor ( SPI *  spi,
PinName  cs_pin,
PinName  int1_pin = NC,
PinName  int2_pin = NC,
SPI_type_t  spi_type = SPI4W 
)

Constructor.

Parameters:
spiobject of an helper class which handles the SPI peripheral
cs_pinthe chip select pin
int1_pinthe interrupt 1 pin
int2_pinthe interrupt 2 pin
spi_typethe SPI type

Definition at line 54 of file LSM6DSOXSensor.cpp.

LSM6DSOXSensor ( DevI2C *  i2c,
uint8_t  address = LSM6DSOX_I2C_ADD_H,
PinName  int1_pin = NC,
PinName  int2_pin = NC 
)

Constructor.

Parameters:
i2cobject of an helper class which handles the I2C peripheral
addressthe address of the component's instance
int1_pinthe interrupt 1 pin
int2_pinthe interrupt 2 pin

Definition at line 87 of file LSM6DSOXSensor.cpp.


Member Function Documentation

void attach_int1_irq ( void(*)(void)  fptr )

Attaching an interrupt handler to the INT1 interrupt.

Parameters:
fptrAn interrupt handler.
Return values:
None.

Definition at line 206 of file LSM6DSOXSensor.h.

void attach_int2_irq ( void(*)(void)  fptr )

Attaching an interrupt handler to the INT2 interrupt.

Parameters:
fptrAn interrupt handler.
Return values:
None.

Definition at line 236 of file LSM6DSOXSensor.h.

int disable_6d_orientation ( void   )

Disable 6D orientation detection.

Return values:
0in case of success, an error code otherwise

Definition at line 2306 of file LSM6DSOXSensor.cpp.

int disable_double_tap_detection ( void   )

Disable double tap detection.

Return values:
0in case of success, an error code otherwise

Definition at line 2089 of file LSM6DSOXSensor.cpp.

int disable_free_fall_detection ( void   )

Disable free fall detection.

Return values:
0in case of success, an error code otherwise

Definition at line 1294 of file LSM6DSOXSensor.cpp.

int disable_g ( void   )

Disable the LSM6DSOX gyroscope sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 748 of file LSM6DSOXSensor.cpp.

void disable_int1_irq ( void   )

Disabling the INT1 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 226 of file LSM6DSOXSensor.h.

void disable_int2_irq ( void   )

Disabling the INT2 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 256 of file LSM6DSOXSensor.h.

int disable_pedometer ( void   )

Disable pedometer.

Return values:
0in case of success, an error code otherwise

Definition at line 1441 of file LSM6DSOXSensor.cpp.

int disable_single_tap_detection ( void   )

Disable single tap detection.

Return values:
0in case of success, an error code otherwise

Definition at line 1906 of file LSM6DSOXSensor.cpp.

int disable_tilt_detection ( void   )

Disable tilt detection.

Return values:
0in case of success, an error code otherwise

Definition at line 1596 of file LSM6DSOXSensor.cpp.

int disable_wake_up_detection ( void   )

Disable wake up detection.

Return values:
0in case of success, an error code otherwise

Definition at line 1723 of file LSM6DSOXSensor.cpp.

int disable_x ( void   )

Disable the LSM6DSOX accelerometer sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 201 of file LSM6DSOXSensor.cpp.

int enable_6d_orientation ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT1_PIN )

Enable 6D orientation detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 2239 of file LSM6DSOXSensor.cpp.

int enable_double_tap_detection ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT1_PIN )

Enable double tap detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 1980 of file LSM6DSOXSensor.cpp.

int enable_free_fall_detection ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT1_PIN )

Enable free fall detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 1209 of file LSM6DSOXSensor.cpp.

int enable_g ( void   )

Enable the LSM6DSOX gyroscope sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 724 of file LSM6DSOXSensor.cpp.

void enable_int1_irq ( void   )

Enabling the INT1 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 216 of file LSM6DSOXSensor.h.

void enable_int2_irq ( void   )

Enabling the INT2 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 246 of file LSM6DSOXSensor.h.

int enable_pedometer ( void   )

Enable pedometer.

Return values:
0in case of success, an error code otherwise

Definition at line 1375 of file LSM6DSOXSensor.cpp.

int enable_single_tap_detection ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT1_PIN )

Enable single tap detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 1805 of file LSM6DSOXSensor.cpp.

int enable_tilt_detection ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT1_PIN )

Enable tilt detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 1510 of file LSM6DSOXSensor.cpp.

int enable_wake_up_detection ( LSM6DSOX_Interrupt_Pin_t  int_pin = LSM6DSOX_INT2_PIN )

Enable wake up detection.

Parameters:
int_pininterrupt pin line to be used
Return values:
0in case of success, an error code otherwise

Definition at line 1649 of file LSM6DSOXSensor.cpp.

int enable_x ( void   )

Enable the LSM6DSOX accelerometer sensor.

Return values:
0in case of success, an error code otherwise

Definition at line 178 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_xh ( uint8_t *  xh )

Get the status of XHigh orientation.

Parameters:
xhthe status of XHigh orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2384 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_xl ( uint8_t *  xl )

Get the status of XLow orientation.

Parameters:
xlthe status of XLow orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2365 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_yh ( uint8_t *  yh )

Get the status of YHigh orientation.

Parameters:
yhthe status of YHigh orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2422 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_yl ( uint8_t *  yl )

Get the status of YLow orientation.

Parameters:
ylthe status of YLow orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2403 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_zh ( uint8_t *  zh )

Get the status of ZHigh orientation.

Parameters:
zhthe status of ZHigh orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2460 of file LSM6DSOXSensor.cpp.

int get_6d_orientation_zl ( uint8_t *  zl )

Get the status of ZLow orientation.

Parameters:
zlthe status of ZLow orientation
Return values:
0in case of success, an error code otherwise

Definition at line 2441 of file LSM6DSOXSensor.cpp.

int get_event_status ( LSM6DSOX_Event_Status_t *  status )

Get the status of all hardware events.

Parameters:
statusthe status of all hardware events
Return values:
0in case of success, an error code otherwise

Definition at line 2494 of file LSM6DSOXSensor.cpp.

int get_fifo_data ( uint8_t *  data )

Get the LSM6DSOX FIFO raw data.

Parameters:
dataFIFO raw data array [6]
Return values:
0in case of success, an error code otherwise

Definition at line 2831 of file LSM6DSOXSensor.cpp.

int get_fifo_full_status ( uint8_t *  status )

Get the LSM6DSOX FIFO full status.

Parameters:
statusFIFO full status
Return values:
0in case of success, an error code otherwise

Definition at line 2702 of file LSM6DSOXSensor.cpp.

int get_fifo_g_axes ( int32_t *  angular_velocity )

Get the LSM6DSOX FIFO gyro single sample (16-bit data per 3 axes) and calculate angular velocity [mDPS].

Parameters:
angular_velocityFIFO gyro axes [mDPS]
Return values:
0in case of success, an error code otherwise

Definition at line 2912 of file LSM6DSOXSensor.cpp.

int get_fifo_num_samples ( uint16_t *  num_samples )

Get the LSM6DSOX FIFO number of samples.

Parameters:
num_samplesnumber of samples
Return values:
0in case of success, an error code otherwise

Definition at line 2687 of file LSM6DSOXSensor.cpp.

int get_fifo_tag ( uint8_t *  tag )

Get the LSM6DSOX FIFO tag.

Parameters:
tagFIFO tag
Return values:
0in case of success, an error code otherwise

Definition at line 2812 of file LSM6DSOXSensor.cpp.

int get_fifo_x_axes ( int32_t *  acceleration )

Get the LSM6DSOX FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg].

Parameters:
accelerationFIFO accelero axes [mg]
Return values:
0in case of success, an error code otherwise

Definition at line 2846 of file LSM6DSOXSensor.cpp.

int get_g_axes ( int32_t *  angular_rate ) [virtual]

Get the LSM6DSOX gyroscope sensor axes.

Parameters:
angular_ratepointer where the values of the axes are written
Return values:
0in case of success, an error code otherwise

Definition at line 1125 of file LSM6DSOXSensor.cpp.

int get_g_axes_raw ( int16_t *  value ) [virtual]

Get the LSM6DSOX gyroscope sensor raw axes.

Parameters:
valuepointer where the raw values of the axes are written
Return values:
0in case of success, an error code otherwise

Definition at line 1101 of file LSM6DSOXSensor.cpp.

int get_g_drdy_status ( uint8_t *  status )

Get the LSM6DSOX GYRO data ready bit value.

Parameters:
statusthe status of data ready bit
Return values:
0in case of success, an error code otherwise

Definition at line 2649 of file LSM6DSOXSensor.cpp.

int get_g_fs ( float *  full_scale ) [virtual]

Get the LSM6DSOX gyroscope sensor full scale.

Parameters:
full_scalepointer where the full scale is written
Return values:
0in case of success, an error code otherwise

Definition at line 1032 of file LSM6DSOXSensor.cpp.

int get_g_odr ( float *  odr ) [virtual]

Get the LSM6DSOX gyroscope sensor output data rate.

Parameters:
odrpointer where the output data rate is written
Return values:
0in case of success, an error code otherwise

Definition at line 825 of file LSM6DSOXSensor.cpp.

int get_g_sensitivity ( float *  sensitivity ) [virtual]

Get the LSM6DSOX gyroscope sensor sensitivity.

Parameters:
sensitivitypointer where the sensitivity is written
Return values:
0in case of success, an error code otherwise

Definition at line 778 of file LSM6DSOXSensor.cpp.

int get_mlc_output ( uint8_t *  output )

Get the LSM6DSOX MLC output.

Parameters:
outputthe result of the MLC computation
Return values:
0in case of success, an error code otherwise

Definition at line 2993 of file LSM6DSOXSensor.cpp.

int get_mlc_status ( LSM6DSOX_MLC_Status_t *  status )

Get the LSM6DSOX MLC status.

Parameters:
statusthe status to be set
Return values:
0in case of success, an error code otherwise

Definition at line 2978 of file LSM6DSOXSensor.cpp.

int get_step_counter ( uint16_t *  step_count )

Get step count.

Parameters:
step_countstep counter
Return values:
0in case of success, an error code otherwise

Definition at line 1481 of file LSM6DSOXSensor.cpp.

int get_x_axes ( int32_t *  acceleration ) [virtual]

Get the LSM6DSOX accelerometer sensor axes.

Parameters:
accelerationpointer where the values of the axes are written
Return values:
0in case of success, an error code otherwise

Definition at line 694 of file LSM6DSOXSensor.cpp.

int get_x_axes_raw ( int16_t *  value ) [virtual]

Get the LSM6DSOX accelerometer sensor raw axes.

Parameters:
valuepointer where the raw values of the axes are written
Return values:
0in case of success, an error code otherwise

Definition at line 670 of file LSM6DSOXSensor.cpp.

int get_x_drdy_status ( uint8_t *  status )

Get the LSM6DSOX ACC data ready bit value.

Parameters:
statusthe status of data ready bit
Return values:
0in case of success, an error code otherwise

Definition at line 2479 of file LSM6DSOXSensor.cpp.

int get_x_fs ( float *  full_scale ) [virtual]

Get the LSM6DSOX accelerometer sensor full scale.

Parameters:
full_scalepointer where the full scale is written
Return values:
0in case of success, an error code otherwise

Definition at line 604 of file LSM6DSOXSensor.cpp.

int get_x_odr ( float *  odr ) [virtual]

Get the LSM6DSOX accelerometer sensor output data rate.

Parameters:
odrpointer where the output data rate is written
Return values:
0in case of success, an error code otherwise

Definition at line 274 of file LSM6DSOXSensor.cpp.

int get_x_sensitivity ( float *  sensitivity ) [virtual]

Get the LSM6DSOX accelerometer sensor sensitivity.

Parameters:
sensitivitypointer where the sensitivity is written
Return values:
0in case of success, an error code otherwise

Definition at line 231 of file LSM6DSOXSensor.cpp.

int init ( void *  init ) [virtual]

Initializing the component.

Parameters:
initpointer to device specific initalization structure
Return values:
0in case of success, an error code otherwise

Definition at line 101 of file LSM6DSOXSensor.cpp.

uint8_t io_read ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToRead 
)

Utility function to read data.

Parameters:
pBuffer,:pointer to data to be read.
RegisterAddr,:specifies internal address register to be read.
NumByteToRead,:number of bytes to be read.
Return values:
0if ok, an error code otherwise.

Definition at line 268 of file LSM6DSOXSensor.h.

uint8_t io_write ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToWrite 
)

Utility function to write data.

Parameters:
pBuffer,:pointer to data to be written.
RegisterAddr,:specifies internal address register to be written.
NumByteToWrite,:number of bytes to write.
Return values:
0if ok, an error code otherwise.

Definition at line 299 of file LSM6DSOXSensor.h.

int read_id ( uint8_t *  id ) [virtual]

Read component ID.

Parameters:
idthe WHO_AM_I value
Return values:
0in case of success, an error code otherwise

Definition at line 164 of file LSM6DSOXSensor.cpp.

int read_reg ( uint8_t  reg,
uint8_t *  data 
)

Get the LSM6DSOX register value.

Parameters:
regaddress to be read
datapointer where the value is written
Return values:
0in case of success, an error code otherwise

Definition at line 1157 of file LSM6DSOXSensor.cpp.

int reset_step_counter ( void   )

Enable step counter reset.

Return values:
0in case of success, an error code otherwise

Definition at line 1495 of file LSM6DSOXSensor.cpp.

int set_6d_orientation_threshold ( uint8_t  thr )

Set 6D orientation threshold.

Parameters:
thr6D Orientation detection threshold
Return values:
0in case of success, an error code otherwise

Definition at line 2350 of file LSM6DSOXSensor.cpp.

int set_fifo_g_bdr ( float  bdr )

Set the LSM6DSOX FIFO gyro BDR value.

Parameters:
bdrFIFO gyro BDR value
Return values:
0in case of success, an error code otherwise

Definition at line 2949 of file LSM6DSOXSensor.cpp.

int set_fifo_int1_fifo_full ( uint8_t  status )

Set the LSM6DSOX FIFO full interrupt on INT1 pin.

Parameters:
statusFIFO full interrupt on INT1 pin status
Return values:
0in case of success, an error code otherwise

Definition at line 2721 of file LSM6DSOXSensor.cpp.

int set_fifo_mode ( uint8_t  mode )

Set the LSM6DSOX FIFO mode.

Parameters:
modeFIFO mode
Return values:
0in case of success, an error code otherwise

Definition at line 2775 of file LSM6DSOXSensor.cpp.

int set_fifo_stop_on_fth ( uint8_t  status )

Set the LSM6DSOX FIFO stop on watermark.

Parameters:
statusFIFO stop on watermark status
Return values:
0in case of success, an error code otherwise

Definition at line 2760 of file LSM6DSOXSensor.cpp.

int set_fifo_watermark_level ( uint16_t  watermark )

Set the LSM6DSOX FIFO watermark level.

Parameters:
watermarkFIFO watermark level
Return values:
0in case of success, an error code otherwise

Definition at line 2745 of file LSM6DSOXSensor.cpp.

int set_fifo_x_bdr ( float  bdr )

Set the LSM6DSOX FIFO accelero BDR value.

Parameters:
bdrFIFO accelero BDR value
Return values:
0in case of success, an error code otherwise

Definition at line 2883 of file LSM6DSOXSensor.cpp.

int set_free_fall_duration ( uint8_t  dur )

Set free fall duration.

Parameters:
durfree fall detection duration
Return values:
0in case of success, an error code otherwise

Definition at line 1360 of file LSM6DSOXSensor.cpp.

int set_free_fall_threshold ( uint8_t  thr )

Set free fall threshold.

Parameters:
thrfree fall detection threshold
Return values:
0in case of success, an error code otherwise

Definition at line 1344 of file LSM6DSOXSensor.cpp.

int set_g_fs ( float  full_scale ) [virtual]

Set the LSM6DSOX gyroscope sensor full scale.

Parameters:
full_scalethe functional full scale to be set
Return values:
0in case of success, an error code otherwise

Definition at line 1078 of file LSM6DSOXSensor.cpp.

int set_g_odr ( float  odr ) [virtual]

Set the LSM6DSOX gyroscope sensor output data rate.

Parameters:
odrthe output data rate value to be set
Return values:
0in case of success, an error code otherwise

Definition at line 895 of file LSM6DSOXSensor.cpp.

int set_g_odr_with_mode ( float  odr,
LSM6DSOX_GYRO_Operating_Mode_t  mode 
) [virtual]

Set the LSM6DSOX gyroscope sensor output data rate with operating mode.

Parameters:
odrthe output data rate value to be set
modethe gyroscope operating mode
Return values:
0in case of success, an error code otherwise

Definition at line 906 of file LSM6DSOXSensor.cpp.

int set_g_self_test ( uint8_t  val )

Set self test.

Parameters:
valthe value of st_xl in reg CTRL5_C
Return values:
0in case of success, an error code otherwise

Definition at line 2664 of file LSM6DSOXSensor.cpp.

int set_interrupt_latch ( uint8_t  status )

Set the interrupt latch.

Parameters:
statusvalue to be written
Return values:
0in case of success, an error code otherwise

Definition at line 1189 of file LSM6DSOXSensor.cpp.

int set_tap_duration_time ( uint8_t  time )

Set tap duration time.

Parameters:
timetap duration time
Return values:
0in case of success, an error code otherwise

Definition at line 2223 of file LSM6DSOXSensor.cpp.

int set_tap_quiet_time ( uint8_t  time )

Set tap quiet time.

Parameters:
timetap quiet time
Return values:
0in case of success, an error code otherwise

Definition at line 2207 of file LSM6DSOXSensor.cpp.

int set_tap_shock_time ( uint8_t  time )

Set tap shock time.

Parameters:
timetap shock time
Return values:
0in case of success, an error code otherwise

Definition at line 2191 of file LSM6DSOXSensor.cpp.

int set_tap_threshold ( uint8_t  thr )

Set tap threshold.

Parameters:
thrtap threshold
Return values:
0in case of success, an error code otherwise

Definition at line 2175 of file LSM6DSOXSensor.cpp.

int set_wake_up_duration ( uint8_t  dur )

Set wake up duration.

Parameters:
durwake up detection duration
Return values:
0in case of success, an error code otherwise

Definition at line 1789 of file LSM6DSOXSensor.cpp.

int set_wake_up_threshold ( uint8_t  thr )

Set wake up threshold.

Parameters:
thrwake up detection threshold
Return values:
0in case of success, an error code otherwise

Definition at line 1773 of file LSM6DSOXSensor.cpp.

int set_x_fs ( float  full_scale ) [virtual]

Set the LSM6DSOX accelerometer sensor full scale.

Parameters:
full_scalethe functional full scale to be set
Return values:
0in case of success, an error code otherwise

Definition at line 646 of file LSM6DSOXSensor.cpp.

int set_x_odr ( float  odr ) [virtual]

Set the LSM6DSOX accelerometer sensor output data rate.

Parameters:
odrthe output data rate value to be set
Return values:
0in case of success, an error code otherwise

Definition at line 348 of file LSM6DSOXSensor.cpp.

int set_x_odr_with_mode ( float  odr,
LSM6DSOX_ACC_Operating_Mode_t  mode 
) [virtual]

Set the LSM6DSOX accelerometer sensor output data rate with operating mode.

Parameters:
odrthe output data rate value to be set
modethe accelerometer operating mode
Note:
This function switches off the gyroscope if Ultra Low Power Mode is set
Return values:
0in case of success, an error code otherwise

Definition at line 360 of file LSM6DSOXSensor.cpp.

int set_x_self_test ( uint8_t  val )

Set self test.

Parameters:
valthe value of st_xl in reg CTRL5_C
Return values:
0in case of success, an error code otherwise

Definition at line 2627 of file LSM6DSOXSensor.cpp.

int write_reg ( uint8_t  reg,
uint8_t  data 
)

Set the LSM6DSOX register value.

Parameters:
regaddress to be written
datavalue to be written
Return values:
0in case of success, an error code otherwise

Definition at line 1174 of file LSM6DSOXSensor.cpp.