From 54f1873785e218c72c131623ecc93df1f71e08f7 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Sat, 19 Feb 2022 14:22:23 -0500 Subject: documentation and such --- .../sensor/accelerometer_data_acquisition_face.c | 2 +- .../sensor/accelerometer_data_acquisition_face.h | 26 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'movement/watch_faces') diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c index ea50ad27..cf441031 100644 --- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c +++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c @@ -25,6 +25,7 @@ #include #include #include "accelerometer_data_acquisition_face.h" +#include "lis2dw.h" static const char activity_types[][3] = { "ID", // Idle @@ -61,7 +62,6 @@ void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, ui state->beep_with_countdown = true; state->countdown_length = 10; } - // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } void accelerometer_data_acquisition_face_activate(movement_settings_t *settings, void *context) { diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h index b3fdbbd7..e29b9909 100644 --- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h +++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h @@ -35,28 +35,28 @@ typedef union { struct { union { - int16_t record_type : 2; - int16_t range : 2; - int16_t temperature : 12; + int16_t record_type : 2; // see above, helps us identify record types when reading back + int16_t range : 2; // accelerometer range (see lis2dw_range_t) + int16_t temperature : 12; // raw value from the temperature sensor } info; - int8_t char1 : 8; - int8_t char2 : 8; - int32_t timestamp : 32; + int8_t char1 : 8; // First character of the activity type + int8_t char2 : 8; // Second character of the activity type + int32_t timestamp : 32; // UNIX timestamp for the measurement } header; struct { union { - int16_t mode : 2; - int16_t accel : 14; + int16_t record_type : 2; // duplicate; this is the same field as info above + int16_t accel : 14; // X acceleration value, raw } x; union { - int16_t lpmode : 2; - int16_t accel : 14; + int16_t lpmode : 2; // low power mode (see lis2dw_low_power_mode_t) + int16_t accel : 14; // Y acceleration value, raw } y; union { - int16_t filter : 2; - int16_t accel : 14; + int16_t filter : 2; // bandwidth filtering selection (see lis2dw_bandwidth_filtering_mode_t) + int16_t accel : 14; // Z acceleration value, raw } z; - int32_t counter : 16; + int32_t counter : 16; // number of seconds since timestamp in header } data; uint64_t value; } accelerometer_data_acquisition_record_t; -- cgit v1.2.3