|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Implemnetation for electrical status: supply voltage, current, battery status, etc. More...
#include "modules/energy/electrical.h"#include "mcu_periph/adc.h"#include "modules/core/commands.h"#include "autopilot.h"#include "generated/airframe.h"#include "generated/modules.h"#include <BOARD_CONFIG>Go to the source code of this file.
Macros | |
| #define | BAT_CHECKER_DELAY 5 |
| #define | MIN_BAT_LEVEL 3 |
| #define | TAKEOFF_BAT_LEVEL LOW_BAT_LEVEL |
| #define | VoltageOfAdc(adc) |
| #define | VBoardOfAdc(adc) |
| #define | MilliAmpereOfAdc(adc) |
| #define | CURRENT_ESTIMATION_NONLINEARITY 1.2 |
Functions | |
| void | electrical_init (void) |
| void | electrical_periodic (void) |
| void | electrical_avg_reset (float var) |
Variables | |
| struct Electrical | electrical |
Implemnetation for electrical status: supply voltage, current, battery status, etc.
Definition in file electrical.c.
| #define BAT_CHECKER_DELAY 5 |
Definition at line 53 of file electrical.c.
Referenced by electrical_periodic().
| #define CURRENT_ESTIMATION_NONLINEARITY 1.2 |
Definition at line 80 of file electrical.c.
Referenced by electrical_init().
| #define MilliAmpereOfAdc | ( | adc | ) |
| #define MIN_BAT_LEVEL 3 |
Definition at line 57 of file electrical.c.
Referenced by electrical_periodic().
| #define TAKEOFF_BAT_LEVEL LOW_BAT_LEVEL |
Definition at line 61 of file electrical.c.
| #define VBoardOfAdc | ( | adc | ) |
Definition at line 73 of file electrical.c.
Referenced by electrical_periodic().
| #define VoltageOfAdc | ( | adc | ) |
Definition at line 70 of file electrical.c.
Referenced by electrical_periodic().
| void electrical_avg_reset | ( | float | var | ) |
Definition at line 272 of file electrical.c.
References electrical.
| void electrical_init | ( | void | ) |
Definition at line 128 of file electrical.c.
References adc_buf_channel(), ADC_CHANNEL_CURRENT, ADC_CHANNEL_VBOARD, ADC_CHANNEL_VSUPPLY, CURRENT_ESTIMATION_NONLINEARITY, DEFAULT_AV_NB_SAMPLE, electrical, and preflight_check_register().
Referenced by main_recovery_init().
| void electrical_periodic | ( | void | ) |
Definition at line 166 of file electrical.c.
References adc_buf_get(), autopilot_throttle_killed(), BAT_CHECKER_DELAY, commands, CRITIC_BAT_LEVEL, electrical, LOW_BAT_LEVEL, MAX_PPRZ, MilliAmpereOfAdc, MIN_BAT_LEVEL, VBoardOfAdc, and VoltageOfAdc.
Referenced by main_fbw_periodic(), and main_recovery_periodic().
| struct Electrical electrical |
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(), 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(), stabilization_indi_set_wls_settings(), and v_ctl_guidance_loop().