dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_hmc5883_priv.h File Reference
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  pios_hmc5883_cfg
 
struct  pios_hmc5883_data
 

Macros

#define PIOS_HMC5883_I2C_ADDR   0x1E
 
#define PIOS_HMC5883_I2C_READ_ADDR   0x3D
 
#define PIOS_HMC5883_I2C_WRITE_ADDR   0x3C
 
#define PIOS_HMC5883_CONFIG_REG_A   (uint8_t)0x00
 
#define PIOS_HMC5883_CONFIG_REG_B   (uint8_t)0x01
 
#define PIOS_HMC5883_MODE_REG   (uint8_t)0x02
 
#define PIOS_HMC5883_DATAOUT_XMSB_REG   0x03
 
#define PIOS_HMC5883_DATAOUT_XLSB_REG   0x04
 
#define PIOS_HMC5883_DATAOUT_ZMSB_REG   0x05
 
#define PIOS_HMC5883_DATAOUT_ZLSB_REG   0x06
 
#define PIOS_HMC5883_DATAOUT_YMSB_REG   0x07
 
#define PIOS_HMC5883_DATAOUT_YLSB_REG   0x08
 
#define PIOS_HMC5883_DATAOUT_STATUS_REG   0x09
 
#define PIOS_HMC5883_DATAOUT_IDA_REG   0x0A
 
#define PIOS_HMC5883_DATAOUT_IDB_REG   0x0B
 
#define PIOS_HMC5883_DATAOUT_IDC_REG   0x0C
 
#define PIOS_HMC5883_ODR_0_75   0x00
 
#define PIOS_HMC5883_ODR_1_5   0x04
 
#define PIOS_HMC5883_ODR_3   0x08
 
#define PIOS_HMC5883_ODR_7_5   0x0C
 
#define PIOS_HMC5883_ODR_15   0x10
 
#define PIOS_HMC5883_ODR_30   0x14
 
#define PIOS_HMC5883_ODR_75   0x18
 
#define PIOS_HMC5883_MEASCONF_NORMAL   0x00
 
#define PIOS_HMC5883_MEASCONF_BIAS_POS   0x01
 
#define PIOS_HMC5883_MEASCONF_BIAS_NEG   0x02
 
#define PIOS_HMC5883_GAIN_0_88   0x00
 
#define PIOS_HMC5883_GAIN_1_3   0x20
 
#define PIOS_HMC5883_GAIN_1_9   0x40
 
#define PIOS_HMC5883_GAIN_2_5   0x60
 
#define PIOS_HMC5883_GAIN_4_0   0x80
 
#define PIOS_HMC5883_GAIN_4_7   0xA0
 
#define PIOS_HMC5883_GAIN_5_6   0xC0
 
#define PIOS_HMC5883_GAIN_8_1   0xE0
 
#define PIOS_HMC5883_MODE_CONTINUOUS   0x00
 
#define PIOS_HMC5883_MODE_SINGLE   0x01
 
#define PIOS_HMC5883_MODE_IDLE   0x02
 
#define PIOS_HMC5883_MODE_SLEEP   0x03
 

Enumerations

enum  pios_hmc5883_sensitivity {
  PIOS_HMC5883_Sensitivity_0_88Ga = 1370, PIOS_HMC5883_Sensitivity_1_3Ga = 1090, PIOS_HMC5883_Sensitivity_1_9Ga = 820, PIOS_HMC5883_Sensitivity_2_5Ga = 660,
  PIOS_HMC5883_Sensitivity_4_0Ga = 440, PIOS_HMC5883_Sensitivity_4_7Ga = 390, PIOS_HMC5883_Sensitivity_5_6Ga = 330, PIOS_HMC5883_Sensitivity_8_1Ga = 230
}
 
enum  pios_hmc5883_orientation {
  PIOS_HMC5883_TOP_0DEG, PIOS_HMC5883_TOP_90DEG, PIOS_HMC5883_TOP_180DEG, PIOS_HMC5883_TOP_270DEG,
  PIOS_HMC5883_BOTTOM_0DEG, PIOS_HMC5883_BOTTOM_90DEG, PIOS_HMC5883_BOTTOM_180DEG, PIOS_HMC5883_BOTTOM_270DEG
}
 

Functions

int32_t PIOS_HMC5883_Init (pios_i2c_t i2c_id, const struct pios_hmc5883_cfg *cfg)
 
int32_t PIOS_HMC5883_Test (void)
 
int32_t PIOS_HMC5883_SetOrientation (enum pios_hmc5883_orientation orientation)
 
bool PIOS_HMC5883_IRQHandler ()