|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <stdbool.h>#include <stdint.h>#include "dev_bus.h"#include "dev_ms5611.h"#include "records.h"Go to the source code of this file.
Classes | |
| struct | sensors_device_t |
| struct | sensors_core_t |
Macros | |
| #define | SENSORS_EV_IMU (1U << 0) |
| #define | SENSORS_EV_HIGHG (1U << 1) |
| #define | SENSORS_IMU_PERIOD_US 1200U /* 833 Hz (ISM330DHCX ODR) */ |
| #define | SENSORS_HIGHG_PERIOD_US 2500U /* 400 Hz (H3LIS100DL ODR) */ |
| #define | SENSORS_BARO_STEP_US (MS5611_CONVERSION_MS * 1000U) |
| #define | SENSORS_RETRY_US 1000000U |
| #define | SENSORS_MAX_ERRORS 3U |
Typedefs | |
| typedef record_sink_t | sensors_sink_t |
Functions | |
| void | sensors_core_init (sensors_core_t *core, uint32_t now_us) |
| void | sensors_core_stop (sensors_core_t *core) |
| void | sensors_core_step (sensors_core_t *core, uint32_t events, uint32_t imu_edge_us, uint32_t highg_edge_us, uint32_t now_us) |
| uint32_t | sensors_core_wait_us (const sensors_core_t *core, uint32_t now_us) |
| #define SENSORS_BARO_STEP_US (MS5611_CONVERSION_MS * 1000U) |
Definition at line 34 of file sensors_core.h.
Referenced by check_sample_values(), step_baro(), and test_wait_never_overshoots_a_deadline().
| #define SENSORS_EV_HIGHG (1U << 1) |
Definition at line 30 of file sensors_core.h.
Referenced by fly(), run(), sensors_core_step(), and sensors_task().
| #define SENSORS_EV_IMU (1U << 0) |
Definition at line 29 of file sensors_core.h.
Referenced by fly(), run(), sensors_core_step(), and sensors_task().
| #define SENSORS_HIGHG_PERIOD_US 2500U /* 400 Hz (H3LIS100DL ODR) */ |
Definition at line 33 of file sensors_core.h.
Referenced by check_timestamps(), fly(), rig_init(), run(), sensors_core_step(), sensors_core_wait_us(), test_stop_powers_down_and_init_restarts(), and world_init().
| #define SENSORS_IMU_PERIOD_US 1200U /* 833 Hz (ISM330DHCX ODR) */ |
Definition at line 32 of file sensors_core.h.
Referenced by check_fault_imu_silent(), check_timestamps(), fly(), rig_init(), run(), sensors_core_step(), sensors_core_wait_us(), test_stop_powers_down_and_init_restarts(), test_wait_never_overshoots_a_deadline(), and world_init().
| #define SENSORS_MAX_ERRORS 3U |
Definition at line 36 of file sensors_core.h.
Referenced by failed(), and test_failing_imu_is_dropped_and_recovered().
| #define SENSORS_RETRY_US 1000000U |
Definition at line 35 of file sensors_core.h.
Referenced by check_fault_imu_silent(), failed(), init_baro(), init_highg(), init_imu(), sensors_core_wait_us(), test_failing_imu_is_dropped_and_recovered(), and test_wrong_chip_never_produces_and_keeps_retrying().
| typedef record_sink_t sensors_sink_t |
Definition at line 38 of file sensors_core.h.
| void sensors_core_init | ( | sensors_core_t * | core, |
| uint32_t | now_us ) |
Definition at line 63 of file sensors_core.c.
References init_baro(), init_highg(), and init_imu().
Referenced by rig_init(), sensors_task(), test_stop_powers_down_and_init_restarts(), and world_init().
| void sensors_core_step | ( | sensors_core_t * | core, |
| uint32_t | events, | ||
| uint32_t | imu_edge_us, | ||
| uint32_t | highg_edge_us, | ||
| uint32_t | now_us ) |
Definition at line 157 of file sensors_core.c.
References sensors_core_t::baro, sensors_core_t::baro_due_us, sensors_core_t::highg, sensors_core_t::highg_last_us, sensors_core_t::imu, sensors_core_t::imu_last_us, init_baro(), init_highg(), init_imu(), sensors_device_t::missed_drdy, sensors_device_t::ok, reached(), read_highg(), read_imu(), sensors_device_t::retry_at_us, SENSORS_EV_HIGHG, SENSORS_EV_IMU, SENSORS_HIGHG_PERIOD_US, SENSORS_IMU_PERIOD_US, and step_baro().
Referenced by fly(), run(), and sensors_task().
| void sensors_core_stop | ( | sensors_core_t * | core | ) |
Definition at line 69 of file sensors_core.c.
References sensors_core_t::baro, sensors_core_t::baro_phase, h3lis_power_down(), sensors_core_t::highg, sensors_core_t::highg_bus, sensors_core_t::imu, sensors_core_t::imu_bus, ism330_power_down(), and sensors_device_t::ok.
Referenced by sensors_task(), and test_stop_powers_down_and_init_restarts().
| uint32_t sensors_core_wait_us | ( | const sensors_core_t * | core, |
| uint32_t | now_us ) |
Definition at line 202 of file sensors_core.c.
References sensors_core_t::baro, sensors_core_t::baro_due_us, sensors_core_t::highg, sensors_core_t::highg_last_us, sensors_core_t::imu, sensors_core_t::imu_last_us, sensors_device_t::ok, sensors_device_t::retry_at_us, SENSORS_HIGHG_PERIOD_US, SENSORS_IMU_PERIOD_US, SENSORS_RETRY_US, sooner(), and until().
Referenced by fly(), run(), sensors_task(), and test_wait_never_overshoots_a_deadline().