SerialIO
Loading...
Searching...
No Matches
sbus_protocol.h
Go to the documentation of this file.
1
5#pragma once
6
7#ifndef SBUS_PROTOCOL_H
8#define SBUS_PROTOCOL_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <stdint.h>
15
16#define PACKED __attribute__((packed))
17#define HEADER_SBUS 0x0F
18#define FOOTER_SBUS 0x00
19#define SBUS_BAUDRATE 100000
20#define SBUS_MAX_PACKET_SIZE 25
21
22typedef struct sbus_channels_s {
23 unsigned header : 8;
24 unsigned channel1 : 11;
25 unsigned channel2 : 11;
26 unsigned channel3 : 11;
27 unsigned channel4 : 11;
28 unsigned channel5 : 11;
29 unsigned channel6 : 11;
30 unsigned channel7 : 11;
31 unsigned channel8 : 11;
32 unsigned channel9 : 11;
33 unsigned channel10 : 11;
34 unsigned channel11 : 11;
35 unsigned channel12 : 11;
36 unsigned channel13 : 11;
37 unsigned channel14 : 11;
38 unsigned channel15 : 11;
39 unsigned channel16 : 11;
40 unsigned dummy : 4;
41 unsigned failsafe : 1;
42 unsigned framelost : 1;
43 unsigned channel17 : 1;
44 unsigned channel18 : 1;
45 unsigned footer : 8;
46} PACKED sbus_channels_t;
47#ifdef __cplusplus
48}
49#endif
50
51#endif
Definition sbus_protocol.h:22