28#include "generated/airframe.h"
33#ifndef PTU_PRESSURE_OFFSET
34#define PTU_PRESSURE_OFFSET 0
36#ifndef PTU_PRESSURE_SCALE
37#define PTU_PRESSURE_SCALE 1.0
39#ifndef PTU_TEMPERATURE_OFFSET
40#define PTU_TEMPERATURE_OFFSET 0
42#ifndef PTU_TEMPERATURE_SCALE
43#define PTU_TEMPERATURE_SCALE 1.0
45#ifndef PTU_HUMIDTY_OFFSET
46#define PTU_HUMIDTY_OFFSET 0
48#ifndef PTU_HUMIDTY_SCALE
49#define PTU_HUMIDTY_SCALE 1.0
53#ifndef ADC_CHANNEL_PTU_NB_SAMPLES
54#define ADC_CHANNEL_PTU_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
71#include "pprzlink/messages.h"
91 log_ptu_started =
false;
106 if (!log_ptu_started) {
108 "P(adc) T(adc) H(usec) GPS_fix TOW(ms) Week Lat(1e7rad) Lon(1e7rad) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n");
109 log_ptu_started =
true;
114 gps.lla_pos.lat,
gps.lla_pos.lon,
gps.hmsl,
122#define PTU_DATA_SIZE 3
123 float ptu_data[PTU_DATA_SIZE];
arch independent ADC (Analog to Digital Converter) API
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.
Common code for AP and FBW telemetry.
Some architecture independent helper functions for GPIOs.
struct GpsState gps
global GPS state
Device independent GPS code (interface).
static FILE * pprzLogFile
#define PTU_PRESSURE_OFFSET
Default scale and offset send raw values if nothing defined in airframe file.
void mf_ptu_init(void)
Data acquisition module for Meteo France PTU board.
struct adc_buf pressure_buf
void mf_ptu_periodic(void)
#define ADC_CHANNEL_PTU_NB_SAMPLES
ADC buffers.
uint16_t pressure_adc
Raw values.
#define PTU_PRESSURE_SCALE
#define PTU_HUMIDTY_SCALE
#define PTU_TEMPERATURE_SCALE
#define PTU_TEMPERATURE_OFFSET
#define PTU_HUMIDTY_OFFSET
SdioError sdLogWriteLog(const FileDes fd, const char *fmt,...)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.