diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2023-12-17 17:59:25 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-01-19 11:55:15 -0500 |
commit | 266e96621c0133e1192bbaec5addb6bcf443a203 (patch) | |
tree | 1f4396874db47db20aa75feb09757204c13b2c98 /src/sensor_bulk.h | |
parent | dc6182f3b339b990c8a68940f02a210e332be269 (diff) | |
download | kutter-266e96621c0133e1192bbaec5addb6bcf443a203.tar.gz kutter-266e96621c0133e1192bbaec5addb6bcf443a203.tar.xz kutter-266e96621c0133e1192bbaec5addb6bcf443a203.zip |
sensor_bulk: New C file with helper code for sending bulk sensor measurements
Refactor the low-level "bulk sensor" management code in the mcu. This
updates the sensor_adxl345.c, sensor_mpu9250.c, sensor_lis2dw.c, and
sensor_angle.c code to use the same "bulk sensor" messages. All of
these sensors will now send "sensor_bulk_data" and
"sensor_bulk_status" messages.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sensor_bulk.h')
-rw-r--r-- | src/sensor_bulk.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sensor_bulk.h b/src/sensor_bulk.h new file mode 100644 index 00000000..9c130bea --- /dev/null +++ b/src/sensor_bulk.h @@ -0,0 +1,15 @@ +#ifndef __SENSOR_BULK_H +#define __SENSOR_BULK_H + +struct sensor_bulk { + uint16_t sequence, possible_overflows; + uint8_t data_count; + uint8_t data[52]; +}; + +void sensor_bulk_reset(struct sensor_bulk *sb); +void sensor_bulk_report(struct sensor_bulk *sb, uint8_t oid); +void sensor_bulk_status(struct sensor_bulk *sb, uint8_t oid + , uint32_t time1, uint32_t query_ticks, uint32_t fifo); + +#endif // sensor_bulk.h |