94 #define Int16FromBuf(_buf,_idx) ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))
void ak8963_event(struct Ak8963 *ak)
void ak8963_configure(struct Ak8963 *ak)
void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
Initialize AK8963 struct.
void ak8963_read(struct Ak8963 *ak)
#define Int16FromBuf(_buf, _idx)
Register and address definitions for AK8963 magnetometer.
enum Ak8963Status status
main status
struct i2c_transaction i2c_trans
i2c transaction used for communication with the ak8936
enum Ak8963ConfStatus init_status
init status
bool initialized
config done flag
volatile bool data_available
data ready flag
struct i2c_periph * i2c_p
peripheral used for communcation
Default Ak8963 structure.
#define AK8963_CNTL1_CM_2
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
uint8_t slave_addr
Slave address.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.