Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
electrical.h File Reference

Interface for electrical status: supply voltage, current, battery status, etc. More...

#include "std.h"
#include "generated/airframe.h"
+ Include dependency graph for electrical.h:
+ 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) 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
 

Detailed Description

Interface for electrical status: supply voltage, current, battery status, etc.

Definition in file electrical.h.


Data Structure Documentation

struct Electrical

Definition at line 44 of file electrical.h.

Data Fields
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 vsupply supply voltage in V

Macro Definition Documentation

#define CRITIC_BAT_LEVEL   9.8

critical battery level in Volts (for 3S LiPo)

Definition at line 41 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().

Function Documentation

void electrical_init ( void  )

Definition at line 100 of file electrical.c.

References adc_buf_channel(), ADC_CHANNEL_CURRENT, ADC_CHANNEL_VSUPPLY, Electrical::bat_critical, Electrical::bat_low, Electrical::charge, Electrical::current, CURRENT_ESTIMATION_NONLINEARITY, DEFAULT_AV_NB_SAMPLE, Electrical::energy, and Electrical::vsupply.

Referenced by init_fbw(), and main_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation