new standalone drivers/system_power (split out of adc)

- system_power portion of drivers/adc split into a new standalone module (drivers/system_power)
 - additional availability flags added to system_power.msg so we know what boards even support (previously certain flags were faked if not available)
 - drivers/system_power scheduled at minimum rate by default, but now also scheduled immediately on any relevant GPIO events
 - now instead of running at 100 Hz with heavily reduced logging we can run at a minimal rate, log at full rate, and catch relevant changes immediately
This commit is contained in:
Daniel Agar
2020-08-08 14:24:58 -04:00
parent cee4016665
commit 3fff512ec0
127 changed files with 863 additions and 1017 deletions
+29 -20
View File
@@ -1,21 +1,30 @@
uint64 timestamp # time since system start (microseconds)
float32 voltage5v_v # peripheral 5V rail voltage
float32[4] sensors3v3 # Sensors 3V3 rail voltage
uint8 sensors3v3_valid # Sensors 3V3 rail voltage was read (bitfield).
uint8 usb_connected # USB is connected when 1
uint8 brick_valid # brick bits power is good when bit 1
uint8 usb_valid # USB is valid when 1
uint8 servo_valid # servo power is good when 1
uint8 periph_5v_oc # peripheral overcurrent when 1
uint8 hipower_5v_oc # high power peripheral overcurrent when 1
uint8 comp_5v_valid # 5V to companion valid
uint8 can1_gps1_5v_valid # 5V for CAN1/GPS1 valid
uint64 timestamp # time since system start (microseconds)
uint8 BRICK1_VALID_SHIFTS=0
uint8 BRICK1_VALID_MASK=1
uint8 BRICK2_VALID_SHIFTS=1
uint8 BRICK2_VALID_MASK=2
uint8 BRICK3_VALID_SHIFTS=2
uint8 BRICK3_VALID_MASK=4
uint8 BRICK4_VALID_SHIFTS=3
uint8 BRICK4_VALID_MASK=8
bool voltage5v_available # peripheral 5V rail voltage status available
float32 voltage5v_v # peripheral 5V rail voltage
bool[4] sensors3v3_available # sensor 3.3V rail voltage status available
float32[4] sensors3v3 # Sensors 3V3 rail voltage
bool usb_connected # USB is connected when true
bool usb_power_valid # On USB power when true
bool servo_power_available # servo power status available
bool servo_power_valid # servo power is good when true
bool peripheral_5v_available # 5V peripheral status available
bool peripheral_5v_overcurrent # 5V peripheral overcurrent when true
bool hipower_5v_available # 5V hi power peripheral status available
bool hipower_5v_overcurrent # 5V hi power peripheral overcurrent when true
bool comp_5v_available # 5V to companion status available
bool comp_5v_valid # 5V to companion valid
bool can1_gps1_5v_available # 5V for CAN1/GPS1 status available
bool can1_gps1_5v_valid # 5V for CAN1/GPS1 valid
uint8 bricks_supported
bool[4] brick_valid # brick power is good when true
float32[4] brick_voltage_adc # brick voltage ADC
float32[4] brick_current_adc # brick current ADC