Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
electrical.c File Reference
#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

static float period_to_hour = 1 / 3600.f / ELECTRICAL_PERIODIC_FREQ
 
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 52 of file electrical.c.

◆ CURRENT_ESTIMATION_NONLINEARITY

#define CURRENT_ESTIMATION_NONLINEARITY   1.2

Definition at line 90 of file electrical.c.

◆ ELECTRICAL_PERIODIC_FREQ

#define ELECTRICAL_PERIODIC_FREQ   10

Definition at line 55 of file electrical.c.

◆ MilliAmpereOfAdc

#define MilliAmpereOfAdc (   adc)    DefaultMilliAmpereOfAdc(adc)

Definition at line 86 of file electrical.c.

◆ MIN_BAT_LEVEL

#define MIN_BAT_LEVEL   3

Definition at line 59 of file electrical.c.

◆ VoltageOfAdc

#define VoltageOfAdc (   adc)    DefaultVoltageOfAdc(adc)

Definition at line 83 of file electrical.c.

Function Documentation

◆ electrical_init()

void electrical_init ( void  )

◆ electrical_periodic()

Variable Documentation

◆ electrical

◆ period_to_hour

float period_to_hour = 1 / 3600.f / ELECTRICAL_PERIODIC_FREQ
static

Definition at line 56 of file electrical.c.

Referenced by electrical_periodic().