Paparazzi UAS
v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
|
Implemnetation for electrical status: supply voltage, current, battery status, etc. More...
#include "subsystems/electrical.h"
#include "mcu_periph/adc.h"
#include "subsystems/commands.h"
#include "autopilot.h"
#include "generated/airframe.h"
#include <BOARD_CONFIG>
Go to the source code of this file.
Macros | |
#define | BAT_CHECKER_DELAY 5 |
#define | ELECTRICAL_PERIODIC_FREQ 10 |
#define | MIN_BAT_LEVEL 3 |
#define | VoltageOfAdc(adc) DefaultVoltageOfAdc(adc) |
#define | MilliAmpereOfAdc(adc) DefaultMilliAmpereOfAdc(adc) |
#define | CURRENT_ESTIMATION_NONLINEARITY 1.2 |
Functions | |
void | electrical_init (void) |
void | electrical_periodic (void) |
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 52 of file electrical.c.
Referenced by electrical_periodic().
#define CURRENT_ESTIMATION_NONLINEARITY 1.2 |
Definition at line 89 of file electrical.c.
Referenced by electrical_init().
#define ELECTRICAL_PERIODIC_FREQ 10 |
Definition at line 55 of file electrical.c.
Referenced by electrical_periodic().
#define MilliAmpereOfAdc | ( | adc | ) | DefaultMilliAmpereOfAdc(adc) |
Definition at line 85 of file electrical.c.
Referenced by electrical_periodic().
#define MIN_BAT_LEVEL 3 |
Definition at line 58 of file electrical.c.
Referenced by electrical_periodic().
#define VoltageOfAdc | ( | adc | ) | DefaultVoltageOfAdc(adc) |
Definition at line 82 of file electrical.c.
Referenced by electrical_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 autopilot_throttle_killed(), BAT_CHECKER_DELAY, Electrical::bat_critical, Electrical::bat_low, commands, CRITIC_BAT_LEVEL, Electrical::current, ELECTRICAL_PERIODIC_FREQ, Electrical::energy, 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(), actuators_disco_commit(), bat_checker_periodic(), bat_read(), bat_voltage_ardrone2_periodic(), battery_monitor_read_bus(), 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().