SerialIO
Loading...
Searching...
No Matches
fport_protocol.h
Go to the documentation of this file.
1
5#pragma once
6
7#ifndef FPORT_PROTOCOL_H
8#define FPORT_PROTOCOL_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <stdint.h>
15
16#define PACKED __attribute__((packed))
17#define FPORT_BAUDRATE 115200
18#define FPORT_MAX_PACKET_SIZE 29
19#define FPORT_END_BYTES 0x7E
20
21typedef enum {
22 FPORT_FRAMETYPE_RC_CHANNELS_PACKED = 0x00,
23 FPORT_FRAMETYPE_DOWNLINK = 0x01,
24 FPORT_FRAMETYPE_UPLINK = 0x81,
25} fport_frame_type_e;
26
27typedef struct fport_channels_s {
28 unsigned channel1 : 11;
29 unsigned channel2 : 11;
30 unsigned channel3 : 11;
31 unsigned channel4 : 11;
32 unsigned channel5 : 11;
33 unsigned channel6 : 11;
34 unsigned channel7 : 11;
35 unsigned channel8 : 11;
36 unsigned channel9 : 11;
37 unsigned channel10 : 11;
38 unsigned channel11 : 11;
39 unsigned channel12 : 11;
40 unsigned channel13 : 11;
41 unsigned channel14 : 11;
42 unsigned channel15 : 11;
43 unsigned channel16 : 11;
44 unsigned dummy : 4;
45 unsigned failsafe : 1;
46 unsigned framelost : 1;
47 unsigned channel17 : 1;
48 unsigned channel18 : 1;
49} PACKED fport_channels_t;
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif
Definition fport_protocol.h:27