11#include "stm32f439xx.h"
17#define A3G4250D_SENSITIVITY (0.00875f)
18#define A3G4250D_CTRL_REG1 0x20
19#define A3G4250D_CTRL_REG1_ODR_800Hz 0xC0
20#define A3G4250D_CTRL_REG1_PD_ENABLE 0x08
21#define A3G4250D_CTRL_REG1_AXIS_ENABLE 0x07
22#define A3G4250D_OUT_X_L 0x28
23#define A3G4250D_OUT_X_H 0x29
24#define A3G4250D_OUT_Y_L 0x2A
25#define A3G4250D_OUT_Y_H 0x2B
26#define A3G4250D_OUT_Z_L 0x2C
27#define A3G4250D_OUT_Z_H 0x2D
29#define A3G4250D_DATA_SIZE 2
30#define A3G4250D_DATA_COUNT 3
31#define A3G4250D_DATA_TOTAL (A3G4250D_DATA_COUNT * A3G4250D_DATA_SIZE)
47 uint8_t
axes[A3G4250D_DATA_COUNT];
48 int8_t
sign[A3G4250D_DATA_COUNT];
59uint8_t A3G4250D_readRegister(
A3G4250D *, uint8_t);
60void A3G4250D_writeRegister(
A3G4250D *, uint8_t, uint8_t);
void A3G4250D_processRawBytes(A3G4250D *, uint8_t *, float *)
Process raw 3-axis data to floating point gyro rates.
void A3G4250D_readGyro(A3G4250D *, float *)
Read 3-axis floating point gyro rates.
void A3G4250D_readRawBytes(A3G4250D *, uint8_t *)
Read raw 3-axis data.
DeviceHandle_t A3G4250D_init(A3G4250D *, char[DEVICE_NAME_LENGTH], GPIO_TypeDef *, unsigned long, const float, const uint8_t *, const int8_t *)
Initialiser for a A3G4250D gyroscope.
void A3G4250D_update(A3G4250D *)
Updates internally stored gyro readings.
uint8_t rawGyroData[A3G4250D_DATA_TOTAL]
Raw gyro rates array.
SPI base
Parent SPI interface.
void(* readRawBytes)(struct A3G4250D *, uint8_t *)
Raw gyro read method.
int8_t sign[A3G4250D_DATA_COUNT]
Array defining sign of axes.
uint8_t axes[A3G4250D_DATA_COUNT]
Array defining axes of mounting.
void(* readGyro)(struct A3G4250D *, float *)
Gyro read method.
float sensitivity
Gyroscope sensitivity.
void(* processRawBytes)(struct A3G4250D *, uint8_t *, float *)
Process raw gyro method.
void(* update)(struct A3G4250D *)
Gyro update method.
float gyroData[A3G4250D_DATA_COUNT]
Processed gyro rates array.
Struct definition for SPI interface. Provides the interface for API consumers to interact with the SP...