2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
23 #define MAX_FLYSKY_CHANNEL_COUNT 8
24 #define MAX_FLYSKY_2A_CHANNEL_COUNT 14
26 #define FLYSKY_PAYLOAD_SIZE 21
27 #define FLYSKY_2A_PAYLOAD_SIZE 37
29 #define FLYSKY_FREQUENCY_COUNT 16
30 #define FLYSKY_RSSI_SAMPLE_COUNT 16
32 #ifndef FLYSKY_CHANNEL_COUNT
33 #define FLYSKY_CHANNEL_COUNT MAX_FLYSKY_CHANNEL_COUNT
36 #ifndef FLYSKY_2A_CHANNEL_COUNT
37 #define FLYSKY_2A_CHANNEL_COUNT MAX_FLYSKY_2A_CHANNEL_COUNT
41 #define BIND_TIMEOUT 200000
43 typedef struct __attribute__((packed
)) {
50 typedef struct __attribute__((packed
)) {
54 flySky2ASens_t sens
[7];
55 } flySky2ATelemetryPkt_t
;
57 typedef struct __attribute__((packed
)) {
63 uint8_t rfChannelMap
[16];
64 uint8_t reserved2
[10];
67 typedef struct __attribute__((packed
)) {
72 } flySky2ARcDataPkt_t
;
74 typedef struct __attribute__((packed
)) {
90 SENSOR_MOT_RPM
= 0x02,
93 SENSOR_ERR_RATE
= 0xFE
97 FLYSKY_2A_PACKET_RC_DATA
= 0x58,
98 FLYSKY_2A_PACKET_BIND1
= 0xBB,
99 FLYSKY_2A_PACKET_BIND2
= 0xBC,
100 FLYSKY_2A_PACKET_FS_SETTINGS
= 0x56,
101 FLYSKY_2A_PACKET_SETTINGS
= 0xAA,
102 FLYSKY_2A_PACKET_TELEMETRY
= 0xAA,
103 FLYSKY_PACKET_RC_DATA
= 0x55,
104 FLYSKY_PACKET_BIND
= 0xAA