Simulated sensors, measuring what their simulator API sets.
More...
|
| #define | SIM_TEMP (&pbl_temp_sim) |
| | The simulated temperature sensor, at 25 degrees Celsius until set.
|
| |
| #define | SIM_MAG (&pbl_mag_sim) |
| | The simulated magnetometer, measuring no field until set.
|
| |
| #define | PBL_ACCEL_SIM_QUEUE_SIZE 256U |
| | Number of samples the replay queue of the simulated accelerometer holds.
|
| |
| #define | SIM_ACCEL (&pbl_accel_sim) |
| | The simulated accelerometer, replaying the samples and events it is fed.
|
| |
Simulated sensors, measuring what their simulator API sets.
◆ 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. |
◆ PBL_ACCEL_SIM_QUEUE_SIZE
| #define PBL_ACCEL_SIM_QUEUE_SIZE 256U |
Number of samples the replay queue of the simulated accelerometer holds.
◆ SIM_ACCEL
| #define SIM_ACCEL (&pbl_accel_sim) |
The 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 device lying still, face up, until the first one. The simulated part has no FIFO: it reports every frame while it has a sampling frequency and a report latency.
◆ SIM_MAG
| #define SIM_MAG (&pbl_mag_sim) |
The simulated magnetometer, measuring no field until set.
While sampling, the field is reported once per sampling interval, whatever the report latency.
◆ SIM_TEMP
| #define SIM_TEMP (&pbl_temp_sim) |
The simulated temperature sensor, at 25 degrees Celsius until set.
◆ pbl_accel_sim_feed()
Queue samples for the simulated accelerometer to replay.
Samples that do not fit in the queue are dropped.
- Parameters
-
| sensor | Sensor. |
| samples | Samples, in the device frame. |
| count | Number of samples. |
- Returns
- Number of samples queued.
◆ pbl_accel_sim_flush()
| void pbl_accel_sim_flush |
( |
const struct pbl_sensor * |
sensor | ) |
|
Drop the queued samples, keeping the last one replayed latched.
- Parameters
-
◆ pbl_accel_sim_report_event()
Report an event, as if the simulated accelerometer detected it.
Dropped while detection of that event type is disabled, as on real hardware. The event is timed as it is reported.
- Parameters
-
| sensor | Sensor. |
| event | Event, in the device frame. |
◆ pbl_mag_sim_set()
| void pbl_mag_sim_set |
( |
const struct pbl_sensor * |
sensor, |
|
|
int32_t |
x, |
|
|
int32_t |
y, |
|
|
int32_t |
z |
|
) |
| |
Set the magnetic field the simulated magnetometer measures.
- Parameters
-
| sensor | Sensor. |
| x | Field along the device X axis, in nanotesla. |
| y | Field along the device Y axis, in nanotesla. |
| z | Field along the device Z axis, in nanotesla. |
◆ pbl_temp_sim_set()
| void pbl_temp_sim_set |
( |
const struct pbl_sensor * |
sensor, |
|
|
int32_t |
millicelsius |
|
) |
| |
Set the temperature the simulated temperature sensor reads.
- Parameters
-
| sensor | Sensor. |
| millicelsius | Temperature in millidegrees Celsius. |