PebbleOS v4.47.0
Loading...
Searching...
No Matches

Simulated accelerometer, replaying the samples and events it is fed. More...

Data Structures

struct  pbl_accel_sim_sample
 Simulated accelerometer sample. More...
 

Macros

#define PBL_ACCEL_SIM_QUEUE_SIZE   256U
 Number of samples the replay queue holds.
 
#define SIM_ACCEL   (&pbl_accel_sim)
 The simulated accelerometer.
 

Functions

size_t pbl_accel_sim_feed (const struct pbl_accel *accel, const struct pbl_accel_sim_sample *samples, size_t count)
 Queue samples for replay.
 
void pbl_accel_sim_flush (const struct pbl_accel *accel)
 Drop the queued samples, keeping the last one replayed latched.
 
void pbl_accel_sim_report_event (const struct pbl_accel *accel, const struct pbl_accel_event *event)
 Report an event, as if the part detected it.
 

Detailed Description

Simulated accelerometer, replaying the samples and events it is fed.

Fed samples are replayed one per sampling interval, the last one being latched once the queue runs out: a watch lying still, face up, until the first one. The simulated part has no FIFO.


Data Structure Documentation

◆ pbl_accel_sim_sample

struct pbl_accel_sim_sample

Simulated accelerometer sample.

Data Fields
int16_t x Acceleration along the x axis, in milli-g.
int16_t y Acceleration along the y axis, in milli-g.
int16_t z Acceleration along the z axis, in milli-g.

Macro Definition Documentation

◆ PBL_ACCEL_SIM_QUEUE_SIZE

#define PBL_ACCEL_SIM_QUEUE_SIZE   256U

Number of samples the replay queue holds.

◆ SIM_ACCEL

#define SIM_ACCEL   (&pbl_accel_sim)

The simulated accelerometer.

Function Documentation

◆ pbl_accel_sim_feed()

size_t pbl_accel_sim_feed ( const struct pbl_accel *  accel,
const struct pbl_accel_sim_sample *  samples,
size_t  count 
)

Queue samples for replay.

Samples that do not fit in the queue are dropped.

Parameters
accelDevice.
samplesSamples.
countNumber of samples.
Returns
Number of samples queued.

◆ pbl_accel_sim_flush()

void pbl_accel_sim_flush ( const struct pbl_accel *  accel)

Drop the queued samples, keeping the last one replayed latched.

Parameters
accelDevice.

◆ pbl_accel_sim_report_event()

void pbl_accel_sim_report_event ( const struct pbl_accel *  accel,
const struct pbl_accel_event *  event 
)

Report an event, as if the part detected it.

Dropped while detection of that event type is disabled, as on real hardware.

Parameters
accelDevice.
eventEvent.