PX4 Firmware
PX4 Autopilot Software http://px4.io
rm3100.h File Reference

Shared defines for the RM3100 driver. More...

#include <float.h>
#include <drivers/device/i2c.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_mag.h>
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <px4_platform_common/defines.h>
#include <systemlib/err.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
Include dependency graph for rm3100.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RM3100
 
struct  RM3100::_last_report
 used for info() More...
 

Macros

#define RM3100_CONVERSION_INTERVAL   10000
 RM3100 internal constants and data structures. More...
 
#define UTESLA_TO_GAUSS   100.0f
 
#define RM3100_SENSITIVITY   75.0f
 
#define ADDR_POLL   0x00
 
#define ADDR_CMM   0x01
 
#define ADDR_CCX   0x04
 
#define ADDR_CCY   0x06
 
#define ADDR_CCZ   0x08
 
#define ADDR_TMRC   0x0B
 
#define ADDR_MX   0x24
 
#define ADDR_MY   0x27
 
#define ADDR_MZ   0x2A
 
#define ADDR_BIST   0x33
 
#define ADDR_STATUS   0x34
 
#define ADDR_HSHAKE   0x35
 
#define ADDR_REVID   0x36
 
#define CCX_DEFAULT_MSB   0x00
 
#define CCX_DEFAULT_LSB   0xC8
 
#define CCY_DEFAULT_MSB   CCX_DEFAULT_MSB
 
#define CCY_DEFAULT_LSB   CCX_DEFAULT_LSB
 
#define CCZ_DEFAULT_MSB   CCX_DEFAULT_MSB
 
#define CCZ_DEFAULT_LSB   CCX_DEFAULT_LSB
 
#define CMM_DEFAULT   0x70
 
#define CONTINUOUS_MODE   (1 << 0)
 
#define POLLING_MODE   (0 << 0)
 
#define TMRC_DEFAULT   0x94
 
#define BIST_SELFTEST   0x8F
 
#define BIST_DEFAULT   0x00
 
#define BIST_XYZ_OK   ((1 << 4) | (1 << 5) | (1 << 6))
 
#define STATUS_DRDY   (1 << 7)
 
#define POLL_XYZ   0x70
 
#define RM3100_REVID   0x22
 
#define NUM_BUS_OPTIONS   (sizeof(bus_options)/sizeof(bus_options[0]))
 

Typedefs

typedef device::Device *(* RM3100_constructor) (int)
 

Enumerations

enum  RM3100_BUS {
  RM3100_BUS_ALL = 0, RM3100_BUS_I2C_INTERNAL, RM3100_BUS_I2C_EXTERNAL, RM3100_BUS_SPI_INTERNAL,
  RM3100_BUS_SPI_EXTERNAL
}
 
enum  OPERATING_MODE { CONTINUOUS = 0, SINGLE, CONTINUOUS = 0, SINGLE }
 

Functions

device::DeviceRM3100_SPI_interface (int bus)
 
device::DeviceRM3100_I2C_interface (int bus)
 

Detailed Description

Shared defines for the RM3100 driver.

Definition in file rm3100.h.

Macro Definition Documentation

◆ ADDR_BIST

#define ADDR_BIST   0x33

Definition at line 75 of file rm3100.h.

Referenced by RM3100::self_test(), and RM3100::set_default_register_values().

◆ ADDR_CCX

#define ADDR_CCX   0x04

Definition at line 68 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ ADDR_CCY

#define ADDR_CCY   0x06

Definition at line 69 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ ADDR_CCZ

#define ADDR_CCZ   0x08

Definition at line 70 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ ADDR_CMM

#define ADDR_CMM   0x01

Definition at line 67 of file rm3100.h.

Referenced by RM3100::measure(), and RM3100::set_default_register_values().

◆ ADDR_HSHAKE

#define ADDR_HSHAKE   0x35

Definition at line 77 of file rm3100.h.

◆ ADDR_MX

#define ADDR_MX   0x24

Definition at line 72 of file rm3100.h.

Referenced by RM3100::collect().

◆ ADDR_MY

#define ADDR_MY   0x27

Definition at line 73 of file rm3100.h.

◆ ADDR_MZ

#define ADDR_MZ   0x2A

Definition at line 74 of file rm3100.h.

◆ ADDR_POLL

#define ADDR_POLL   0x00

Definition at line 66 of file rm3100.h.

Referenced by RM3100::measure(), and RM3100::self_test().

◆ ADDR_REVID

#define ADDR_REVID   0x36

Definition at line 78 of file rm3100.h.

◆ ADDR_STATUS

#define ADDR_STATUS   0x34

Definition at line 76 of file rm3100.h.

◆ ADDR_TMRC

#define ADDR_TMRC   0x0B

Definition at line 71 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ BIST_DEFAULT

#define BIST_DEFAULT   0x00

Definition at line 91 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ BIST_SELFTEST

#define BIST_SELFTEST   0x8F

Definition at line 90 of file rm3100.h.

Referenced by RM3100::self_test().

◆ BIST_XYZ_OK

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

Definition at line 92 of file rm3100.h.

Referenced by RM3100::self_test().

◆ CCX_DEFAULT_LSB

#define CCX_DEFAULT_LSB   0xC8

Definition at line 81 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CCX_DEFAULT_MSB

#define CCX_DEFAULT_MSB   0x00

Definition at line 80 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CCY_DEFAULT_LSB

#define CCY_DEFAULT_LSB   CCX_DEFAULT_LSB

Definition at line 83 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CCY_DEFAULT_MSB

#define CCY_DEFAULT_MSB   CCX_DEFAULT_MSB

Definition at line 82 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CCZ_DEFAULT_LSB

#define CCZ_DEFAULT_LSB   CCX_DEFAULT_LSB

Definition at line 85 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CCZ_DEFAULT_MSB

#define CCZ_DEFAULT_MSB   CCX_DEFAULT_MSB

Definition at line 84 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ CMM_DEFAULT

#define CMM_DEFAULT   0x70

Definition at line 86 of file rm3100.h.

Referenced by RM3100::measure(), and RM3100::set_default_register_values().

◆ CONTINUOUS_MODE

#define CONTINUOUS_MODE   (1 << 0)

Definition at line 87 of file rm3100.h.

Referenced by RM3100::measure().

◆ NUM_BUS_OPTIONS

#define NUM_BUS_OPTIONS   (sizeof(bus_options)/sizeof(bus_options[0]))

Definition at line 97 of file rm3100.h.

◆ POLL_XYZ

#define POLL_XYZ   0x70

Definition at line 94 of file rm3100.h.

Referenced by RM3100::measure(), and RM3100::self_test().

◆ POLLING_MODE

#define POLLING_MODE   (0 << 0)

Definition at line 88 of file rm3100.h.

Referenced by RM3100::measure().

◆ RM3100_CONVERSION_INTERVAL

#define RM3100_CONVERSION_INTERVAL   10000

RM3100 internal constants and data structures.

Definition at line 62 of file rm3100.h.

Referenced by RM3100::ioctl(), RM3100::read(), RM3100::self_test(), and RM3100::start().

◆ RM3100_REVID

#define RM3100_REVID   0x22

Definition at line 95 of file rm3100.h.

◆ RM3100_SENSITIVITY

#define RM3100_SENSITIVITY   75.0f

Definition at line 64 of file rm3100.h.

Referenced by RM3100::RM3100().

◆ STATUS_DRDY

#define STATUS_DRDY   (1 << 7)

Definition at line 93 of file rm3100.h.

Referenced by RM3100::check_measurement().

◆ TMRC_DEFAULT

#define TMRC_DEFAULT   0x94

Definition at line 89 of file rm3100.h.

Referenced by RM3100::set_default_register_values().

◆ UTESLA_TO_GAUSS

#define UTESLA_TO_GAUSS   100.0f

Definition at line 63 of file rm3100.h.

Referenced by RM3100::RM3100().

Typedef Documentation

◆ RM3100_constructor

typedef device::Device*(* RM3100_constructor) (int)

Definition at line 102 of file rm3100.h.

Enumeration Type Documentation

◆ OPERATING_MODE

Enumerator
CONTINUOUS 
SINGLE 
CONTINUOUS 
SINGLE 

Definition at line 112 of file rm3100.h.

◆ RM3100_BUS

enum RM3100_BUS
Enumerator
RM3100_BUS_ALL 
RM3100_BUS_I2C_INTERNAL 
RM3100_BUS_I2C_EXTERNAL 
RM3100_BUS_SPI_INTERNAL 
RM3100_BUS_SPI_EXTERNAL 

Definition at line 104 of file rm3100.h.

Function Documentation

◆ RM3100_I2C_interface()

device::Device* RM3100_I2C_interface ( int  bus)

◆ RM3100_SPI_interface()

device::Device* RM3100_SPI_interface ( int  bus)