PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
MMC5603NJ

MEMSIC MMC5603NJ magnetometer. More...

Data Structures

struct  pbl_mmc5603nj_state
 MMC5603NJ driver state, owned by the driver. More...
 
struct  pbl_mmc5603nj
 MMC5603NJ magnetometer. More...
 

Macros

#define PBL_MMC5603NJ_DEFINE(sym, _bus, _addr, ...)
 Define an MMC5603NJ.
 

Detailed Description

MEMSIC MMC5603NJ magnetometer.

The part has no data-ready interrupt line: while sampling, the driver polls it at the output data rate. Reads run a single measurement when not sampling.

PBL_MMC5603NJ_DEFINE(s_mmc5603nj, &s_i2c2, 0x30,
PBL_SENSOR_MOUNT_MATRIX(0, -1, 0, 1, 0, 0, 0, 0, 1));
const struct pbl_sensor *const MAG = &s_mmc5603nj;
A sensor.
Definition driver.h:142
#define PBL_SENSOR_MOUNT_MATRIX(xx, xy, xz, yx, yy, yz, zx, zy, zz)
Initializer for a struct pbl_sensor_mount, from the rows of a mount matrix.
Definition driver.h:61
#define PBL_MMC5603NJ_DEFINE(sym, _bus, _addr,...)
Define an MMC5603NJ.
Definition mmc5603nj.h:65
const struct pbl_sensor *const MAG
The board's magnetometer.

Data Structure Documentation

◆ pbl_mmc5603nj_state

struct pbl_mmc5603nj_state

MMC5603NJ driver state, owned by the driver.

Data Fields
struct pbl_delayed_work poll_timer Polling work.
uint8_t rate_hz Output data rate in Hz, 0 when not sampling.
bool report Frames are reported as they are sampled.

◆ pbl_mmc5603nj

struct pbl_mmc5603nj

MMC5603NJ magnetometer.

Data Fields
struct pbl_i2c_dev i2c I2C device.
struct pbl_sensor sensor Sensor, child of the I2C bus.
struct pbl_mmc5603nj_state * state Driver state.

Macro Definition Documentation

◆ PBL_MMC5603NJ_DEFINE

#define PBL_MMC5603NJ_DEFINE (   sym,
  _bus,
  _addr,
  ... 
)
Value:
static struct pbl_mmc5603nj_state sym##_mmc5603nj_state; \
PBL_DEVICE_INSTANCE(sym, struct pbl_mmc5603nj, struct pbl_sensor, sensor) { \
.sensor = PBL_SENSOR_INIT(sym, "mmc5603nj", &(_bus)->dev, &pbl_mmc5603nj_ops, \
pbl_mmc5603nj_chans, 0U, __VA_ARGS__), \
.state = &sym##_mmc5603nj_state, .i2c = PBL_I2C_DEV(_bus, _addr), \
}
#define PBL_I2C_DEV(_bus, _addr)
Initializer for a struct pbl_i2c_dev.
Definition i2c.h:159
#define PBL_SENSOR_STREAM_STATE_DEFINE(sym, _num_bufs, _buf_size)
Define the class state of streaming sensor sym, with its batch buffers.
Definition driver.h:181
#define PBL_SENSOR_INIT(sym, _name, _parent, _ops, _chans, _events,...)
Initializer for the struct pbl_sensor of sensor sym.
Definition driver.h:206
MMC5603NJ magnetometer.
Definition mmc5603nj.h:41
MMC5603NJ driver state, owned by the driver.
Definition mmc5603nj.h:31

Define an MMC5603NJ.

Only one instance is supported.

Parameters
symSymbol of the instance, a struct pbl_sensor.
_busI2C bus.
_addr7-bit I2C address.
...Mounting, from PBL_SENSOR_MOUNT_MATRIX().