32 #define FXAS21002_DEBUG
103 void I2Cwrite8(uint8_t regOfInterest, uint8_t valToWrite);
104 uint8_t
I2Cread8(uint8_t regOfInterest);
NXP FXAS21002 gyro sensor driver.
Definition: fxas21002_gyro.h:90
uint8_t I2Cread8(uint8_t regOfInterest)
Read FXAS21002 register value over I2C.
Definition: fxas21002_gyro.cpp:252
float GetGy()
Return gyro y-measurement in [deg/s].
Definition: fxas21002_gyro.cpp:215
float GetTemperature()
Read device's 8-bit temperature register and return in degrees C.
Definition: fxas21002_gyro.cpp:190
float GetGx()
Return gyro x-measurement in [deg/s].
Definition: fxas21002_gyro.cpp:206
bool Initialize(GyroRanges_t rng=GYRO_RNG_1000DPS)
Initialize and configure gyroscope sensor.
Definition: fxas21002_gyro.cpp:48
bool ReadSensor()
Read gyroscope data from device registers.
Definition: fxas21002_gyro.cpp:116
GyroRanges_t gyroRange
Selected gyro measurement range.
Definition: fxas21002_gyro.h:108
TwoWire * _SensorWire
I2C bus the sensor is connected to.
Definition: fxas21002_gyro.h:109
~FXAS21002Gyro()
Definition: fxas21002_gyro.h:93
float _gy
Gyro y reading, [deg/s].
Definition: fxas21002_gyro.h:106
float GetGz()
Return gyro z-measurement in [deg/s].
Definition: fxas21002_gyro.cpp:224
uint32_t prevMeasMicros
Previous measurement micros()
Definition: fxas21002_gyro.h:100
float _gx
Gyro x reading, [deg/s].
Definition: fxas21002_gyro.h:105
float _gz
Gyro z reading, [deg/s].
Definition: fxas21002_gyro.h:107
void I2Cwrite8(uint8_t regOfInterest, uint8_t valToWrite)
Write to FXAS21002 device register over I2C.
Definition: fxas21002_gyro.cpp:236
FXAS21002Gyro(TwoWire *wireInput=&SENSOR_I2C)
FXAS21002 Constructor.
Definition: fxas21002_gyro.cpp:29
constexpr float GYRO_SENS_2000
Definition: fxas21002_gyro.h:51
GyroRanges_t
Gyro measurement ranges.
Definition: fxas21002_gyro.h:78
@ GYRO_RNG_1000DPS
Definition: fxas21002_gyro.h:81
@ GYRO_RNG_250DPS
Definition: fxas21002_gyro.h:79
@ GYRO_RNG_2000DPS
Definition: fxas21002_gyro.h:82
@ GYRO_RNG_500DPS
Definition: fxas21002_gyro.h:80
constexpr uint8_t FXAS21002C_ADDRESS
Definition: fxas21002_gyro.h:40
GyroRegisters_t
FXAS21002 device registers.
Definition: fxas21002_gyro.h:58
@ GYRO_REG_STATUS
Definition: fxas21002_gyro.h:59
@ GYRO_REG_XOUT_LSB
Definition: fxas21002_gyro.h:61
@ GYRO_REG_CTRL2
Definition: fxas21002_gyro.h:70
@ GYRO_REG_XOUT_MSB
Definition: fxas21002_gyro.h:60
@ GYRO_REG_CTRL0
Definition: fxas21002_gyro.h:68
@ GYRO_REG_CTRL1
Definition: fxas21002_gyro.h:69
@ GYRO_REG_ZOUT_MSB
Definition: fxas21002_gyro.h:64
@ GYRO_REG_ID
Definition: fxas21002_gyro.h:66
@ GYRO_REG_TEMP
Definition: fxas21002_gyro.h:67
@ GYRO_REG_ZOUT_LSB
Definition: fxas21002_gyro.h:65
@ GYRO_REG_YOUT_LSB
Definition: fxas21002_gyro.h:63
@ GYRO_REG_YOUT_MSB
Definition: fxas21002_gyro.h:62
constexpr float GYRO_SENS_250
Gyro measurement sensitivities.
Definition: fxas21002_gyro.h:48
constexpr uint8_t FXAS21002C_ID
Definition: fxas21002_gyro.h:41
constexpr float GYRO_SENS_500
Definition: fxas21002_gyro.h:49
constexpr float GYRO_SENS_1000
Definition: fxas21002_gyro.h:50
#define SENSOR_I2C
UBER-EXTREME CAUTION SHOULD BE USED CHANGING PARAMETERS IN THIS FILE.
Definition: hummingbird_config.h:26