Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
PNI RM3100 3-axis magnetometer driver interface (I2C). More...
Go to the source code of this file.
Data Structures | |
struct | Rm3100 |
union | Rm3100.data |
Macros | |
#define | RM3100_ADDR0 (0b0100000 << 1) |
The lower 2 bits of the slave address are user-configurable, using pins 3 and 28. More... | |
#define | RM3100_ADDR1 (0b0100001 << 1) |
#define | RM3100_ADDR2 (0b0100010 << 1) |
#define | RM3100_ADDR3 (0b0100011 << 1) |
#define | RM3100_RATE_600 0x92 |
#define | RM3100_RATE_300 0x93 |
#define | RM3100_RATE_150 0x94 |
#define | RM3100_RATE_75 0x95 |
#define | RM3100_RATE_37 0x96 |
#define | RM3100_RATE_18 0x97 |
#define | RM3100_RATE_9 0x98 |
#define | RM3100_RATE_4_5 0x99 |
#define | RM3100_RATE_2_3 0x9A |
#define | RM3100_RATE_1_2 0x9B |
#define | RM3100_RATE_0_6 0x9C |
#define | RM3100_RATE_0_3 0x9D |
#define | RM3100_RATE_0_15 0x9E |
#define | RM3100_RATE_0_075 0x9F |
#define | RM3100_TMRC_DEFAULT RM3100_RATE_150 |
Enumerations | |
enum | Rm3100Status { RM3100_CONF_UNINIT , RM3100_CONF_CCR_DONE , RM3100_CONF_TMRC_DONE , RM3100_CONF_CCM_DONE , RM3100_STATUS_IDLE , RM3100_STATUS_MEAS } |
config status states More... | |
Functions | |
void | rm3100_init (struct Rm3100 *mag, struct i2c_periph *i2c_p, uint8_t addr, uint8_t data_rate) |
void | rm3100_configure (struct Rm3100 *mag) |
void | rm3100_event (struct Rm3100 *mag) |
void | rm3100_read (struct Rm3100 *mag) |
static void | rm3100_periodic (struct Rm3100 *mag) |
convenience function: read or start configuration if not already initialized More... | |
PNI RM3100 3-axis magnetometer driver interface (I2C).
Definition in file rm3100.h.
struct Rm3100 |
Data Fields | ||
---|---|---|
union Rm3100 | data | |
volatile bool | data_available | data ready flag |
uint8_t | data_rate | sensor data rate |
struct i2c_periph * | i2c_p | peripheral used for communcation |
struct i2c_transaction | i2c_trans | i2c transaction |
bool | initialized | config done flag |
enum Rm3100Status | status | init status |
union Rm3100.data |
Data Fields | ||
---|---|---|
int32_t | value[3] | data values accessible by channel index |
struct Int32Vect3 | vect | data vector in mag coordinate system |
#define RM3100_ADDR0 (0b0100000 << 1) |
#define RM3100_TMRC_DEFAULT RM3100_RATE_150 |
enum Rm3100Status |
void rm3100_configure | ( | struct Rm3100 * | mag | ) |
Definition at line 75 of file rm3100.c.
References i2c_transaction::buf, Rm3100::data_rate, Rm3100::i2c_p, Rm3100::i2c_trans, i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, Rm3100::initialized, RM3100_ADDR_CCX, RM3100_ADDR_CMM, RM3100_ADDR_TMRC, RM3100_CCX_DEFAULT_LSB, RM3100_CCX_DEFAULT_MSB, RM3100_CCY_DEFAULT_LSB, RM3100_CCY_DEFAULT_MSB, RM3100_CCZ_DEFAULT_LSB, RM3100_CCZ_DEFAULT_MSB, RM3100_CONF_CCM_DONE, RM3100_CONF_CCR_DONE, RM3100_CONF_TMRC_DONE, RM3100_CONF_UNINIT, RM3100_CONTINUOUS_MODE, RM3100_POLL_XYZ, RM3100_STATUS_IDLE, i2c_transaction::slave_addr, i2c_transaction::status, and Rm3100::status.
Referenced by rm3100_periodic().
void rm3100_event | ( | struct Rm3100 * | mag | ) |
Definition at line 152 of file rm3100.c.
References i2c_transaction::buf, Rm3100::data, Rm3100::data_available, Rm3100::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Rm3100::initialized, rm3100_get_raw_from_buf(), RM3100_STATUS_IDLE, RM3100_STATUS_MEAS, i2c_transaction::status, and Rm3100::status.
Referenced by mag_rm3100_module_event().
void rm3100_init | ( | struct Rm3100 * | mag, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr, | ||
uint8_t | data_rate | ||
) |
Definition at line 59 of file rm3100.c.
References Rm3100::data_available, Rm3100::data_rate, Rm3100::i2c_p, Rm3100::i2c_trans, I2CTransDone, Rm3100::initialized, RM3100_CONF_UNINIT, i2c_transaction::slave_addr, i2c_transaction::status, and Rm3100::status.
Referenced by mag_rm3100_module_init().
|
inlinestatic |
convenience function: read or start configuration if not already initialized
Definition at line 92 of file rm3100.h.
References Rm3100::initialized, rm3100_configure(), and rm3100_read().
Referenced by mag_rm3100_module_periodic().
void rm3100_read | ( | struct Rm3100 * | mag | ) |
Definition at line 130 of file rm3100.c.
References i2c_transaction::buf, Rm3100::i2c_p, Rm3100::i2c_trans, i2c_transceive(), RM3100_ADDR_MX, RM3100_STATUS_IDLE, RM3100_STATUS_MEAS, i2c_transaction::slave_addr, and Rm3100::status.
Referenced by rm3100_periodic().