2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
26 #define MAX_FLYSKY_CHANNEL_COUNT 8
27 #define MAX_FLYSKY_2A_CHANNEL_COUNT 14
29 #define FLYSKY_PAYLOAD_SIZE 21
30 #define FLYSKY_2A_PAYLOAD_SIZE 37
32 #define FLYSKY_FREQUENCY_COUNT 16
33 #define FLYSKY_RSSI_SAMPLE_COUNT 16
35 #ifndef FLYSKY_CHANNEL_COUNT
36 #define FLYSKY_CHANNEL_COUNT MAX_FLYSKY_CHANNEL_COUNT
39 #ifndef FLYSKY_2A_CHANNEL_COUNT
40 #define FLYSKY_2A_CHANNEL_COUNT MAX_FLYSKY_2A_CHANNEL_COUNT
44 #define BIND_TIMEOUT 200000
46 typedef struct __attribute__((packed
)) {
53 typedef struct __attribute__((packed
)) {
57 flySky2ASens_t sens
[7];
58 } flySky2ATelemetryPkt_t
;
60 typedef struct __attribute__((packed
)) {
66 uint8_t rfChannelMap
[16];
67 uint8_t reserved2
[10];
70 typedef struct __attribute__((packed
)) {
75 } flySky2ARcDataPkt_t
;
77 typedef struct __attribute__((packed
)) {
93 SENSOR_MOT_RPM
= 0x02,
96 SENSOR_ERR_RATE
= 0xFE
100 FLYSKY_2A_PACKET_RC_DATA
= 0x58,
101 FLYSKY_2A_PACKET_BIND1
= 0xBB,
102 FLYSKY_2A_PACKET_BIND2
= 0xBC,
103 FLYSKY_2A_PACKET_FS_SETTINGS
= 0x56,
104 FLYSKY_2A_PACKET_SETTINGS
= 0xAA,
105 FLYSKY_2A_PACKET_TELEMETRY
= 0xAA,
106 FLYSKY_PACKET_RC_DATA
= 0x55,
107 FLYSKY_PACKET_BIND
= 0xAA