Suppressed conflicting destructor function.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: D7A_1x_TRAINING D7_MLX_AND_BAT D7A_1x_demo_sensors_v3
Fork of X_NUCLEO_IKS01A1 by
LSM303C_MAG_Sensor Class Reference
Abstract class of an LSM303C Inertial Measurement Unit (IMU) 6 axes sensor. More...
#include <LSM303C_MAG_Sensor.h>
Public Member Functions | |
| LSM303C_MAG_Sensor (DevI2C &i2c) | |
| Constructor. | |
| LSM303C_MAG_Sensor (DevI2C &i2c, uint8_t address) | |
| Constructor. | |
| virtual int | Init (void *init) |
| Initializing the component. | |
| virtual int | ReadID (uint8_t *id) |
| Read ID of LSM303C Magnetometer. | |
| virtual int | Get_M_Axes (int32_t *pData) |
| Read data from LSM303C Magnetometer. | |
| virtual int | Get_M_AxesRaw (int16_t *pData) |
| Read raw data from LSM303C Magnetometer. | |
| int | Enable (void) |
| Enable LSM303C magnetometer. | |
| int | Disable (void) |
| Disable LSM303C magnetometer. | |
| int | Get_M_Sensitivity (float *pfData) |
| Read Magnetometer Sensitivity. | |
| int | Get_M_ODR (float *odr) |
| Read LSM303C Magnetometer output data rate. | |
| int | Set_M_ODR (float odr) |
| Set ODR. | |
| int | Get_M_FS (float *fullScale) |
| Read LSM303C Magnetometer full scale. | |
| int | Set_M_FS (float fullScale) |
| Set full scale. | |
| int | ReadReg (uint8_t reg, uint8_t *data) |
| Read magnetometer data from register. | |
| int | WriteReg (uint8_t reg, uint8_t data) |
| Write magnetometer data to register. | |
| 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 LSM303C Inertial Measurement Unit (IMU) 6 axes sensor.
Definition at line 58 of file LSM303C_MAG_Sensor.h.
Constructor & Destructor Documentation
| LSM303C_MAG_Sensor | ( | DevI2C & | i2c ) |
Constructor.
- Parameters:
-
i2c object of an helper class which handles the I2C peripheral address the address of the component's instance
Definition at line 53 of file LSM303C_MAG_Sensor.cpp.
| LSM303C_MAG_Sensor | ( | DevI2C & | i2c, |
| uint8_t | address | ||
| ) |
Constructor.
- Parameters:
-
i2c object of an helper class which handles the I2C peripheral address the address of the component's instance
Definition at line 62 of file LSM303C_MAG_Sensor.cpp.
Member Function Documentation
| int Disable | ( | void | ) |
Disable LSM303C magnetometer.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 123 of file LSM303C_MAG_Sensor.cpp.
| int Enable | ( | void | ) |
Enable LSM303C magnetometer.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 108 of file LSM303C_MAG_Sensor.cpp.
| int Get_M_Axes | ( | int32_t * | pData ) | [virtual] |
Read data from LSM303C Magnetometer.
- Parameters:
-
pData the pointer where the magnetometer data are stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 160 of file LSM303C_MAG_Sensor.cpp.
| int Get_M_AxesRaw | ( | int16_t * | pData ) | [virtual] |
Read raw data from LSM303C Magnetometer.
- Parameters:
-
pData the pointer where the magnetomer raw data are stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 202 of file LSM303C_MAG_Sensor.cpp.
| int Get_M_FS | ( | float * | fullScale ) |
Read LSM303C Magnetometer full scale.
- Parameters:
-
fullScale the pointer to the output data rate
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 303 of file LSM303C_MAG_Sensor.cpp.
| int Get_M_ODR | ( | float * | odr ) |
Read LSM303C Magnetometer output data rate.
- Parameters:
-
odr the pointer to the output data rate
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 228 of file LSM303C_MAG_Sensor.cpp.
| int Get_M_Sensitivity | ( | float * | pfData ) |
Read Magnetometer Sensitivity.
- Parameters:
-
pfData the pointer where the magnetometer sensitivity is stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 190 of file LSM303C_MAG_Sensor.cpp.
| int Init | ( | void * | init ) | [virtual] |
Initializing the component.
- Parameters:
-
[in] init pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 72 of file LSM303C_MAG_Sensor.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:
-
0 if ok, an error code otherwise.
Definition at line 84 of file LSM303C_MAG_Sensor.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:
-
0 if ok, an error code otherwise.
Definition at line 96 of file LSM303C_MAG_Sensor.h.
| int ReadID | ( | uint8_t * | id ) | [virtual] |
Read ID of LSM303C Magnetometer.
- Parameters:
-
p_id the pointer where the ID of the device is stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 139 of file LSM303C_MAG_Sensor.cpp.
| int ReadReg | ( | uint8_t | reg, |
| uint8_t * | data | ||
| ) |
Read magnetometer data from register.
- Parameters:
-
reg register address data register data
- Return values:
-
0 in case of success 1 in case of failure
Definition at line 328 of file LSM303C_MAG_Sensor.cpp.
| int Set_M_FS | ( | float | fullScale ) |
Set full scale.
- Parameters:
-
fullScale the full scale to be set
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 315 of file LSM303C_MAG_Sensor.cpp.
| int Set_M_ODR | ( | float | odr ) |
Set ODR.
- Parameters:
-
odr the output data rate to be set
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 276 of file LSM303C_MAG_Sensor.cpp.
| int WriteReg | ( | uint8_t | reg, |
| uint8_t | data | ||
| ) |
Write magnetometer data to register.
- Parameters:
-
reg register address data register data
- Return values:
-
0 in case of success 1 in case of failure
Definition at line 346 of file LSM303C_MAG_Sensor.cpp.
Generated on Tue Jul 12 2022 17:30:07 by
1.7.2
