Beta
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A2 by
LSM303AGRAccSensor Class Reference
Abstract class of an LSM303AGR Inertial Measurement Unit (IMU) 6 axes sensor. More...
#include <LSM303AGRAccSensor.h>
Public Member Functions | |
| LSM303AGRAccSensor (DevI2C &i2c) | |
| Constructor. | |
| LSM303AGRAccSensor (DevI2C &i2c, uint8_t address) | |
| Constructor. | |
| virtual int | init (void *init) |
| Initializing the component. | |
| virtual int | read_id (uint8_t *id) |
| Read ID of LSM303AGR Accelerometer. | |
| virtual int | get_x_axes (int32_t *pData) |
| Read data from LSM303AGR Accelerometer. | |
| virtual int | get_x_axes_raw (int16_t *pData) |
| Read raw data from LSM303AGR Accelerometer. | |
| virtual int | get_x_sensitivity (float *pfData) |
| Read Accelerometer Sensitivity. | |
| virtual int | get_x_odr (float *odr) |
| Read LSM303AGR Accelerometer output data rate. | |
| virtual int | set_x_odr (float odr) |
| Set ODR. | |
| virtual int | get_x_fs (float *fullScale) |
| Read LSM303AGR Accelerometer full scale. | |
| virtual int | set_x_fs (float fullScale) |
| Set full scale. | |
| int | enable (void) |
| Enable LSM303AGR Accelerator. | |
| int | disable (void) |
| Disable LSM303AGR Accelerator. | |
| int | read_reg (uint8_t reg, uint8_t *data) |
| Read accelerometer data from register. | |
| int | write_reg (uint8_t reg, uint8_t data) |
| Write accelerometer 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 LSM303AGR Inertial Measurement Unit (IMU) 6 axes sensor.
Definition at line 71 of file LSM303AGRAccSensor.h.
Constructor & Destructor Documentation
| LSM303AGRAccSensor | ( | 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 52 of file LSM303AGRAccSensor.cpp.
| LSM303AGRAccSensor | ( | 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 61 of file LSM303AGRAccSensor.cpp.
Member Function Documentation
| int disable | ( | void | ) |
Disable LSM303AGR Accelerator.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 148 of file LSM303AGRAccSensor.cpp.
| int enable | ( | void | ) |
Enable LSM303AGR Accelerator.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 125 of file LSM303AGRAccSensor.cpp.
| int get_x_axes | ( | int32_t * | pData ) | [virtual] |
Read data from LSM303AGR Accelerometer.
- Parameters:
-
pData the pointer where the accelerometer data are stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 199 of file LSM303AGRAccSensor.cpp.
| int get_x_axes_raw | ( | int16_t * | pData ) | [virtual] |
Read raw data from LSM303AGR Accelerometer.
- Parameters:
-
pData the pointer where the accelerometer raw data are stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 377 of file LSM303AGRAccSensor.cpp.
| int get_x_fs | ( | float * | fullScale ) | [virtual] |
Read LSM303AGR Accelerometer full scale.
- Parameters:
-
fullScale the pointer to the full scale
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 542 of file LSM303AGRAccSensor.cpp.
| int get_x_odr | ( | float * | odr ) | [virtual] |
Read LSM303AGR Accelerometer 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 425 of file LSM303AGRAccSensor.cpp.
| int get_x_sensitivity | ( | float * | pfData ) | [virtual] |
Read Accelerometer Sensitivity.
- Parameters:
-
pfData the pointer where the accelerometer sensitivity is stored
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 222 of file LSM303AGRAccSensor.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 71 of file LSM303AGRAccSensor.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 97 of file LSM303AGRAccSensor.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 109 of file LSM303AGRAccSensor.h.
| int read_id | ( | uint8_t * | id ) | [virtual] |
Read ID of LSM303AGR Accelerometer.
- 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 178 of file LSM303AGRAccSensor.cpp.
| int read_reg | ( | uint8_t | reg, |
| uint8_t * | data | ||
| ) |
Read accelerometer 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 602 of file LSM303AGRAccSensor.cpp.
| int set_x_fs | ( | float | fullScale ) | [virtual] |
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 578 of file LSM303AGRAccSensor.cpp.
| int set_x_odr | ( | float | odr ) | [virtual] |
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 473 of file LSM303AGRAccSensor.cpp.
| int write_reg | ( | uint8_t | reg, |
| uint8_t | data | ||
| ) |
Write accelerometer 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 620 of file LSM303AGRAccSensor.cpp.
Generated on Wed Jul 13 2022 13:21:41 by
1.7.2
