Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
electrical.c File Reference

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

#include "modules/energy/electrical.h"
#include "mcu_periph/adc.h"
#include "modules/core/commands.h"
#include "autopilot.h"
#include "generated/airframe.h"
#include "generated/modules.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 MIN_BAT_LEVEL   3
 
#define TAKEOFF_BAT_LEVEL   LOW_BAT_LEVEL
 
#define VoltageOfAdc(adc)   DefaultVoltageOfAdc(adc)
 
#define VBoardOfAdc(adc)   DefaultVBoardOfAdc(adc)
 
#define MilliAmpereOfAdc(adc)   DefaultMilliAmpereOfAdc(adc)
 
#define CURRENT_ESTIMATION_NONLINEARITY   1.2
 

Functions

void electrical_init (void)
 
void electrical_periodic (void)
 
void electrical_avg_reset (float var)
 

Variables

struct Electrical electrical
 

Detailed Description

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

Definition in file electrical.c.

Macro Definition Documentation

◆ BAT_CHECKER_DELAY

#define BAT_CHECKER_DELAY   5

Definition at line 53 of file electrical.c.

◆ CURRENT_ESTIMATION_NONLINEARITY

#define CURRENT_ESTIMATION_NONLINEARITY   1.2

Definition at line 80 of file electrical.c.

◆ MilliAmpereOfAdc

#define MilliAmpereOfAdc (   adc)    DefaultMilliAmpereOfAdc(adc)

Definition at line 76 of file electrical.c.

◆ MIN_BAT_LEVEL

#define MIN_BAT_LEVEL   3

Definition at line 57 of file electrical.c.

◆ TAKEOFF_BAT_LEVEL

#define TAKEOFF_BAT_LEVEL   LOW_BAT_LEVEL

Definition at line 61 of file electrical.c.

◆ VBoardOfAdc

#define VBoardOfAdc (   adc)    DefaultVBoardOfAdc(adc)

Definition at line 73 of file electrical.c.

◆ VoltageOfAdc

#define VoltageOfAdc (   adc)    DefaultVoltageOfAdc(adc)

Definition at line 70 of file electrical.c.

Function Documentation

◆ electrical_avg_reset()

void electrical_avg_reset ( float  var)

Definition at line 274 of file electrical.c.

References Electrical::avg_cnt, Electrical::avg_power, and electrical.

◆ electrical_init()

◆ electrical_periodic()

Variable Documentation

◆ electrical