Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
syslink_dl.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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, see
18
* <http://www.gnu.org/licenses/>.
19
*/
20
28
#ifndef SYSLINK_DL_H
29
#define SYSLINK_DL_H
30
31
#include "
modules/datalink/bitcraze/syslink.h
"
32
#include "
modules/datalink/bitcraze/crtp.h
"
33
#include "pprzlink/pprzlink_device.h"
34
35
#define CRTP_BUF_LEN 16
36
#define SYSLINK_RX_BUF_LEN 256
37
38
struct
syslink_dl
{
39
// syslink structures
40
syslink_parse_state
state
;
41
syslink_message_t
msg_rx
;
42
crtp_message_t
msg_tx
[
CRTP_BUF_LEN
];
43
uint8_t
tx_insert_idx
;
44
uint8_t
tx_extract_idx
;
45
uint8_t
rx_buf
[
SYSLINK_RX_BUF_LEN
];
46
uint8_t
rx_insert_idx
;
47
uint8_t
rx_extract_idx
;
48
49
// generic device to use pprzlink over syslink
50
struct
link_device
device
;
51
52
// crazyflie state
53
uint8_t
rssi
;
54
bool
charging
;
55
bool
powered
;
56
};
57
58
extern
struct
syslink_dl
syslink
;
59
61
extern
void
syslink_dl_init
(
void
);
62
64
extern
void
syslink_dl_periodic
(
void
);
65
67
extern
void
syslink_dl_event
(
void
);
68
69
#endif
70
syslink_dl_event
void syslink_dl_event(void)
Datalink event.
Definition:
syslink_dl.c:413
CRTP_BUF_LEN
#define CRTP_BUF_LEN
Definition:
syslink_dl.h:35
syslink_dl::powered
bool powered
USB powered.
Definition:
syslink_dl.h:55
syslink_dl::device
struct link_device device
Definition:
syslink_dl.h:50
syslink_dl::msg_rx
syslink_message_t msg_rx
last received syslink message
Definition:
syslink_dl.h:41
syslink_dl::rx_extract_idx
uint8_t rx_extract_idx
rx extract index
Definition:
syslink_dl.h:47
syslink_dl::charging
bool charging
battery charging
Definition:
syslink_dl.h:54
syslink_dl::rx_buf
uint8_t rx_buf[SYSLINK_RX_BUF_LEN]
received pprzlink bytes from syslink/crtp
Definition:
syslink_dl.h:45
syslink
struct syslink_dl syslink
Definition:
syslink_dl.c:34
syslink_dl_periodic
void syslink_dl_periodic(void)
Periodic function.
Definition:
syslink_dl.c:397
crtp_message_t
Definition:
crtp.h:52
uint8_t
unsigned char uint8_t
Definition:
types.h:14
syslink_message_t
Definition:
syslink.h:66
syslink_parse_state
Definition:
syslink.h:82
syslink_dl::rssi
uint8_t rssi
Definition:
syslink_dl.h:53
syslink_dl::state
syslink_parse_state state
syslink parser state
Definition:
syslink_dl.h:40
crtp.h
syslink_dl::rx_insert_idx
uint8_t rx_insert_idx
rx insert index
Definition:
syslink_dl.h:46
syslink_dl
Definition:
syslink_dl.h:38
SYSLINK_RX_BUF_LEN
#define SYSLINK_RX_BUF_LEN
Definition:
syslink_dl.h:36
syslink_dl::tx_insert_idx
uint8_t tx_insert_idx
tx insert index
Definition:
syslink_dl.h:43
syslink_dl_init
void syslink_dl_init(void)
Init function.
Definition:
syslink_dl.c:366
syslink_dl::tx_extract_idx
uint8_t tx_extract_idx
tx extract index
Definition:
syslink_dl.h:44
syslink_dl::msg_tx
crtp_message_t msg_tx[CRTP_BUF_LEN]
queued crtp packets to be send
Definition:
syslink_dl.h:42
syslink.h
sw
airborne
modules
datalink
bitcraze
syslink_dl.h
Generated on Tue Feb 1 2022 13:51:15 for Paparazzi UAS by
1.8.17