Paparazzi UAS  v5.15_devel-61-g9c6bcf9
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ak8963.c File Reference

Driver for the AKM AK8963 magnetometer. More...

#include "peripherals/ak8963.h"
#include "std.h"
+ Include dependency graph for ak8963.c:

Go to the source code of this file.

Macros

#define Int16FromBuf(_buf, _idx)   ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))
 

Functions

void ak8963_init (struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
 Initialize AK8963 struct. More...
 
void ak8963_configure (struct Ak8963 *ak)
 
void ak8963_read (struct Ak8963 *ak)
 
void ak8963_event (struct Ak8963 *ak)
 

Detailed Description

Driver for the AKM AK8963 magnetometer.

Definition in file ak8963.c.

Macro Definition Documentation

#define Int16FromBuf (   _buf,
  _idx 
)    ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8)))

Definition at line 94 of file ak8963.c.

Referenced by ak8963_event().

Function Documentation

void ak8963_configure ( struct Ak8963 ak)
void ak8963_init ( struct Ak8963 ak,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize AK8963 struct.

Definition at line 34 of file ak8963.c.

References AK_CONF_UNINIT, Ak8963::data_available, Ak8963::i2c_p, Ak8963::i2c_trans, I2CTransDone, Ak8963::init_status, Ak8963::initialized, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by imu_bebop_init(), imu_disco_init(), and mpu9250_i2c_init().

+ Here is the caller graph for this function:

void ak8963_read ( struct Ak8963 ak)

Definition at line 83 of file ak8963.c.

References AK8963_REG_ST1, AK_STATUS_IDLE, i2c_transaction::buf, Ak8963::i2c_p, Ak8963::i2c_trans, i2c_transceive(), i2c_transaction::slave_addr, and Ak8963::status.

Referenced by ak8963_periodic(), and mpu9250_i2c_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: