Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
electrical.c File Reference

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>
+ Include dependency graph for electrical.c:

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
 

Detailed Description

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

Definition in file electrical.c.

Macro Definition Documentation

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

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