SerialIO
Loading...
Searching...
No Matches
ibus_protocol.h
Go to the documentation of this file.
1
5#pragma once
6
7#ifndef IBUS_PROTOCOL_H
8#define IBUS_PROTOCOL_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <stdint.h>
15
16#define PACKED __attribute__((packed))
17#define IBUS_MAX_PACKET_SIZE 32
18#define IBUS_BAUDRATE 115200
19#define IBUS_HEADER1 0x20
20#define IBUS_HEADER2 0x40
21
22typedef struct ibus_channels_s {
23 unsigned header : 16;
24 unsigned channel1 : 16;
25 unsigned channel2 : 16;
26 unsigned channel3 : 16;
27 unsigned channel4 : 16;
28 unsigned channel5 : 16;
29 unsigned channel6 : 16;
30 unsigned channel7 : 16;
31 unsigned channel8 : 16;
32 unsigned channel9 : 16;
33 unsigned channel10 : 16;
34 unsigned channel11 : 16;
35 unsigned channel12 : 16;
36 unsigned channel13 : 16;
37 unsigned channel14 : 16;
38 unsigned checksum : 16;
39} PACKED ibus_channels_t;
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
Definition ibus_protocol.h:22