Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
rm3100.c File Reference
+ Include dependency graph for rm3100.c:

Go to the source code of this file.

Macros

#define RM3100_ADDR_POLL   0x00
 
#define RM3100_ADDR_CMM   0x01
 
#define RM3100_ADDR_CCX   0x04
 
#define RM3100_ADDR_CCY   0x06
 
#define RM3100_ADDR_CCZ   0x08
 
#define RM3100_ADDR_TMRC   0x0B
 
#define RM3100_ADDR_MX   0x24
 
#define RM3100_ADDR_MY   0x27
 
#define RM3100_ADDR_MZ   0x2A
 
#define RM3100_ADDR_BIST   0x33
 
#define RM3100_ADDR_STATUS   0x34
 
#define RM3100_ADDR_HSHAKE   0x35
 
#define RM3100_ADDR_REVID   0x36
 
#define RM3100_CCX_DEFAULT_MSB   0x00
 
#define RM3100_CCX_DEFAULT_LSB   0xC8
 
#define RM3100_CCY_DEFAULT_MSB   RM3100_CCX_DEFAULT_MSB
 
#define RM3100_CCY_DEFAULT_LSB   RM3100_CCX_DEFAULT_LSB
 
#define RM3100_CCZ_DEFAULT_MSB   RM3100_CCX_DEFAULT_MSB
 
#define RM3100_CCZ_DEFAULT_LSB   RM3100_CCX_DEFAULT_LSB
 
#define RM3100_CMM_DEFAULT   0x70
 
#define RM3100_CONTINUOUS_MODE   (1 << 0)
 
#define RM3100_POLLING_MODE   (0 << 0)
 
#define RM3100_BIST_SELFTEST   0x8F
 
#define RM3100_BIST_DEFAULT   0x00
 
#define RM3100_BIST_XYZ_OK   ((1 << 4) | (1 << 5) | (1 << 6))
 
#define RM3100_STATUS_DRDY   (1 << 7)
 
#define RM3100_POLL_XYZ   0x70
 
#define RM3100_RM3100_REVID   0x22
 

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_read (struct Rm3100 *mag)
 
static int32_t rm3100_get_raw_from_buf (const volatile uint8_t *buf, uint8_t idx)
 
void rm3100_event (struct Rm3100 *mag)
 

Macro Definition Documentation

◆ RM3100_ADDR_BIST

#define RM3100_ADDR_BIST   0x33

Definition at line 38 of file rm3100.c.

◆ RM3100_ADDR_CCX

#define RM3100_ADDR_CCX   0x04

Definition at line 31 of file rm3100.c.

◆ RM3100_ADDR_CCY

#define RM3100_ADDR_CCY   0x06

Definition at line 32 of file rm3100.c.

◆ RM3100_ADDR_CCZ

#define RM3100_ADDR_CCZ   0x08

Definition at line 33 of file rm3100.c.

◆ RM3100_ADDR_CMM

#define RM3100_ADDR_CMM   0x01

Definition at line 30 of file rm3100.c.

◆ RM3100_ADDR_HSHAKE

#define RM3100_ADDR_HSHAKE   0x35

Definition at line 40 of file rm3100.c.

◆ RM3100_ADDR_MX

#define RM3100_ADDR_MX   0x24

Definition at line 35 of file rm3100.c.

◆ RM3100_ADDR_MY

#define RM3100_ADDR_MY   0x27

Definition at line 36 of file rm3100.c.

◆ RM3100_ADDR_MZ

#define RM3100_ADDR_MZ   0x2A

Definition at line 37 of file rm3100.c.

◆ RM3100_ADDR_POLL

#define RM3100_ADDR_POLL   0x00

Definition at line 29 of file rm3100.c.

◆ RM3100_ADDR_REVID

#define RM3100_ADDR_REVID   0x36

Definition at line 41 of file rm3100.c.

◆ RM3100_ADDR_STATUS

#define RM3100_ADDR_STATUS   0x34

Definition at line 39 of file rm3100.c.

◆ RM3100_ADDR_TMRC

#define RM3100_ADDR_TMRC   0x0B

Definition at line 34 of file rm3100.c.

◆ RM3100_BIST_DEFAULT

#define RM3100_BIST_DEFAULT   0x00

Definition at line 53 of file rm3100.c.

◆ RM3100_BIST_SELFTEST

#define RM3100_BIST_SELFTEST   0x8F

Definition at line 52 of file rm3100.c.

◆ RM3100_BIST_XYZ_OK

#define RM3100_BIST_XYZ_OK   ((1 << 4) | (1 << 5) | (1 << 6))

Definition at line 54 of file rm3100.c.

◆ RM3100_CCX_DEFAULT_LSB

#define RM3100_CCX_DEFAULT_LSB   0xC8

Definition at line 44 of file rm3100.c.

◆ RM3100_CCX_DEFAULT_MSB

#define RM3100_CCX_DEFAULT_MSB   0x00

Definition at line 43 of file rm3100.c.

◆ RM3100_CCY_DEFAULT_LSB

#define RM3100_CCY_DEFAULT_LSB   RM3100_CCX_DEFAULT_LSB

Definition at line 46 of file rm3100.c.

◆ RM3100_CCY_DEFAULT_MSB

#define RM3100_CCY_DEFAULT_MSB   RM3100_CCX_DEFAULT_MSB

Definition at line 45 of file rm3100.c.

◆ RM3100_CCZ_DEFAULT_LSB

#define RM3100_CCZ_DEFAULT_LSB   RM3100_CCX_DEFAULT_LSB

Definition at line 48 of file rm3100.c.

◆ RM3100_CCZ_DEFAULT_MSB

#define RM3100_CCZ_DEFAULT_MSB   RM3100_CCX_DEFAULT_MSB

Definition at line 47 of file rm3100.c.

◆ RM3100_CMM_DEFAULT

#define RM3100_CMM_DEFAULT   0x70

Definition at line 49 of file rm3100.c.

◆ RM3100_CONTINUOUS_MODE

#define RM3100_CONTINUOUS_MODE   (1 << 0)

Definition at line 50 of file rm3100.c.

◆ RM3100_POLL_XYZ

#define RM3100_POLL_XYZ   0x70

Definition at line 56 of file rm3100.c.

◆ RM3100_POLLING_MODE

#define RM3100_POLLING_MODE   (0 << 0)

Definition at line 51 of file rm3100.c.

◆ RM3100_RM3100_REVID

#define RM3100_RM3100_REVID   0x22

Definition at line 57 of file rm3100.c.

◆ RM3100_STATUS_DRDY

#define RM3100_STATUS_DRDY   (1 << 7)

Definition at line 55 of file rm3100.c.

Function Documentation

◆ rm3100_configure()

◆ rm3100_event()

void rm3100_event ( struct Rm3100 mag)

◆ rm3100_get_raw_from_buf()

static int32_t rm3100_get_raw_from_buf ( const volatile uint8_t buf,
uint8_t  idx 
)
static

Definition at line 145 of file rm3100.c.

References idx.

Referenced by rm3100_event().

+ Here is the caller graph for this function:

◆ rm3100_init()

void rm3100_init ( struct Rm3100 mag,
struct i2c_periph i2c_p,
uint8_t  addr,
uint8_t  data_rate 
)

◆ rm3100_read()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: