Paparazzi UAS  v5.8.2_stable-0-g6260b7c
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 46 of file electrical.h.

Data Fields
bool_t bat_critical battery critical status
bool_t 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

Macro Definition Documentation

#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().

Function Documentation

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, FALSE, 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