|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Go to the source code of this file.
Macros | |
| #define | IDLE_ADC_FULL_SCALE 65535U |
| #define | IDLE_MV_AT_FULL_SCALE 10624U |
Functions | |
| uint16_t | idle_counts_to_mv (uint32_t raw_counts) |
| static bool | config_valid (const idle_config_t *c) |
| static bool | port_valid (const idle_port_t *p) |
| bool | idle_init (idle_t *idle, const idle_config_t *config, const idle_port_t *port, void *context) |
| bool | idle_enter (idle_t *idle, uint32_t now_ms) |
| static idle_battery_state_t | band_fresh (const idle_config_t *c, uint16_t mv) |
| static idle_battery_state_t | band_next (const idle_config_t *c, idle_battery_state_t previous, uint16_t mv) |
| static void | read_battery (idle_t *idle, uint32_t now_ms) |
| static void | send_heartbeat (idle_t *idle, uint32_t now_ms) |
| static int32_t | ms_until (uint32_t now_ms, uint32_t target_ms) |
| idle_result_t | idle_on_wake (idle_t *idle, uint32_t now_ms) |
| const idle_heartbeat_t * | idle_last_heartbeat (const idle_t *idle) |
| #define IDLE_ADC_FULL_SCALE 65535U |
Definition at line 10 of file idle.c.
Referenced by idle_counts_to_mv(), and read_battery().
| #define IDLE_MV_AT_FULL_SCALE 10624U |
Definition at line 11 of file idle.c.
Referenced by idle_counts_to_mv().
|
static |
Definition at line 81 of file idle.c.
References IDLE_BATT_FAIL, IDLE_BATT_OK, and IDLE_BATT_WARN.
Referenced by band_next().
|
static |
Definition at line 96 of file idle.c.
References band_fresh(), idle_config_t::battery_fail_mv, idle_config_t::battery_hysteresis_mv, idle_config_t::battery_warn_mv, IDLE_BATT_FAIL, IDLE_BATT_OK, and IDLE_BATT_WARN.
Referenced by read_battery().
|
static |
Definition at line 24 of file idle.c.
References idle_config_t::battery_fail_mv, idle_config_t::battery_hysteresis_mv, idle_config_t::battery_warn_mv, idle_config_t::callback_budget_ms, idle_config_t::heartbeat_interval_ms, and idle_config_t::wake_tolerance_ms.
| uint16_t idle_counts_to_mv | ( | uint32_t | raw_counts | ) |
Definition at line 13 of file idle.c.
References IDLE_ADC_FULL_SCALE, and IDLE_MV_AT_FULL_SCALE.
Referenced by read_battery(), and test_conversion().
| bool idle_enter | ( | idle_t * | idle, |
| uint32_t | now_ms ) |
Definition at line 70 of file idle.c.
Referenced by idle_task(), anonymous_namespace{idle_e2e.cpp}::run(), setup(), and test_wake_before_enter_is_error().
| bool idle_init | ( | idle_t * | idle, |
| const idle_config_t * | config, | ||
| const idle_port_t * | port, | ||
| void * | context ) |
Definition at line 50 of file idle.c.
References config, config_valid, idle, IDLE_BATT_UNKNOWN, NULL, port, port_valid(), and SELF_TEST_PENDING.
Referenced by idle_task(), setup(), test_init_rejects_bad_input(), test_wake_before_enter_is_error(), and anonymous_namespace{idle_e2e.cpp}::world_init().
| const idle_heartbeat_t * idle_last_heartbeat | ( | const idle_t * | idle | ) |
Definition at line 211 of file idle.c.
Referenced by anonymous_namespace{idle_e2e.cpp}::check_idle_tx_fail(), anonymous_namespace{idle_e2e.cpp}::check_idle_usb(), test_failure_count_saturates(), and test_init_rejects_bad_input().
| idle_result_t idle_on_wake | ( | idle_t * | idle, |
| uint32_t | now_ms ) |
Definition at line 168 of file idle.c.
References idle, IDLE_CMD_ARM, IDLE_CMD_NONE, IDLE_EVENT_ARM_REQUESTED, IDLE_EVENT_ERROR, IDLE_EVENT_SLEEP, IDLE_MAX_COMMANDS_PER_WAKE, ms_until(), NULL, read_battery(), result, and send_heartbeat().
Referenced by idle_task(), anonymous_namespace{idle_e2e.cpp}::run(), test_arm_requested_without_heartbeat(), test_battery_read_before_transmit(), test_clock_and_sequence_wraparound(), test_command_drain_is_bounded(), test_disarm_stays_idle(), test_disarm_then_arm_in_one_wake(), test_early_lsi_wake_within_tolerance(), test_failure_count_saturates(), test_first_wake_sends_heartbeat(), test_hysteresis(), test_init_rejects_bad_input(), test_invalid_battery_still_sends(), test_long_gap_sends_one_heartbeat(), test_radio_wake_does_not_delay_heartbeat(), test_send_failure_counted_and_sleep_continues(), test_sixty_seconds_gives_six_heartbeats(), test_thresholds(), test_usb_is_never_battery_health(), and test_wake_before_enter_is_error().
|
static |
Definition at line 164 of file idle.c.
Referenced by idle_on_wake().
|
static |
|
static |
Definition at line 120 of file idle.c.
References band_next(), idle, IDLE_ADC_FULL_SCALE, IDLE_BATT_INVALID, IDLE_BATT_USB, idle_counts_to_mv(), self_test_battery_t::raw_counts, self_test_battery_t::reply, self_test_reply_t::result, SELF_TEST_PASS, and self_test_battery_t::valid.
Referenced by idle_on_wake(), and idle_task().
|
static |
Definition at line 145 of file idle.c.
References idle, reply(), and SELF_TEST_PASS.
Referenced by idle_on_wake(), and idle_task().