|
void | ahrsOn () |
| Switch on the AHRS.
|
|
void | ahrsOff () |
| Switch off the AHRS.
|
|
bool | ahrsWriteReg (I2C_Device *dev, uint8_t addr, uint8_t reg_addr, f32_t newvalue, f32_t *readback) |
| Writes an AHRS register. More...
|
|
bool | ahrsReadReg (I2C_Device *dev, uint8_t addr, uint8_t reg_addr, f32_t *value) |
| Reads an AHRS register. More...
|
|
bool | ahrsGetVersion (I2C_Device *dev, uint8_t addr, uint8_t *version) |
| Reads the AHRS version. More...
|
|
bool | ahrsRead (I2C_Device *dev, uint8_t addr, CompassData *data) |
| Reads all data from the AHRS. More...
|
|
This driver is to read and configure the AHRS I2C sensor.
Usage:
AHRS_Data_Struct data;
if (
ahrsRead(
I2C2, AHRS_I2C_ADDR, AHRS_DATA_ID, (uint8_t *)&data,
sizeof(data))) {
printf("\n\nYaw: %x %x %x %x \n", data.Yaw[0], data.Yaw[1], data.Yaw[2], data.Yaw[3]);
printf("\n\nPitch: %x %x %x %x \n", data.Pitch[0], data.Pitch[1], data.Pitch[2], data.Pitch[3]);
printf...
}else{
printf("Error reading AHRS:\n");
}
}
Definition in file ahrs.h.