ST / LSM6DSO

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   X_NUCLEO_IKS01A3 X_NUCLEO_IKS01A3

Embed: (wiki syntax)

« Back to documentation index

LSM6DSOSensor Class Reference

LSM6DSOSensor Class Reference

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

#include <LSM6DSOSensor.h>

Public Member Functions

 LSM6DSOSensor (SPI *spi, PinName cs_pin, PinName int1_pin=NC, PinName int2_pin=NC, SPI_type_t spi_type=SPI4W)
 Constructor.
 LSM6DSOSensor (DevI2C *i2c, uint8_t address=LSM6DSO_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 LSM6DSO accelerometer sensor axes.
virtual int get_g_axes (int32_t *angular_rate)
 Get the LSM6DSO gyroscope sensor axes.
virtual int get_x_sensitivity (float *sensitivity)
 Get the LSM6DSO accelerometer sensor sensitivity.
virtual int get_g_sensitivity (float *sensitivity)
 Get the LSM6DSO gyroscope sensor sensitivity.
virtual int get_x_axes_raw (int16_t *value)
 Get the LSM6DSO accelerometer sensor raw axes.
virtual int get_g_axes_raw (int16_t *value)
 Get the LSM6DSO gyroscope sensor raw axes.
virtual int get_x_odr (float *odr)
 Get the LSM6DSO accelerometer sensor output data rate.
virtual int get_g_odr (float *odr)
 Get the LSM6DSO gyroscope sensor output data rate.
virtual int set_x_odr (float odr)
 Set the LSM6DSO accelerometer sensor output data rate.
virtual int set_x_odr_with_mode (float odr, LSM6DSO_ACC_Operating_Mode_t mode)
 Set the LSM6DSO accelerometer sensor output data rate with operating mode.
virtual int set_g_odr (float odr)
 Set the LSM6DSO gyroscope sensor output data rate.
virtual int set_g_odr_with_mode (float odr, LSM6DSO_GYRO_Operating_Mode_t mode)
 Set the LSM6DSO gyroscope sensor output data rate with operating mode.
virtual int get_x_fs (float *full_scale)
 Get the LSM6DSO accelerometer sensor full scale.
virtual int get_g_fs (float *full_scale)
 Get the LSM6DSO gyroscope sensor full scale.
virtual int set_x_fs (float full_scale)
 Set the LSM6DSO accelerometer sensor full scale.
virtual int set_g_fs (float full_scale)
 Set the LSM6DSO gyroscope sensor full scale.
int enable_x (void)
 Enable the LSM6DSO accelerometer sensor.
int enable_g (void)
 Enable the LSM6DSO gyroscope sensor.
int disable_x (void)
 Disable the LSM6DSO accelerometer sensor.
int disable_g (void)
 Disable the LSM6DSO gyroscope sensor.
int enable_free_fall_detection (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_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 (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_INT1_PIN)
 Enable tilt detection.
int disable_tilt_detection (void)
 Disable tilt detection.
int enable_wake_up_detection (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_INT1_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 (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_INT1_PIN)
 Enable single tap detection.
int disable_single_tap_detection (void)
 Disable single tap detection.
int enable_double_tap_detection (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_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 (LSM6DSO_Interrupt_Pin_t pin=LSM6DSO_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 (LSM6DSO_Event_Status_t *status)
 Get the status of all hardware events.
int read_reg (uint8_t reg, uint8_t *data)
 Get the LSM6DSO register value.
int write_reg (uint8_t reg, uint8_t data)
 Set the LSM6DSO register value.
int set_interrupt_latch (uint8_t status)
 Set the interrupt latch.
int get_x_drdy_status (uint8_t *status)
 Get the LSM6DSO 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 LSM6DSO 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 LSM6DSO FIFO number of samples.
int get_fifo_full_status (uint8_t *status)
 Get the LSM6DSO FIFO full status.
int set_fifo_int1_fifo_full (uint8_t status)
 Set the LSM6DSO FIFO full interrupt on INT1 pin.
int set_fifo_watermark_level (uint16_t watermark)
 Set the LSM6DSO FIFO watermark level.
int set_fifo_stop_on_fth (uint8_t status)
 Set the LSM6DSO FIFO stop on watermark.
int set_fifo_mode (uint8_t mode)
 Set the LSM6DSO FIFO mode.
int get_fifo_tag (uint8_t *tag)
 Get the LSM6DSO FIFO tag.
int get_fifo_data (uint8_t *data)
 Get the LSM6DSO FIFO raw data.
int get_fifo_x_axes (int32_t *acceleration)
 Get the LSM6DSO FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg].
int set_fifo_x_bdr (float bdr)
 Set the LSM6DSO FIFO accelero BDR value.
int get_fifo_g_axes (int32_t *angular_velocity)
 Get the LSM6DSO FIFO gyro single sample (16-bit data per 3 axes) and calculate angular velocity [mDPS].
int set_fifo_g_bdr (float bdr)
 Set the LSM6DSO FIFO gyro BDR value.
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 LSM6DSO Inertial Measurement Unit (IMU) 6 axes sensor.

Definition at line 106 of file LSM6DSOSensor.h.


Constructor & Destructor Documentation

LSM6DSOSensor ( 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 LSM6DSOSensor.cpp.

LSM6DSOSensor ( DevI2C *  i2c,
uint8_t  address = LSM6DSO_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 85 of file LSM6DSOSensor.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 190 of file LSM6DSOSensor.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 220 of file LSM6DSOSensor.h.

int disable_6d_orientation ( void   )

Disable 6D orientation detection.

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

Definition at line 2148 of file LSM6DSOSensor.cpp.

int disable_double_tap_detection ( void   )

Disable double tap detection.

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

Definition at line 1955 of file LSM6DSOSensor.cpp.

int disable_free_fall_detection ( void   )

Disable free fall detection.

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

Definition at line 1242 of file LSM6DSOSensor.cpp.

int disable_g ( void   )

Disable the LSM6DSO gyroscope sensor.

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

Definition at line 725 of file LSM6DSOSensor.cpp.

void disable_int1_irq ( void   )

Disabling the INT1 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 210 of file LSM6DSOSensor.h.

void disable_int2_irq ( void   )

Disabling the INT2 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 240 of file LSM6DSOSensor.h.

int disable_pedometer ( void   )

Disable pedometer.

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

Definition at line 1377 of file LSM6DSOSensor.cpp.

int disable_single_tap_detection ( void   )

Disable single tap detection.

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

Definition at line 1797 of file LSM6DSOSensor.cpp.

int disable_tilt_detection ( void   )

Disable tilt detection.

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

Definition at line 1521 of file LSM6DSOSensor.cpp.

int disable_wake_up_detection ( void   )

Disable wake up detection.

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

Definition at line 1635 of file LSM6DSOSensor.cpp.

int disable_x ( void   )

Disable the LSM6DSO accelerometer sensor.

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

Definition at line 194 of file LSM6DSOSensor.cpp.

int enable_6d_orientation ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_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 2089 of file LSM6DSOSensor.cpp.

int enable_double_tap_detection ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_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 1861 of file LSM6DSOSensor.cpp.

int enable_free_fall_detection ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_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 1168 of file LSM6DSOSensor.cpp.

int enable_g ( void   )

Enable the LSM6DSO gyroscope sensor.

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

Definition at line 703 of file LSM6DSOSensor.cpp.

void enable_int1_irq ( void   )

Enabling the INT1 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 200 of file LSM6DSOSensor.h.

void enable_int2_irq ( void   )

Enabling the INT2 interrupt handling.

Parameters:
None.
Return values:
None.

Definition at line 230 of file LSM6DSOSensor.h.

int enable_pedometer ( void   )

Enable pedometer.

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

Definition at line 1315 of file LSM6DSOSensor.cpp.

int enable_single_tap_detection ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_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 1709 of file LSM6DSOSensor.cpp.

int enable_tilt_detection ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_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 1442 of file LSM6DSOSensor.cpp.

int enable_wake_up_detection ( LSM6DSO_Interrupt_Pin_t  int_pin = LSM6DSO_INT1_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 1570 of file LSM6DSOSensor.cpp.

int enable_x ( void   )

Enable the LSM6DSO accelerometer sensor.

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

Definition at line 173 of file LSM6DSOSensor.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 2219 of file LSM6DSOSensor.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 2201 of file LSM6DSOSensor.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 2255 of file LSM6DSOSensor.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 2237 of file LSM6DSOSensor.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 2291 of file LSM6DSOSensor.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 2273 of file LSM6DSOSensor.cpp.

int get_event_status ( LSM6DSO_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 2323 of file LSM6DSOSensor.cpp.

int get_fifo_data ( uint8_t *  data )

Get the LSM6DSO FIFO raw data.

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

Definition at line 2622 of file LSM6DSOSensor.cpp.

int get_fifo_full_status ( uint8_t *  status )

Get the LSM6DSO FIFO full status.

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

Definition at line 2502 of file LSM6DSOSensor.cpp.

int get_fifo_g_axes ( int32_t *  angular_velocity )

Get the LSM6DSO 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 2699 of file LSM6DSOSensor.cpp.

int get_fifo_num_samples ( uint16_t *  num_samples )

Get the LSM6DSO FIFO number of samples.

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

Definition at line 2488 of file LSM6DSOSensor.cpp.

int get_fifo_tag ( uint8_t *  tag )

Get the LSM6DSO FIFO tag.

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

Definition at line 2604 of file LSM6DSOSensor.cpp.

int get_fifo_x_axes ( int32_t *  acceleration )

Get the LSM6DSO 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 2636 of file LSM6DSOSensor.cpp.

int get_g_axes ( int32_t *  angular_rate ) [virtual]

Get the LSM6DSO 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 1090 of file LSM6DSOSensor.cpp.

int get_g_axes_raw ( int16_t *  value ) [virtual]

Get the LSM6DSO 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 1067 of file LSM6DSOSensor.cpp.

int get_g_drdy_status ( uint8_t *  status )

Get the LSM6DSO 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 2452 of file LSM6DSOSensor.cpp.

int get_g_fs ( float *  full_scale ) [virtual]

Get the LSM6DSO 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 1001 of file LSM6DSOSensor.cpp.

int get_g_odr ( float *  odr ) [virtual]

Get the LSM6DSO 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 797 of file LSM6DSOSensor.cpp.

int get_g_sensitivity ( float *  sensitivity ) [virtual]

Get the LSM6DSO gyroscope sensor sensitivity.

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

Definition at line 752 of file LSM6DSOSensor.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 1415 of file LSM6DSOSensor.cpp.

int get_x_axes ( int32_t *  acceleration ) [virtual]

Get the LSM6DSO 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 675 of file LSM6DSOSensor.cpp.

int get_x_axes_raw ( int16_t *  value ) [virtual]

Get the LSM6DSO 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 652 of file LSM6DSOSensor.cpp.

int get_x_drdy_status ( uint8_t *  status )

Get the LSM6DSO 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 2309 of file LSM6DSOSensor.cpp.

int get_x_fs ( float *  full_scale ) [virtual]

Get the LSM6DSO 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 589 of file LSM6DSOSensor.cpp.

int get_x_odr ( float *  odr ) [virtual]

Get the LSM6DSO 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 262 of file LSM6DSOSensor.cpp.

int get_x_sensitivity ( float *  sensitivity ) [virtual]

Get the LSM6DSO accelerometer sensor sensitivity.

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

Definition at line 221 of file LSM6DSOSensor.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 99 of file LSM6DSOSensor.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 252 of file LSM6DSOSensor.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 285 of file LSM6DSOSensor.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 160 of file LSM6DSOSensor.cpp.

int read_reg ( uint8_t  reg,
uint8_t *  data 
)

Get the LSM6DSO 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 1120 of file LSM6DSOSensor.cpp.

int reset_step_counter ( void   )

Enable step counter reset.

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

Definition at line 1428 of file LSM6DSOSensor.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 2187 of file LSM6DSOSensor.cpp.

int set_fifo_g_bdr ( float  bdr )

Set the LSM6DSO FIFO gyro BDR value.

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

Definition at line 2734 of file LSM6DSOSensor.cpp.

int set_fifo_int1_fifo_full ( uint8_t  status )

Set the LSM6DSO 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 2520 of file LSM6DSOSensor.cpp.

int set_fifo_mode ( uint8_t  mode )

Set the LSM6DSO FIFO mode.

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

Definition at line 2570 of file LSM6DSOSensor.cpp.

int set_fifo_stop_on_fth ( uint8_t  status )

Set the LSM6DSO FIFO stop on watermark.

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

Definition at line 2556 of file LSM6DSOSensor.cpp.

int set_fifo_watermark_level ( uint16_t  watermark )

Set the LSM6DSO FIFO watermark level.

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

Definition at line 2542 of file LSM6DSOSensor.cpp.

int set_fifo_x_bdr ( float  bdr )

Set the LSM6DSO FIFO accelero BDR value.

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

Definition at line 2671 of file LSM6DSOSensor.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 1301 of file LSM6DSOSensor.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 1286 of file LSM6DSOSensor.cpp.

int set_g_fs ( float  full_scale ) [virtual]

Set the LSM6DSO 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 1045 of file LSM6DSOSensor.cpp.

int set_g_odr ( float  odr ) [virtual]

Set the LSM6DSO 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 865 of file LSM6DSOSensor.cpp.

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

Set the LSM6DSO 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 876 of file LSM6DSOSensor.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 2466 of file LSM6DSOSensor.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 1150 of file LSM6DSOSensor.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 2074 of file LSM6DSOSensor.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 2059 of file LSM6DSOSensor.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 2044 of file LSM6DSOSensor.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 2029 of file LSM6DSOSensor.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 1694 of file LSM6DSOSensor.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 1679 of file LSM6DSOSensor.cpp.

int set_x_fs ( float  full_scale ) [virtual]

Set the LSM6DSO 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 629 of file LSM6DSOSensor.cpp.

int set_x_odr ( float  odr ) [virtual]

Set the LSM6DSO 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 334 of file LSM6DSOSensor.cpp.

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

Set the LSM6DSO 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 346 of file LSM6DSOSensor.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 2431 of file LSM6DSOSensor.cpp.

int write_reg ( uint8_t  reg,
uint8_t  data 
)

Set the LSM6DSO register value.

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

Definition at line 1136 of file LSM6DSOSensor.cpp.