Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hmc58xx.h File Reference
#include "std.h"
#include "mcu_periph/i2c.h"
#include "math/pprz_algebra_int.h"
+ Include dependency graph for hmc58xx.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HMC58XX_ADDR   0x3C
 
#define HMC58XX_REG_CFGA   0x00
 
#define HMC58XX_REG_CFGB   0x01
 
#define HMC58XX_REG_MODE   0x02
 
#define HMC58XX_REG_DATXM   0x03
 
#define HMC58XX_REG_DATXL   0x04
 
#define HMC58XX_REG_DATYM   0x05
 
#define HMC58XX_REG_DATYL   0x06
 
#define HMC58XX_REG_DATZM   0x07
 
#define HMC58XX_REG_DATZL   0x08
 
#define HMC58XX_REG_STATUS   0x09
 
#define HMC58XX_REG_IDA   0x0A
 
#define HMC58XX_REG_IDB   0x0B
 
#define HMC58XX_REG_IDC   0x0C
 
#define HMC58XX_DO   0x6
 
#define HMC58XX_MS   0x0
 
#define HMC58XX_GN   0x1
 
#define HMC58XX_MD   0x0
 
#define HMC58XX_CRA   ((HMC58XX_DO<<2)|(HMC58XX_MS))
 
#define HMC58XX_CRB   (HMC58XX_GN<<5)
 
#define HMC58XX_I2C_DEVICE   i2c2
 
#define Hmc58xxPeriodic()
 
#define MagEvent(_m_handler)
 

Functions

void hmc58xx_init (void)
 
void hmc58xx_configure (void)
 
void hmc58xx_read (void)
 
void hmc58xx_event (void)
 

Variables

bool_t hmc58xx_initialized
 
volatile bool_t hmc58xx_data_available
 
struct Int16Vect3 hmc58xx_data
 
struct i2c_transaction hmc58xx_i2c_trans
 

Macro Definition Documentation

#define HMC58XX_ADDR   0x3C

Definition at line 34 of file hmc58xx.h.

Referenced by hmc58xx_init(), hmc58xx_read(), hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_CRA   ((HMC58XX_DO<<2)|(HMC58XX_MS))

Definition at line 65 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_CRB   (HMC58XX_GN<<5)

Definition at line 66 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_DO   0x6

Definition at line 53 of file hmc58xx.h.

#define HMC58XX_GN   0x1

Definition at line 59 of file hmc58xx.h.

#define HMC58XX_I2C_DEVICE   i2c2

Definition at line 70 of file hmc58xx.h.

Referenced by hmc58xx_read(), and hmc58xx_send_config().

#define HMC58XX_MD   0x0

Definition at line 62 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_MS   0x0

Definition at line 56 of file hmc58xx.h.

#define HMC58XX_REG_CFGA   0x00

Definition at line 37 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_REG_CFGB   0x01

Definition at line 38 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_REG_DATXL   0x04

Definition at line 41 of file hmc58xx.h.

#define HMC58XX_REG_DATXM   0x03

Definition at line 40 of file hmc58xx.h.

Referenced by hmc58xx_read(), and mpu_configure().

#define HMC58XX_REG_DATYL   0x06

Definition at line 43 of file hmc58xx.h.

#define HMC58XX_REG_DATYM   0x05

Definition at line 42 of file hmc58xx.h.

#define HMC58XX_REG_DATZL   0x08

Definition at line 45 of file hmc58xx.h.

#define HMC58XX_REG_DATZM   0x07

Definition at line 44 of file hmc58xx.h.

#define HMC58XX_REG_IDA   0x0A

Definition at line 47 of file hmc58xx.h.

#define HMC58XX_REG_IDB   0x0B

Definition at line 48 of file hmc58xx.h.

#define HMC58XX_REG_IDC   0x0C

Definition at line 49 of file hmc58xx.h.

#define HMC58XX_REG_MODE   0x02

Definition at line 39 of file hmc58xx.h.

Referenced by hmc58xx_send_config(), and mpu_configure().

#define HMC58XX_REG_STATUS   0x09

Definition at line 46 of file hmc58xx.h.

#define Hmc58xxPeriodic ( )
Value:
{ \
}
bool_t hmc58xx_initialized
Definition: hmc58xx.c:43
void hmc58xx_configure(void)
Definition: hmc58xx.c:88
void hmc58xx_read(void)
Definition: hmc58xx.c:99

Definition at line 91 of file hmc58xx.h.

Referenced by imu_periodic().

#define MagEvent (   _m_handler)
Value:
{ \
_m_handler(); \
} \
}
void hmc58xx_event(void)
Definition: hmc58xx.c:109
volatile bool_t hmc58xx_data_available
Definition: hmc58xx.c:37

Definition at line 96 of file hmc58xx.h.

Function Documentation

void hmc58xx_configure ( void  )

Definition at line 88 of file hmc58xx.c.

References hmc58xx_i2c_trans, hmc58xx_init_status, hmc58xx_send_config(), HMC_CONF_UNINIT, I2CTransDone, I2CTransSuccess, and i2c_transaction::status.

+ Here is the call graph for this function:

void hmc58xx_event ( void  )
void hmc58xx_init ( void  )

Definition at line 48 of file hmc58xx.c.

References FALSE, HMC58XX_ADDR, hmc58xx_i2c_trans, hmc58xx_init_status, hmc58xx_initialized, HMC_CONF_UNINIT, I2CTransDone, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by imu_impl_init().

+ Here is the caller graph for this function:

Variable Documentation

struct Int16Vect3 hmc58xx_data

Definition at line 39 of file hmc58xx.c.

Referenced by hmc58xx_event(), imu_navgo_event(), and mag_hmc58xx_report().

volatile bool_t hmc58xx_data_available

Definition at line 37 of file hmc58xx.c.

Referenced by hmc58xx_event(), and imu_navgo_event().

struct i2c_transaction hmc58xx_i2c_trans
bool_t hmc58xx_initialized

Definition at line 43 of file hmc58xx.c.

Referenced by hmc58xx_event(), hmc58xx_init(), hmc58xx_read(), and hmc58xx_send_config().