33 #include "pprzlink/messages.h"
39 #if FLIGHTRECORDER_SDLOG
46 #define uADC_WAIT_START uADC_UNINIT
47 #define uADC_WAIT_COUNTER 1
48 #define uADC_WAIT_ANGLES 2
49 #define uADC_WAIT_ALTITUDE 3
50 #define uADC_WAIT_PRESSURES 4
51 #define uADC_WAIT_CHECKSUM 5
53 #define uADC_START 0x0A
54 #define uADC_LIMITER ','
69 static char uadc_inp[64];
83 if (isdigit((
int)c)) {
99 if (isdigit((
int)c) || (c ==
'-') || (c ==
'.')) {
110 }
else if ((c ==
' ') || (c ==
'+')) {
121 if (isdigit((
int)c) || (c ==
'-') || (c ==
'.')) {
129 }
else if ((c ==
' ') || (c ==
'+')) {
140 if (isdigit((
int)c) || (c ==
'-') || (c ==
'.')) {
151 }
else if ((c ==
' ') || (c ==
'+')) {
162 if (isxdigit((
int)c)) {
167 checksum = strtol(uadc_inp, NULL, 16);
170 #if FLIGHTRECORDER_SDLOG
171 if (flightRecorderLogFile != -1) {
172 DOWNLINK_SEND_AEROPROBE(
pprzlog_tp, flightrecorder_sdlog,
178 }
else if ((c ==
' ')) {
#define uADC_WAIT_COUNTER
static uint8_t uadc_status
#define uADC_WAIT_ALTITUDE
void airspeed_uADC_init(void)
static int32_t pressures[2]
static uint8_t uadc_tab_idx
void airspeed_uadc_parse(char c)
#define uADC_WAIT_CHECKSUM
void airspeed_uADC_periodic(void)
#define uADC_WAIT_PRESSURES
void airspeed_uADC_event(void)
UART interface for Aeroprobe uADC air data computer.
Common code for AP and FBW telemetry.
int uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
uint8_t uart_getch(struct uart_periph *p)
struct pprzlog_transport pprzlog_tp
PPRZLOG transport structure.
Initialize pprzlog transport.
Periodic telemetry system header (includes downlink utility and generated code).
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.