|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
36 #ifndef HMC58XX_DEFAULT_DO
37 #define HMC58XX_DEFAULT_DO 0x6 // Data Output Rate (6 -> 50Hz with HMC5843, 75Hz with HMC5883)
39 #ifndef HMC58XX_DEFAULT_MS
40 #define HMC58XX_DEFAULT_MS 0x0 // Measurement configuration
42 #ifndef HMC58XX_DEFAULT_GN
43 #define HMC58XX_DEFAULT_GN 0x1 // Gain configuration (1 -> +- 1 Gauss)
45 #ifndef HMC58XX_DEFAULT_MD
46 #define HMC58XX_DEFAULT_MD 0x0 // Continious measurement mode
57 #ifndef HMC58XX_STARTUP_DELAY
58 #define HMC58XX_STARTUP_DELAY 1.5
150 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
170 if (hmc->
data.vect.x != -4096 && hmc->
data.vect.y != -4096 &&
171 hmc->
data.vect.z != -4096) {
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
uint8_t mode
Measurement mode.
uint16_t len_r
Number of bytes to read/receive.
void hmc58xx_start_configure(struct Hmc58xx *hmc)
void hmc58xx_event(struct Hmc58xx *hmc)
@ I2CTransTx
transmit only transaction
#define HMC58XX_DEFAULT_MD
static float get_sys_time_float(void)
Get the time in seconds since startup.
struct i2c_transaction i2c_trans
uint8_t meas
Measurement configuration.
@ I2CTransFailed
transaction failed
enum Hmc58xxConfStatus init_status
init status
#define HMC58XX_STARTUP_DELAY
HMC58XX startup delay.
uint8_t gain
Gain configuration (1 -> +- 1 Gauss)
uint8_t len_w
Number of bytes to write/transmit.
@ I2CTransSuccess
transaction successfully finished by I2C driver
#define HMC58XX_DEFAULT_MS
Architecture independent timing functions.
#define HMC58XX_REG_DATXM
static void hmc58xx_send_config(struct Hmc58xx *hmc)
Configuration function called once before normal use.
enum I2CTransactionStatus status
Transaction status.
void hmc58xx_read(struct Hmc58xx *hmc)
@ I2CTransTxRx
transmit and receive transaction
static void hmc58xx_i2c_tx_reg(struct Hmc58xx *hmc, uint8_t reg, uint8_t val)
uint8_t slave_addr
Slave address.
uint16_t adc_overflow_cnt
counts number of ADC measurement under/overflows
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
#define HMC58XX_DEFAULT_DO
#define HMC58XX_DEFAULT_GN
uint8_t rate
Data Output Rate Bits(6 -> 50Hz with HMC5843, 75Hz with HMC5883)
@ I2CTransDone
transaction set to done by user level
static void hmc58xx_set_default_config(struct Hmc58xxConfig *c)
static bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
Submit a I2C transaction.
struct Hmc58xxConfig config
volatile bool data_available
data ready flag
#define Int16FromBuf(_buf, _idx)
struct i2c_periph * i2c_p
enum I2CTransactionType type
Transaction type.
bool initialized
config done flag