Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
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"
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) More... | |
#define | CRITIC_BAT_LEVEL 9.8 |
critical battery level in Volts (for 3S LiPo) More... | |
Functions | |
void | electrical_init (void) |
void | electrical_periodic (void) |
Variables | |
struct Electrical | electrical |
Interface for electrical status: supply voltage, current, battery status, etc.
Definition in file electrical.h.
struct Electrical |
Definition at line 46 of file electrical.h.
Data Fields | ||
---|---|---|
bool | bat_critical | battery critical status |
bool | bat_low | battery low status |
int32_t | consumed | consumption in mAh |
int32_t | current | current in milliamps |
float | energy | consumed energy in mAh |
uint16_t | vsupply | supply voltage in decivolts |
#define CRITIC_BAT_LEVEL 9.8 |
critical battery level in Volts (for 3S LiPo)
Definition at line 42 of file electrical.h.
Referenced by electrical_periodic().
#define LOW_BAT_LEVEL 10.5 |
low battery level in Volts (for 3S LiPo)
Definition at line 36 of file electrical.h.
Referenced by electrical_periodic(), and max7456_periodic().
void electrical_init | ( | void | ) |
Definition at line 99 of file electrical.c.
References adc_buf_channel(), ADC_CHANNEL_CURRENT, ADC_CHANNEL_VSUPPLY, Electrical::bat_critical, Electrical::bat_low, Electrical::current, CURRENT_ESTIMATION_NONLINEARITY, DEFAULT_AV_NB_SAMPLE, Electrical::energy, and Electrical::vsupply.
Referenced by init_fbw(), and main_init().
void electrical_periodic | ( | void | ) |
Definition at line 121 of file electrical.c.
References BAT_CHECKER_DELAY, Electrical::bat_critical, Electrical::bat_low, commands, CRITIC_BAT_LEVEL, Electrical::current, ELECTRICAL_PERIODIC_FREQ, Electrical::energy, kill_throttle, LOW_BAT_LEVEL, MAX_PPRZ, MilliAmpereOfAdc, MIN_BAT_LEVEL, VoltageOfAdc, and Electrical::vsupply.
Referenced by handle_periodic_tasks(), handle_periodic_tasks_fbw(), and sim_periodic_task().
struct Electrical electrical |
Definition at line 65 of file electrical.c.
Referenced by actuators_bebop_commit(), bat_checker_periodic(), bat_voltage_ardrone2_periodic(), ezcurrent_init(), ezcurrent_read_event(), failsafe_check(), generic_com_periodic(), hott_update_eam_msg(), intermcu_send_status(), mavlink_send_battery_status(), mavlink_send_sys_status(), max7456_periodic(), nps_electrical_run_step(), rpm_sensor_send_motor(), send_energy(), send_fbw_status(), send_imu_mag_current(), send_status(), and update_bat().