2016-03-08 22:20:49 +01:00
|
|
|
/*
|
|
|
|
This project is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Multiprotocol is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-12-19 17:33:30 +01:00
|
|
|
//******************
|
|
|
|
// Version
|
|
|
|
//******************
|
2016-12-22 10:31:00 +01:00
|
|
|
#define VERSION_MAJOR 1
|
2019-09-30 17:35:12 +02:00
|
|
|
#define VERSION_MINOR 3
|
2020-05-23 22:41:07 +02:00
|
|
|
#define VERSION_REVISION 1
|
2020-10-30 12:01:29 +01:00
|
|
|
#define VERSION_PATCH_LEVEL 76
|
2018-05-04 07:12:04 -07:00
|
|
|
|
2016-03-08 22:20:49 +01:00
|
|
|
//******************
|
|
|
|
// Protocols
|
|
|
|
//******************
|
|
|
|
enum PROTOCOLS
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
MODE_SERIAL = 0, // Serial commands
|
2018-01-30 12:02:45 +01:00
|
|
|
PROTO_FLYSKY = 1, // =>A7105
|
|
|
|
PROTO_HUBSAN = 2, // =>A7105
|
|
|
|
PROTO_FRSKYD = 3, // =>CC2500
|
|
|
|
PROTO_HISKY = 4, // =>NRF24L01
|
|
|
|
PROTO_V2X2 = 5, // =>NRF24L01
|
|
|
|
PROTO_DSM = 6, // =>CYRF6936
|
|
|
|
PROTO_DEVO = 7, // =>CYRF6936
|
|
|
|
PROTO_YD717 = 8, // =>NRF24L01
|
|
|
|
PROTO_KN = 9, // =>NRF24L01
|
|
|
|
PROTO_SYMAX = 10, // =>NRF24L01
|
|
|
|
PROTO_SLT = 11, // =>NRF24L01
|
|
|
|
PROTO_CX10 = 12, // =>NRF24L01
|
|
|
|
PROTO_CG023 = 13, // =>NRF24L01
|
|
|
|
PROTO_BAYANG = 14, // =>NRF24L01
|
|
|
|
PROTO_FRSKYX = 15, // =>CC2500
|
|
|
|
PROTO_ESKY = 16, // =>NRF24L01
|
|
|
|
PROTO_MT99XX = 17, // =>NRF24L01
|
|
|
|
PROTO_MJXQ = 18, // =>NRF24L01
|
|
|
|
PROTO_SHENQI = 19, // =>NRF24L01
|
|
|
|
PROTO_FY326 = 20, // =>NRF24L01
|
2020-10-30 12:01:29 +01:00
|
|
|
PROTO_FUTABA = 21, // =>CC2500
|
2018-01-30 12:02:45 +01:00
|
|
|
PROTO_J6PRO = 22, // =>CYRF6936
|
|
|
|
PROTO_FQ777 = 23, // =>NRF24L01
|
|
|
|
PROTO_ASSAN = 24, // =>NRF24L01
|
|
|
|
PROTO_FRSKYV = 25, // =>CC2500
|
|
|
|
PROTO_HONTAI = 26, // =>NRF24L01
|
|
|
|
PROTO_OPENLRS = 27, // =>OpenLRS hardware
|
|
|
|
PROTO_AFHDS2A = 28, // =>A7105
|
|
|
|
PROTO_Q2X2 = 29, // =>NRF24L01, extension of CX-10 protocol
|
|
|
|
PROTO_WK2x01 = 30, // =>CYRF6936
|
|
|
|
PROTO_Q303 = 31, // =>NRF24L01
|
|
|
|
PROTO_GW008 = 32, // =>NRF24L01
|
|
|
|
PROTO_DM002 = 33, // =>NRF24L01
|
|
|
|
PROTO_CABELL = 34, // =>NRF24L01
|
|
|
|
PROTO_ESKY150 = 35, // =>NRF24L01
|
|
|
|
PROTO_H8_3D = 36, // =>NRF24L01
|
|
|
|
PROTO_CORONA = 37, // =>CC2500
|
2018-05-04 07:12:04 -07:00
|
|
|
PROTO_CFLIE = 38, // =>NRF24L01
|
2018-08-03 18:29:24 +02:00
|
|
|
PROTO_HITEC = 39, // =>CC2500
|
2018-08-21 14:58:44 +02:00
|
|
|
PROTO_WFLY = 40, // =>CYRF6936
|
2018-08-28 16:13:28 +02:00
|
|
|
PROTO_BUGS = 41, // =>A7105
|
2018-10-17 13:23:27 +02:00
|
|
|
PROTO_BUGSMINI = 42, // =>NRF24L01
|
2018-11-02 21:20:57 +01:00
|
|
|
PROTO_TRAXXAS = 43, // =>CYRF6936
|
|
|
|
PROTO_NCC1701 = 44, // =>NRF24L01
|
2018-11-06 21:43:55 +01:00
|
|
|
PROTO_E01X = 45, // =>NRF24L01
|
2018-11-09 00:31:26 +01:00
|
|
|
PROTO_V911S = 46, // =>NRF24L01
|
2018-11-15 11:08:07 +01:00
|
|
|
PROTO_GD00X = 47, // =>NRF24L01
|
2019-05-17 16:25:39 +02:00
|
|
|
PROTO_V761 = 48, // =>NRF24L01
|
2019-06-04 21:44:40 +02:00
|
|
|
PROTO_KF606 = 49, // =>NRF24L01
|
2019-06-17 17:16:39 +02:00
|
|
|
PROTO_REDPINE = 50, // =>CC2500
|
2019-06-19 11:25:21 +02:00
|
|
|
PROTO_POTENSIC = 51, // =>NRF24L01
|
2019-08-10 21:43:14 +02:00
|
|
|
PROTO_ZSX = 52, // =>NRF24L01
|
2020-08-01 19:19:11 +02:00
|
|
|
PROTO_HEIGHT = 53, // =>A7105
|
2019-09-10 23:37:54 +02:00
|
|
|
PROTO_SCANNER = 54, // =>CC2500
|
2019-10-12 19:50:11 +02:00
|
|
|
PROTO_FRSKY_RX = 55, // =>CC2500
|
2019-10-01 20:44:26 +02:00
|
|
|
PROTO_AFHDS2A_RX= 56, // =>A7105
|
2019-11-02 20:51:41 +01:00
|
|
|
PROTO_HOTT = 57, // =>CC2500
|
2019-11-27 12:12:13 +01:00
|
|
|
PROTO_FX816 = 58, // =>NRF24L01
|
2019-11-28 20:02:59 +01:00
|
|
|
PROTO_BAYANG_RX = 59, // =>NRF24L01
|
2019-12-19 22:39:01 +01:00
|
|
|
PROTO_PELIKAN = 60, // =>A7105
|
2019-12-19 23:40:33 +01:00
|
|
|
PROTO_TIGER = 61, // =>NRF24L01
|
2020-01-14 12:19:12 +01:00
|
|
|
PROTO_XK = 62, // =>NRF24L01
|
2019-05-08 22:01:24 +02:00
|
|
|
PROTO_XN297DUMP = 63, // =>NRF24L01
|
2020-01-20 23:52:17 +01:00
|
|
|
PROTO_FRSKYX2 = 64, // =>CC2500
|
2020-01-24 12:12:07 +01:00
|
|
|
PROTO_FRSKY_R9 = 65, // =>SX1276
|
2020-04-03 19:36:05 +02:00
|
|
|
PROTO_PROPEL = 66, // =>NRF24L01
|
2020-04-11 20:09:32 +02:00
|
|
|
PROTO_FRSKYL = 67, // =>CC2500
|
2020-04-18 19:04:38 +02:00
|
|
|
PROTO_SKYARTEC = 68, // =>CC2500
|
2020-05-08 19:55:16 +02:00
|
|
|
PROTO_ESKY150V2 = 69, // =>CC2500+NRF24L01
|
2020-05-17 15:45:23 +02:00
|
|
|
PROTO_DSM_RX = 70, // =>CYRF6936
|
2020-05-21 11:47:51 +02:00
|
|
|
PROTO_JJRC345 = 71, // =>NRF24L01
|
2020-05-24 17:39:14 +02:00
|
|
|
PROTO_Q90C = 72, // =>NRF24L01 or CC2500
|
2020-07-10 15:25:32 +02:00
|
|
|
PROTO_KYOSHO = 73, // =>A7105
|
2020-07-22 15:37:47 +02:00
|
|
|
PROTO_RLINK = 74, // =>CC2500
|
2020-08-10 23:54:33 +02:00
|
|
|
PROTO_REALACC = 76, // =>NRF24L01
|
2020-09-18 16:13:45 +02:00
|
|
|
PROTO_OMP = 77, // =>CC2500 & NRF24L01
|
2020-06-03 11:43:27 +02:00
|
|
|
|
2020-09-07 22:58:37 +02:00
|
|
|
PROTO_NANORF = 126, // =>NRF24L01
|
2020-06-03 11:43:27 +02:00
|
|
|
PROTO_TEST = 127, // =>CC2500
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Flysky
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
Flysky = 0,
|
|
|
|
V9X9 = 1,
|
|
|
|
V6X6 = 2,
|
2016-11-29 22:30:03 +01:00
|
|
|
V912 = 3,
|
2018-09-03 16:02:43 +02:00
|
|
|
CX20 = 4,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2020-08-01 19:19:11 +02:00
|
|
|
enum Height
|
2019-08-17 22:37:00 +02:00
|
|
|
{
|
|
|
|
FZ410 = 0,
|
|
|
|
};
|
2017-11-30 20:12:23 +01:00
|
|
|
enum Hubsan
|
|
|
|
{
|
|
|
|
H107 = 0,
|
|
|
|
H301 = 1,
|
|
|
|
H501 = 2,
|
|
|
|
};
|
2016-10-20 19:29:46 +02:00
|
|
|
enum AFHDS2A
|
|
|
|
{
|
|
|
|
PWM_IBUS = 0,
|
|
|
|
PPM_IBUS = 1,
|
|
|
|
PWM_SBUS = 2,
|
|
|
|
PPM_SBUS = 3,
|
2020-07-15 23:58:41 +02:00
|
|
|
PWM_IB16 = 4,
|
|
|
|
PPM_IB16 = 5,
|
2016-10-20 19:29:46 +02:00
|
|
|
};
|
2016-03-08 22:20:49 +01:00
|
|
|
enum Hisky
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
Hisky = 0,
|
2018-09-03 16:02:43 +02:00
|
|
|
HK310 = 1,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2016-09-01 14:00:42 +02:00
|
|
|
enum DSM
|
2016-09-15 12:38:49 +02:00
|
|
|
{
|
|
|
|
DSM2_22 = 0,
|
|
|
|
DSM2_11 = 1,
|
|
|
|
DSMX_22 = 2,
|
|
|
|
DSMX_11 = 3,
|
2018-09-03 16:02:43 +02:00
|
|
|
DSM_AUTO = 4,
|
2016-09-15 12:38:49 +02:00
|
|
|
};
|
2016-03-08 22:20:49 +01:00
|
|
|
enum YD717
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
YD717 = 0,
|
|
|
|
SKYWLKR = 1,
|
|
|
|
SYMAX4 = 2,
|
|
|
|
XINXUN = 3,
|
2018-09-03 16:02:43 +02:00
|
|
|
NIHUI = 4,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
enum KN
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
WLTOYS = 0,
|
2018-09-03 16:02:43 +02:00
|
|
|
FEILUN = 1,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
enum SYMAX
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
SYMAX = 0,
|
2018-09-03 16:02:43 +02:00
|
|
|
SYMAX5C = 1,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2016-11-23 15:35:27 +01:00
|
|
|
enum SLT
|
|
|
|
{
|
2018-09-03 16:02:43 +02:00
|
|
|
SLT_V1 = 0,
|
|
|
|
SLT_V2 = 1,
|
2018-09-10 08:11:56 +02:00
|
|
|
Q100 = 2,
|
|
|
|
Q200 = 3,
|
|
|
|
MR100 = 4,
|
2016-11-23 15:35:27 +01:00
|
|
|
};
|
2016-03-08 22:20:49 +01:00
|
|
|
enum CX10
|
|
|
|
{
|
2016-11-23 21:56:00 +01:00
|
|
|
CX10_GREEN = 0,
|
|
|
|
CX10_BLUE = 1, // also compatible with CX10-A, CX12
|
|
|
|
DM007 = 2,
|
2016-08-24 14:52:47 +02:00
|
|
|
JC3015_1 = 4,
|
|
|
|
JC3015_2 = 5,
|
|
|
|
MK33041 = 6,
|
2016-11-23 21:56:00 +01:00
|
|
|
};
|
|
|
|
enum Q2X2
|
|
|
|
{
|
2018-01-30 12:02:45 +01:00
|
|
|
Q222 = 0,
|
|
|
|
Q242 = 1,
|
|
|
|
Q282 = 2,
|
|
|
|
F_Q222 = 8,
|
|
|
|
F_Q242 = 9,
|
|
|
|
F_Q282 = 10,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
enum CG023
|
|
|
|
{
|
2016-08-24 14:52:47 +02:00
|
|
|
CG023 = 0,
|
|
|
|
YD829 = 1,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2016-12-02 10:19:35 +01:00
|
|
|
enum BAYANG
|
|
|
|
{
|
|
|
|
BAYANG = 0,
|
2017-11-20 16:01:12 +01:00
|
|
|
H8S3D = 1,
|
|
|
|
X16_AH = 2,
|
2017-11-28 17:17:02 +01:00
|
|
|
IRDRONE = 3,
|
2019-05-09 18:23:19 +02:00
|
|
|
DHD_D4 = 4,
|
2020-06-02 17:17:49 +02:00
|
|
|
QX100 = 5,
|
2016-12-02 10:19:35 +01:00
|
|
|
};
|
2016-03-08 22:20:49 +01:00
|
|
|
enum MT99XX
|
|
|
|
{
|
|
|
|
MT99 = 0,
|
|
|
|
H7 = 1,
|
2016-08-01 21:57:18 +02:00
|
|
|
YZ = 2,
|
2016-12-09 10:19:35 +01:00
|
|
|
LS = 3,
|
2018-09-03 16:02:43 +02:00
|
|
|
FY805 = 4,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
enum MJXQ
|
|
|
|
{
|
|
|
|
WLH08 = 0,
|
|
|
|
X600 = 1,
|
|
|
|
X800 = 2,
|
2016-08-28 14:03:22 +02:00
|
|
|
H26D = 3,
|
2016-12-13 14:58:02 +01:00
|
|
|
E010 = 4,
|
|
|
|
H26WH = 5,
|
2019-04-15 10:48:20 +02:00
|
|
|
PHOENIX = 6,
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2020-04-13 22:10:58 +02:00
|
|
|
enum FRSKYD
|
|
|
|
{
|
|
|
|
FRSKYD = 0,
|
|
|
|
DCLONE = 1,
|
|
|
|
};
|
2016-04-06 12:57:42 +02:00
|
|
|
enum FRSKYX
|
|
|
|
{
|
2020-07-21 01:40:14 +02:00
|
|
|
CH_16 = 0,
|
|
|
|
CH_8 = 1,
|
|
|
|
EU_16 = 2,
|
|
|
|
EU_8 = 3,
|
|
|
|
XCLONE_16 = 4,
|
|
|
|
XCLONE_8 = 5,
|
2016-04-06 12:57:42 +02:00
|
|
|
};
|
2016-09-09 18:34:20 +02:00
|
|
|
enum HONTAI
|
|
|
|
{
|
2018-01-30 12:02:45 +01:00
|
|
|
HONTAI = 0,
|
|
|
|
JJRCX1 = 1,
|
2018-09-03 16:02:43 +02:00
|
|
|
X5C1 = 2,
|
|
|
|
FQ777_951 =3,
|
2016-09-09 18:34:20 +02:00
|
|
|
};
|
2016-12-12 11:15:37 +01:00
|
|
|
enum V2X2
|
|
|
|
{
|
|
|
|
V2X2 = 0,
|
|
|
|
JXD506 = 1,
|
2020-06-20 21:40:03 +02:00
|
|
|
V2X2_MR101 = 2,
|
2016-12-12 11:15:37 +01:00
|
|
|
};
|
2016-12-12 15:47:58 +01:00
|
|
|
enum FY326
|
|
|
|
{
|
|
|
|
FY326 = 0,
|
|
|
|
FY319 = 1,
|
|
|
|
};
|
2017-01-03 19:19:53 +01:00
|
|
|
enum WK2x01
|
|
|
|
{
|
|
|
|
WK2801 = 0,
|
WK2x01: subprotocols addition
WK2801 number 0, 8 channels, fixed id is not supported
WK2401 number 1, 4 channels
W6_5_1 number 2, 6 channels
W6_6_1 number 3, 7 channels
W6_HEL number 4, 6 channels, option is used to limit COL
W6_HEL_I number 5, 6 channels, COL inverted, option is used to limit COL
2017-01-03 19:56:20 +01:00
|
|
|
WK2401 = 1,
|
|
|
|
W6_5_1 = 2,
|
|
|
|
W6_6_1 = 3,
|
|
|
|
W6_HEL = 4,
|
|
|
|
W6_HEL_I= 5,
|
2017-01-03 19:19:53 +01:00
|
|
|
};
|
2017-01-24 16:58:41 +01:00
|
|
|
enum Q303
|
|
|
|
{
|
|
|
|
Q303 = 0,
|
|
|
|
CX35 = 1,
|
|
|
|
CX10D = 2,
|
|
|
|
CX10WD = 3,
|
|
|
|
};
|
2017-11-23 18:44:31 +01:00
|
|
|
enum CABELL
|
|
|
|
{
|
|
|
|
CABELL_V3 = 0,
|
|
|
|
CABELL_V3_TELEMETRY = 1,
|
|
|
|
CABELL_SET_FAIL_SAFE= 6,
|
|
|
|
CABELL_UNBIND = 7,
|
|
|
|
};
|
2017-11-29 14:13:12 +01:00
|
|
|
enum H8_3D
|
|
|
|
{
|
|
|
|
H8_3D = 0,
|
|
|
|
H20H = 1,
|
|
|
|
H20MINI = 2,
|
|
|
|
H30MINI = 3,
|
|
|
|
};
|
2018-01-03 13:04:58 +01:00
|
|
|
enum CORONA
|
|
|
|
{
|
|
|
|
COR_V1 = 0,
|
|
|
|
COR_V2 = 1,
|
2018-07-20 19:13:56 +02:00
|
|
|
FD_V3 = 2,
|
2018-01-03 13:04:58 +01:00
|
|
|
};
|
2018-08-03 18:29:24 +02:00
|
|
|
enum HITEC
|
|
|
|
{
|
2018-08-09 19:51:07 +02:00
|
|
|
OPT_FW = 0,
|
|
|
|
OPT_HUB = 1,
|
|
|
|
MINIMA = 2,
|
2018-08-03 18:29:24 +02:00
|
|
|
};
|
2018-11-06 21:43:55 +01:00
|
|
|
enum E01X
|
|
|
|
{
|
|
|
|
E012 = 0,
|
|
|
|
E015 = 1,
|
2019-02-28 21:11:05 +01:00
|
|
|
E016H = 2,
|
2018-11-06 21:43:55 +01:00
|
|
|
};
|
2019-04-18 10:44:42 +02:00
|
|
|
enum GD00X
|
2019-04-02 09:16:13 +02:00
|
|
|
{
|
|
|
|
GD_V1 = 0,
|
|
|
|
GD_V2 = 1,
|
|
|
|
};
|
2019-04-18 10:44:42 +02:00
|
|
|
enum BUGSMINI
|
|
|
|
{
|
|
|
|
BUGSMINI= 0,
|
|
|
|
BUGS3H = 1,
|
|
|
|
};
|
2019-06-17 17:16:39 +02:00
|
|
|
enum REDPINE
|
|
|
|
{
|
|
|
|
RED_FAST= 0,
|
|
|
|
RED_SLOW= 1,
|
|
|
|
};
|
2019-08-06 17:27:42 +02:00
|
|
|
enum TRAXXAS
|
|
|
|
{
|
|
|
|
RX6519 = 0,
|
|
|
|
};
|
2019-11-28 17:01:33 +01:00
|
|
|
enum ESKY150
|
|
|
|
{
|
|
|
|
ESKY150_4CH = 0,
|
|
|
|
ESKY150_7CH = 1,
|
|
|
|
};
|
2020-01-12 14:06:27 +01:00
|
|
|
enum V911S
|
|
|
|
{
|
|
|
|
V911S_STD = 0,
|
|
|
|
V911S_E119 = 1,
|
|
|
|
};
|
2020-01-14 12:19:12 +01:00
|
|
|
enum XK
|
|
|
|
{
|
|
|
|
X450 = 0,
|
|
|
|
X420 = 1,
|
|
|
|
};
|
2019-12-19 17:26:47 +01:00
|
|
|
enum XN297DUMP
|
|
|
|
{
|
|
|
|
XN297DUMP_250K = 0,
|
|
|
|
XN297DUMP_1M = 1,
|
|
|
|
XN297DUMP_2M = 2,
|
|
|
|
XN297DUMP_AUTO = 3,
|
|
|
|
};
|
2020-01-24 12:12:07 +01:00
|
|
|
enum FRSKY_R9
|
|
|
|
{
|
2020-01-24 14:59:26 +01:00
|
|
|
R9_915 = 0,
|
|
|
|
R9_868 = 1,
|
|
|
|
R9_915_8CH = 2,
|
|
|
|
R9_868_8CH = 3,
|
2020-07-06 09:52:43 +02:00
|
|
|
R9_FCC = 4,
|
|
|
|
R9_EU = 5,
|
|
|
|
R9_FCC_8CH = 6,
|
|
|
|
R9_EU_8CH = 7,
|
2020-01-24 12:12:07 +01:00
|
|
|
};
|
2020-03-21 15:16:01 +01:00
|
|
|
enum ESKY
|
|
|
|
{
|
|
|
|
ESKY_STD = 0,
|
|
|
|
ESKY_ET4 = 1,
|
|
|
|
};
|
2019-08-06 17:27:42 +02:00
|
|
|
|
2020-04-10 19:32:50 +02:00
|
|
|
enum FRSKY_RX
|
|
|
|
{
|
|
|
|
FRSKY_RX = 0,
|
|
|
|
FRSKY_CLONE = 1,
|
|
|
|
};
|
|
|
|
|
2020-04-11 20:09:32 +02:00
|
|
|
enum FRSKYL
|
|
|
|
{
|
|
|
|
LR12 = 0,
|
|
|
|
LR12_6CH = 1,
|
|
|
|
};
|
|
|
|
|
2020-06-01 22:55:32 +02:00
|
|
|
enum HOTT
|
|
|
|
{
|
|
|
|
HOTT_SYNC = 0,
|
|
|
|
HOTT_NO_SYNC= 1,
|
|
|
|
};
|
|
|
|
|
2020-06-02 19:04:05 +02:00
|
|
|
enum PELIKAN
|
|
|
|
{
|
|
|
|
PELIKAN_PRO = 0,
|
|
|
|
PELIKAN_LITE= 1,
|
|
|
|
};
|
|
|
|
|
2020-06-26 17:54:56 +02:00
|
|
|
enum V761
|
|
|
|
{
|
2020-06-27 17:58:29 +02:00
|
|
|
V761_3CH = 0,
|
|
|
|
V761_4CH = 1,
|
2020-06-26 17:54:56 +02:00
|
|
|
};
|
|
|
|
|
2020-08-01 19:19:11 +02:00
|
|
|
enum HEIGHT
|
2020-07-31 10:42:10 +02:00
|
|
|
{
|
2020-08-01 19:19:11 +02:00
|
|
|
HEIGHT_5CH = 0,
|
|
|
|
HEIGHT_8CH = 1,
|
2020-07-31 10:42:10 +02:00
|
|
|
};
|
|
|
|
|
2020-09-29 11:24:55 +02:00
|
|
|
enum KYOSHO
|
|
|
|
{
|
|
|
|
KYOSHO_FHSS = 0,
|
|
|
|
KYOSHO_HYPE = 1,
|
|
|
|
};
|
|
|
|
|
2020-10-30 12:01:29 +01:00
|
|
|
enum JJRC345
|
|
|
|
{
|
|
|
|
JJRC345 = 0,
|
|
|
|
SKYTMBLR = 1,
|
|
|
|
};
|
|
|
|
|
2016-03-08 22:20:49 +01:00
|
|
|
#define NONE 0
|
|
|
|
#define P_HIGH 1
|
|
|
|
#define P_LOW 0
|
|
|
|
#define AUTOBIND 1
|
|
|
|
#define NO_AUTOBIND 0
|
|
|
|
|
|
|
|
struct PPM_Parameters
|
|
|
|
{
|
2019-10-29 00:36:57 +01:00
|
|
|
uint8_t protocol;
|
|
|
|
uint8_t sub_proto : 3;
|
|
|
|
uint8_t rx_num : 6;
|
|
|
|
uint8_t power : 1;
|
|
|
|
uint8_t autobind : 1;
|
2019-10-28 23:29:34 +01:00
|
|
|
int8_t option;
|
2019-09-23 18:13:25 +02:00
|
|
|
uint32_t chan_order;
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
|
|
|
|
2016-12-13 23:58:13 +01:00
|
|
|
// Telemetry
|
2017-12-17 01:13:43 +01:00
|
|
|
enum MultiPacketTypes
|
|
|
|
{
|
|
|
|
MULTI_TELEMETRY_STATUS = 1,
|
|
|
|
MULTI_TELEMETRY_SPORT = 2,
|
|
|
|
MULTI_TELEMETRY_HUB = 3,
|
|
|
|
MULTI_TELEMETRY_DSM = 4,
|
|
|
|
MULTI_TELEMETRY_DSMBIND = 5,
|
|
|
|
MULTI_TELEMETRY_AFHDS2A = 6,
|
2019-10-10 23:12:09 +02:00
|
|
|
MULTI_TELEMETRY_REUSE_1 = 7,
|
2017-12-17 01:13:43 +01:00
|
|
|
MULTI_TELEMETRY_SYNC = 8,
|
2019-10-10 23:12:09 +02:00
|
|
|
MULTI_TELEMETRY_REUSE_2 = 9,
|
2018-08-03 18:29:24 +02:00
|
|
|
MULTI_TELEMETRY_HITEC = 10,
|
2019-09-10 23:37:54 +02:00
|
|
|
MULTI_TELEMETRY_SCANNER = 11,
|
2019-09-14 16:34:19 +02:00
|
|
|
MULTI_TELEMETRY_AFHDS2A_AC = 12,
|
2019-09-17 23:35:19 +02:00
|
|
|
MULTI_TELEMETRY_RX_CHANNELS = 13,
|
2019-11-05 00:31:20 +01:00
|
|
|
MULTI_TELEMETRY_HOTT = 14,
|
2016-12-13 23:58:13 +01:00
|
|
|
};
|
|
|
|
|
2016-09-21 14:28:37 +02:00
|
|
|
// Macros
|
|
|
|
#define NOP() __asm__ __volatile__("nop")
|
|
|
|
|
2019-11-29 18:50:57 +01:00
|
|
|
//***************
|
|
|
|
//*** Tests ***
|
|
|
|
//***************
|
2020-10-30 12:01:29 +01:00
|
|
|
#define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_FUTABA || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || protocol==PROTO_FRSKY_R9)
|
|
|
|
#define IS_CHMAP_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_FUTABA || protocol==PROTO_WK2x01 || protocol== PROTO_DSM || protocol==PROTO_SLT || protocol==PROTO_FLYSKY || (protocol==PROTO_KYOSHO && sub_protocol==KYOSHO_HYPE) || protocol==PROTO_ESKY || protocol==PROTO_J6PRO || protocol==PROTO_PELIKAN || protocol==PROTO_SKYARTEC || protocol==PROTO_ESKY150V2 || protocol==PROTO_DSM_RX)
|
2019-11-29 18:50:57 +01:00
|
|
|
|
2016-09-21 14:28:37 +02:00
|
|
|
//***************
|
|
|
|
//*** Flags ***
|
|
|
|
//***************
|
2016-03-08 22:20:49 +01:00
|
|
|
#define RX_FLAG_on protocol_flags |= _BV(0)
|
|
|
|
#define RX_FLAG_off protocol_flags &= ~_BV(0)
|
|
|
|
#define IS_RX_FLAG_on ( ( protocol_flags & _BV(0) ) !=0 )
|
|
|
|
//
|
|
|
|
#define CHANGE_PROTOCOL_FLAG_on protocol_flags |= _BV(1)
|
2016-09-21 14:28:37 +02:00
|
|
|
#define CHANGE_PROTOCOL_FLAG_off protocol_flags &= ~_BV(1)
|
2016-03-08 22:20:49 +01:00
|
|
|
#define IS_CHANGE_PROTOCOL_FLAG_on ( ( protocol_flags & _BV(1) ) !=0 )
|
|
|
|
//
|
|
|
|
#define POWER_FLAG_on protocol_flags |= _BV(2)
|
|
|
|
#define POWER_FLAG_off protocol_flags &= ~_BV(2)
|
|
|
|
#define IS_POWER_FLAG_on ( ( protocol_flags & _BV(2) ) !=0 )
|
|
|
|
//
|
|
|
|
#define RANGE_FLAG_on protocol_flags |= _BV(3)
|
|
|
|
#define RANGE_FLAG_off protocol_flags &= ~_BV(3)
|
|
|
|
#define IS_RANGE_FLAG_on ( ( protocol_flags & _BV(3) ) !=0 )
|
|
|
|
//
|
|
|
|
#define AUTOBIND_FLAG_on protocol_flags |= _BV(4)
|
|
|
|
#define AUTOBIND_FLAG_off protocol_flags &= ~_BV(4)
|
|
|
|
#define IS_AUTOBIND_FLAG_on ( ( protocol_flags & _BV(4) ) !=0 )
|
|
|
|
//
|
|
|
|
#define BIND_BUTTON_FLAG_on protocol_flags |= _BV(5)
|
|
|
|
#define BIND_BUTTON_FLAG_off protocol_flags &= ~_BV(5)
|
|
|
|
#define IS_BIND_BUTTON_FLAG_on ( ( protocol_flags & _BV(5) ) !=0 )
|
|
|
|
//PPM RX OK
|
2016-09-21 14:28:37 +02:00
|
|
|
#define PPM_FLAG_off protocol_flags &= ~_BV(6)
|
2016-03-08 22:20:49 +01:00
|
|
|
#define PPM_FLAG_on protocol_flags |= _BV(6)
|
|
|
|
#define IS_PPM_FLAG_on ( ( protocol_flags & _BV(6) ) !=0 )
|
2016-09-21 14:28:37 +02:00
|
|
|
//Bind flag
|
2016-03-08 22:20:49 +01:00
|
|
|
#define BIND_IN_PROGRESS protocol_flags &= ~_BV(7)
|
|
|
|
#define BIND_DONE protocol_flags |= _BV(7)
|
2018-01-03 13:04:58 +01:00
|
|
|
#define IS_BIND_DONE ( ( protocol_flags & _BV(7) ) !=0 )
|
|
|
|
#define IS_BIND_IN_PROGRESS ( ( protocol_flags & _BV(7) ) ==0 )
|
2016-09-21 14:28:37 +02:00
|
|
|
//
|
2017-12-07 16:02:18 +01:00
|
|
|
#define FAILSAFE_VALUES_off protocol_flags2 &= ~_BV(0)
|
|
|
|
#define FAILSAFE_VALUES_on protocol_flags2 |= _BV(0)
|
|
|
|
#define IS_FAILSAFE_VALUES_on ( ( protocol_flags2 & _BV(0) ) !=0 )
|
2016-09-21 14:28:37 +02:00
|
|
|
//
|
2017-12-11 13:00:08 +01:00
|
|
|
#define RX_DONOTUPDATE_off protocol_flags2 &= ~_BV(1)
|
|
|
|
#define RX_DONOTUPDATE_on protocol_flags2 |= _BV(1)
|
|
|
|
#define IS_RX_DONOTUPDATE_on ( ( protocol_flags2 & _BV(1) ) !=0 )
|
2016-09-21 14:28:37 +02:00
|
|
|
//
|
2016-08-25 11:26:08 +02:00
|
|
|
#define RX_MISSED_BUFF_off protocol_flags2 &= ~_BV(2)
|
|
|
|
#define RX_MISSED_BUFF_on protocol_flags2 |= _BV(2)
|
|
|
|
#define IS_RX_MISSED_BUFF_on ( ( protocol_flags2 & _BV(2) ) !=0 )
|
2016-09-21 14:28:37 +02:00
|
|
|
//TX Pause
|
|
|
|
#define TX_MAIN_PAUSE_off protocol_flags2 &= ~_BV(3)
|
|
|
|
#define TX_MAIN_PAUSE_on protocol_flags2 |= _BV(3)
|
|
|
|
#define IS_TX_MAIN_PAUSE_on ( ( protocol_flags2 & _BV(3) ) !=0 )
|
2016-08-31 10:26:27 +02:00
|
|
|
#define TX_RX_PAUSE_off protocol_flags2 &= ~_BV(4)
|
2016-09-21 14:28:37 +02:00
|
|
|
#define TX_RX_PAUSE_on protocol_flags2 |= _BV(4)
|
|
|
|
#define IS_TX_RX_PAUSE_on ( ( protocol_flags2 & _BV(4) ) !=0 )
|
2016-08-31 10:26:27 +02:00
|
|
|
#define IS_TX_PAUSE_on ( ( protocol_flags2 & (_BV(4)|_BV(3)) ) !=0 )
|
2019-10-07 19:06:00 +02:00
|
|
|
#define IS_TX_PAUSE_off ( ( protocol_flags2 & (_BV(4)|_BV(3)) ) ==0 )
|
2016-11-17 12:08:44 +01:00
|
|
|
//Signal OK
|
|
|
|
#define INPUT_SIGNAL_off protocol_flags2 &= ~_BV(5)
|
|
|
|
#define INPUT_SIGNAL_on protocol_flags2 |= _BV(5)
|
|
|
|
#define IS_INPUT_SIGNAL_on ( ( protocol_flags2 & _BV(5) ) !=0 )
|
|
|
|
#define IS_INPUT_SIGNAL_off ( ( protocol_flags2 & _BV(5) ) ==0 )
|
2017-02-10 17:37:58 +01:00
|
|
|
//Bind from channel
|
2017-01-02 18:22:03 +01:00
|
|
|
#define BIND_CH_PREV_off protocol_flags2 &= ~_BV(6)
|
|
|
|
#define BIND_CH_PREV_on protocol_flags2 |= _BV(6)
|
|
|
|
#define IS_BIND_CH_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 )
|
|
|
|
#define IS_BIND_CH_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 )
|
2017-02-10 17:37:58 +01:00
|
|
|
//Wait for bind
|
|
|
|
#define WAIT_BIND_off protocol_flags2 &= ~_BV(7)
|
|
|
|
#define WAIT_BIND_on protocol_flags2 |= _BV(7)
|
|
|
|
#define IS_WAIT_BIND_on ( ( protocol_flags2 & _BV(7) ) !=0 )
|
|
|
|
#define IS_WAIT_BIND_off ( ( protocol_flags2 & _BV(7) ) ==0 )
|
2019-10-03 16:38:50 +02:00
|
|
|
//Incoming telemetry data buffer
|
|
|
|
#define DATA_BUFFER_LOW_off protocol_flags3 &= ~_BV(0)
|
|
|
|
#define DATA_BUFFER_LOW_on protocol_flags3 |= _BV(0)
|
|
|
|
#define IS_DATA_BUFFER_LOW_on ( ( protocol_flags3 & _BV(0) ) !=0 )
|
|
|
|
#define IS_DATA_BUFFER_LOW_off ( ( protocol_flags3 & _BV(0) ) ==0 )
|
|
|
|
#define SEND_MULTI_STATUS_off protocol_flags3 &= ~_BV(1)
|
|
|
|
#define SEND_MULTI_STATUS_on protocol_flags3 |= _BV(1)
|
|
|
|
#define IS_SEND_MULTI_STATUS_on ( ( protocol_flags3 & _BV(1) ) !=0 )
|
|
|
|
#define IS_SEND_MULTI_STATUS_off ( ( protocol_flags3 & _BV(1) ) ==0 )
|
2019-10-07 19:06:00 +02:00
|
|
|
#define DISABLE_CH_MAP_off protocol_flags3 &= ~_BV(2)
|
|
|
|
#define DISABLE_CH_MAP_on protocol_flags3 |= _BV(2)
|
|
|
|
#define IS_DISABLE_CH_MAP_on ( ( protocol_flags3 & _BV(2) ) !=0 )
|
|
|
|
#define IS_DISABLE_CH_MAP_off ( ( protocol_flags3 & _BV(2) ) ==0 )
|
|
|
|
#define DISABLE_TELEM_off protocol_flags3 &= ~_BV(3)
|
|
|
|
#define DISABLE_TELEM_on protocol_flags3 |= _BV(3)
|
|
|
|
#define IS_DISABLE_TELEM_on ( ( protocol_flags3 & _BV(3) ) !=0 )
|
|
|
|
#define IS_DISABLE_TELEM_off ( ( protocol_flags3 & _BV(3) ) ==0 )
|
2020-05-02 18:20:47 +02:00
|
|
|
//LBT power
|
|
|
|
#define LBT_POWER_off protocol_flags3 &= ~_BV(7)
|
|
|
|
#define LBT_POWER_on protocol_flags3 |= _BV(7)
|
|
|
|
#define IS_LBT_POWER_on ( ( protocol_flags3 & _BV(7) ) !=0 )
|
|
|
|
#define IS_LBT_POWER_off ( ( protocol_flags3 & _BV(7) ) ==0 )
|
2019-10-07 19:06:00 +02:00
|
|
|
|
2017-02-10 17:37:58 +01:00
|
|
|
|
2017-11-24 23:01:47 +01:00
|
|
|
// Failsafe
|
2019-09-22 20:00:04 +02:00
|
|
|
#define FAILSAFE_CHANNEL_HOLD 2047
|
|
|
|
#define FAILSAFE_CHANNEL_NOPULSES 0
|
2017-11-24 23:01:47 +01:00
|
|
|
|
2017-12-15 17:31:25 +01:00
|
|
|
//********************
|
|
|
|
//** Debug messages **
|
|
|
|
//********************
|
2019-09-06 13:05:57 +01:00
|
|
|
#if defined(STM32_BOARD) && (defined (DEBUG_SERIAL) || defined (ARDUINO_MULTI_DEBUG))
|
2017-12-15 17:31:25 +01:00
|
|
|
uint16_t debug_time=0;
|
2018-11-09 00:31:26 +01:00
|
|
|
#define debug(msg, ...) {char debug_buf[64]; sprintf(debug_buf, msg, ##__VA_ARGS__); Serial.write(debug_buf);}
|
|
|
|
#define debugln(msg, ...) {char debug_buf[64]; sprintf(debug_buf, msg "\r\n", ##__VA_ARGS__); Serial.write(debug_buf);}
|
2018-11-07 15:52:39 +01:00
|
|
|
#define debug_time(msg) { uint16_t debug_time_TCNT1=TCNT1; debug_time=debug_time_TCNT1-debug_time; debug(msg "%u", debug_time>>1); debug_time=debug_time_TCNT1; }
|
2019-08-01 14:23:08 +02:00
|
|
|
#define debugln_time(msg) { uint16_t debug_time_TCNT1=TCNT1; debug_time=debug_time_TCNT1-debug_time; debug(msg "%u\r\n", debug_time>>1); debug_time=debug_time_TCNT1; }
|
2017-11-24 23:01:47 +01:00
|
|
|
#else
|
2017-12-07 16:02:18 +01:00
|
|
|
#define debug(...) { }
|
2017-12-10 09:48:20 +01:00
|
|
|
#define debugln(...) { }
|
2019-08-01 14:23:08 +02:00
|
|
|
#define debugln_time(...) { }
|
2017-12-11 18:49:50 +01:00
|
|
|
#undef DEBUG_SERIAL
|
2017-11-24 23:01:47 +01:00
|
|
|
#endif
|
2016-08-31 10:26:27 +02:00
|
|
|
|
2016-09-21 14:28:37 +02:00
|
|
|
//********************
|
|
|
|
//*** Blink timing ***
|
|
|
|
//********************
|
|
|
|
#define BLINK_BIND_TIME 100
|
|
|
|
#define BLINK_SERIAL_TIME 500
|
2016-11-17 12:08:44 +01:00
|
|
|
#define BLINK_PPM_TIME 1000
|
2016-03-08 22:20:49 +01:00
|
|
|
#define BLINK_BAD_PROTO_TIME_HIGH 50
|
2017-02-10 17:37:58 +01:00
|
|
|
#define BLINK_BAD_PROTO_TIME_LOW 1000
|
|
|
|
#define BLINK_WAIT_BIND_TIME_HIGH 1000
|
|
|
|
#define BLINK_WAIT_BIND_TIME_LOW 100
|
2018-01-30 12:02:45 +01:00
|
|
|
#define BLINK_BANK_TIME_HIGH 50
|
|
|
|
#define BLINK_BANK_TIME_LOW 500
|
|
|
|
#define BLINK_BANK_REPEAT 1500
|
2017-02-10 17:37:58 +01:00
|
|
|
|
2016-09-21 14:28:37 +02:00
|
|
|
//*******************
|
|
|
|
//*** AUX flags ***
|
|
|
|
//*******************
|
|
|
|
#define GET_FLAG(ch, mask) ( ch ? mask : 0)
|
2018-01-08 19:37:14 +01:00
|
|
|
#define CH5_SW (Channel_AUX & _BV(0))
|
|
|
|
#define CH6_SW (Channel_AUX & _BV(1))
|
|
|
|
#define CH7_SW (Channel_AUX & _BV(2))
|
|
|
|
#define CH8_SW (Channel_AUX & _BV(3))
|
|
|
|
#define CH9_SW (Channel_AUX & _BV(4))
|
|
|
|
#define CH10_SW (Channel_AUX & _BV(5))
|
|
|
|
#define CH11_SW (Channel_AUX & _BV(6))
|
|
|
|
#define CH12_SW (Channel_AUX & _BV(7))
|
|
|
|
#define CH13_SW (Channel_data[CH13]>CHANNEL_SWITCH)
|
|
|
|
#define CH14_SW (Channel_data[CH14]>CHANNEL_SWITCH)
|
|
|
|
#define CH15_SW (Channel_data[CH15]>CHANNEL_SWITCH)
|
|
|
|
#define CH16_SW (Channel_data[CH16]>CHANNEL_SWITCH)
|
2016-03-08 22:20:49 +01:00
|
|
|
|
|
|
|
//************************
|
|
|
|
//*** Power settings ***
|
|
|
|
//************************
|
|
|
|
enum {
|
|
|
|
TXPOWER_100uW,
|
|
|
|
TXPOWER_300uW,
|
|
|
|
TXPOWER_1mW,
|
|
|
|
TXPOWER_3mW,
|
|
|
|
TXPOWER_10mW,
|
|
|
|
TXPOWER_30mW,
|
|
|
|
TXPOWER_100mW,
|
|
|
|
TXPOWER_150mW
|
|
|
|
};
|
|
|
|
|
|
|
|
// A7105 power
|
2020-08-13 21:21:34 +02:00
|
|
|
// The numbers do not take into account any outside amplifier
|
2016-03-08 22:20:49 +01:00
|
|
|
enum A7105_POWER
|
|
|
|
{
|
2020-08-13 21:21:34 +02:00
|
|
|
A7105_POWER_0 = 0x00<<3 | 0x00, // -23dBm == PAC=0 TBG=0
|
|
|
|
A7105_POWER_1 = 0x00<<3 | 0x01, // -20dBm == PAC=0 TBG=1
|
|
|
|
A7105_POWER_2 = 0x00<<3 | 0x02, // -16dBm == PAC=0 TBG=2
|
|
|
|
A7105_POWER_3 = 0x00<<3 | 0x04, // -11dBm == PAC=0 TBG=4
|
|
|
|
A7105_POWER_4 = 0x01<<3 | 0x05, // -6dBm == PAC=1 TBG=5
|
|
|
|
A7105_POWER_5 = 0x02<<3 | 0x07, // 0dBm == PAC=2 TBG=7
|
|
|
|
A7105_POWER_6 = 0x03<<3 | 0x07, // +1dBm == PAC=3 TBG=7
|
|
|
|
A7105_POWER_7 = 0x03<<3 | 0x07 // +1dBm == PAC=3 TBG=7
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2016-04-06 12:57:42 +02:00
|
|
|
#define A7105_HIGH_POWER A7105_POWER_7
|
2016-03-08 22:20:49 +01:00
|
|
|
#define A7105_LOW_POWER A7105_POWER_3
|
|
|
|
#define A7105_RANGE_POWER A7105_POWER_0
|
2016-04-06 12:57:42 +02:00
|
|
|
#define A7105_BIND_POWER A7105_POWER_0
|
2016-03-08 22:20:49 +01:00
|
|
|
|
|
|
|
// NRF Power
|
2020-08-13 21:21:34 +02:00
|
|
|
// The numbers do not take into account any outside amplifier
|
2016-03-08 22:20:49 +01:00
|
|
|
enum NRF_POWER
|
2020-08-13 21:21:34 +02:00
|
|
|
{
|
|
|
|
NRF_POWER_0 = 0x00, // -18dBm
|
|
|
|
NRF_POWER_1 = 0x01, // -12dBm
|
|
|
|
NRF_POWER_2 = 0x02, // -6dBm
|
|
|
|
NRF_POWER_3 = 0x03 // 0dBm
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2018-05-04 16:08:29 +02:00
|
|
|
#define NRF_HIGH_POWER NRF_POWER_3
|
2016-03-08 22:20:49 +01:00
|
|
|
#define NRF_LOW_POWER NRF_POWER_1
|
|
|
|
#define NRF_RANGE_POWER NRF_POWER_0
|
2016-04-06 12:57:42 +02:00
|
|
|
#define NRF_BIND_POWER NRF_POWER_0
|
2016-03-08 22:20:49 +01:00
|
|
|
|
2016-04-06 14:58:06 +02:00
|
|
|
// CC2500 power output from the chip itself
|
|
|
|
// The numbers do not take into account any outside amplifier
|
2016-03-08 22:20:49 +01:00
|
|
|
enum CC2500_POWER
|
|
|
|
{
|
2017-12-11 18:49:50 +01:00
|
|
|
CC2500_POWER_0 = 0x00, // -55dbm or less
|
2016-04-06 14:58:06 +02:00
|
|
|
CC2500_POWER_1 = 0x50, // -30dbm
|
2017-12-11 18:49:50 +01:00
|
|
|
CC2500_POWER_2 = 0x44, // -28dbm
|
|
|
|
CC2500_POWER_3 = 0xC0, // -26dbm
|
|
|
|
CC2500_POWER_4 = 0x84, // -24dbm
|
|
|
|
CC2500_POWER_5 = 0x81, // -22dbm
|
|
|
|
CC2500_POWER_6 = 0x46, // -20dbm
|
|
|
|
CC2500_POWER_7 = 0x93, // -18dbm
|
|
|
|
CC2500_POWER_8 = 0x55, // -16dbm
|
|
|
|
CC2500_POWER_9 = 0x8D, // -14dbm
|
2016-04-06 14:58:06 +02:00
|
|
|
CC2500_POWER_10 = 0xC6, // -12dbm
|
|
|
|
CC2500_POWER_11 = 0x97, // -10dbm
|
|
|
|
CC2500_POWER_12 = 0x6E, // -8dbm
|
|
|
|
CC2500_POWER_13 = 0x7F, // -6dbm
|
|
|
|
CC2500_POWER_14 = 0xA9, // -4dbm
|
|
|
|
CC2500_POWER_15 = 0xBB, // -2dbm
|
|
|
|
CC2500_POWER_16 = 0xFE, // 0dbm
|
|
|
|
CC2500_POWER_17 = 0xFF // +1dbm
|
2016-03-08 22:20:49 +01:00
|
|
|
};
|
2017-11-20 16:01:12 +01:00
|
|
|
#define CC2500_HIGH_POWER CC2500_POWER_17
|
2020-05-02 18:20:47 +02:00
|
|
|
#define CC2500_LBT_POWER CC2500_POWER_14
|
2016-04-10 20:04:11 +02:00
|
|
|
#define CC2500_LOW_POWER CC2500_POWER_13
|
2016-04-06 14:58:06 +02:00
|
|
|
#define CC2500_RANGE_POWER CC2500_POWER_1
|
|
|
|
#define CC2500_BIND_POWER CC2500_POWER_1
|
2016-03-08 22:20:49 +01:00
|
|
|
|
|
|
|
// CYRF power
|
2020-08-13 21:21:34 +02:00
|
|
|
// The numbers do not take into account any outside amplifier
|
2016-03-08 22:20:49 +01:00
|
|
|
enum CYRF_POWER
|
|
|
|
{
|
|
|
|
CYRF_POWER_0 = 0x00, // -35dbm
|
|
|
|
CYRF_POWER_1 = 0x01, // -30dbm
|
|
|
|
CYRF_POWER_2 = 0x02, // -24dbm
|
|
|
|
CYRF_POWER_3 = 0x03, // -18dbm
|
|
|
|
CYRF_POWER_4 = 0x04, // -13dbm
|
|
|
|
CYRF_POWER_5 = 0x05, // -5dbm
|
|
|
|
CYRF_POWER_6 = 0x06, // 0dbm
|
|
|
|
CYRF_POWER_7 = 0x07 // +4dbm
|
|
|
|
};
|
|
|
|
#define CYRF_HIGH_POWER CYRF_POWER_7
|
|
|
|
#define CYRF_LOW_POWER CYRF_POWER_3
|
2016-04-06 14:58:06 +02:00
|
|
|
#define CYRF_RANGE_POWER CYRF_POWER_1 // 1/30 of the full power distance
|
2016-09-01 14:00:42 +02:00
|
|
|
#define CYRF_BIND_POWER CYRF_POWER_0
|
2016-03-08 22:20:49 +01:00
|
|
|
|
|
|
|
enum TXRX_State {
|
|
|
|
TXRX_OFF,
|
|
|
|
TX_EN,
|
|
|
|
RX_EN
|
|
|
|
};
|
|
|
|
|
|
|
|
// Packet ack status values
|
|
|
|
enum {
|
|
|
|
PKT_PENDING = 0,
|
|
|
|
PKT_ACKED,
|
|
|
|
PKT_TIMEOUT
|
|
|
|
};
|
|
|
|
|
2016-08-15 11:52:43 +02:00
|
|
|
// baudrate defines for serial
|
|
|
|
#define SPEED_100K 0
|
|
|
|
#define SPEED_9600 1
|
2016-09-16 10:39:44 +02:00
|
|
|
#define SPEED_57600 2
|
|
|
|
#define SPEED_125K 3
|
2016-08-15 11:52:43 +02:00
|
|
|
|
2017-11-24 23:01:47 +01:00
|
|
|
/** EEPROM Layout */
|
|
|
|
#define EEPROM_ID_OFFSET 10 // Module ID (4 bytes)
|
2018-01-30 12:02:45 +01:00
|
|
|
#define EEPROM_BANK_OFFSET 15 // Current bank number (1 byte)
|
2017-11-24 23:01:47 +01:00
|
|
|
#define EEPROM_ID_VALID_OFFSET 20 // 1 byte flag that ID is valid
|
2018-08-28 16:13:28 +02:00
|
|
|
#define MODELMODE_EEPROM_OFFSET 30 // Autobind mode, 1 byte per model, end is 30+16=46
|
2018-10-17 13:23:27 +02:00
|
|
|
#define AFHDS2A_EEPROM_OFFSET 50 // RX ID, 4 bytes per model id, end is 50+64=114
|
2019-06-09 14:51:21 +02:00
|
|
|
#define BUGS_EEPROM_OFFSET 114 // RX ID, 2 bytes per model id, end is 114+32=146
|
|
|
|
#define BUGSMINI_EEPROM_OFFSET 146 // RX ID, 2 bytes per model id, end is 146+32=178
|
2019-10-14 00:28:39 +02:00
|
|
|
#define FRSKY_RX_EEPROM_OFFSET 178 // (1) format + (3) TX ID + (1) freq_tune + (47) channels, 52 bytes, end is 178+52=230
|
|
|
|
#define AFHDS2A_RX_EEPROM_OFFSET 230 // (4) TX ID + (16) channels, 20 bytes, end is 230+20=250
|
|
|
|
#define AFHDS2A_EEPROM_OFFSET2 250 // RX ID, 4 bytes per model id, end is 250+192=442
|
2019-11-04 19:16:19 +01:00
|
|
|
#define HOTT_EEPROM_OFFSET 442 // RX ID, 5 bytes per model id, end is 320+442=762
|
2019-11-29 02:06:58 +01:00
|
|
|
#define BAYANG_RX_EEPROM_OFFSET 762 // (5) TX ID + (4) channels, 9 bytes, end is 771
|
2020-04-13 22:10:58 +02:00
|
|
|
#define FRSKYD_CLONE_EEPROM_OFFSET 771 // (1) format + (3) TX ID + (47) channels, 51 bytes, end is 822
|
|
|
|
#define FRSKYX_CLONE_EEPROM_OFFSET 822 // (1) format + (3) TX ID + (47) channels, 51 bytes, end is 873
|
|
|
|
#define FRSKYX2_CLONE_EEPROM_OFFSET 873 // (1) format + (3) TX ID, 4 bytes, end is 877
|
2020-05-17 15:45:23 +02:00
|
|
|
#define DSM_RX_EEPROM_OFFSET 877 // (4) TX ID + format, 5 bytes, end is 882
|
|
|
|
//#define CONFIG_EEPROM_OFFSET 882 // Current configuration of the multimodule
|
2017-11-24 23:01:47 +01:00
|
|
|
|
2020-10-30 11:21:39 +00:00
|
|
|
/* STM32 Flash Size */
|
|
|
|
#ifndef DISABLE_FLASH_SIZE_CHECK
|
|
|
|
#ifdef MCU_STM32F103C8
|
|
|
|
#define MCU_EXPECTED_FLASH_SIZE 64 // STM32F103C8 has 64KB of flash space
|
|
|
|
#else
|
|
|
|
#define MCU_EXPECTED_FLASH_SIZE 128 // STM32F103CB has 128KB of flash space
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2016-03-08 22:20:49 +01:00
|
|
|
//****************************************
|
|
|
|
//*** MULTI protocol serial definition ***
|
|
|
|
//****************************************
|
|
|
|
/*
|
2019-10-07 19:06:00 +02:00
|
|
|
***************************
|
2016-03-08 22:20:49 +01:00
|
|
|
16 channels serial protocol
|
2019-10-07 19:06:00 +02:00
|
|
|
***************************
|
2016-03-08 22:20:49 +01:00
|
|
|
Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
2019-10-12 19:50:41 +02:00
|
|
|
Total of 26 bytes for protocol V1, variable length 27..36 for protocol V2
|
2019-10-07 19:06:00 +02:00
|
|
|
Stream[0] = header
|
|
|
|
0x55 sub_protocol values are 0..31 Stream contains channels
|
|
|
|
0x54 sub_protocol values are 32..63 Stream contains channels
|
|
|
|
0x57 sub_protocol values are 0..31 Stream contains failsafe
|
|
|
|
0x56 sub_protocol values are 32..63 Stream contains failsafe
|
2016-03-08 22:20:49 +01:00
|
|
|
Stream[1] = sub_protocol|BindBit|RangeCheckBit|AutoBindBit;
|
2019-09-30 20:53:10 +02:00
|
|
|
sub_protocol is 0..31 (bits 0..4), value should be added with 32 if Stream[0] = 0x54 | 0x56
|
2019-10-07 19:06:00 +02:00
|
|
|
Reserved 0
|
|
|
|
Flysky 1
|
|
|
|
Hubsan 2
|
|
|
|
FrskyD 3
|
|
|
|
Hisky 4
|
|
|
|
V2x2 5
|
|
|
|
DSM 6
|
|
|
|
Devo 7
|
|
|
|
YD717 8
|
|
|
|
KN 9
|
|
|
|
SymaX 10
|
|
|
|
SLT 11
|
|
|
|
CX10 12
|
|
|
|
CG023 13
|
|
|
|
Bayang 14
|
|
|
|
FrskyX 15
|
|
|
|
ESky 16
|
|
|
|
MT99XX 17
|
|
|
|
MJXQ 18
|
|
|
|
SHENQI 19
|
|
|
|
FY326 20
|
|
|
|
SFHSS 21
|
|
|
|
J6PRO 22
|
|
|
|
FQ777 23
|
|
|
|
ASSAN 24
|
|
|
|
FrskyV 25
|
|
|
|
HONTAI 26
|
|
|
|
OpenLRS 27
|
|
|
|
AFHDS2A 28
|
|
|
|
Q2X2 29
|
|
|
|
WK2x01 30
|
|
|
|
Q303 31
|
|
|
|
GW008 32
|
|
|
|
DM002 33
|
|
|
|
CABELL 34
|
|
|
|
ESKY150 35
|
|
|
|
H8_3D 36
|
|
|
|
CORONA 37
|
|
|
|
CFlie 38
|
|
|
|
Hitec 39
|
|
|
|
WFLY 40
|
|
|
|
BUGS 41
|
|
|
|
BUGSMINI 42
|
|
|
|
TRAXXAS 43
|
|
|
|
NCC1701 44
|
|
|
|
E01X 45
|
|
|
|
V911S 46
|
|
|
|
GD00X 47
|
|
|
|
V761 48
|
|
|
|
KF606 49
|
|
|
|
REDPINE 50
|
|
|
|
POTENSIC 51
|
|
|
|
ZSX 52
|
2020-08-01 19:19:11 +02:00
|
|
|
HEIGHT 53
|
2019-10-07 19:06:00 +02:00
|
|
|
SCANNER 54
|
2019-10-12 19:50:11 +02:00
|
|
|
FRSKY_RX 55
|
2019-10-15 02:04:19 +02:00
|
|
|
AFHDS2A_RX 56
|
2019-11-02 20:51:41 +01:00
|
|
|
HOTT 57
|
2019-11-27 12:12:13 +01:00
|
|
|
FX816 58
|
2019-11-28 20:02:59 +01:00
|
|
|
BAYANG_RX 59
|
2019-12-19 22:39:01 +01:00
|
|
|
PELIKAN 60
|
2019-12-19 23:40:33 +01:00
|
|
|
TIGER 61
|
2020-01-14 12:19:12 +01:00
|
|
|
XK 62
|
|
|
|
XN297DUMP 63
|
2020-01-24 12:12:07 +01:00
|
|
|
FRSKYX2 64
|
|
|
|
FRSKY_R9 65
|
2020-04-03 19:36:05 +02:00
|
|
|
PROPEL 66
|
2020-04-18 19:04:38 +02:00
|
|
|
FRSKYL 67
|
|
|
|
SKYARTEC 68
|
2020-05-08 19:55:16 +02:00
|
|
|
ESKY150V2 69
|
2020-05-21 11:47:51 +02:00
|
|
|
DSM_RX 70
|
|
|
|
JJRC345 71
|
2020-05-24 17:39:14 +02:00
|
|
|
Q90C 72
|
2020-07-10 15:25:32 +02:00
|
|
|
KYOSHO 73
|
2020-07-22 15:37:47 +02:00
|
|
|
RLINK 74
|
2020-08-10 23:54:33 +02:00
|
|
|
REALACC 76
|
2020-08-15 16:17:18 +02:00
|
|
|
OMP 77
|
2016-03-08 22:20:49 +01:00
|
|
|
BindBit=> 0x80 1=Bind/0=No
|
|
|
|
AutoBindBit=> 0x40 1=Yes /0=No
|
|
|
|
RangeCheck=> 0x20 1=Yes /0=No
|
|
|
|
Stream[2] = RxNum | Power | Type;
|
|
|
|
RxNum value is 0..15 (bits 0..3)
|
|
|
|
Type is 0..7 <<4 (bit 4..6)
|
|
|
|
sub_protocol==Flysky
|
2016-09-19 18:58:09 +02:00
|
|
|
Flysky 0
|
|
|
|
V9x9 1
|
|
|
|
V6x6 2
|
|
|
|
V912 3
|
2016-11-29 22:30:03 +01:00
|
|
|
CX20 4
|
2017-11-30 20:12:23 +01:00
|
|
|
sub_protocol==Hubsan
|
|
|
|
H107 0
|
|
|
|
H301 1
|
|
|
|
H501 2
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==Hisky
|
2016-09-19 18:58:09 +02:00
|
|
|
Hisky 0
|
|
|
|
HK310 1
|
2016-09-01 14:00:42 +02:00
|
|
|
sub_protocol==DSM
|
2016-09-19 18:58:09 +02:00
|
|
|
DSM2_22 0
|
|
|
|
DSM2_11 1
|
|
|
|
DSMX_22 2
|
|
|
|
DSMX_11 3
|
2016-11-17 12:08:44 +01:00
|
|
|
DSM_AUTO 4
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==YD717
|
2016-09-19 18:58:09 +02:00
|
|
|
YD717 0
|
|
|
|
SKYWLKR 1
|
|
|
|
SYMAX4 2
|
|
|
|
XINXUN 3
|
|
|
|
NIHUI 4
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==KN
|
2016-09-19 18:58:09 +02:00
|
|
|
WLTOYS 0
|
|
|
|
FEILUN 1
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==SYMAX
|
2016-09-19 18:58:09 +02:00
|
|
|
SYMAX 0
|
|
|
|
SYMAX5C 1
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==CX10
|
|
|
|
CX10_GREEN 0
|
|
|
|
CX10_BLUE 1 // also compatible with CX10-A, CX12
|
|
|
|
DM007 2
|
2016-11-23 21:56:00 +01:00
|
|
|
--- 3
|
2016-03-08 22:20:49 +01:00
|
|
|
JC3015_1 4
|
|
|
|
JC3015_2 5
|
|
|
|
MK33041 6
|
2016-11-23 21:56:00 +01:00
|
|
|
sub_protocol==Q2X2
|
|
|
|
Q222 0
|
|
|
|
Q242 1
|
|
|
|
Q282 2
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==CG023
|
|
|
|
CG023 0
|
|
|
|
YD829 1
|
2016-12-02 10:19:35 +01:00
|
|
|
sub_protocol==BAYANG
|
|
|
|
BAYANG 0
|
|
|
|
H8S3D 1
|
2017-11-20 16:01:12 +01:00
|
|
|
X16_AH 2
|
2017-11-28 17:17:02 +01:00
|
|
|
IRDRONE 3
|
2019-05-09 18:23:19 +02:00
|
|
|
DHD_D4 4
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==MT99XX
|
|
|
|
MT99 0
|
|
|
|
H7 1
|
|
|
|
YZ 2
|
2016-08-01 21:57:18 +02:00
|
|
|
LS 3
|
2016-12-09 10:19:35 +01:00
|
|
|
FY805 4
|
2016-03-08 22:20:49 +01:00
|
|
|
sub_protocol==MJXQ
|
|
|
|
WLH08 0
|
|
|
|
X600 1
|
|
|
|
X800 2
|
|
|
|
H26D 3
|
2016-08-28 14:03:22 +02:00
|
|
|
E010 4
|
2016-12-13 14:58:02 +01:00
|
|
|
H26WH 5
|
2019-04-15 10:48:20 +02:00
|
|
|
PHOENIX 6
|
2020-04-13 22:10:58 +02:00
|
|
|
sub_protocol==FRSKYD
|
|
|
|
FRSKYD 0
|
|
|
|
DCLONE 1
|
2016-04-06 12:57:42 +02:00
|
|
|
sub_protocol==FRSKYX
|
|
|
|
CH_16 0
|
|
|
|
CH_8 1
|
2017-01-30 16:10:32 +01:00
|
|
|
EU_16 2
|
|
|
|
EU_8 3
|
2020-04-13 22:10:58 +02:00
|
|
|
XCLONE 4
|
|
|
|
sub_protocol==FRSKYX2
|
|
|
|
CH_16 0
|
|
|
|
CH_8 1
|
|
|
|
EU_16 2
|
|
|
|
EU_8 3
|
|
|
|
XCLONE 4
|
2016-09-09 18:34:20 +02:00
|
|
|
sub_protocol==HONTAI
|
2018-01-30 12:02:45 +01:00
|
|
|
HONTAI 0
|
|
|
|
JJRCX1 1
|
|
|
|
X5C1 2
|
|
|
|
FQ777_951 3
|
2016-11-06 16:36:44 +01:00
|
|
|
sub_protocol==AFHDS2A
|
|
|
|
PWM_IBUS 0
|
|
|
|
PPM_IBUS 1
|
|
|
|
PWM_SBUS 2
|
|
|
|
PPM_SBUS 3
|
2020-07-15 23:58:41 +02:00
|
|
|
PWM_IB16 4
|
|
|
|
PPM_IB16 5
|
2016-12-12 11:15:37 +01:00
|
|
|
sub_protocol==V2X2
|
|
|
|
V2X2 0
|
|
|
|
JXD506 1
|
2020-06-20 21:40:03 +02:00
|
|
|
V2X2_MR101 2
|
2016-12-12 15:47:58 +01:00
|
|
|
sub_protocol==FY326
|
|
|
|
FY326 0
|
|
|
|
FY319 1
|
2017-01-03 19:19:53 +01:00
|
|
|
sub_protocol==WK2x01
|
|
|
|
WK2801 0
|
WK2x01: subprotocols addition
WK2801 number 0, 8 channels, fixed id is not supported
WK2401 number 1, 4 channels
W6_5_1 number 2, 6 channels
W6_6_1 number 3, 7 channels
W6_HEL number 4, 6 channels, option is used to limit COL
W6_HEL_I number 5, 6 channels, COL inverted, option is used to limit COL
2017-01-03 19:56:20 +01:00
|
|
|
WK2401 1
|
|
|
|
W6_5_1 2
|
|
|
|
W6_6_1 3
|
|
|
|
W6_HEL 4
|
|
|
|
W6_HEL_I 5
|
2017-01-24 16:58:41 +01:00
|
|
|
sub_protocol==Q303
|
|
|
|
Q303 0
|
|
|
|
CX35 1
|
|
|
|
CX10D 2
|
|
|
|
CX10WD 3
|
2017-11-23 18:44:31 +01:00
|
|
|
sub_protocol==CABELL
|
|
|
|
CABELL_V3 0
|
|
|
|
CABELL_V3_TELEMETRY 1
|
|
|
|
CABELL_SET_FAIL_SAFE 6
|
|
|
|
CABELL_UNBIND 7
|
2017-11-29 14:13:12 +01:00
|
|
|
sub_protocol==H8_3D
|
|
|
|
H8_3D 0
|
|
|
|
H20H 1
|
|
|
|
H20MINI 2
|
|
|
|
H30MINI 3
|
2018-01-03 13:04:58 +01:00
|
|
|
sub_protocol==CORONA
|
|
|
|
COR_V1 0
|
|
|
|
COR_V2 1
|
2018-07-20 19:13:56 +02:00
|
|
|
FD_V3 2
|
2018-08-03 18:29:24 +02:00
|
|
|
sub_protocol==HITEC
|
2018-08-09 19:51:07 +02:00
|
|
|
OPT_FW 0
|
|
|
|
OPT_HUB 1
|
|
|
|
MINIMA 2
|
2018-09-03 16:02:43 +02:00
|
|
|
sub_protocol==SLT
|
|
|
|
SLT_V1 0
|
|
|
|
SLT_V2 1
|
2018-09-10 08:11:56 +02:00
|
|
|
Q100 2
|
|
|
|
Q200 3
|
|
|
|
MR100 4
|
2018-11-06 21:43:55 +01:00
|
|
|
sub_protocol==E01X
|
|
|
|
E012 0
|
|
|
|
E015 1
|
2019-02-28 21:11:05 +01:00
|
|
|
E016H 2
|
2019-04-02 09:16:13 +02:00
|
|
|
sub_protocol==GD00X
|
|
|
|
GD_V1 0
|
|
|
|
GD_V2 1
|
2019-06-17 17:16:39 +02:00
|
|
|
sub_protocol==REDPINE
|
|
|
|
RED_FAST 0
|
|
|
|
RED_SLOW 1
|
2019-08-06 17:27:42 +02:00
|
|
|
sub_protocol==TRAXXAS
|
|
|
|
RX6519 0
|
2019-11-28 17:01:33 +01:00
|
|
|
sub_protocol==ESKY150
|
|
|
|
ESKY150_4CH 0
|
|
|
|
ESKY150_7CH 1
|
2020-01-12 14:06:27 +01:00
|
|
|
sub_protocol==V911S
|
|
|
|
V911S_STD 0
|
|
|
|
V911S_E119 1
|
2020-01-14 12:19:12 +01:00
|
|
|
sub_protocol==XK
|
|
|
|
X450 0
|
|
|
|
X420 1
|
2020-01-24 12:12:07 +01:00
|
|
|
sub_protocol==FRSKY_R9
|
2020-01-24 14:59:26 +01:00
|
|
|
R9_915 0
|
|
|
|
R9_868 1
|
|
|
|
R9_915_8CH 2
|
|
|
|
R9_868_8CH 3
|
2020-07-06 09:52:43 +02:00
|
|
|
R9_FCC 4
|
|
|
|
R9_EU 5
|
|
|
|
R9_FCC_8CH 6
|
|
|
|
R9_EU_8CH 7
|
2020-03-21 15:16:01 +01:00
|
|
|
sub_protocol==ESKY
|
|
|
|
ESKY_STD 0
|
|
|
|
ESKY_ET4 1
|
2020-04-10 19:32:50 +02:00
|
|
|
sub_protocol==FRSKY_RX
|
2020-04-11 20:09:32 +02:00
|
|
|
FRSKY_RX 0
|
|
|
|
FRSKY_CLONE 1
|
|
|
|
sub_protocol==FRSKYL
|
|
|
|
LR12 0
|
|
|
|
LR12_6CH 1
|
2020-06-01 22:55:32 +02:00
|
|
|
sub_protocol==HOTT
|
|
|
|
HOTT_SYNC 0
|
|
|
|
HOTT_NO_SYNC 1
|
2020-06-02 19:04:05 +02:00
|
|
|
sub_protocol==PELIKAN
|
|
|
|
PELIKAN_PRO 0
|
|
|
|
PELIKAN_LITE 1
|
2020-06-26 17:54:56 +02:00
|
|
|
sub_protocol==V761
|
2020-06-27 17:58:29 +02:00
|
|
|
V761_3CH 0
|
|
|
|
V761_4CH 1
|
2020-08-01 19:19:11 +02:00
|
|
|
sub_protocol==HEIGHT
|
|
|
|
HEIGHT_5CH 0
|
|
|
|
HEIGHT_8CH 1
|
2020-10-30 12:01:29 +01:00
|
|
|
sub_protocol==JJRC345
|
|
|
|
JJRC345 0
|
|
|
|
SKYTMBLR 1
|
2016-12-12 11:15:37 +01:00
|
|
|
|
2016-03-08 22:20:49 +01:00
|
|
|
Power value => 0x80 0=High/1=Low
|
|
|
|
Stream[3] = option_protocol;
|
2017-01-31 09:12:06 +01:00
|
|
|
option_protocol value is -128..127
|
2017-12-07 16:02:18 +01:00
|
|
|
Stream[4] to [25] = Channels or failsafe depending on Steam[0]
|
2016-03-08 22:20:49 +01:00
|
|
|
16 Channels on 11 bits (0..2047)
|
|
|
|
0 -125%
|
|
|
|
204 -100%
|
|
|
|
1024 0%
|
|
|
|
1843 +100%
|
|
|
|
2047 +125%
|
2017-12-07 16:02:18 +01:00
|
|
|
Values are concatenated to fit in 22 bytes like in SBUS protocol.
|
|
|
|
Failsafe values have exactly the same range/values than normal channels except the extremes where
|
2019-09-22 20:00:04 +02:00
|
|
|
0=no pulse, 2047=hold. If failsafe is not set or RX then failsafe packets should not be sent.
|
2019-10-13 22:23:32 +02:00
|
|
|
Stream[26] = sub_protocol bits 6 & 7|RxNum bits 4 & 5|Telemetry_Invert 3|Future_Use 2|Disable_Telemetry 1|Disable_CH_Mapping 0
|
2019-10-07 19:06:00 +02:00
|
|
|
sub_protocol is 0..255 (bits 0..5 + bits 6..7)
|
|
|
|
RxNum value is 0..63 (bits 0..3 + bits 4..5)
|
2019-10-09 11:58:50 +02:00
|
|
|
Telemetry_Invert => 0x08 0=normal, 1=invert
|
|
|
|
Future_Use => 0x04 0= , 1=
|
|
|
|
Disable_Telemetry => 0x02 0=enable, 1=disable
|
|
|
|
Disable_CH_Mapping => 0x01 0=enable, 1=disable
|
2019-10-12 19:50:41 +02:00
|
|
|
Stream[27.. 35] = between 0 and 9 bytes for additional protocol data
|
2020-03-30 18:22:13 +02:00
|
|
|
Protocol specific use:
|
|
|
|
FrSkyX and FrSkyX2: Stream[27] during bind Telem on=0x00,off=0x01 | CH1-8=0x00,CH9-16=0x02
|
|
|
|
FrSkyX and FrSkyX2: Stream[27..34] during normal operation unstuffed SPort data to be sent
|
|
|
|
HoTT: Stream[27] 1 byte for telemetry type
|
2020-08-31 22:21:21 +02:00
|
|
|
DSM: Stream[27..33] Forward Programming
|
2016-03-08 22:20:49 +01:00
|
|
|
*/
|
2016-12-12 20:33:10 +01:00
|
|
|
/*
|
2017-01-30 16:10:32 +01:00
|
|
|
Multimodule Status
|
|
|
|
Based on #define MULTI_STATUS
|
|
|
|
|
|
|
|
Serial: 100000 Baud 8e2 (same as input)
|
|
|
|
|
|
|
|
Format: header (2 bytes) + data (variable)
|
|
|
|
[0] = 'M' (0x4d)
|
|
|
|
[1] Length (excluding the 2 header bytes)
|
|
|
|
[2-xx] data
|
|
|
|
|
|
|
|
Type = 0x01 Multimodule Status:
|
|
|
|
[2] Flags
|
|
|
|
0x01 = Input signal detected
|
|
|
|
0x02 = Serial mode enabled
|
2017-12-07 17:28:01 +01:00
|
|
|
0x04 = Protocol is valid
|
|
|
|
0x08 = Module is in binding mode
|
|
|
|
0x10 = Module waits a bind event to load the protocol
|
2019-10-03 16:38:50 +02:00
|
|
|
0x20 = Current protocol supports failsafe
|
2019-10-08 18:52:47 +02:00
|
|
|
0x40 = Current protocol supports disable channel mapping
|
2019-10-03 16:38:50 +02:00
|
|
|
0x80 = Data buffer is almost full
|
2017-01-30 16:10:32 +01:00
|
|
|
[3] major
|
|
|
|
[4] minor
|
|
|
|
[5] revision
|
|
|
|
[6] patchlevel,
|
|
|
|
version of multi code, should be displayed as major.minor.revision.patchlevel
|
|
|
|
*/
|
|
|
|
/*
|
2017-11-24 23:01:47 +01:00
|
|
|
Multiprotocol telemetry/command definition for OpenTX
|
2017-01-30 16:10:32 +01:00
|
|
|
Based on #define MULTI_TELEMETRY enables OpenTX to get the multimodule status and select the correct telemetry type automatically.
|
2016-12-12 20:33:10 +01:00
|
|
|
|
|
|
|
Serial: 100000 Baud 8e2 (same as input)
|
|
|
|
|
|
|
|
TLV Protocol (type, length, value), allows a TX to ignore unknown messages
|
|
|
|
|
|
|
|
Format: header (4 byte) + data (variable)
|
|
|
|
[0] = 'M' (0x4d)
|
|
|
|
[1] = 'P' (0x50)
|
|
|
|
|
|
|
|
The first byte is deliberatly chosen to be different from other telemetry protocols
|
|
|
|
(e.g. 0xAA for DSM/Multi, 0xAA for FlySky and 0x7e for Frsky) to allow a TX to detect
|
|
|
|
the telemetry format of older versions
|
|
|
|
|
|
|
|
[2] Type (see below)
|
|
|
|
[3] Length (excluding the 4 header bytes)
|
|
|
|
|
|
|
|
[4-xx] data
|
|
|
|
|
2017-11-24 23:01:47 +01:00
|
|
|
Commands from TX to multi cannot be longer than 22 bytes (RXLen -4byte header)
|
|
|
|
|
2017-01-30 16:10:32 +01:00
|
|
|
Type = 0x01 Multimodule Status:
|
2016-12-12 20:33:10 +01:00
|
|
|
[4] Flags
|
|
|
|
0x01 = Input signal detected
|
|
|
|
0x02 = Serial mode enabled
|
2019-10-03 16:38:50 +02:00
|
|
|
0x04 = Protocol is valid
|
|
|
|
0x08 = Module is in binding mode
|
|
|
|
0x10 = Module waits a bind event to load the protocol
|
|
|
|
0x20 = Current protocol supports failsafe
|
2019-10-09 11:58:50 +02:00
|
|
|
0x40 = Current protocol supports disable channel mapping
|
2019-10-03 16:38:50 +02:00
|
|
|
0x80 = Data buffer is almost full
|
2016-12-13 23:58:13 +01:00
|
|
|
[5] major
|
2016-12-19 17:33:30 +01:00
|
|
|
[6] minor
|
2016-12-22 10:31:00 +01:00
|
|
|
[7] revision
|
2019-10-09 11:58:50 +02:00
|
|
|
[8] patchlevel
|
|
|
|
version of multi code, should be displayed as major.minor.revision.patchlevel
|
|
|
|
[9] channel order: CH4|CH3|CH2|CH1 with CHx value A=0,E=1,T=2,R=3
|
2019-10-15 02:04:19 +02:00
|
|
|
[10] Next valid protocol number, can be used to skip invalid protocols
|
|
|
|
[11] Prev valid protocol number, can be used to skip invalid protocols
|
|
|
|
[12..18] Protocol name [7], not null terminated if prototcol len == 7
|
2019-10-17 09:41:20 +02:00
|
|
|
[19>>4] Option text to be displayed:
|
2019-10-15 02:04:19 +02:00
|
|
|
OPTION_NONE 0
|
|
|
|
OPTION_OPTION 1
|
|
|
|
OPTION_RFTUNE 2
|
|
|
|
OPTION_VIDFREQ 3
|
|
|
|
OPTION_FIXEDID 4
|
|
|
|
OPTION_TELEM 5
|
|
|
|
OPTION_SRVFREQ 6
|
2019-11-04 19:16:19 +01:00
|
|
|
OPTION_MAXTHR 7
|
2019-11-09 19:26:31 +01:00
|
|
|
OPTION_RFCHAN 8
|
2020-06-07 18:06:19 +02:00
|
|
|
OPTION_RFPOWER 9
|
2019-10-17 09:41:20 +02:00
|
|
|
[19&0x0F] Number of sub protocols
|
|
|
|
[20..27] Sub protocol name [8], not null terminated if sub prototcol len == 8
|
2020-04-21 11:43:48 +02:00
|
|
|
If the current protocol is invalid [12..27] are all 0x00.
|
|
|
|
|
2016-12-12 20:33:10 +01:00
|
|
|
more information can be added by specifing a longer length of the type, the TX will just ignore these bytes
|
|
|
|
|
2017-01-30 16:10:32 +01:00
|
|
|
Type 0x02 Frksy S.port telemetry
|
|
|
|
Type 0x03 Frsky Hub telemetry
|
2016-12-12 20:33:10 +01:00
|
|
|
|
2016-12-13 23:58:13 +01:00
|
|
|
*No* usual frsky byte stuffing and without start/stop byte (0x7e)
|
2016-12-12 20:33:10 +01:00
|
|
|
|
2017-01-30 16:10:32 +01:00
|
|
|
Type 0x04 Spektrum telemetry data
|
2018-08-08 00:30:19 +02:00
|
|
|
data[0] TX RSSI
|
2016-12-12 20:33:10 +01:00
|
|
|
data[1-15] telemetry data
|
|
|
|
|
2017-01-30 16:10:32 +01:00
|
|
|
Type 0x05 DSM bind data
|
2016-12-12 20:33:10 +01:00
|
|
|
data[0-16] DSM bind data
|
|
|
|
|
2017-11-24 23:01:47 +01:00
|
|
|
technically DSM bind data is only 10 bytes but multi sends 16
|
|
|
|
like with telemtery, check length field)
|
2016-12-12 20:33:10 +01:00
|
|
|
|
2019-09-14 16:34:19 +02:00
|
|
|
Type 0x06 Flysky AFHDS2 telemetry data type 0xAA
|
2016-12-12 20:33:10 +01:00
|
|
|
length: 29
|
|
|
|
data[0] = RSSI value
|
|
|
|
data[1-28] telemetry data
|
|
|
|
|
2019-10-10 23:12:09 +02:00
|
|
|
Type 0x08 Input synchronisation
|
|
|
|
Informs the TX about desired rate and current delay
|
|
|
|
length: 4
|
|
|
|
data[0-1] Desired refresh rate in ??s
|
|
|
|
data[2-3] Time (??s) between last serial servo input received and servo input needed (lateness), TX should adjust its
|
|
|
|
sending time to minimise this value.
|
|
|
|
data[4] Interval of this message in ms
|
|
|
|
data[5] Input delay target in 10??s
|
|
|
|
Note that there are protocols (AFHDS2A) that have a refresh rate that is smaller than the maximum achievable
|
|
|
|
refresh rate via the serial protocol, in this case, the TX should double the rate and also subract this
|
|
|
|
refresh rate from the input lag if the input lag is more than the desired refresh rate.
|
|
|
|
The remote should try to get to zero of (inputdelay+target*10).
|
|
|
|
|
2018-08-03 18:29:24 +02:00
|
|
|
Type 0x0A Hitec telemetry data
|
2018-08-08 00:30:19 +02:00
|
|
|
length: 8
|
|
|
|
data[0] = TX RSSI value
|
|
|
|
data[1] = TX LQI value
|
|
|
|
data[2] = frame number
|
|
|
|
data[3-7] telemetry data
|
|
|
|
Full description at the bottom of Hitec_cc2500.ino
|
2018-08-03 18:29:24 +02:00
|
|
|
|
2019-09-14 16:34:19 +02:00
|
|
|
Type 0x0B Spectrum Scanner telemetry data
|
2019-09-10 23:37:54 +02:00
|
|
|
length: 6
|
|
|
|
data[0] = start channel (2400 + x*0.333 Mhz)
|
|
|
|
data[1-5] power levels
|
2019-09-14 16:34:19 +02:00
|
|
|
|
|
|
|
Type 0x0C Flysky AFHDS2 telemetry data type 0xAC
|
|
|
|
length: 29
|
|
|
|
data[0] = RSSI value
|
|
|
|
data[1-28] telemetry data
|
|
|
|
|
2019-09-17 23:35:19 +02:00
|
|
|
Type 0x0D RX channels forwarding
|
|
|
|
length: variable
|
|
|
|
data[0] = received packets per second
|
|
|
|
data[1] = rssi
|
|
|
|
data[2] = start channel
|
|
|
|
data[3] = number of channels to follow
|
|
|
|
data[4-]= packed channels data, 11 bit per channel
|
|
|
|
|
2019-11-05 00:31:20 +01:00
|
|
|
Type 0x0E HoTT telemetry
|
2019-11-07 11:13:48 +01:00
|
|
|
length: 14
|
2019-11-05 00:31:20 +01:00
|
|
|
data[0] = TX_RSSI
|
|
|
|
data[1] = TX_LQI
|
2019-11-07 11:13:48 +01:00
|
|
|
data[2] = type
|
|
|
|
data[3] = page
|
|
|
|
data[4-13] = data
|
2019-11-05 00:31:20 +01:00
|
|
|
|
2017-12-01 16:46:42 +01:00
|
|
|
*/
|