Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
adc_generic.c File Reference

This module can be used to read one or two values from the ADC channels in a generic way. More...

#include "adc_generic.h"
#include "mcu_periph/adc.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "subsystems/datalink/telemetry.h"
+ Include dependency graph for adc_generic.c:

Go to the source code of this file.

Macros

#define ADC_CHANNEL_GENERIC_NB_SAMPLES   DEFAULT_AV_NB_SAMPLE
 
#define ADC_GENERIC_PERIODIC_SEND   TRUE
 

Functions

static void adc_msg_send (struct transport_tx *trans, struct link_device *dev)
 
void adc_generic_init (void)
 
void adc_generic_periodic (void)
 

Variables

uint16_t adc_generic_val1
 
uint16_t adc_generic_val2
 

Detailed Description

This module can be used to read one or two values from the ADC channels in a generic way.

Data is reported through the default telemetry channel (by default) or can be redirected to an other one (alternate telemetry, datalogger) at a frequency defined in the telemetry xml file.

Definition in file adc_generic.c.

Macro Definition Documentation

#define ADC_CHANNEL_GENERIC_NB_SAMPLES   DEFAULT_AV_NB_SAMPLE

Definition at line 48 of file adc_generic.c.

Referenced by adc_generic_init().

#define ADC_GENERIC_PERIODIC_SEND   TRUE

Definition at line 56 of file adc_generic.c.

Function Documentation

void adc_generic_init ( void  )

Definition at line 77 of file adc_generic.c.

References adc_buf_channel(), ADC_CHANNEL_GENERIC_NB_SAMPLES, adc_generic_val1, adc_generic_val2, adc_msg_send(), DefaultPeriodic, and register_periodic_telemetry().

+ Here is the call graph for this function:

void adc_generic_periodic ( void  )

Definition at line 94 of file adc_generic.c.

References adc_msg_send(), DefaultChannel, and DefaultDevice.

+ Here is the call graph for this function:

static void adc_msg_send ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 67 of file adc_generic.c.

References adc_generic_val1, and adc_generic_val2.

Referenced by adc_generic_init(), and adc_generic_periodic().

+ Here is the caller graph for this function:

Variable Documentation

uint16_t adc_generic_val1

Definition at line 38 of file adc_generic.c.

Referenced by adc_generic_init(), and adc_msg_send().

uint16_t adc_generic_val2

Definition at line 39 of file adc_generic.c.

Referenced by adc_generic_init(), and adc_msg_send().