Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
LIS3MDL Class Reference
Class representing a LIS3MDL sensor component. More...
#include <lis3mdl_class.h>
Public Member Functions | |
LIS3MDL (DevI2C &i2c) | |
Constructor. | |
virtual | ~LIS3MDL () |
Destructor. | |
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
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.
Generated on Wed Jul 20 2022 14:59:11 by
