Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
hmc58xx.h File Reference
#include "std.h"
#include "mcu_periph/i2c.h"
#include "math/pprz_algebra_int.h"
#include "peripherals/hmc58xx_regs.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.

Data Structures

struct  Hmc58xxConfig
 
struct  Hmc58xx
 

Enumerations

enum  Hmc58xxConfStatus {
  HMC_CONF_UNINIT, HMC_CONF_CRA, HMC_CONF_CRB, HMC_CONF_MODE,
  HMC_CONF_DONE
}
 config status states More...
 
enum  Hmc58xxType { HMC_TYPE_5843, HMC_TYPE_5883 }
 

Functions

void hmc58xx_init (struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
 Initialize Hmc58xx struct and set default config options. More...
 
void hmc58xx_start_configure (struct Hmc58xx *hmc)
 
void hmc58xx_read (struct Hmc58xx *hmc)
 
void hmc58xx_event (struct Hmc58xx *hmc)
 
static void hmc58xx_periodic (struct Hmc58xx *hmc)
 convenience function: read or start configuration if not already initialized More...
 

Enumeration Type Documentation

config status states

Enumerator
HMC_CONF_UNINIT 
HMC_CONF_CRA 
HMC_CONF_CRB 
HMC_CONF_MODE 
HMC_CONF_DONE 

Definition at line 47 of file hmc58xx.h.

Enumerator
HMC_TYPE_5843 
HMC_TYPE_5883 

Definition at line 55 of file hmc58xx.h.

Function Documentation

void hmc58xx_init ( struct Hmc58xx hmc,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize Hmc58xx struct and set default config options.

Parameters
hmcHmc58xx struct
i2c_pI2C periperal to use
addrI2C address of HMC58xx

Definition at line 62 of file hmc58xx.c.

References Hmc58xx::config, FALSE, hmc58xx_set_default_config(), HMC_CONF_UNINIT, HMC_TYPE_5883, Hmc58xx::i2c_p, Hmc58xx::i2c_trans, I2CTransDone, Hmc58xx::init_status, Hmc58xx::initialized, i2c_transaction::slave_addr, i2c_transaction::status, and Hmc58xx::type.

Referenced by imu_impl_init(), and mag_hmc58xx_module_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void hmc58xx_periodic ( struct Hmc58xx hmc)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 84 of file hmc58xx.h.

References hmc58xx_read(), hmc58xx_start_configure(), and Hmc58xx::initialized.

Referenced by imu_periodic(), and mag_hmc58xx_module_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void hmc58xx_read ( struct Hmc58xx hmc)

Definition at line 123 of file hmc58xx.c.

References i2c_transaction::buf, HMC58XX_REG_DATXM, Hmc58xx::i2c_p, i2c_submit(), Hmc58xx::i2c_trans, I2CTransDone, I2CTransTxRx, Hmc58xx::initialized, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::status, and i2c_transaction::type.

Referenced by hmc58xx_periodic(), and imu_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void hmc58xx_start_configure ( struct Hmc58xx hmc)

Definition at line 112 of file hmc58xx.c.

References hmc58xx_send_config(), HMC_CONF_UNINIT, Hmc58xx::i2c_trans, I2CTransDone, I2CTransSuccess, Hmc58xx::init_status, and i2c_transaction::status.

Referenced by hmc58xx_periodic(), and imu_drotek2_configure_mag_slave().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: