NXP FXAS21002 gyro sensor driver.
More...
#include <fxas21002_gyro.h>
|
void | I2Cwrite8 (uint8_t regOfInterest, uint8_t valToWrite) |
| Write to FXAS21002 device register over I2C. More...
|
|
uint8_t | I2Cread8 (uint8_t regOfInterest) |
| Read FXAS21002 register value over I2C. More...
|
|
NXP FXAS21002 gyro sensor driver.
◆ FXAS21002Gyro()
FXAS21002Gyro::FXAS21002Gyro |
( |
TwoWire * |
wireInput = &SENSOR_I2C | ) |
|
FXAS21002 Constructor.
Constructor for the FXAS21002 gyro sensor.
- Parameters
-
wireInput | I2C/Wire interface the device is connected to. |
◆ ~FXAS21002Gyro()
FXAS21002Gyro::~FXAS21002Gyro |
( |
| ) |
|
|
inline |
◆ GetGx()
float FXAS21002Gyro::GetGx |
( |
| ) |
|
Return gyro x-measurement in [deg/s].
◆ GetGy()
float FXAS21002Gyro::GetGy |
( |
| ) |
|
Return gyro y-measurement in [deg/s].
◆ GetGz()
float FXAS21002Gyro::GetGz |
( |
| ) |
|
Return gyro z-measurement in [deg/s].
◆ GetTemperature()
float FXAS21002Gyro::GetTemperature |
( |
| ) |
|
Read device's 8-bit temperature register and return in degrees C.
Temperature will not have any decimals, as it is an 8-bit signed int (-127C to 127C). Note that the temperature is not factory calibrated!
- Returns
- Temperature in [C]
◆ I2Cread8()
uint8_t FXAS21002Gyro::I2Cread8 |
( |
uint8_t |
regOfInterest | ) |
|
|
private |
Read FXAS21002 register value over I2C.
- Parameters
-
regOfInterest | Register address on device. |
- Returns
- Value stored in the register.
◆ I2Cwrite8()
void FXAS21002Gyro::I2Cwrite8 |
( |
uint8_t |
regOfInterest, |
|
|
uint8_t |
valToWrite |
|
) |
| |
|
private |
Write to FXAS21002 device register over I2C.
- Parameters
-
regOfInterest | Register address on device. |
valToWrite | Value to write to register. |
◆ Initialize()
Initialize and configure gyroscope sensor.
If unspecified, the default gyro measurement rage is GYRO_RNG_1000DPS
- Parameters
-
rng | Gyro measurement range. |
- See also
- GyroRanges_t
- Returns
- True if successful, false if failed.
◆ ReadSensor()
bool FXAS21002Gyro::ReadSensor |
( |
| ) |
|
Read gyroscope data from device registers.
Raw gyro readings are in [deg/s].
- Returns
- True if successful, false if failed.
◆ _gx
◆ _gy
◆ _gz
◆ _SensorWire
TwoWire* FXAS21002Gyro::_SensorWire |
|
private |
I2C bus the sensor is connected to.
◆ gyroRange
Selected gyro measurement range.
◆ prevMeasMicros
uint32_t FXAS21002Gyro::prevMeasMicros |
Previous measurement micros()
The documentation for this class was generated from the following files: