PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros
LIS2DW12

ST LIS2DW12 accelerometer driver board configuration. More...

Data Structures

struct  LIS2DW12State
 LIS2DW12 driver state, owned by the driver. More...
 
struct  LIS2DW12Config
 LIS2DW12 board configuration. More...
 

Macros

#define LIS2DW12_FIFO_SIZE   32
 FIFO depth in samples.
 
#define LIS2DW12_SAMPLE_SIZE_BYTES   6
 Sample size in bytes (X, Y, Z, 16 bits each).
 

Detailed Description

ST LIS2DW12 accelerometer driver board configuration.


Data Structure Documentation

◆ LIS2DW12State

struct LIS2DW12State

LIS2DW12 driver state, owned by the driver.

Data Fields
bool double_tap_detection_enabled Double tap detection requested.
bool initialized Driver initialized.
uint32_t int1_period_ms Expected INT1 period in milliseconds.
RegularTimerInfo int1_wdt_timer Watchdog timer detecting a stalled INT1 stream.
RtcTicks last_fifo_read_tick Time of the last FIFO read.
AccelDriverSample last_sample Most recent sample, returned by peeks while streaming.
bool last_sample_valid last_sample holds a sample.
uint32_t num_recoveries Number of stream recoveries performed.
uint8_t num_samples Samples per FIFO batch requested by the subscribers, 0 when not streaming.
uint8_t raw_sample_buf[DCACHE_ROUND_UP(LIS2DW12_FIFO_SIZE *LIS2DW12_SAMPLE_SIZE_BYTES)] Raw FIFO read buffer, filled with i2c_read_register_block_dma().
bool recovery_pending A stream recovery is queued.
bool rotated Watch mounted rotated 180 degrees: X and Y are inverted.
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.
bool wu_active Wake-up condition currently asserted, to report a shake once per assertion.

◆ LIS2DW12Config

struct LIS2DW12Config

LIS2DW12 board configuration.

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).
I2CSlavePort i2c I2C device.
ExtiConfig int1 INT1 interrupt line.
InputConfig int1_in INT1 input, to read back the pad level.
LIS2DW12State * state Driver state.

Macro Definition Documentation

◆ LIS2DW12_FIFO_SIZE

#define LIS2DW12_FIFO_SIZE   32

FIFO depth in samples.

◆ LIS2DW12_SAMPLE_SIZE_BYTES

#define LIS2DW12_SAMPLE_SIZE_BYTES   6

Sample size in bytes (X, Y, Z, 16 bits each).