LIS3MDL Class Reference
Class representing a LIS3MDL sensor component. More...
#include <lis3mdl_class.h>
Inherits MagneticSensor.
Public Member Functions | |
LIS3MDL (DevI2C &i2c) | |
Constructor. | |
virtual | ~LIS3MDL () |
Destructor. | |
virtual int | Init (void *init_struct) |
Initialization of sensor. | |
virtual int | ReadID (uint8_t *m_id) |
Get ID of sensor. | |
virtual int | Get_M_Axes (int32_t *pData) |
Get current magnetometer magnetic X/Y/Z-axes values in standard data units [mgauss]. | |
virtual int | Get_M_AxesRaw (int16_t *pData) |
Get current magnetometer raw data X/Y/Z-axes values in device sepcific LSB units. | |
Protected Member Functions | |
MAGNETO_StatusTypeDef | LIS3MDL_Init (MAGNETO_InitTypeDef *LIS3MDL_Init) |
Set LIS3MDL Initialization. | |
MAGNETO_StatusTypeDef | LIS3MDL_Read_M_ID (uint8_t *m_id) |
Read ID of LIS3MDL Magnetic sensor. | |
MAGNETO_StatusTypeDef | LIS3MDL_M_GetAxes (int32_t *pData) |
Read data from LIS3MDL Magnetic sensor and calculate Magnetic in mgauss. | |
MAGNETO_StatusTypeDef | LIS3MDL_M_GetAxesRaw (int16_t *pData) |
Read raw data from LIS3MDL Magnetic sensor output register. | |
void | LIS3MDL_IO_ITConfig (void) |
Configures LIS3MDL interrupt lines for NUCLEO boards. | |
MAGNETO_StatusTypeDef | LIS3MDL_IO_Init (void) |
Configures LIS3MDL I2C interface. | |
MAGNETO_StatusTypeDef | LIS3MDL_IO_Read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead) |
Utility function to read data from LIS3MDL. | |
MAGNETO_StatusTypeDef | LIS3MDL_IO_Write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite) |
Utility function to write data to LIS3MDL. |
Detailed Description
Class representing a LIS3MDL sensor component.
Definition at line 50 of file lis3mdl_class.h.
Constructor & Destructor Documentation
LIS3MDL | ( | DevI2C & | i2c ) |
Constructor.
- Parameters:
-
[in] i2c device I2C to be used for communication
Definition at line 55 of file lis3mdl_class.h.
virtual ~LIS3MDL | ( | ) | [virtual] |
Destructor.
Definition at line 60 of file lis3mdl_class.h.
Member Function Documentation
virtual int Get_M_Axes | ( | int32_t * | pData ) | [virtual] |
Get current magnetometer magnetic X/Y/Z-axes values in standard data units [mgauss].
- Parameters:
-
[out] pData Pointer to where to store magnetic values to. pData must point to an array of (at least) three elements, where: pData[0] corresponds to X-axis, pData[1] corresponds to Y-axis, and pData[2] corresponds to Z-axis.
- Returns:
- 0 in case of success, an error code otherwise
Implements MagneticSensor.
Definition at line 71 of file lis3mdl_class.h.
virtual int Get_M_AxesRaw | ( | int16_t * | pData ) | [virtual] |
Get current magnetometer raw data X/Y/Z-axes values in device sepcific LSB units.
- Parameters:
-
[out] pData Pointer to where to store magnetometer raw data to. pData must point to an array of (at least) three elements, where: pData[0] corresponds to X-axis, pData[1] corresponds to Y-axis, and pData[2] corresponds to Z-axis.
- Returns:
- 0 in case of success, an error code otherwise
Implements MagneticSensor.
Definition at line 75 of file lis3mdl_class.h.
virtual int Init | ( | void * | ptr ) | [virtual] |
Initialization of sensor.
- Parameters:
-
[out] ptr Pointer to device specific initalization structure
- Returns:
- 0 in case of success, an error code otherwise
Implements GenericSensor.
Definition at line 63 of file lis3mdl_class.h.
MAGNETO_StatusTypeDef LIS3MDL_Init | ( | MAGNETO_InitTypeDef * | LIS3MDL_Init ) | [protected] |
Set LIS3MDL Initialization.
- Parameters:
-
LIS3MDL_Init the configuration setting for the LIS3MDL
- Return values:
-
MAGNETO_OK in case of success, an error code otherwise
Definition at line 53 of file lis3mdl_class.cpp.
MAGNETO_StatusTypeDef LIS3MDL_IO_Init | ( | void | ) | [protected] |
Configures LIS3MDL I2C interface.
- Returns:
- MAGNETO_OK in case of success, an error code otherwise
Definition at line 98 of file lis3mdl_class.h.
void LIS3MDL_IO_ITConfig | ( | void | ) | [protected] |
Configures LIS3MDL interrupt lines for NUCLEO boards.
Definition at line 89 of file lis3mdl_class.h.
MAGNETO_StatusTypeDef LIS3MDL_IO_Read | ( | uint8_t * | pBuffer, |
uint8_t | RegisterAddr, | ||
uint16_t | NumByteToRead | ||
) | [protected] |
Utility function to read data from LIS3MDL.
- Parameters:
-
[out] pBuffer pointer to the byte-array to read data in to [in] RegisterAddr specifies internal address register to read from. [in] NumByteToRead number of bytes to be read.
- Return values:
-
MAGNETO_OK if ok, MAGNETO_ERROR if an I2C error has occured
Definition at line 111 of file lis3mdl_class.h.
MAGNETO_StatusTypeDef LIS3MDL_IO_Write | ( | uint8_t * | pBuffer, |
uint8_t | RegisterAddr, | ||
uint16_t | NumByteToWrite | ||
) | [protected] |
Utility function to write data to LIS3MDL.
- Parameters:
-
[in] pBuffer pointer to the byte-array data to send [in] RegisterAddr specifies internal address register to read from. [in] NumByteToWrite number of bytes to write.
- Return values:
-
MAGNETO_OK if ok, MAGNETO_ERROR if an I2C error has occured
Definition at line 132 of file lis3mdl_class.h.
MAGNETO_StatusTypeDef LIS3MDL_M_GetAxes | ( | int32_t * | pData ) | [protected] |
Read data from LIS3MDL Magnetic sensor and calculate Magnetic in mgauss.
- Parameters:
-
pData the pointer where the magnetometer data are stored
- Return values:
-
MAGNETO_OK in case of success, an error code otherwise
Definition at line 178 of file lis3mdl_class.cpp.
MAGNETO_StatusTypeDef LIS3MDL_M_GetAxesRaw | ( | int16_t * | pData ) | [protected] |
Read raw data from LIS3MDL Magnetic sensor output register.
- Parameters:
-
pData the pointer where the magnetometer raw data are stored
- Return values:
-
MAGNETO_OK in case of success, an error code otherwise
Definition at line 141 of file lis3mdl_class.cpp.
MAGNETO_StatusTypeDef LIS3MDL_Read_M_ID | ( | uint8_t * | m_id ) | [protected] |
Read ID of LIS3MDL Magnetic sensor.
- Parameters:
-
m_id the pointer where the ID of the device is stored
- Return values:
-
MAGNETO_OK in case of success, an error code otherwise
Definition at line 125 of file lis3mdl_class.cpp.
virtual int ReadID | ( | uint8_t * | id ) | [virtual] |
Get ID of sensor.
- Parameters:
-
[out] id Pointer to where to store the ID to
- Returns:
- 0 in case of success, an error code otherwise
Implements GenericSensor.
Definition at line 67 of file lis3mdl_class.h.
Generated on Tue Jul 12 2022 20:24:47 by 1.7.2