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 ADC (Analog to Digital Converter) API
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)
uint32_t tow
GPS time of week in ms.
int32_t hmsl
height above mean sea level (MSL) in mm
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
struct NedCoor_i ned_vel
speed NED in cm/s
uint16_t gspeed
norm of 2d ground speed in cm/s
int32_t lat
in degrees*1e7
int32_t lon
in degrees*1e7
#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
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.