Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
electrical.c File Reference
#include "subsystems/electrical.h"
#include "mcu_periph/adc.h"
#include "commands.h"
#include "generated/airframe.h"
+ Include dependency graph for electrical.c:

Go to the source code of this file.

Macros

#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
 
struct {
   struct adc_buf   vsupply_adc_buf
 
electrical_priv
 

Macro Definition Documentation

#define CURRENT_ESTIMATION_NONLINEARITY   1.2

Definition at line 36 of file electrical.c.

Referenced by electrical_init().

#define MilliAmpereOfAdc (   adc)    DefaultMilliAmpereOfAdc(adc)

Definition at line 32 of file electrical.c.

Referenced by electrical_periodic().

#define VoltageOfAdc (   adc)    DefaultVoltageOfAdc(adc)

Definition at line 29 of file electrical.c.

Referenced by electrical_periodic().

Function Documentation

void electrical_init ( void  )

Definition at line 39 of file electrical.c.

References adc_buf_channel(), ADC_CHANNEL_VSUPPLY, Electrical::current, CURRENT_ESTIMATION_NONLINEARITY, DEFAULT_AV_NB_SAMPLE, electrical, electrical_priv, 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:

void electrical_periodic ( void  )

Definition at line 53 of file electrical.c.

References commands, Electrical::current, electrical, electrical_priv, MAX_PPRZ, MilliAmpereOfAdc, VoltageOfAdc, and Electrical::vsupply.

Referenced by handle_periodic_tasks(), and handle_periodic_tasks_fbw().

+ Here is the caller graph for this function:

Variable Documentation

struct { ... } electrical_priv
struct adc_buf vsupply_adc_buf

Definition at line 19 of file electrical.c.