Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
datalink.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2005 Pascal Brisset, Antoine Drouin
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 *
21 */
27#ifndef DATALINK_H
28#define DATALINK_H
29
30#include "std.h"
31#include "pprzlink/dl_protocol.h"
32
34#define PPRZ 1
35#define XBEE 2
36#define SUPERBITRF 3
37#define W5100 4
38
39#define DATALINK_MSG_SIZE 256
40
42extern bool dl_msg_available;
43
46
49
51extern uint8_t* datalink_get_buffer(void);
52
54extern void dl_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf);
55
56#if USE_NPS
57extern bool datalink_enabled;
58#endif
59
61extern void datalink_fill_buffer(uint8_t *buf, uint16_t len);
62
64extern void datalink_init(void);
65
67extern void datalink_periodic(void);
68
69extern void datalink_parse_PING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf);
70
72static inline void DlCheckAndParse(struct link_device *dev, struct transport_tx *trans, uint8_t *buf, bool *msg_available, bool update_dl)
73{
74 // make it possible to disable datalink in NPS sim
75#if USE_NPS
76 if (!datalink_enabled) {
77 return;
78 }
79#endif
80
81 if (*msg_available) {
82 if (update_dl) {
83 datalink_time = 0;
85 }
86 dl_parse_msg(dev, trans, buf);
87 *msg_available = false;
88 }
89}
90
91#endif /* DATALINK_H */
static struct uart_periph * dev
uint16_t foo
Definition main_demo5.c:58
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.