dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_hmc5983.h File Reference

HMC5983 functions header. More...

#include <pios.h>

Go to the source code of this file.

Data Structures

struct  pios_hmc5983_cfg
 

Macros

#define PIOS_HMC5983_I2C_ADDR   0x1E
 
#define PIOS_HMC5983_I2C_READ_ADDR   0x3D
 
#define PIOS_HMC5983_I2C_WRITE_ADDR   0x3C
 
#define PIOS_HMC5983_CONFIG_REG_A   (uint8_t)0x00
 
#define PIOS_HMC5983_CONFIG_REG_B   (uint8_t)0x01
 
#define PIOS_HMC5983_MODE_REG   (uint8_t)0x02
 
#define PIOS_HMC5983_DATAOUT_XMSB_REG   0x03
 
#define PIOS_HMC5983_DATAOUT_XLSB_REG   0x04
 
#define PIOS_HMC5983_DATAOUT_ZMSB_REG   0x05
 
#define PIOS_HMC5983_DATAOUT_ZLSB_REG   0x06
 
#define PIOS_HMC5983_DATAOUT_YMSB_REG   0x07
 
#define PIOS_HMC5983_DATAOUT_YLSB_REG   0x08
 
#define PIOS_HMC5983_DATAOUT_STATUS_REG   0x09
 
#define PIOS_HMC5983_DATAOUT_IDA_REG   0x0A
 
#define PIOS_HMC5983_DATAOUT_IDB_REG   0x0B
 
#define PIOS_HMC5983_DATAOUT_IDC_REG   0x0C
 
#define PIOS_HMC5983_DATAOUT_TEMPMSB_REG   0x31
 
#define PIOS_HMC5983_DATAOUT_TEMPLSB_REG   0x32
 
#define PIOS_HMC5983_ODR_0_75   0x00
 
#define PIOS_HMC5983_ODR_1_5   0x04
 
#define PIOS_HMC5983_ODR_3   0x08
 
#define PIOS_HMC5983_ODR_7_5   0x0C
 
#define PIOS_HMC5983_ODR_15   0x10
 
#define PIOS_HMC5983_ODR_30   0x14
 
#define PIOS_HMC5983_ODR_75   0x18
 
#define PIOS_HMC5983_ODR_220   0x1c
 
#define PIOS_HMC5983_MEASCONF_NORMAL   0x00
 
#define PIOS_HMC5983_MEASCONF_BIAS_POS   0x01
 
#define PIOS_HMC5983_MEASCONF_BIAS_NEG   0x02
 
#define PIOS_HMC5983_GAIN_0_88   0x00
 
#define PIOS_HMC5983_GAIN_1_3   0x20
 
#define PIOS_HMC5983_GAIN_1_9   0x40
 
#define PIOS_HMC5983_GAIN_2_5   0x60
 
#define PIOS_HMC5983_GAIN_4_0   0x80
 
#define PIOS_HMC5983_GAIN_4_7   0xA0
 
#define PIOS_HMC5983_GAIN_5_6   0xC0
 
#define PIOS_HMC5983_GAIN_8_1   0xE0
 
#define PIOS_HMC5983_MODE_CONTINUOUS   0x00
 
#define PIOS_HMC5983_MODE_SINGLE   0x01
 
#define PIOS_HMC5983_MODE_IDLE   0x02
 
#define PIOS_HMC5983_MODE_SLEEP   0x03
 
#define PIOS_HMC5983_Sensitivity_0_88Ga   1370
 
#define PIOS_HMC5983_Sensitivity_1_3Ga   1090
 
#define PIOS_HMC5983_Sensitivity_1_9Ga   820
 
#define PIOS_HMC5983_Sensitivity_2_5Ga   660
 
#define PIOS_HMC5983_Sensitivity_4_0Ga   440
 
#define PIOS_HMC5983_Sensitivity_4_7Ga   390
 
#define PIOS_HMC5983_Sensitivity_5_6Ga   330
 
#define PIOS_HMC5983_Sensitivity_8_1Ga   230
 
#define PIOS_HMC5983_AVERAGING_1   0x00
 
#define PIOS_HMC5983_AVERAGING_2   0x20
 
#define PIOS_HMC5983_AVERAGING_4   0x40
 
#define PIOS_HMC5983_AVERAGING_8   0x60
 
#define PIOS_HMC5983_READ_MODE   0xC0
 
#define PIOS_HMC5983_ENABLE_TEMP_SENSOR   0x80
 

Enumerations

enum  pios_hmc5983_orientation {
  PIOS_HMC5983_TOP_0DEG, PIOS_HMC5983_TOP_90DEG, PIOS_HMC5983_TOP_180DEG, PIOS_HMC5983_TOP_270DEG,
  PIOS_HMC5983_BOTTOM_0DEG, PIOS_HMC5983_BOTTOM_90DEG, PIOS_HMC5983_BOTTOM_180DEG, PIOS_HMC5983_BOTTOM_270DEG
}
 

Functions

int32_t PIOS_HMC5983_Init (pios_spi_t spi_id, uint32_t slave_num, const struct pios_hmc5983_cfg *cfg)
 
bool PIOS_HMC5983_IRQHandler (void)
 

Detailed Description

HMC5983 functions header.

Author
The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
Tau Labs, http://taulabs.org, Copyright (C) 2012-2013
See Also
The GNU Public License (GPL) Version 3

Definition in file pios_hmc5983.h.