29#include "navigation.h"
34#ifndef PUMP_CONTROL_ADC
35#error "PUMP_CONTROL_ADC must be defined!"
36#define PUMP_CONTROL_ADC ADC_4
39#ifndef PUMP_CONTROL_ADC_EMPTY
40#define PUMP_CONTROL_ADC_EMPTY 20000
43#ifndef PUMP_CONTROL_GPIO_ACTIVATE
44#define PUMP_CONTROL_GPIO_ACTIVATE GPIOA,GPIO0
47#ifndef PUMP_CONTROL_GPIO_PURGE
48#define PUMP_CONTROL_GPIO_PURGE GPIOA,GPIO1
52#define PUMP_CTRL_OFF 0
53#define PUMP_CTRL_PUMP 1
54#define PUMP_CTRL_VALVE 2
arch independent ADC (Analog to Digital Converter) API
#define DEFAULT_AV_NB_SAMPLE
static uint16_t adc_buf_get(struct adc_buf *s)
Get filtered value from buffer.
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Link between ChibiOS ADC drivers and Paparazzi adc_buffers.
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
static void gpio_set(ioportid_t port, uint16_t pin)
Set a gpio output to high level.
static void gpio_clear(ioportid_t port, uint16_t pin)
Clear a gpio output to low level.
Common code for AP and FBW telemetry.
Some architecture independent helper functions for GPIOs.
#define NAVIGATION_FREQUENCY
Default fixedwing navigation frequency.
void pump_control_init(void)
void pump_control_report(void)
#define PUMP_CONTROL_GPIO_ACTIVATE
bool pump_done(float duration, float timeout)
#define PUMP_CONTROL_ADC_EMPTY
void pump_control_handler(float value)
#define PUMP_CONTROL_GPIO_PURGE
static const float nav_dt
static struct PumpControl pump_control
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.