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;
111 sdLogWriteLog(
pprzLogFile,
"%d %d %d %d %d %d %d %d %d %d %d %d\n",
122 #define PTU_DATA_SIZE 3
123 float ptu_data[PTU_DATA_SIZE];
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void mf_ptu_init(void)
Data acquisition module for Meteo France PTU board.
#define PTU_PRESSURE_SCALE
#define ADC_CHANNEL_PTU_NB_SAMPLES
ADC buffers.
Some architecture independent helper functions for GPIOs.
struct adc_buf pressure_buf
#define PTU_HUMIDTY_SCALE
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.
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
uint16_t pressure_adc
Raw values.
int32_t hmsl
height above mean sea level (MSL) in mm
void mf_ptu_periodic(void)
#define PTU_TEMPERATURE_SCALE
uint32_t tow
GPS time of week in ms.
Device independent GPS code (interface)
int32_t lon
in degrees*1e7
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
#define PTU_TEMPERATURE_OFFSET
Common code for AP and FBW telemetry.
uint16_t gspeed
norm of 2d ground speed in cm/s
#define PTU_HUMIDTY_OFFSET
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t lat
in degrees*1e7
struct NedCoor_i ned_vel
speed NED in cm/s
struct GpsState gps
global GPS state
static void gpio_set(ioportid_t port, uint16_t pin)
Set a gpio output to high level.
#define PTU_PRESSURE_OFFSET
Default scale and offset send raw values if nothing defined in airframe file.