|
PebbleOS v4.47.0-512-g5285d4236
|
MEMSIC MMC5603NJ Magnetometer driver. More...
Modules | |
| MMC5603NJ registers | |
| MMC5603NJ register map, from the MEMSIC datasheet (Rev. | |
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. | |
MEMSIC MMC5603NJ Magnetometer driver.
The part has no data-ready interrupt line: while sampling, the driver polls it at the output data rate.
| 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 | rotated | Watch mounted rotated 180 degrees: X and Y are inverted. |
| struct pbl_mmc5603nj |
MMC5603NJ magnetometer.
| Data Fields | ||
|---|---|---|
| int8_t | axis_dir[3] | Direction of each watch axis: 1 or -1. |
| uint8_t | axis_map[3] | Sensor axis feeding each watch axis (0: X, 1: Y, 2: Z). |
| struct pbl_i2c_dev | i2c | I2C device. |
| struct pbl_mag | mag | Magnetometer, child of the I2C bus. |
| struct pbl_mmc5603nj_state * | state | Driver state. |
| #define PBL_MMC5603NJ_DEFINE | ( | sym, | |
| _bus, | |||
| _addr, | |||
| ... | |||
| ) |
Define an MMC5603NJ.
Only one instance is supported.
| sym | Symbol of the instance, a struct pbl_mag. |
| _bus | I2C bus. |
| _addr | 7-bit I2C address. |
| ... | Designated initializers of the remaining fields: axis_map and axis_dir. |