|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
Interface for electrical status: supply voltage, current, battery status, etc. More...
#include "std.h"#include "generated/airframe.h" Include dependency graph for electrical.h:
 Include dependency graph for electrical.h: This graph shows which files directly or indirectly include this file:
 This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| Data Structures | |
| struct | Electrical | 
| Macros | |
| #define | LOW_BAT_LEVEL 10.5 | 
| low battery level in Volts (for 3S LiPo) | |
| #define | CRITIC_BAT_LEVEL 9.8 | 
| critical battery level in Volts (for 3S LiPo) | |
| Functions | |
| void | electrical_init (void) | 
| void | electrical_periodic (void) | 
| void | electrical_avg_reset (float var) | 
| Variables | |
| struct Electrical | electrical | 
Interface for electrical status: supply voltage, current, battery status, etc.
Definition in file electrical.h.
| struct Electrical | 
Definition at line 44 of file electrical.h.
| Data Fields | ||
|---|---|---|
| uint32_t | avg_cnt | average power counter | 
| uint32_t | avg_power | average power sum | 
| bool | bat_critical | battery critical status | 
| bool | bat_low | battery low status | 
| float | charge | consumed electric charge in Ah | 
| float | current | current in A | 
| float | energy | consumed energy in Wh | 
| float | vboard | board voltage in V | 
| float | vsupply | supply voltage in V | 
| #define CRITIC_BAT_LEVEL 9.8 | 
critical battery level in Volts (for 3S LiPo)
Definition at line 41 of file electrical.h.
| #define LOW_BAT_LEVEL 10.5 | 
low battery level in Volts (for 3S LiPo)
Definition at line 36 of file electrical.h.
Definition at line 274 of file electrical.c.
References Electrical::avg_cnt, Electrical::avg_power, and electrical.
Definition at line 128 of file electrical.c.
References adc_buf_channel(), ADC_CHANNEL_CURRENT, ADC_CHANNEL_VBOARD, ADC_CHANNEL_VSUPPLY, Electrical::avg_cnt, Electrical::avg_power, Electrical::bat_critical, Electrical::bat_low, Electrical::charge, Electrical::current, CURRENT_ESTIMATION_NONLINEARITY, DEFAULT_AV_NB_SAMPLE, electrical, Electrical::energy, foo, preflight_check_register(), Electrical::vboard, and Electrical::vsupply.
Referenced by main_recovery_init().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 166 of file electrical.c.
References autopilot_throttle_killed(), Electrical::avg_cnt, Electrical::avg_power, BAT_CHECKER_DELAY, Electrical::bat_critical, Electrical::bat_low, Electrical::charge, commands, CRITIC_BAT_LEVEL, Electrical::current, electrical, Electrical::energy, foo, LOW_BAT_LEVEL, MAX_PPRZ, MilliAmpereOfAdc, MIN_BAT_LEVEL, Electrical::vboard, VBoardOfAdc, VoltageOfAdc, and Electrical::vsupply.
Referenced by main_fbw_periodic(), and main_recovery_periodic().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | extern | 
Definition at line 92 of file electrical.c.
Referenced by actuators_bebop_commit(), actuators_disco_commit(), actuators_uavcan_esc_status_cb(), actuators_uavcan_send_esc(), attitude_loop(), autopilot_failsafe_checks(), bat_checker_periodic(), bat_voltage_ardrone2_periodic(), battery_monitor_read_bus(), bf_adcGetChannel(), bf_getAmperage(), bf_getBatteryVoltage(), bf_getLegacyBatteryVoltage(), bf_getMAhDrawn(), calc_flight_time_left(), draw_osd(), electrical_avg_reset(), electrical_init(), electrical_periodic(), esc_msg_send(), ezcurrent_read_event(), generic_com_periodic(), gsm_send_report_continue(), guidance_module_run(), handle_battery(), hott_update_eam_msg(), imu_mag_raw_cb(), intermcu_parse_IMCU_FBW_STATUS(), intermcu_send_status(), mavlink_send_battery_status(), mavlink_send_sys_status(), monitor_task(), nps_electrical_run_step(), power_uavcan_battery_cb(), power_uavcan_circuit_cb(), rpm_sensor_send_motor(), send_energy(), send_fbw_status(), send_fbw_status(), send_mag_current(), send_minimal_com(), send_status(), send_status(), send_windtunnel_meas(), sensors_hitl_periodic(), and v_ctl_guidance_loop().