|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | battery_t |
Macros | |
| #define | BATTERY_MV_AT_FULL_SCALE 10624U /* 3320 mV / 0.3125 */ |
| #define | BATTERY_ADC_FULL_SCALE 65535U /* ADC1, 16-bit */ |
| #define | BATTERY_WARN_MV 7000U |
| #define | BATTERY_FAIL_MV 6600U |
| #define | BATTERY_MAX_MV 8800U |
Enumerations | |
| enum | battery_state_t { BATTERY_UNKNOWN = 0 , BATTERY_OK , BATTERY_WARN , BATTERY_FAIL , BATTERY_USB , BATTERY_INVALID } |
Functions | |
| uint16_t | battery_counts_to_mv (uint32_t counts) |
| battery_t | battery_assess (bool valid, uint32_t counts, bool on_usb) |
| const char * | battery_state_name (battery_state_t state) |
| #define BATTERY_ADC_FULL_SCALE 65535U /* ADC1, 16-bit */ |
Definition at line 30 of file battery.h.
Referenced by battery_assess(), and battery_counts_to_mv().
| #define BATTERY_FAIL_MV 6600U |
Definition at line 33 of file battery.h.
Referenced by battery_assess().
| #define BATTERY_MAX_MV 8800U |
Definition at line 36 of file battery.h.
Referenced by battery_assess().
| #define BATTERY_MV_AT_FULL_SCALE 10624U /* 3320 mV / 0.3125 */ |
Definition at line 29 of file battery.h.
Referenced by battery_counts_to_mv().
| #define BATTERY_WARN_MV 7000U |
Definition at line 32 of file battery.h.
Referenced by battery_assess().
| enum battery_state_t |
| battery_t battery_assess | ( | bool | valid, |
| uint32_t | counts, | ||
| bool | on_usb ) |
Definition at line 12 of file battery.c.
References b, BATTERY_ADC_FULL_SCALE, battery_counts_to_mv(), BATTERY_FAIL, BATTERY_FAIL_MV, BATTERY_INVALID, BATTERY_MAX_MV, BATTERY_OK, BATTERY_USB, BATTERY_WARN, BATTERY_WARN_MV, and on_usb().
Referenced by bringup_task(), test_all_pass_on_battery_is_ready(), test_gps_reports_its_baud(), test_optional_chip_or_low_battery_is_warn(), test_required_chip_or_bad_battery_is_fail(), test_thresholds(), and test_usb_is_not_judged().
| uint16_t battery_counts_to_mv | ( | uint32_t | counts | ) |
Definition at line 3 of file battery.c.
References BATTERY_ADC_FULL_SCALE, and BATTERY_MV_AT_FULL_SCALE.
Referenced by battery_assess(), and test_conversion().
| const char * battery_state_name | ( | battery_state_t | state | ) |
Definition at line 31 of file battery.c.
References BATTERY_FAIL, BATTERY_INVALID, BATTERY_OK, BATTERY_USB, BATTERY_WARN, and state.
Referenced by boot_report_build().