Soldered LSM6DS3 Arduino library 1.0.0
Library for LSM6DS3 accelerometer and gyroscope by Soldered
Loading...
Searching...
No Matches
LSM6DS3Sensor Class Reference

#include <LSM6DS3Sensor.h>

Inherited by Soldered_LSM6DS3.

Public Member Functions

 LSM6DS3Sensor (TwoWire *i2c, uint8_t address=LSM6DS3_ACC_GYRO_I2C_ADDRESS_HIGH)
 
LSM6DS3StatusTypeDef begin (void)
 Configure the sensor in order to be used.
 
LSM6DS3StatusTypeDef end (void)
 Disable the sensor and relative resources.
 
LSM6DS3StatusTypeDef enableAccelerator (void)
 Enable LSM6DS3 Accelerator.
 
LSM6DS3StatusTypeDef enableGyro (void)
 Enable LSM6DS3 Gyroscope.
 
LSM6DS3StatusTypeDef disableAccelerator (void)
 Disable LSM6DS3 Accelerator.
 
LSM6DS3StatusTypeDef disableGyro (void)
 Disable LSM6DS3 Gyroscope.
 
LSM6DS3StatusTypeDef readId (uint8_t *p_id)
 Read ID of LSM6DS3 Accelerometer and Gyroscope.
 
LSM6DS3StatusTypeDef getAcceleratorAxes (int32_t *pData)
 Read data from LSM6DS3 Accelerometer.
 
LSM6DS3StatusTypeDef getGyroAxes (int32_t *pData)
 Read data from LSM6DS3 Gyroscope.
 
LSM6DS3StatusTypeDef getAcceleratorSensitivity (float *pfData)
 Read Accelerometer Sensitivity.
 
LSM6DS3StatusTypeDef getGyroSensitivity (float *pfData)
 Read Gyroscope Sensitivity.
 
LSM6DS3StatusTypeDef getAcceleratorAxesRaw (int16_t *pData)
 Read raw data from LSM6DS3 Accelerometer.
 
LSM6DS3StatusTypeDef getGyroAxesRaw (int16_t *pData)
 Read raw data from LSM6DS3 Gyroscope.
 
LSM6DS3StatusTypeDef getAcceleratorOdr (float *odr)
 Read LSM6DS3 Accelerometer output data rate.
 
LSM6DS3StatusTypeDef getGyroOdr (float *odr)
 Read LSM6DS3 Gyroscope output data rate.
 
LSM6DS3StatusTypeDef setAcceleratorOdr (float odr)
 Set LSM6DS3 Accelerometer output data rate.
 
LSM6DS3StatusTypeDef setGyroOdr (float odr)
 Set LSM6DS3 Gyroscope output data rate.
 
LSM6DS3StatusTypeDef getAcceleratorFullScale (float *fullScale)
 Read LSM6DS3 Accelerometer full scale.
 
LSM6DS3StatusTypeDef getGyroFullScale (float *fullScale)
 Read LSM6DS3 Gyroscope full scale.
 
LSM6DS3StatusTypeDef setAcceleratorFullScale (float fullScale)
 Set LSM6DS3 Accelerometer full scale.
 
LSM6DS3StatusTypeDef setGyroFullScale (float fullScale)
 Set LSM6DS3 Gyroscope full scale.
 
LSM6DS3StatusTypeDef enableFreeFallDetection (void)
 Enable free fall detection.
 
LSM6DS3StatusTypeDef enableFreeFallDetection (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable free fall detection.
 
LSM6DS3StatusTypeDef disableFreeFallDetection (void)
 Disable free fall detection.
 
LSM6DS3StatusTypeDef setFreeFallThreshold (uint8_t thr)
 Set the free fall detection threshold for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enablePedometer (void)
 Enable the pedometer feature for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disablePedometer (void)
 Disable the pedometer feature for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef getStepCounter (uint16_t *step_count)
 Get the step counter for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef resetStepCounter (void)
 Reset of the step counter for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setPedometerThreshold (uint8_t thr)
 Set the pedometer threshold for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableTiltDetection (void)
 Enable the tilt detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableTiltDetection (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable the tilt detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disableTiltDetection (void)
 Disable the tilt detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableWakeUpDetection (void)
 Enable the wake up detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableWakeUpDetection (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable the wake up detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disableWakeUpDetection (void)
 Disable the wake up detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setWakeUpThreshold (uint8_t thr)
 Set the wake up threshold for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableSingleTapDetection (void)
 Enable the single tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableSingleTapDetection (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable the single tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disableSingleTapDetection (void)
 Disable the single tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableDoubleTapDetection (void)
 Enable the double tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enableDoubleTapDetection (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable the double tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disableDoubleTapDetection (void)
 Disable the double tap detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setTapThreshold (uint8_t thr)
 Set the tap threshold for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setTapShockTime (uint8_t time)
 Set the tap shock time window for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setTapQuietTime (uint8_t time)
 Set the tap quiet time window for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef setTapDurationTime (uint8_t time)
 Set the tap duration of the time window for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enable6dOrientation (void)
 Enable the 6D orientation detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef enable6dOrientation (LSM6DS3_Interrupt_Pin_t int_pin)
 Enable the 6D orientation detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef disable6dOrientation (void)
 Disable the 6D orientation detection for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationXl (uint8_t *xl)
 Get the 6D orientation XL axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationXh (uint8_t *xh)
 Get the 6D orientation XH axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationYl (uint8_t *yl)
 Get the 6D orientation YL axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationYh (uint8_t *yh)
 Get the 6D orientation YH axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationZl (uint8_t *zl)
 Get the 6D orientation ZL axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef get6dOrientationZh (uint8_t *zh)
 Get the 6D orientation ZH axis for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef getEventStatus (LSM6DS3_Event_Status_t *status)
 Get the status of all hardware events for LSM6DS3 accelerometer sensor.
 
LSM6DS3StatusTypeDef readRegister (uint8_t reg, uint8_t *data)
 Read the data from register.
 
LSM6DS3StatusTypeDef writeRegister (uint8_t reg, uint8_t data)
 Write the data to register.
 
uint8_t ioRead (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
 Utility function to read data.
 
uint8_t ioWrite (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
 Utility function to write data.
 

Private Member Functions

LSM6DS3StatusTypeDef setAcceleratorOdrWhenEnabled (float odr)
 Set LSM6DS3 Accelerometer output data rate when enabled.
 
LSM6DS3StatusTypeDef setGyroOdrWhenEnabled (float odr)
 Set LSM6DS3 Gyroscope output data rate when enabled.
 
LSM6DS3StatusTypeDef setAcceleratorOdrWhenDisabled (float odr)
 Set LSM6DS3 Accelerometer output data rate when disabled.
 
LSM6DS3StatusTypeDef setGyroOdrWhenDisabled (float odr)
 Set LSM6DS3 Gyroscope output data rate when disabled.
 

Private Attributes

TwoWire * dev_i2c
 
uint8_t address
 
uint8_t X_isEnabled
 
float X_Last_ODR
 
uint8_t G_isEnabled
 
float G_Last_ODR
 

Detailed Description

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

Constructor & Destructor Documentation

◆ LSM6DS3Sensor()

LSM6DS3Sensor::LSM6DS3Sensor ( TwoWire * i2c,
uint8_t address = LSM6DS3_ACC_GYRO_I2C_ADDRESS_HIGH )

Constructor

Parameters
i2cobject of an helper class which handles the I2C peripheral
addressthe address of the component's instance

Member Function Documentation

◆ begin()

LSM6DS3StatusTypeDef LSM6DS3Sensor::begin ( void )

Configure the sensor in order to be used.

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

◆ disable6dOrientation()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disable6dOrientation ( void )

Disable the 6D orientation detection for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableAccelerator()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableAccelerator ( void )

Disable LSM6DS3 Accelerator.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableDoubleTapDetection()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableDoubleTapDetection ( void )

Disable the double tap detection for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableFreeFallDetection()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableFreeFallDetection ( void )

Disable free fall detection.

Parameters
None
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableGyro()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableGyro ( void )

Disable LSM6DS3 Gyroscope.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disablePedometer()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disablePedometer ( void )

Disable the pedometer feature for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableSingleTapDetection()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableSingleTapDetection ( void )

Disable the single tap detection for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableTiltDetection()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableTiltDetection ( void )

Disable the tilt detection for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ disableWakeUpDetection()

LSM6DS3StatusTypeDef LSM6DS3Sensor::disableWakeUpDetection ( void )

Disable the wake up detection for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enable6dOrientation() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enable6dOrientation ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable the 6D orientation detection for LSM6DS3 accelerometer sensor.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enable6dOrientation() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enable6dOrientation ( void )

Enable the 6D orientation detection for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableAccelerator()

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableAccelerator ( void )

Enable LSM6DS3 Accelerator.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableDoubleTapDetection() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableDoubleTapDetection ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable the double tap detection for LSM6DS3 accelerometer sensor.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableDoubleTapDetection() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableDoubleTapDetection ( void )

Enable the double tap detection for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableFreeFallDetection() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableFreeFallDetection ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable free fall detection.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableFreeFallDetection() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableFreeFallDetection ( void )

Enable free fall detection.

Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableGyro()

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableGyro ( void )

Enable LSM6DS3 Gyroscope.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enablePedometer()

LSM6DS3StatusTypeDef LSM6DS3Sensor::enablePedometer ( void )

Enable the pedometer feature for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 26Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableSingleTapDetection() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableSingleTapDetection ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable the single tap detection for LSM6DS3 accelerometer sensor.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableSingleTapDetection() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableSingleTapDetection ( void )

Enable the single tap detection for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableTiltDetection() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableTiltDetection ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable the tilt detection for LSM6DS3 accelerometer sensor.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 26Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableTiltDetection() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableTiltDetection ( void )

Enable the tilt detection for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 26Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableWakeUpDetection() [1/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableWakeUpDetection ( LSM6DS3_Interrupt_Pin_t int_pin)

Enable the wake up detection for LSM6DS3 accelerometer sensor.

Parameters
int_pinthe interrupt pin to be used
Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ enableWakeUpDetection() [2/2]

LSM6DS3StatusTypeDef LSM6DS3Sensor::enableWakeUpDetection ( void )

Enable the wake up detection for LSM6DS3 accelerometer sensor.

Note
This function sets the LSM6DS3 accelerometer ODR to 416Hz and the LSM6DS3 accelerometer full scale to 2g
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ end()

LSM6DS3StatusTypeDef LSM6DS3Sensor::end ( void )

Disable the sensor and relative resources.

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

◆ get6dOrientationXh()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationXh ( uint8_t * xh)

Get the 6D orientation XH axis for LSM6DS3 accelerometer sensor.

Parameters
xhthe pointer to the 6D orientation XH axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ get6dOrientationXl()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationXl ( uint8_t * xl)

Get the 6D orientation XL axis for LSM6DS3 accelerometer sensor.

Parameters
xlthe pointer to the 6D orientation XL axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ get6dOrientationYh()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationYh ( uint8_t * yh)

Get the 6D orientation YH axis for LSM6DS3 accelerometer sensor.

Parameters
yhthe pointer to the 6D orientation YH axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ get6dOrientationYl()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationYl ( uint8_t * yl)

Get the 6D orientation YL axis for LSM6DS3 accelerometer sensor.

Parameters
ylthe pointer to the 6D orientation YL axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ get6dOrientationZh()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationZh ( uint8_t * zh)

Get the 6D orientation ZH axis for LSM6DS3 accelerometer sensor.

Parameters
zhthe pointer to the 6D orientation ZH axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ get6dOrientationZl()

LSM6DS3StatusTypeDef LSM6DS3Sensor::get6dOrientationZl ( uint8_t * zl)

Get the 6D orientation ZL axis for LSM6DS3 accelerometer sensor.

Parameters
zlthe pointer to the 6D orientation ZL axis
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getAcceleratorAxes()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getAcceleratorAxes ( int32_t * pData)

Read data from LSM6DS3 Accelerometer.

Parameters
pDatathe pointer where the accelerometer data are stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getAcceleratorAxesRaw()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getAcceleratorAxesRaw ( int16_t * pData)

Read raw data from LSM6DS3 Accelerometer.

Parameters
pDatathe pointer where the accelerometer raw data are stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getAcceleratorFullScale()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getAcceleratorFullScale ( float * fullScale)

Read LSM6DS3 Accelerometer full scale.

Parameters
fullScalethe pointer to the full scale
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getAcceleratorOdr()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getAcceleratorOdr ( float * odr)

Read LSM6DS3 Accelerometer output data rate.

Parameters
odrthe pointer to the output data rate
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getAcceleratorSensitivity()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getAcceleratorSensitivity ( float * pfData)

Read Accelerometer Sensitivity.

Parameters
pfDatathe pointer where the accelerometer sensitivity is stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getEventStatus()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getEventStatus ( LSM6DS3_Event_Status_t * status)

Get the status of all hardware events for LSM6DS3 accelerometer sensor.

Parameters
statusthe pointer to the status of all hardware events
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getGyroAxes()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getGyroAxes ( int32_t * pData)

Read data from LSM6DS3 Gyroscope.

Parameters
pDatathe pointer where the gyroscope data are stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getGyroAxesRaw()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getGyroAxesRaw ( int16_t * pData)

Read raw data from LSM6DS3 Gyroscope.

Parameters
pDatathe pointer where the gyroscope raw data are stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getGyroFullScale()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getGyroFullScale ( float * fullScale)

Read LSM6DS3 Gyroscope full scale.

Parameters
fullScalethe pointer to the full scale
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getGyroOdr()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getGyroOdr ( float * odr)

Read LSM6DS3 Gyroscope output data rate.

Parameters
odrthe pointer to the output data rate
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getGyroSensitivity()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getGyroSensitivity ( float * pfData)

Read Gyroscope Sensitivity.

Parameters
pfDatathe pointer where the gyroscope sensitivity is stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ getStepCounter()

LSM6DS3StatusTypeDef LSM6DS3Sensor::getStepCounter ( uint16_t * step_count)

Get the step counter for LSM6DS3 accelerometer sensor.

Parameters
step_countthe pointer to the step counter
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ ioRead()

uint8_t LSM6DS3Sensor::ioRead ( uint8_t * pBuffer,
uint8_t RegisterAddr,
uint16_t NumByteToRead )
inline

Utility function to read data.

Parameters
pBufferpointer to data to be read.
RegisterAddrspecifies internal address register to be read.
NumByteToReadnumber of bytes to be read.
Return values
0if ok, an error code otherwise.

◆ ioWrite()

uint8_t LSM6DS3Sensor::ioWrite ( uint8_t * pBuffer,
uint8_t RegisterAddr,
uint16_t NumByteToWrite )
inline

Utility function to write data.

Parameters
pBufferpointer to data to be written.
RegisterAddrspecifies internal address register to be written.
NumByteToWritenumber of bytes to write.
Return values
0if ok, an error code otherwise.

◆ readId()

LSM6DS3StatusTypeDef LSM6DS3Sensor::readId ( uint8_t * p_id)

Read ID of LSM6DS3 Accelerometer and Gyroscope.

Parameters
p_idthe pointer where the ID of the device is stored
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ readRegister()

LSM6DS3StatusTypeDef LSM6DS3Sensor::readRegister ( uint8_t reg,
uint8_t * data )

Read the data from register.

Parameters
regregister address
dataregister data
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ resetStepCounter()

LSM6DS3StatusTypeDef LSM6DS3Sensor::resetStepCounter ( void )

Reset of the step counter for LSM6DS3 accelerometer sensor.

Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setAcceleratorFullScale()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setAcceleratorFullScale ( float fullScale)

Set LSM6DS3 Accelerometer full scale.

Parameters
fullScalethe full scale to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setAcceleratorOdr()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setAcceleratorOdr ( float odr)

Set LSM6DS3 Accelerometer output data rate.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setAcceleratorOdrWhenDisabled()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setAcceleratorOdrWhenDisabled ( float odr)
private

Set LSM6DS3 Accelerometer output data rate when disabled.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setAcceleratorOdrWhenEnabled()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setAcceleratorOdrWhenEnabled ( float odr)
private

Set LSM6DS3 Accelerometer output data rate when enabled.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setFreeFallThreshold()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setFreeFallThreshold ( uint8_t thr)

Set the free fall detection threshold for LSM6DS3 accelerometer sensor.

Parameters
thrthe threshold to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setGyroFullScale()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setGyroFullScale ( float fullScale)

Set LSM6DS3 Gyroscope full scale.

Parameters
fullScalethe full scale to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setGyroOdr()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setGyroOdr ( float odr)

Set LSM6DS3 Gyroscope output data rate.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setGyroOdrWhenDisabled()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setGyroOdrWhenDisabled ( float odr)
private

Set LSM6DS3 Gyroscope output data rate when disabled.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setGyroOdrWhenEnabled()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setGyroOdrWhenEnabled ( float odr)
private

Set LSM6DS3 Gyroscope output data rate when enabled.

Parameters
odrthe output data rate to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setPedometerThreshold()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setPedometerThreshold ( uint8_t thr)

Set the pedometer threshold for LSM6DS3 accelerometer sensor.

Parameters
thrthe threshold to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setTapDurationTime()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setTapDurationTime ( uint8_t time)

Set the tap duration of the time window for LSM6DS3 accelerometer sensor.

Parameters
timethe duration of the time window to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setTapQuietTime()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setTapQuietTime ( uint8_t time)

Set the tap quiet time window for LSM6DS3 accelerometer sensor.

Parameters
timethe quiet time window to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setTapShockTime()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setTapShockTime ( uint8_t time)

Set the tap shock time window for LSM6DS3 accelerometer sensor.

Parameters
timethe shock time window to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setTapThreshold()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setTapThreshold ( uint8_t thr)

Set the tap threshold for LSM6DS3 accelerometer sensor.

Parameters
thrthe threshold to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ setWakeUpThreshold()

LSM6DS3StatusTypeDef LSM6DS3Sensor::setWakeUpThreshold ( uint8_t thr)

Set the wake up threshold for LSM6DS3 accelerometer sensor.

Parameters
thrthe threshold to be set
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

◆ writeRegister()

LSM6DS3StatusTypeDef LSM6DS3Sensor::writeRegister ( uint8_t reg,
uint8_t data )

Write the data to register.

Parameters
regregister address
dataregister data
Return values
LSM6DS3_STATUS_OKin case of success, an error code otherwise

Member Data Documentation

◆ address

uint8_t LSM6DS3Sensor::address
private

◆ dev_i2c

TwoWire* LSM6DS3Sensor::dev_i2c
private

◆ G_isEnabled

uint8_t LSM6DS3Sensor::G_isEnabled
private

◆ G_Last_ODR

float LSM6DS3Sensor::G_Last_ODR
private

◆ X_isEnabled

uint8_t LSM6DS3Sensor::X_isEnabled
private

◆ X_Last_ODR

float LSM6DS3Sensor::X_Last_ODR
private

The documentation for this class was generated from the following files: