34 if (AHRS_I2C_ADDR != 0)
37 if(!
ahrsReadReg(INS_I2C_DEV, AHRS_I2C_ADDR, ahrs_reg, &answer)){
45 if (msgId->
msgId == MSG_INS_AHRS_GET_REG_EX)
53 bool _msgInsAHRSGetRegEx(
MsgId * msgId,
DataBuffer * cmd) __attribute__((alias(
"_msgInsAHRSGetReg")));
68 if (AHRS_I2C_ADDR != 0)
71 if(!
ahrsWriteReg(INS_I2C_DEV, AHRS_I2C_ADDR, ahrs_reg, val, NULL)){
bool _msgInsAHRSSetReg(MsgId *id, DataBuffer *buf)
Writes a register of the AHRS.
This driver is to read and configure the AHRS I2C sensor.
bool dbReadU8(DataBuffer *buf, uint8_t *byte)
Reads an unsigned byte.
Special library for primitive IEEE 754 floating point handling without dragging all float support alo...
bool dbReadF32(DataBuffer *buf, f32_t *flt)
Reads an 32-bit floating point.
static bool msgTxCurError(MsgId *id)
Invoke to reply the current global error.
Defines a DataBuffer structure.
Handles MCF packed messages from the higher protocol layer.
bool ahrsWriteReg(I2C_Device *dev, uint8_t addr, uint8_t reg_addr, f32_t newvalue, f32_t *readback)
Writes an AHRS register.
void errPrint(bool clear)
Prints the last error.
bool msgTxReply(MsgId *id, DataBuffer *buf)
Invoke to send a reply.
uint32_t f32_t
32 bit representation for float.
bool dbWriteF32(DataBuffer *buf, f32_t flt)
Writes a 32-bit floating point.
bool msgRxBufCheck(DataBuffer *buf)
Checks the received buffer, and logs an error if there is something wrong.
bool dbWriteU8(DataBuffer *buf, uint8_t byte)
Writes a unsigned byte.
If defined, events will not require an acknowledge.
#define DB_BUF_INIT(PTR, LEN)
Simple buffer initialization.
bool _msgInsAHRSGetReg(MsgId *id, DataBuffer *buf)
Reads a register of the AHRS.
bool ahrsReadReg(I2C_Device *dev, uint8_t addr, uint8_t reg_addr, f32_t *value)
Reads an AHRS register.
uint16_t msgId
the message identifier
Configures the board-specific peripherals, like I2C, SPI etc...