|
PebbleOS v4.47.0-1362-gd278268fe
|
ST LSM6DSO accelerometer and gyroscope; only the accelerometer is used. More...
Data Structures | |
| struct | pbl_lsm6dso_state |
| LSM6DSO driver state, owned by the driver. More... | |
| struct | pbl_lsm6dso |
| LSM6DSO accelerometer. More... | |
Macros | |
| #define | LSM6DSO_SAMPLE_SIZE_BYTES 6 |
| Accelerometer sample size in bytes (X, Y, Z, 16 bits each). | |
| #define | LSM6DSO_FIFO_WORD_SIZE_BYTES 7 |
| FIFO word size in bytes as read from FIFO_DATA_OUT (tag byte plus sample). | |
| #define | LSM6DSO_FIFO_THRESHOLD 128 |
| Largest FIFO watermark used, in samples (the FIFO holds up to 512). | |
| #define | LSM6DSO_FIFO_SIZE LSM6DSO_FIFO_THRESHOLD |
| Read buffer capacity in samples, sized to the watermark. | |
| #define | LSM6DSO_NUM_BUFS 2 |
| Number of FIFO read buffers. | |
| #define | PBL_LSM6DSO_DEFINE(sym, _bus, _addr, _mount, ...) |
| Define an LSM6DSO. | |
ST LSM6DSO accelerometer and gyroscope; only the accelerometer is used.
| struct pbl_lsm6dso_state |
LSM6DSO driver state, owned by the driver.
| Data Fields | ||
|---|---|---|
| bool | double_tap_detection_enabled | Double tap detection requested. |
| bool | drain_pending | A FIFO drain stopped for lack of a buffer. |
| bool | fifo_on | The FIFO is batching: a sampling interval and a report latency are set. |
| uint32_t | int1_period_ms | Expected INT1 period in milliseconds. |
| bool | int1_requeued | The INT1 servicing pass was requeued while the pad stayed high. |
| uint64_t | int1_time_us | Time of the last INT1 interrupt, in microseconds of uptime. |
| bool | int1_time_valid | int1_time_us is yet to be used. |
| struct pbl_wallclock_work | int1_wdt_timer | Watchdog timer detecting a stalled INT1 stream. |
| uint64_t | last_fifo_read_tick | Time of the last FIFO read. |
| int32_t | latency_us | Report latency requested in microseconds, or PBL_SENSOR_LATENCY_NONE. |
| uint32_t | num_int1_irqs | Number of INT1 interrupts taken. |
| uint32_t | num_recoveries | Number of stream recoveries performed. |
| uint16_t | num_samples | FIFO watermark in samples, derived from the report latency, 0 for no batches. |
| uint8_t | range | Range in effect, an index among the supported ones. |
| struct pbl_sensor_rate | rate | Measured sampling interval. |
| uint32_t | rate_frames | Frames reported since the last read timed by the INT1 interrupt. |
| bool | recovery_deferred | A stream recovery waits for a buffer to finish draining the FIFO. |
| bool | recovery_pending | A stream recovery is queued. |
| uint32_t | req_interval_us | Sampling interval requested, 0 when only events keep the part sampling. |
| uint32_t | sampling_interval_us | Sampling interval in microseconds, 0 when not sampling. |
| bool | shake_detection_enabled | Shake detection requested. |
| uint8_t | shake_stuck_passes | Consecutive watchdog passes with INT1 stuck high in shake-only mode. |
| uint8_t | wk_ths_curr | Current wake-up (shake) threshold register value. |
| int32_t | wk_ths_mm_s2 | Wake-up (shake) threshold requested, in mm/s². |
| bool | wu_active | Wake-up condition currently asserted, to report a shake once per assertion. |
| struct pbl_lsm6dso |
LSM6DSO accelerometer.
| Data Fields | ||
|---|---|---|
| struct pbl_i2c_dev | i2c | I2C device. |
| struct pbl_irq_spec | int1 | INT1 interrupt line. |
| struct pbl_gpio | int1_in | INT1 input, to read back the pad level. |
| struct pbl_sensor | sensor | Sensor, child of the I2C bus. |
| struct pbl_lsm6dso_state * | state | Driver state. |
| #define LSM6DSO_FIFO_SIZE LSM6DSO_FIFO_THRESHOLD |
Read buffer capacity in samples, sized to the watermark.
| #define LSM6DSO_FIFO_THRESHOLD 128 |
Largest FIFO watermark used, in samples (the FIFO holds up to 512).
| #define LSM6DSO_FIFO_WORD_SIZE_BYTES 7 |
FIFO word size in bytes as read from FIFO_DATA_OUT (tag byte plus sample).
| #define LSM6DSO_NUM_BUFS 2 |
Number of FIFO read buffers.
| #define LSM6DSO_SAMPLE_SIZE_BYTES 6 |
Accelerometer sample size in bytes (X, Y, Z, 16 bits each).
| #define PBL_LSM6DSO_DEFINE | ( | sym, | |
| _bus, | |||
| _addr, | |||
| _mount, | |||
| ... | |||
| ) |
Define an LSM6DSO.
Only one instance is supported.
| sym | Symbol of the instance, a struct pbl_sensor. |
| _bus | I2C bus. |
| _addr | 7-bit I2C address. |
| _mount | Mounting, from PBL_SENSOR_MOUNT_MATRIX(). |
| ... | Designated initializers of the remaining fields: int1 and int1_in. |