Firmware Library for X-NUCLEO-IKS01A1 (MEMS Inertial & Environmental Sensors) Expansion Board

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   MultiTech_Dragonfly_2015_ATT_Gov_Solutions_Hackathon_Example HelloWorld_IKS01A1 LoRaWAN-test-10secs ServoMotorDemo ... more

Fork of X_NUCLEO_IKS01A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

LSM6DS0 Class Reference

Class representing a LSM6DS0 sensor component. More...

#include <lsm6ds0_class.h>

Public Member Functions

 LSM6DS0 (DevI2C &i2c)
 Constructor.
virtual ~LSM6DS0 ()
 Destructor.

Protected Member Functions

IMU_6AXES_StatusTypeDef LSM6DS0_Init (IMU_6AXES_InitTypeDef *LSM6DS0_Init)
 Set LSM6DS0 Initialization.
IMU_6AXES_StatusTypeDef LSM6DS0_Read_XG_ID (uint8_t *xg_id)
 Read ID of LSM6DS0 Accelerometer and Gyroscope.
IMU_6AXES_StatusTypeDef LSM6DS0_X_GetAxes (int32_t *pData)
 Read data from LSM6DS0 Accelerometer and calculate linear acceleration in mg.
IMU_6AXES_StatusTypeDef LSM6DS0_X_GetAxesRaw (int16_t *pData)
 Read raw data from LSM6DS0 Accelerometer output register.
IMU_6AXES_StatusTypeDef LSM6DS0_G_GetAxes (int32_t *pData)
 Read data from LSM6DS0 Gyroscope and calculate angular rate in mdps.
IMU_6AXES_StatusTypeDef LSM6DS0_G_GetAxesRaw (int16_t *pData)
 Read raw data from LSM6DS0 Gyroscope output register.
IMU_6AXES_StatusTypeDef LSM6DS0_X_Get_ODR (float *odr)
 Read Accelero Output Data Rate.
IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_ODR (float odr)
 Write Accelero Output Data Rate.
IMU_6AXES_StatusTypeDef LSM6DS0_X_GetSensitivity (float *pfData)
 Read Accelero Sensitivity.
IMU_6AXES_StatusTypeDef LSM6DS0_X_Get_FS (float *fullScale)
 Read Accelero Full Scale.
IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_FS (float fullScale)
 Write Accelero Full Scale.
IMU_6AXES_StatusTypeDef LSM6DS0_G_Get_ODR (float *odr)
 Read Gyro Output Data Rate.
IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_ODR (float odr)
 Write Gyro Output Data Rate.
IMU_6AXES_StatusTypeDef LSM6DS0_G_GetSensitivity (float *pfData)
 Read Gyro Sensitivity.
IMU_6AXES_StatusTypeDef LSM6DS0_G_Get_FS (float *fullScale)
 Read Gyro Full Scale.
IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_FS (float fullScale)
 Write Gyro Full Scale.
IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_Axes_Status (uint8_t enableX, uint8_t enableY, uint8_t enableZ)
 Set the status of the axes for accelerometer.
IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_Axes_Status (uint8_t enableX, uint8_t enableY, uint8_t enableZ)
 Set the status of the axes for gyroscope.
void LSM6DS0_IO_ITConfig (void)
 Configures LSM6DS0 interrupt lines for NUCLEO boards.
IMU_6AXES_StatusTypeDef LSM6DS0_IO_Init (void)
 Configures LSM6DS0 I2C interface.
IMU_6AXES_StatusTypeDef LSM6DS0_IO_Read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead)
 Utility function to read data from LSM6DS0.
IMU_6AXES_StatusTypeDef LSM6DS0_IO_Write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite)
 Utility function to write data to LSM6DS0.

Detailed Description

Class representing a LSM6DS0 sensor component.

Definition at line 51 of file lsm6ds0_class.h.


Constructor & Destructor Documentation

LSM6DS0 ( DevI2C &  i2c )

Constructor.

Parameters:
[in]i2cdevice I2C to be used for communication

Definition at line 56 of file lsm6ds0_class.h.

virtual ~LSM6DS0 (  ) [virtual]

Destructor.

Definition at line 61 of file lsm6ds0_class.h.


Member Function Documentation

IMU_6AXES_StatusTypeDef LSM6DS0_G_Get_FS ( float *  fullScale ) [protected]

Read Gyro Full Scale.

Parameters:
fullScalethe pointer where the gyroscope full scale is stored
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 646 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_Get_ODR ( float *  odr ) [protected]

Read Gyro Output Data Rate.

Parameters:
odrthe pointer where the gyroscope output data rate is stored
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 530 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_GetAxes ( int32_t *  pData ) [protected]

Read data from LSM6DS0 Gyroscope and calculate angular rate in mdps.

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

Definition at line 315 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_GetAxesRaw ( int16_t *  pData ) [protected]

Read raw data from LSM6DS0 Gyroscope output register.

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

Definition at line 192 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_GetSensitivity ( float *  pfData ) [protected]

Read Gyro Sensitivity.

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

Definition at line 611 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_Axes_Status ( uint8_t  enableX,
uint8_t  enableY,
uint8_t  enableZ 
) [protected]

Set the status of the axes for gyroscope.

Parameters:
enableXthe status of the x axis to be set
enableYthe status of the y axis to be set
enableZthe status of the z axis to be set
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 273 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_FS ( float  fullScale ) [protected]

Write Gyro Full Scale.

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

Definition at line 681 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_G_Set_ODR ( float  odr ) [protected]

Write Gyro Output Data Rate.

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

Definition at line 577 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_Init ( IMU_6AXES_InitTypeDef LSM6DS0_Init ) [protected]

Set LSM6DS0 Initialization.

Parameters:
LSM6DS0_Initthe configuration setting for the LSM6DS0
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 53 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_IO_Init ( void   ) [protected]

Configures LSM6DS0 I2C interface.

Returns:
IMU_6AXES_OK in case of success, an error code otherwise

Definition at line 162 of file lsm6ds0_class.h.

void LSM6DS0_IO_ITConfig ( void   ) [protected]

Configures LSM6DS0 interrupt lines for NUCLEO boards.

Definition at line 153 of file lsm6ds0_class.h.

IMU_6AXES_StatusTypeDef LSM6DS0_IO_Read ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToRead 
) [protected]

Utility function to read data from LSM6DS0.

Parameters:
[out]pBufferpointer to the byte-array to read data in to
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToReadnumber of bytes to be read.
Return values:
IMU_6AXES_OKif ok,
IMU_6AXES_ERRORif an I2C error has occured

Definition at line 175 of file lsm6ds0_class.h.

IMU_6AXES_StatusTypeDef LSM6DS0_IO_Write ( uint8_t *  pBuffer,
uint8_t  RegisterAddr,
uint16_t  NumByteToWrite 
) [protected]

Utility function to write data to LSM6DS0.

Parameters:
[in]pBufferpointer to the byte-array data to send
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToWritenumber of bytes to write.
Return values:
IMU_6AXES_OKif ok,
IMU_6AXES_ERRORif an I2C error has occured

Definition at line 196 of file lsm6ds0_class.h.

IMU_6AXES_StatusTypeDef LSM6DS0_Read_XG_ID ( uint8_t *  xg_id ) [protected]

Read ID of LSM6DS0 Accelerometer and Gyroscope.

Parameters:
xg_idthe pointer where the ID of the device is stored
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 111 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_Get_FS ( float *  fullScale ) [protected]

Read Accelero Full Scale.

Parameters:
fullScalethe pointer where the accelerometer full scale is stored
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 461 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_Get_ODR ( float *  odr ) [protected]

Read Accelero Output Data Rate.

Parameters:
odrthe pointer where the accelerometer output data rate is stored
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 342 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_GetAxes ( int32_t *  pData ) [protected]

Read data from LSM6DS0 Accelerometer and calculate linear acceleration in mg.

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

Definition at line 164 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_GetAxesRaw ( int16_t *  pData ) [protected]

Read raw data from LSM6DS0 Accelerometer output register.

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

Definition at line 127 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_GetSensitivity ( float *  pfData ) [protected]

Read Accelero Sensitivity.

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

Definition at line 423 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_Axes_Status ( uint8_t  enableX,
uint8_t  enableY,
uint8_t  enableZ 
) [protected]

Set the status of the axes for accelerometer.

Parameters:
enableXthe status of the x axis to be set
enableYthe status of the y axis to be set
enableZthe status of the z axis to be set
Return values:
IMU_6AXES_OKin case of success, an error code otherwise

Definition at line 230 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_FS ( float  fullScale ) [protected]

Write Accelero Full Scale.

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

Definition at line 499 of file lsm6ds0_class.cpp.

IMU_6AXES_StatusTypeDef LSM6DS0_X_Set_ODR ( float  odr ) [protected]

Write Accelero Output Data Rate.

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

Definition at line 389 of file lsm6ds0_class.cpp.