Compare commits

...

49 Commits

Author SHA1 Message Date
Jon Sturm
dcbc557bf7
Enable Telemetry on DumbRC receivers (#1111)
Tested with X6FGv1.1, X6FP, X6DC(G)v1.1

I also tested with multiple X6F receivers and some gave RSSI Telem and some gave nothing.
2 of them had the same PCB as the X6FP and neither gave telemetry.
I had a third with the same PCB with the X6FP which did give RSSI
and of my two with an older PCB one gives RSSI telem and the other does not.

Of the receivers I tried only one set packet_in[6] to match the TX packet[1] and it was the
oldest receiver of the ones I own.
2025-05-10 11:51:48 +02:00
pascallanger
e556f5cc40 SGF22 telem improvement? 2025-04-16 07:53:47 +02:00
pascallanger
9ef2415178
Update Protocols_Details.md (#1101) 2025-04-03 18:39:02 +02:00
pascallanger
bc1a809325 Update Protocols_Details.md 2025-04-03 18:36:31 +02:00
pascallanger
082e96e381 DSMR timing 2025-04-02 18:02:44 +02:00
pascallanger
abd26ee113 Update SGF22_nrf24l01.ino 2025-04-02 14:24:18 +02:00
pascallanger
98518b3c92 Update Protocols_Details.md 2025-04-02 14:11:58 +02:00
pascallanger
d19de99172 SGF22 telemetry 2025-04-02 14:10:54 +02:00
pascallanger
13024e3816 Update SGF22_nrf24l01.ino 2025-04-01 23:01:18 +02:00
pascallanger
90fb2d745f Update AFHDS2A_a7105.ino 2025-03-31 22:21:33 +02:00
pascallanger
fa13b67f3a Update Validate.h 2025-03-31 14:56:46 +02:00
pascallanger
10be906bec Update Validate.h 2025-03-31 14:43:42 +02:00
pascallanger
f538884d48 XK2 low batt telemetry 2025-03-28 19:13:13 +01:00
pascallanger
d3e5acf704 Update Protocols_Details.md 2025-03-28 10:33:39 +01:00
pascallanger
2ac4745c62 FX/QF012 telemetry 2025-03-21 21:48:29 +01:00
pascallanger
889e01c7c6 MouldKg update 2025-03-20 17:28:33 +01:00
pascallanger
db5f1f8899 Added AFHDS2A BS4/BS6 support 2025-03-20 14:49:34 +01:00
pascallanger
d091c57e10 MouldKg swap CH5 and CH6 2025-03-14 10:34:15 +01:00
pascallanger
0fcb4b7f1a FX telemetry 2025-03-13 20:15:57 +01:00
pascallanger
432e2e08a4 FX small changes 2025-03-13 19:13:14 +01:00
pascallanger
77efe467ad MouldKg renamed subprotocols 2025-03-13 18:42:34 +01:00
pascallanger
b9c828c878 MouldKg multi 6 ports brick support 2025-03-13 18:29:56 +01:00
pascallanger
99cd4d34d4 MT99xx Trim channels 2025-03-12 17:20:54 +01:00
pascallanger
a9be2a8644 Update MouldKg_nrf24l01.ino 2025-03-12 14:05:53 +01:00
pascallanger
835facd2c3 XK2 Gyro off 2025-03-12 07:45:05 +01:00
pascallanger
9e20e47c5a FX/QF012 details 2 2025-03-12 07:34:47 +01:00
pascallanger
a916275f0d FX/QF012 details 2025-03-12 07:31:32 +01:00
rdba2k
9beade33de
Add FX_QF012 subprotocol (#1091) 2025-03-12 07:17:08 +01:00
pascallanger
5ba70c3571 Update Protocols_Details.md 2025-03-10 17:40:46 +01:00
pascallanger
168aa89c57 New SFC protocol WL91x 2025-03-10 17:38:37 +01:00
pascallanger
fa055e991c ASF try 1 2025-02-27 16:56:58 +01:00
pascallanger
5437d88642 DSMR SR6200 test 1 2025-02-26 21:12:34 +01:00
pascallanger
d800f2c333 SLT2 final 2025-02-26 11:31:26 +01:00
pascallanger
78f6af6448 SLT2 last trial? 2025-02-26 00:00:49 +01:00
pascallanger
b04d4a54f7 SLT2 trial 3 2025-02-25 22:08:50 +01:00
pascallanger
ed65c81add SLT2 trial 2 2025-02-25 20:31:46 +01:00
pascallanger
9bdc24c42a SLT2 trial 2025-02-25 15:39:16 +01:00
pascallanger
7107d46d29 SHENQI2 new protocol 2025-02-24 17:04:07 +01:00
pascallanger
825f560cbb
Update Protocols_Details.md 2025-02-22 11:51:55 +01:00
pascallanger
ccaec304d5 KAMTOM telemetry 2025-02-22 11:48:03 +01:00
pascallanger
22d45349cc
Update Compiling.md (#1078) 2025-02-22 11:36:23 +01:00
pascallanger
5f26d624ad
Update Compiling.md 2025-02-22 11:23:49 +01:00
pascallanger
496c07943f KAMTOM new surface protocol
Missing low batt telem
2025-02-21 21:46:18 +01:00
pascallanger
af87b0f6d1 Update UDIRC_ccnrf.ino 2025-02-19 17:16:04 +01:00
pascallanger
2918e63fb4 XN297Emu add ReSendPayload 2025-02-19 11:54:29 +01:00
pascallanger
ed63ef7efe Update UDIRC_ccnrf.ino 2025-02-19 11:33:17 +01:00
pascallanger
36d25c7773 Update UDIRC_ccnrf.ino 2025-02-19 11:21:26 +01:00
pascallanger
a3ef2b94d4 Update MultiChan.txt 2025-02-18 19:32:19 +01:00
pascallanger
ad8b45773d UDIRC new protocol / WIP 2025-02-18 11:18:13 +01:00
27 changed files with 1664 additions and 643 deletions

View File

@ -54,10 +54,9 @@
28,1,Flysky_AFHDS2A,PPM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
28,2,Flysky_AFHDS2A,PWM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
28,3,Flysky_AFHDS2A,PPM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
28,6,Flysky_AFHDS2A,PWM_SB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
28,7,Flysky_AFHDS2A,PPM_SB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
28,4,Flysky_AFHDS2A,Gyro_Off,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,ST_Ga,TH_Ga,Prio,Calib
28,5,Flysky_AFHDS2A,Gyro_On,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,ST_Ga,TH_Ga,Prio,Calib
28,6,Flysky_AFHDS2A,G_On_Rev,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,ST_Ga,TH_Ga,Prio,Calib
56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
56,1,Flysky2A_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14
53,0,Height,5ch,0,Gear
@ -91,6 +90,7 @@
58,1,FX,620,1
58,2,FX,9630,1,Rate,Gyro,TrimR,TrimA,TrimE
58,3,FX,Q560,1,FLIP,Gyro,LEDs
58,4,FX,QF012,1,FLIP,Gyro,Invert,Reset
20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib
20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib
23,0,FY326,FY326,1,Flip,RTH,HLess,Expert
@ -133,14 +133,16 @@
18,4,MJXQ,E010,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate
18,5,MJXQ,H26WH,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate
18,6,MJXQ,Phoenix,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate
17,0,MT99XX,Std,1,Flip,LED,Pict,Video,HLess
17,1,MT99XX,H7,1,Flip,LED,Pict,Video,HLess
17,2,MT99XX,YZ,1,Flip,LED,Pict,Video,HLess
17,3,MT99XX,LS,1,Flip,Invert,Pict,Video,HLess
17,4,MT99XX,FY805,1,Flip,n-a,n-a,n-a,HLess
17,5,MT99XX,A180,0,3D_6G
17,6,MT99XX,Dragon,0,Mode,RTH
17,7,MT99XX,F949G,0,6G_3D,Light
17,0,MT99XX,Std,1,Flip,LED,Pict,Video,HLess,Atrim,Etrim
17,1,MT99XX,H7,1,Flip,LED,Pict,Video,HLess,Atrim,Etrim
17,2,MT99XX,YZ,1,Flip,LED,Pict,Video,HLess,Atrim,Etrim
17,3,MT99XX,LS,1,Flip,Invert,Pict,Video,HLess,Atrim,Etrim
17,4,MT99XX,FY805,1,Flip,n-a,n-a,n-a,HLess,Atrim,Etrim
17,5,MT99XX,A180,0,3D_6G,Rate,3D_6G,n-a,n-a,Atrim,Etrim
17,6,MT99XX,Dragon,0,Mode,RTH,n-a,n-a,n-a,Atrim,Etrim
17,7,MT99XX,F949G,0,6G_3D,Light,Rates,Unk1,Unk2,Atrim,Etrim
92,0,MT99xx2,PA18,0,MODE,FLIP,RTH,n-a,n-a,Atrim,Etrim
92,1,MT99xx2,SU35,0,Mode,LED,LED_FH,Invert,Rate,Atrim,Etrim
44,0,NCC1701,Std,1,Warp
77,0,OMP,M2,0,THold,IdleUp,6G_3D
60,0,Pelikan,PRO_V4,0,CH5,CH6,CH7,CH8
@ -213,11 +215,10 @@
85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH
87,0,IKEA
89,0,LOSI
90,0,MouldKg,Analog,0
90,1,MouldKg,Digit,0
90,0,MouldKg,A4444,0
90,1,MouldKg,D4444,0
90,2,MouldKg,A664,0
91,0,Xerall,Tank,0,FlTa,TakLan,Rate,HLess,Photo,Video,TrimR,TrimE,TrimA
92,0,MT99xx2,PA18,0,MODE,FLIP,RTH
92,1,MT99xx2,SU35,0,Mode,LED,LED_FH,Invert,Rate
93,0,Kyosho2,KT-17,0
94,0,Scorpio
95,0,Bluefly,HP100,0,CH5,CH6,CH7,CH8
@ -229,5 +230,8 @@
98,0,Kyosho3,ASF,0
100,0,YuXiang,Std,0,Lock,Rate,Land,Manual,Flip,Mode,Pitch
102,0,JIABAILE,Std,0,Speed,Light,Flash
102,1,JIABAILE,Gyro,0,Speed,Light,Flash,Tr_ST
102,1,JIABAILE,Gyro,0,Speed,Light,Flash,ST_Tr
103,0,H36,Std,1,Flip,HLess,RTH
104,0,KAMTOM,Std,0,ST_Tr,TH_Tr,TH_DR
105,0,Shenqi2,Std,1
106,0,WL91x,Std,0

View File

@ -183,8 +183,18 @@ uint16_t AFHDS2A_RX_callback()
case AFHDS2A_RX_DATA:
if (AFHDS2A_RX_data_ready()) {
A7105_ReadData(AFHDS2A_RX_TXPACKET_SIZE);
if (memcmp(&packet[1], rx_id, 4) == 0 && memcmp(&packet[5], rx_tx_addr, 4) == 0) {
if (packet[0] == 0x58 && packet[37] == 0x00 && (telemetry_link&0x7F) == 0) { // standard packet, send channels to TX
if (memcmp(&packet[1], rx_id, 4) == 0 && memcmp(&packet[5], rx_tx_addr, 4) == 0)
{
#if 0
//if(packet[0] == 0xAA)
{
for(uint8_t i=0;i<AFHDS2A_RX_TXPACKET_SIZE;i++)
debug(" %02X",packet[i]);
debugln("");
}
#endif
if (packet[0] == 0x58 && packet[37] == 0x00 && (telemetry_link&0x7F) == 0)
{ // standard packet, send channels to TX
int rssi = min(A7105_ReadReg(A7105_1D_RSSI_THOLD),160);
RX_RSSI = map16b(rssi, 160, 8, 0, 128);
AFHDS2A_RX_build_telemetry_packet();

View File

@ -93,15 +93,16 @@ static void AFHDS2A_update_telemetry()
if (option & 0x80)
{// forward 0xAA and 0xAC telemetry to TX, skip rx and tx id to save space
packet_in[0]= TX_RSSI;
debug("T(%02X)=",packet[0]);
#if 0
debug("T(%02X)=",packet[0]);
for(uint8_t i=9;i < AFHDS2A_RXPACKET_SIZE; i++)
debug(" %02X",packet[i]);
debugln("");
#endif
for(uint8_t i=9;i < AFHDS2A_RXPACKET_SIZE; i++)
{
packet_in[i-8]=packet[i];
debug(" %02X",packet[i]);
}
packet_in[29]=packet[0]; // 0xAA Normal telemetry, 0xAC Extended telemetry
telemetry_link=2;
debugln("");
return;
}
#endif
@ -186,16 +187,40 @@ static void AFHDS2A_build_packet(uint8_t type)
case AFHDS2A_PACKET_STICKS:
packet[0] = 0x58;
//16 channels + RX_LQI on channel 17
for(uint8_t ch=0; ch<num_ch; ch++)
for(uint8_t ch=0; ch<17; ch++)
{
if(ch == 16 // CH17=RX_LQI
#ifdef AFHDS2A_LQI_CH
|| ch == (AFHDS2A_LQI_CH-1) // override channel with LQI
#endif
)
val = 2000 - 10*RX_LQI;
val = convert_channel_ppm(sub_protocol<AFHDS2A_GYRO_OFF?CH_AETR[ch]:ch); // No remapping for BS receivers
if(ch<14)
{
packet[9 + ch*2] = val;
packet[10 + ch*2] = (val>>8)&0x0F;
}
else
val = convert_channel_ppm(CH_AETR[ch]);
{
if(ch == 16) //CH17=RX_LQI
val = 2000 - 10*RX_LQI;
packet[10 + (ch-14)*6] |= (val)<<4;
packet[12 + (ch-14)*6] |= (val)&0xF0;
packet[14 + (ch-14)*6] |= (val>>4)&0xF0;
}
}
{
uint8_t next_hop = (hopping_frequency_no+1)&0x0F;
packet[34] |= next_hop<<4;
packet[36] |= next_hop?0x80:0x90;
}
break;
case AFHDS2A_PACKET_FAILSAFE:
packet[0] = 0x56;
for(uint8_t ch=0; ch<16; ch++)
{ // Failsafe values
#ifdef FAILSAFE_ENABLE
val = Failsafe_data[protocol==PROTO_AFHDS2A?CH_AETR[ch]:ch]; // No remapping for BS receivers
if(val!=FAILSAFE_CHANNEL_HOLD && val!=FAILSAFE_CHANNEL_NOPULSES)
val = (((val<<2)+val)>>3)+860;
else
#endif
val = 0x0FFF;
if(ch<14)
{
packet[9 + ch*2] = val;
@ -209,42 +234,6 @@ static void AFHDS2A_build_packet(uint8_t type)
}
}
break;
case AFHDS2A_PACKET_FAILSAFE:
packet[0] = 0x56;
for(uint8_t ch=0; ch<num_ch; ch++)
{
#ifdef FAILSAFE_ENABLE
if(ch<16)
val = Failsafe_data[CH_AETR[ch]];
else
val = FAILSAFE_CHANNEL_NOPULSES;
if(val!=FAILSAFE_CHANNEL_HOLD && val!=FAILSAFE_CHANNEL_NOPULSES)
{ // Failsafe values
val = (((val<<2)+val)>>3)+860;
if(ch<14)
{
packet[9 + ch*2] = val;
packet[10 + ch*2] = (val>>8)&0x0F;
}
else
{
packet[10 + (ch-14)*6] &= 0x0F;
packet[10 + (ch-14)*6] |= (val)<<4;
packet[12 + (ch-14)*6] &= 0x0F;
packet[12 + (ch-14)*6] |= (val)&0xF0;
packet[14 + (ch-14)*6] &= 0x0F;
packet[14 + (ch-14)*6] |= (val>>4)&0xF0;
}
}
else
#endif
if(ch<14)
{ // no values
packet[9 + ch*2] = 0xff;
packet[10+ ch*2] = 0xff;
}
}
break;
case AFHDS2A_PACKET_SETTINGS:
packet[0] = 0xaa;
packet[9] = 0xfd;
@ -253,17 +242,43 @@ static void AFHDS2A_build_packet(uint8_t type)
if(val<50 || val>400) val=50; // default is 50Hz
packet[11]= val;
packet[12]= val >> 8;
packet[13] = sub_protocol & 0x01; // 1 -> PPM output enabled
packet[14]= 0x00;
for(uint8_t i=15; i<37; i++)
packet[i] = 0xff;
packet[18] = 0x05; // ?
packet[19] = 0xdc; // ?
packet[20] = 0x05; // ?
if(sub_protocol&2)
packet[21] = 0xdd; // SBUS output enabled
memset(&packet[15],0xFF,22);
#ifndef MULTI_AIR
if(sub_protocol < AFHDS2A_GYRO_OFF)
{
#endif
packet[13] = sub_protocol & 0x01; // 1 -> PPM output enabled
packet[14] = 0x00; // ?
packet[18] = 0x05; // ?
packet[19] = 0xdc; // ?
packet[20] = 0x05; // ?
if(sub_protocol&2)
packet[21] = 0xdd; // SBUS output enabled
else
packet[21] = 0xde; // IBUS
#ifndef MULTI_AIR
}
else
packet[21] = 0xde; // IBUS
{//BS receivers
if(sub_protocol == AFHDS2A_GYRO_OFF)
{
memset(&packet[15],0x00,4);
packet[22] = 0xFC; // ?
}
else
{//AFHDS2A_GYRO_ON & AFHDS2A_GYRO_ON_REV
packet[15] = convert_channel_16b_limit(CH13,0,100); // ST Gain
packet[16] = convert_channel_16b_limit(CH14,0,100); // TH Gain
packet[17] = convert_channel_16b_limit(CH15,0,100); // Priority
if(sub_protocol == AFHDS2A_GYRO_ON_REV)
packet[17] |= 0x80; // Reverse
packet[18] = CH16_SW?(0x32|0x80):0x32; // Calib|50?
packet[19] = 0x64; // 100?
packet[20] = 0x64; // 100?
packet[22] = 0xFE; // ?
}
}
#endif
break;
}
packet[37] = 0x00;
@ -283,6 +298,9 @@ uint16_t AFHDS2A_callback()
static uint16_t packet_counter;
uint8_t data_rx=0;
uint16_t start;
#ifndef MULTI_AIR
static uint16_t Prev_Channel[4] = { 0,0,0,0 };
#endif
#ifndef FORCE_AFHDS2A_TUNING
A7105_AdjustLOBaseFreq(1);
#endif
@ -367,10 +385,39 @@ uint16_t AFHDS2A_callback()
AFHDS2A_build_packet(packet_type);
data_rx=A7105_ReadReg(A7105_00_MODE); // Check if something has been received...
A7105_WriteData(AFHDS2A_TXPACKET_SIZE, hopping_frequency[hopping_frequency_no++]);
if(hopping_frequency_no >= AFHDS2A_NUMFREQ)
hopping_frequency_no = 0;
hopping_frequency_no &= 0x0F; // AFHDS2A_NUMFREQ
#if 0
for(uint8_t i=0; i<AFHDS2A_TXPACKET_SIZE; i++)
debug(" %02X",packet[i]);
debugln("");
#endif
#ifndef MULTI_AIR
if(sub_protocol > AFHDS2A_GYRO_OFF)
{//Gyro is on
//Check if gyro settings have changed
uint16_t val;
for(uint8_t i=0;i<4;i++)
{
val = Channel_data[CH13+i] - Prev_Channel[i];
if(val&0x8000) val ^= 0xFFFF;
if(val > 10)
{//This setting has significantly changed
Prev_Channel[i] = Channel_data[CH13+i];
packet_sent = 5;
}
}
}
if(packet_sent && (packet_counter%5)==0)
{//Inform the RX of the change
packet_type = AFHDS2A_PACKET_SETTINGS;
packet_sent--;
}
else
#endif
if(!(packet_counter % 1313))
{//Send settings every 5s
packet_type = AFHDS2A_PACKET_SETTINGS;
}
else
{
#ifdef FAILSAFE_ENABLE
@ -448,9 +495,6 @@ void AFHDS2A_init()
rx_id[i]=eeprom_read_byte((EE_ADDR)(addr+i));
}
hopping_frequency_no = 0;
if(sub_protocol&0x04)
num_ch=17;
else
num_ch=14;
packet_sent = 0;
}
#endif

View File

@ -292,7 +292,7 @@ uint16_t DSM_callback()
#define DSM_CH1_CH2_DELAY 4010 // Time between write of channel 1 and channel 2
#ifdef STM32_BOARD
#define DSM_WRITE_DELAY 1600 // Time after write to verify write complete
#define DSM_READ_DELAY 400 // Time before write to check read phase, and switch channels.
#define DSM_READ_DELAY 300 // Time before write to check read phase, and switch channels.
#else
#define DSM_WRITE_DELAY 1950 // Time after write to verify write complete
#define DSM_READ_DELAY 600 // Time before write to check read phase, and switch channels.
@ -462,7 +462,7 @@ uint16_t DSM_callback()
else
return DSM2_SFC_PERIOD - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
}
return 11000 - DSM_WRITE_DELAY - DSM_READ_DELAY;
return 10900 - DSM_WRITE_DELAY - DSM_READ_DELAY; //Was 11000 but the SR6200A needs 10900 to report telemetry correctly
}
#endif
return 11000 - DSM_CH1_CH2_DELAY - DSM_WRITE_DELAY - DSM_READ_DELAY;
@ -470,12 +470,15 @@ uint16_t DSM_callback()
case DSM_CH2_READ_B:
//Read telemetry
rx_phase = CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
//debug("ST1:%02X ",rx_phase);
if((rx_phase & 0x03) == 0x02) // RXC=1, RXE=0 then 2nd check is required (debouncing)
rx_phase |= CYRF_ReadRegister(CYRF_07_RX_IRQ_STATUS);
//debug("ST2:%02X ",rx_phase);
if((rx_phase & 0x07) == 0x02)
{ // good data (complete with no errors)
CYRF_WriteRegister(CYRF_07_RX_IRQ_STATUS, 0x80); // need to set RXOW before data read
length=CYRF_ReadRegister(CYRF_09_RX_COUNT);
//debug("RX(%d)",length);
if(length>TELEMETRY_BUFFER_SIZE-2)
length=TELEMETRY_BUFFER_SIZE-2;
CYRF_ReadDataPacketLen(packet_in+1, length);
@ -489,8 +492,11 @@ uint16_t DSM_callback()
}
#endif
packet_in[0]=CYRF_ReadRegister(CYRF_13_RSSI)&0x1F;// store RSSI of the received telemetry signal
//for(uint8_t i=0;i<length+1;i++)
// debug(" %02X", packet_in[i]);
telemetry_link=1;
}
//debugln("");
CYRF_WriteRegister(CYRF_29_RX_ABORT, 0x20); // Abort RX operation
if (phase == DSM_CH2_READ_A && (sub_protocol==DSM2_1F || sub_protocol==DSMX_1F) && num_ch < 8) // 22ms mode
{

View File

@ -34,15 +34,24 @@ Multiprotocol is distributed in the hope that it will be useful,
#define FX620_CH_OFFSET 1
#define FX9630_PACKET_PERIOD 8124 //8156 on QIDI-560
#define FX9630_BIND_PACKET_PERIOD 8124
#define FX9630_BIND_CHANNEL 51
#define FX9630_PAYLOAD_SIZE 8
#define FX9630_NUM_CHANNELS 3
#define FX9630_WRITE_TIME 500
#define FX_QF012_PACKET_PERIOD 12194
#define FX_QF012_RX_PAYLOAD_SIZE 3
//#define FORCE_FX620_ID
//#define FORCE_FX9630_ID
//#define FORCE_QIDI_ID
enum
{
FX_DATA=0,
FX_RX,
};
static void __attribute__((unused)) FX_send_packet()
{
static uint8_t trim_ch = 0;
@ -52,21 +61,20 @@ static void __attribute__((unused)) FX_send_packet()
{
XN297_Hopping(hopping_frequency_no++);
if(sub_protocol >= FX9630)
{ // FX9630 & FX_Q560
XN297_SetTXAddr(rx_tx_addr, 4);
{ // FX9630 & FX_Q560 & FX_QF012
if (hopping_frequency_no >= FX9630_NUM_CHANNELS)
{
hopping_frequency_no = 0;
if(sub_protocol == FX9630)
{
trim_ch++;
if(trim_ch > 3) trim_ch = 0;
trim_ch &= 3;
}
else // FX_Q560
else // FX_Q560 & FX_QF012
trim_ch = 0;
}
}
else // FX816 and FX620
else // FX816 & FX620
{
hopping_frequency_no &= 0x03;
}
@ -77,7 +85,7 @@ static void __attribute__((unused)) FX_send_packet()
//Channels
uint8_t val;
if (sub_protocol >= FX9630)
{ // FX9630 & FX_Q560
{ // FX9630 & FX_Q560 & FX_QF012
packet[0] = convert_channel_8b(THROTTLE);
packet[1] = convert_channel_8b(AILERON);
packet[2] = 0xFF - convert_channel_8b(ELEVATOR);
@ -85,14 +93,18 @@ static void __attribute__((unused)) FX_send_packet()
val = trim_ch==0 ? 0x20 : (convert_channel_8b(trim_ch + CH6) >> 2); // no trim on Throttle
packet[4] = val; // Trim for channel x 0C..20..34
packet[5] = (trim_ch << 4) // channel x << 4
| GET_FLAG(CH5_SW, 0x01) // DR toggle swich: 0 small throw, 1 large throw / Q560 acrobatic
| GET_FLAG(CH5_SW, (sub_protocol == FX_QF012 ? 0x08 : 0x01)) // DR toggle swich: 0 small throw, 1 large throw / Q560 acrobatic / QF012 Special effects
// FX9630 =>0:6G small throw, 1:6G large throw, 2:3D
// QIDI-550=>0:3D, 1:6G, 2:Torque
// QF012=>0:beginner(6G), 1:mid(3D), 2:expert(Gyro off)
| (Channel_data[CH6] < CHANNEL_MIN_COMMAND ? 0x00 : (Channel_data[CH6] > CHANNEL_MAX_COMMAND ? 0x04 : 0x02));
if(sub_protocol == FX_Q560)
packet[5] |= GET_FLAG(CH7_SW, 0x18); // Q560 LED flag 0x10 conflicting with trim_ch... Corrected on new boards using 0x08 instead
else if (sub_protocol == FX_QF012)
packet[5] |= GET_FLAG(CH7_SW, 0x40) // QF012 invert flight
| GET_FLAG(CH8_SW, 0x80); // QF012 Restore fine tunning midpoint
}
else // FX816 and FX620
else // FX816 & FX620
{
uint8_t offset=sub_protocol == FX816 ? FX816_CH_OFFSET:FX620_CH_OFFSET;
val=convert_channel_8b(AILERON);
@ -130,7 +142,7 @@ static void __attribute__((unused)) FX_send_packet()
packet[5] = 0xAB; // Is it based on ID??
}
}
else // FX9630 & FX_Q560
else // FX9630 & FX_Q560 & FX_QF012
{
if(IS_BIND_IN_PROGRESS)
{
@ -182,11 +194,11 @@ static void __attribute__((unused)) FX_RF_init()
packet_period = FX620_BIND_PACKET_PERIOD;
packet_length = FX620_PAYLOAD_SIZE;
}
else // FX9630 & FX_Q560
else // FX9630 & FX_Q560 & FX_QF012
{
XN297_SetTXAddr((uint8_t *)"\x56\x78\x90\x12", 4);
XN297_RFChannel(FX9630_BIND_CHANNEL);
packet_period = FX9630_BIND_PACKET_PERIOD;
packet_period = sub_protocol == FX_QF012 ? FX_QF012_PACKET_PERIOD : FX9630_PACKET_PERIOD;
packet_length = FX9630_PAYLOAD_SIZE;
}
}
@ -214,15 +226,16 @@ static void __attribute__((unused)) FX_initialize_txid()
for(uint8_t i=1;i<FX_NUM_CHANNELS;i++)
hopping_frequency[i] = i*10 + hopping_frequency[0];
}
else // FX9630 & FX_Q560
else // FX9630 & FX_Q560 & FX_QF012
{
//??? Need to find out how the first RF channel is calculated ???
hopping_frequency[0] = 0x13;
//Other 2 RF channels are sent during the bind phase so they can be whatever
hopping_frequency[1] = RX_num & 0x0F + 0x1A;
hopping_frequency[2] = rx_tx_addr[3] & 0x0F + 0x38;
#ifdef FORCE_FX9630_ID
memcpy(rx_tx_addr,(uint8_t*)"\xCE\x31\x9B\x73", 4);
memcpy(hopping_frequency,"\x13\x1A\x38", FX9630_NUM_CHANNELS); //Original dump=>19=0x13,26=0x1A,56=0x38
#else
hopping_frequency[0] = 0x13; // constant???
hopping_frequency[1] = RX_num & 0x0F + 0x1A;
hopping_frequency[2] = rx_tx_addr[3] & 0x0F + 0x38;
#endif
#ifdef FORCE_QIDI_ID
memcpy(rx_tx_addr,(uint8_t*)"\x23\xDC\x76\xA2", 4);
@ -232,26 +245,79 @@ static void __attribute__((unused)) FX_initialize_txid()
//memcpy(rx_tx_addr,(uint8_t*)"\x38\xC7\x6D\x8D", 4);
//memcpy(hopping_frequency,"\x0D\x20\x3A", FX9630_NUM_CHANNELS);
#endif
//??? Need to find out how the first RF channel is calculated ???
}
}
uint16_t FX_callback()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
if(bind_counter)
if(--bind_counter==0)
#ifdef FX_HUB_TELEMETRY
bool rx=false;
switch(phase)
{
BIND_DONE;
if(sub_protocol == FX620)
{
XN297_SetTXAddr(rx_tx_addr, 3);
packet_period = FX620_PACKET_PERIOD;
}
case FX_DATA:
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#endif
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
if(bind_counter)
if(--bind_counter==0)
{
BIND_DONE;
if(sub_protocol == FX620)
{
XN297_SetTXAddr(rx_tx_addr, 3);
packet_period = FX620_PACKET_PERIOD;
}
else if(sub_protocol >= FX9630)
{ // FX9630 & FX_Q560 & FX_QF012
XN297_SetTXAddr(rx_tx_addr, 4);
#ifdef FX_HUB_TELEMETRY
XN297_SetRXAddr(rx_tx_addr, FX_QF012_RX_PAYLOAD_SIZE);
#endif
}
}
FX_send_packet();
#ifdef FX_HUB_TELEMETRY
if(sub_protocol < FX9630)
break;
if(rx)
{
debug("RX");
if(XN297_ReadPayload(packet_in, FX_QF012_RX_PAYLOAD_SIZE))
{//Good CRC
//packets: A5 00 11 -> A5 01 11
telemetry_link = 1;
v_lipo1 = packet_in[1] ? 60:81; // low voltage 3.7V
#if 0
for(uint8_t i=0; i < FX_QF012_RX_PAYLOAD_SIZE; i++)
debug(" %02X", packet_in[i]);
#endif
}
debugln();
}
phase++;
return FX9630_WRITE_TIME;
default: //FX_RX
/* { // Wait for packet to be sent before switching to receive mode
uint16_t start=(uint16_t)micros(), count=0;
while ((uint16_t)((uint16_t)micros()-(uint16_t)start) < 500)
{
if(XN297_IsPacketSent())
break;
count++;
}
debug("%d",count);
} */
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = FX_DATA;
return packet_period - FX9630_WRITE_TIME;
}
FX_send_packet();
#endif
return packet_period;
}
@ -262,6 +328,10 @@ void FX_init()
FX_RF_init();
hopping_frequency_no = 0;
bind_counter=FX_BIND_COUNT;
#ifdef FX_HUB_TELEMETRY
RX_RSSI = 100; // Dummy value
phase = FX_DATA;
#endif
}
#endif

View File

@ -0,0 +1,185 @@
/*
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/>.
*/
#if defined(KAMTOM_NRF24L01_INO)
#include "iface_xn297.h"
//#define FORCE_KAMTOM_ORIGINAL_ID
#define KAMTOM_PAYLOAD_SIZE 16
#define KAMTOM_RF_NUM_CHANNELS 4
#define KAMTOM_BIND_COUNT 2000
#define KAMTOM_WRITE_TIME 650
#define KAMTOM_BIND_CHANNEL 0x28 //40
#define KAMTOM_PACKET_PERIOD 3585
enum {
KAMTOM_DATA,
KAMTOM_RX,
};
static void __attribute__((unused)) KAMTOM_send_packet()
{
if(bind_counter)
{
bind_counter--;
if(!bind_counter)
BIND_DONE;
}
memset(packet, 0x00, 16);
if(IS_BIND_DONE)
{//Normal
XN297_Hopping(hopping_frequency_no);
hopping_frequency_no++;
hopping_frequency_no &= 3;
//RXID
packet[0] = rx_tx_addr[0];
packet[2] = rx_tx_addr[1];
//Next RF channel
packet[1] = hopping_frequency[hopping_frequency_no];
//Channels and trims
for(uint8_t i=0; i<6; i++)
{
packet[4+i] = convert_channel_s8b(CH_TAER[i]);
if(i>3) //ST_TR and TH_TR
packet[4+i] >>= 2;
}
//packet[11] = 0x00; //??
//TH_DR
packet[12] = convert_channel_16b_limit(CH7,0x25,0x64);
}
else
{
packet[1] = KAMTOM_BIND_CHANNEL;
memcpy(&packet[4],hopping_frequency,4);
packet[12] = 0xA5;
}
packet[10] = 0x40; //??
//Checksum
uint16_t sum = packet[1];
for(uint8_t i=4;i<13;i++)
sum += packet[i];
packet[13] = sum;
packet[3] = (sum>>6) & 0xFC;
//TXID
packet[14] = rx_tx_addr[2];
packet[15] = rx_tx_addr[3];
// Send
XN297_SetPower();
XN297_SetTxRxMode(TX_EN);
XN297_WriteEnhancedPayload(packet, KAMTOM_PAYLOAD_SIZE,false);
#if 0
//def DEBUG_SERIAL
for(uint8_t i=0; i < KAMTOM_PAYLOAD_SIZE; i++)
debug("%02X ", packet[i]);
debugln();
#endif
}
static void __attribute__((unused)) KAMTOM_initialize_txid()
{
calc_fh_channels(4);
#ifdef FORCE_KAMTOM_ORIGINAL_ID
rx_tx_addr[0] = 0xC7;
rx_tx_addr[1] = 0x78;
rx_tx_addr[2] = 0x2C;
rx_tx_addr[3] = 0x25;
hopping_frequency[0] = 59;
hopping_frequency[1] = 59;
hopping_frequency[2] = 71;
hopping_frequency[3] = 65;
#endif
}
static void __attribute__((unused)) KAMTOM_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
//Address
XN297_SetTXAddr((uint8_t*)"\xCC\xDD\xEE\xDD", 4);
XN297_SetRXAddr((uint8_t*)"\xCC\xDD\xEE\xDD", KAMTOM_PAYLOAD_SIZE);
XN297_RFChannel(KAMTOM_BIND_CHANNEL);
}
uint16_t KAMTOM_callback()
{
static bool rx=false;
switch(phase)
{
case KAMTOM_DATA:
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#ifdef MULTI_SYNC
telemetry_set_input_sync(KAMTOM_PACKET_PERIOD);
#endif
KAMTOM_send_packet();
if(rx)
{
uint8_t val=XN297_ReadEnhancedPayload(packet_in, KAMTOM_PAYLOAD_SIZE);
if(val==KAMTOM_PAYLOAD_SIZE)
{
BIND_DONE;
if(packet_in[0] == 0xA0 && packet_in[14] == rx_tx_addr[2] && packet_in[15] == rx_tx_addr[3])
{//Good packet with our TXID
rx_tx_addr[0] = packet_in[9];
rx_tx_addr[1] = packet_in[10];
#ifdef KAMTOM_HUB_TELEMETRY
v_lipo1 = packet_in[1] == 0x03 ? 0x00:0xFF; // low voltage
telemetry_link = 1;
#endif
}
#if 0
for(uint8_t i=0; i < KAMTOM_PAYLOAD_SIZE; i++)
debug(" %02X", packet_in[i]);
debugln();
#endif
}
}
phase++;
return KAMTOM_WRITE_TIME;
default: //KAMTOM_RX
//{ // Wait for packet to be sent before switching to receive mode
// uint16_t start=(uint16_t)micros();
// while ((uint16_t)((uint16_t)micros()-(uint16_t)start) < 500)
// if(XN297_IsPacketSent())
// break;
//}
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = KAMTOM_DATA;
return KAMTOM_PACKET_PERIOD - KAMTOM_WRITE_TIME;
}
return 0;
}
void KAMTOM_init()
{
KAMTOM_initialize_txid();
KAMTOM_RF_init();
bind_counter = KAMTOM_BIND_COUNT;
phase = KAMTOM_DATA;
hopping_frequency_no = 0;
#ifdef KAMTOM_HUB_TELEMETRY
RX_RSSI = 100; // Dummy value
#endif
}
#endif

View File

@ -112,7 +112,10 @@ void KYOSHO3_init()
debugln("RF CH: %02X",hopping_frequency[0]);
#endif
CYRF_ConfigRFChannel(hopping_frequency[0]);
if(IS_BIND_IN_PROGRESS)
CYRF_ConfigRFChannel(0x04);
else
CYRF_ConfigRFChannel(hopping_frequency[0]);
bind_counter = 8217;
phase = 0;

View File

@ -189,8 +189,8 @@ static void __attribute__((unused)) MT99XX_send_packet()
packet[1] = convert_channel_16b_limit(RUDDER ,0x00,0xE1); // rudder
packet[2] = convert_channel_16b_limit(AILERON ,0xE1,0x00); // aileron
packet[3] = convert_channel_16b_limit(ELEVATOR,0x00,0xE1); // elevator
packet[4] = 0x20; // pitch trim (0x3f-0x20-0x00)
packet[5] = 0x20; // roll trim (0x00-0x20-0x3f)
packet[4] = (convert_channel_8b(CH10) ^ 0xFF) >> 2; // aileron trim (3F..20..00)
packet[5] = convert_channel_8b(CH11) >> 2; // elevator trim (00..20..3F)
packet[6] = GET_FLAG( CH5_SW, FLAG_MT_FLIP );
if(sub_protocol != PA18+8)
packet[7] = h7_mys_byte[hopping_frequency_no]; // next rf channel index ?
@ -337,7 +337,7 @@ static void __attribute__((unused)) MT99XX_send_packet()
XN297_SetTxRxMode(TX_EN);
XN297_WritePayload(packet, MT99XX_PACKET_SIZE);
#if 0
#if 1
for(uint8_t i=0; i<MT99XX_PACKET_SIZE; i++)
debug(" %02X",packet[i]);
debugln();

View File

@ -50,12 +50,19 @@ static void __attribute__((unused)) MOULDKG_send_packet()
else
{
uint8_t n = num_ch<<2;
if(sub_protocol == MOULDKG_ANALOG)
if(sub_protocol == MOULDKG_ANALOG4 || sub_protocol == MOULDKG_ANALOG6 )
{
packet[0] = 0x36;
uint8_t ch[]={ 1,0,2,3 };
for(uint8_t i=0;i<4;i++)
packet[i+4] = convert_channel_8b(ch[i]+n);
const uint8_t ch[]={ 1,0,2,3,5,4 };
if(sub_protocol == MOULDKG_ANALOG6)
n += num_ch<<1;
for(uint8_t i=0;i<6;i++)
{
if( (i > 3 && sub_protocol == MOULDKG_ANALOG4) || i + n > 15)
packet[i+4] = 0x80; //Centered channel
else
packet[i+4] = convert_channel_8b(ch[i]+n);
}
len = MOULDKG_PAYLOAD_SIZE_ANALOG;
}
else

View File

@ -25,7 +25,7 @@
25,FrskyV
26,HONTAI,HONTAI,JJRCX1,X5C1,FQ777_951,XKK170
27,OpnLrs
28,AFHDS2A,PWM_IBUS,PPM_IBUS,PWM_SBUS,PPM_SBUS,PWM_IB16,PPM_IB16,PWM_SB16,PPM_SB16
28,AFHDS2A,PWM_IBUS,PPM_IBUS,PWM_SBUS,PPM_SBUS,Gyro_Off,Gyro_On,G_On_Rev
29,Q2X2,Q222,Q242,Q282
30,WK2x01,WK2801,WK2401,W6_5_1,W6_6_1,W6_HEL,W6_HEL_I
31,Q303,Q303,CX35,CX10D,CX10WD
@ -55,7 +55,7 @@
55,Frsky_RX,Multi,CloneTX,EraseTX,CPPM
56,AFHDS2A_RX,Multi,CPPM
57,HoTT,Sync,No_Sync
58,FX,816,620,9630,Q560
58,FX,816,620,9630,Q560,QF012
59,Bayang_RX,Multi,CPPM
60,Pelikan,Pro,Lite,SCX24
61,EazyRC
@ -86,7 +86,7 @@
87,IKEA
88,WILLIFM
89,Losi
90,MouldKg,Analog,Digit
90,MouldKg,A4444,D4444,A664
91,Xerall
92,MT99xx,PA18,SU35
93,Kyosho2,KT-17
@ -98,4 +98,7 @@
99,XK2,X4,P10
100,YuXiang
102,JIABAILE,STD,GYRO
103,H36
103,H36
104,KAMTOM
105,Shenqi2
106,WL91x

View File

@ -36,6 +36,7 @@ const char STR_MT99XX[] ="MT99XX";
const char STR_MT99XX2[] ="MT99XX2";
const char STR_MJXQ[] ="MJXq";
const char STR_SHENQI[] ="Shenqi";
const char STR_SHENQI2[] ="Shenqi2";
const char STR_FY326[] ="FY326";
const char STR_FUTABA[] ="Futaba";
const char STR_J6PRO[] ="J6 Pro";
@ -113,8 +114,10 @@ const char STR_SGF22[] ="SGF22";
const char STR_EAZYRC[] ="EazyRC";
const char STR_KYOSHO3[] ="Kyosho3";
const char STR_YUXIANG[] ="YuXiang";
const char STR_PINECONE[] ="PineCone";
const char STR_JIABAILE[] ="JIABAILE";
const char STR_UDIRC[] ="UDIRC";
const char STR_JIABAILE[] ="JIABAILE";
const char STR_KAMTOM[] ="KAMTOM";
const char STR_WL91X[] ="WL91x";
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501";
@ -144,7 +147,7 @@ const char STR_SUBTYPE_MT992[] = "\x04""PA18""SU35";
const char STR_SUBTYPE_MJXQ[] = "\x07""WLH08\0 ""X600\0 ""X800\0 ""H26D\0 ""E010\0 ""H26WH\0 ""Phoenix";
const char STR_SUBTYPE_FY326[] = "\x05""Std\0 ""FY319";
const char STR_SUBTYPE_HONTAI[] = "\x06""Std\0 ""JJRCX1""X5C1\0 ""FQ_951""XKK170";
const char STR_SUBTYPE_AFHDS2A[] = "\x08""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS""PWM,IB16""PPM,IB16""PWM,SB16""PPM,SB16";
const char STR_SUBTYPE_AFHDS2A[] = "\x08""PWM,IBUS""PPM,IBUS""PWM,SBUS""PPM,SBUS""Gyro_Off""Gyro_On\0""G_On_Rev";
const char STR_SUBTYPE_Q2X2[] = "\x04""Q222""Q242""Q282";
const char STR_SUBTYPE_WK2x01[] = "\x06""WK2801""WK2401""W6_5_1""W6_6_1""W6_HeL""W6_HeI";
const char STR_SUBTYPE_Q303[] = "\x06""Std\0 ""CX35\0 ""CX10D\0""CX10WD";
@ -181,10 +184,10 @@ const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17";
const char STR_SUBTYPE_KYOSHO3[] = "\x03""ASF";
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
const char STR_SUBTYPE_MOULDKG[] = "\x06""Analog""Digit\0";
const char STR_SUBTYPE_MOULDKG[] = "\x05""A4444""D4444""A664\0";
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630""Q560";
const char STR_SUBTYPE_FX[] = "\x05""816\0 ""620\0 ""9630\0""Q560\0""QF012";
const char STR_SUBTYPE_SGF22[] = "\x04""F22\0""F22S""J20\0";
const char STR_SUBTYPE_JIABAILE[] = "\x04""Std\0""Gyro";
#define NO_SUBTYPE nullptr
@ -304,7 +307,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_FLYSKY, STR_FLYSKY, STR_SUBTYPE_FLYSKY, 5, OPTION_NONE, 0, 1, SW_A7105, FLYSKY_init, FLYSKY_callback },
#endif
#if defined(AFHDS2A_A7105_INO)
{PROTO_AFHDS2A, STR_AFHDS2A, STR_SUBTYPE_AFHDS2A, 8, OPTION_SRVFREQ, 1, 1, SW_A7105, AFHDS2A_init, AFHDS2A_callback },
{PROTO_AFHDS2A, STR_AFHDS2A, STR_SUBTYPE_AFHDS2A, 7, OPTION_SRVFREQ, 1, 1, SW_A7105, AFHDS2A_init, AFHDS2A_callback },
#endif
#if defined(AFHDS2A_RX_A7105_INO)
{PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,STR_CPPM, NBR_CPPM, OPTION_NONE, 0, 0, SW_A7105, AFHDS2A_RX_init, AFHDS2A_RX_callback },
@ -341,7 +344,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_FUTABA, STR_FUTABA, STR_SUBTYPE_FUTABA, 1, OPTION_RFTUNE, 1, 1, SW_CC2500, SFHSS_init, SFHSS_callback },
#endif
#if defined(FX_NRF24L01_INO)
{PROTO_FX, STR_FX, STR_SUBTYPE_FX, 4, OPTION_NONE, 0, 0, SW_NRF, FX_init, FX_callback },
{PROTO_FX, STR_FX, STR_SUBTYPE_FX, 5, OPTION_NONE, 0, 0, SW_NRF, FX_init, FX_callback },
#endif
#if defined(FY326_NRF24L01_INO)
{PROTO_FY326, STR_FY326, STR_SUBTYPE_FY326, 2, OPTION_NONE, 0, 0, SW_NRF, FY326_init, FY326_callback },
@ -391,6 +394,9 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(JOYSWAY_A7105_INO)
{PROTO_JOYSWAY, STR_JOYSWAY, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_A7105, JOYSWAY_init, JOYSWAY_callback },
#endif
#if defined(KAMTOM_NRF24L01_INO)
{PROTO_KAMTOM, STR_KAMTOM, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, KAMTOM_init, KAMTOM_callback },
#endif
#if defined(KF606_CCNRF_INO)
{PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 3, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
#endif
@ -419,7 +425,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_MLINK, STR_MLINK, NO_SUBTYPE, 0, OPTION_NONE, 1, 0, SW_CYRF, MLINK_init, MLINK_callback },
#endif
#if defined(MOULDKG_NRF24L01_INO)
{PROTO_MOULDKG, STR_MOULDKG, STR_SUBTYPE_MOULDKG, 2, OPTION_OPTION, 0, 0, SW_NRF, MOULDKG_init, MOULDKG_callback },
{PROTO_MOULDKG, STR_MOULDKG, STR_SUBTYPE_MOULDKG, 3, OPTION_OPTION, 0, 0, SW_NRF, MOULDKG_init, MOULDKG_callback },
#endif
#if defined(MT99XX_CCNRF_INO)
{PROTO_MT99XX, STR_MT99XX, STR_SUBTYPE_MT99, 8, OPTION_NONE, 0, 0, SW_NRF, MT99XX_init, MT99XX_callback },
@ -436,9 +442,6 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(PELIKAN_A7105_INO)
{PROTO_PELIKAN, STR_PELIKAN, STR_SUBTYPE_PELIKAN, 3, OPTION_NONE, 0, 1, SW_A7105, PELIKAN_init, PELIKAN_callback },
#endif
#if defined(PINECONE_CCNRF_INO)
{PROTO_PINECONE, STR_PINECONE, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, PINECONE_init, PINECONE_callback },
#endif
#if defined(POTENSIC_NRF24L01_INO)
{PROTO_POTENSIC, STR_POTENSIC, STR_SUBTYPE_POTENSIC, 1, OPTION_NONE, 0, 0, SW_NRF, POTENSIC_init, POTENSIC_callback },
#endif
@ -475,6 +478,9 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(SHENQI_NRF24L01_INO)
{PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback },
#endif
#if defined(SHENQI2_NRF24L01_INO)
{PROTO_SHENQI2, STR_SHENQI2, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI2_init, SHENQI2_callback },
#endif
#if defined(SKYARTEC_CC2500_INO)
{PROTO_SKYARTEC, STR_SKYARTEC, NO_SUBTYPE, 0, OPTION_RFTUNE, 0, 1, SW_CC2500, SKYARTEC_init, SKYARTEC_callback },
#endif
@ -487,6 +493,9 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(TRAXXAS_CYRF6936_INO)
{PROTO_TRAXXAS, STR_TRAXXAS, STR_SUBTYPE_TRAXXAS, 2, OPTION_NONE, 0, 0, SW_CYRF, TRAXXAS_init, TRAXXAS_callback },
#endif
#if defined(UDIRC_CCNRF_INO)
{PROTO_UDIRC, STR_UDIRC, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, UDIRC_init, UDIRC_callback },
#endif
#if defined(V2X2_NRF24L01_INO)
{PROTO_V2X2, STR_V2X2, STR_SUBTYPE_V2X2, 3, OPTION_NONE, 0, 0, SW_NRF, V2X2_init, V2X2_callback },
#endif
@ -496,9 +505,6 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(V911S_CCNRF_INO)
{PROTO_V911S, STR_V911S, STR_SUBTYPE_V911S, 2, OPTION_RFTUNE, 0, 0, SW_NRF, V911S_init, V911S_callback },
#endif
#if defined(WK2x01_CYRF6936_INO)
{PROTO_WK2x01, STR_WK2x01, STR_SUBTYPE_WK2x01, 6, OPTION_NONE, 1, 1, SW_CYRF, WK_init, WK_callback },
#endif
#if defined(WFLY_CYRF6936_INO)
{PROTO_WFLY, STR_WFLY, STR_SUBTYPE_WFLY, 1, OPTION_NONE, 1, 0, SW_CYRF, WFLY_init, WFLY_callback },
#endif
@ -506,6 +512,13 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_WFLY2, STR_WFLY2, STR_SUBTYPE_WFLY2, 1, OPTION_OPTION, 1, 0, SW_A7105, WFLY2_init, WFLY2_callback },
// {PROTO_WFLY2, STR_WFLY2, STR_SUBTYPE_WFLY2, 1, OPTION_WBUS, 1, 0, SW_A7105, WFLY2_init, WFLY2_callback },// crash OpenTX...
#endif
#if defined(WK2x01_CYRF6936_INO)
{PROTO_WK2x01, STR_WK2x01, STR_SUBTYPE_WK2x01, 6, OPTION_NONE, 1, 1, SW_CYRF, WK_init, WK_callback },
#endif
#if defined(WL91X_CCNRF_INO)
{PROTO_WL91X, STR_WL91X, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, WL91X_init, WL91X_callback },
#endif
#if defined(XERALL_NRF24L01_INO)
{PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback },
#endif

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 4
#define VERSION_PATCH_LEVEL 31
#define VERSION_PATCH_LEVEL 50
#define MODE_SERIAL 0
@ -128,9 +128,12 @@ enum PROTOCOLS
PROTO_KYOSHO3 = 98, // =>CYRF6936
PROTO_XK2 = 99, // =>CC2500 & NRF24L01
PROTO_YUXIANG = 100, // =>NRF24L01
PROTO_PINECONE = 101, // =>CC2500 & NRF24L01
PROTO_UDIRC = 101, // =>CC2500 & NRF24L01
PROTO_JIABAILE = 102, // =>NRF24L01
PROTO_H36 = 103, // =>NRF24L01
PROTO_KAMTOM = 104, // =>NRF24L01
PROTO_SHENQI2 = 105, // =>NRF24L01
PROTO_WL91X = 106, // =>CC2500 & NRF24L01
PROTO_NANORF = 126, // =>NRF24L01
PROTO_TEST = 127, // =>CC2500
@ -156,14 +159,13 @@ enum Hubsan
};
enum AFHDS2A
{
PWM_IBUS = 0,
PPM_IBUS = 1,
PWM_SBUS = 2,
PPM_SBUS = 3,
PWM_IB16 = 4,
PPM_IB16 = 5,
PWM_SB16 = 6,
PPM_SB16 = 7,
PWM_IBUS = 0,
PPM_IBUS = 1,
PWM_SBUS = 2,
PPM_SBUS = 3,
AFHDS2A_GYRO_OFF = 4,
AFHDS2A_GYRO_ON = 5,
AFHDS2A_GYRO_ON_REV = 6,
};
enum Hisky
{
@ -468,8 +470,9 @@ enum RLINK
};
enum MOULDKG
{
MOULDKG_ANALOG = 0,
MOULDKG_DIGIT = 1,
MOULDKG_ANALOG4 = 0,
MOULDKG_DIGIT4 = 1,
MOULDKG_ANALOG6 = 2,
};
enum KF606
{
@ -488,6 +491,7 @@ enum FX
FX620 = 1,
FX9630 = 2,
FX_Q560 = 3,
FX_QF012 = 4,
};
enum SGF22
{

View File

@ -1,167 +0,0 @@
/*
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/>.
*/
#if defined(PINECONE_CCNRF_INO)
#include "iface_xn297.h"
#define FORCE_PINECONE_ORIGINAL_ID
#define PINECONE_PAYLOAD_SIZE 15
#define PINECONE_RF_NUM_CHANNELS 4
#define PINECONE_PACKET_PERIOD 9000
#define PINECONE_BIND_COUNT 2000
#define PINECONE_WRITE_TIME 1500
enum {
PINECONE_DATA=0,
PINECONE_RX,
};
static void __attribute__((unused)) PINECONE_send_packet()
{
if(rf_ch_num==0)
{
XN297_Hopping(hopping_frequency_no);
debug("H %d ",hopping_frequency_no);
hopping_frequency_no++;
hopping_frequency_no &= 3;
}
if(bind_counter==0) bind_counter=2;
memset(&packet[3], 0x00, 12);
if(bind_counter)
{//Bind in progress
bind_counter--;
if(bind_counter)
{//Bind
packet[0] = 0x01;
memcpy(&packet[1],rx_tx_addr,5);
}
else
{//Switch to normal
XN297_SetTXAddr(rx_tx_addr, 5);
XN297_SetRXAddr(rx_tx_addr, PINECONE_PAYLOAD_SIZE);
}
}
if(!bind_counter)
{//Normal
packet[0] = 0x08;
packet[1] = convert_channel_16b_limit(AILERON,0,200); //ST
packet[2] = convert_channel_16b_limit(THROTTLE,0,200); //TH
packet[3] = convert_channel_16b_limit(ELEVATOR,0,200); //CH4
packet[4] = convert_channel_16b_limit(RUDDER,0,200); //CH3
}
//packet[5/6..8] = 00 unknown
packet[9] = convert_channel_16b_limit(CH5,0,200); //ESP
packet[10] = convert_channel_16b_limit(CH6,0,200); //ST_TRIM
packet[11] = convert_channel_16b_limit(CH7,0,200); //ST_DR
packet[12] = GET_FLAG(CH8_SW, 0x40) //TH.REV
|GET_FLAG(CH9_SW, 0x80); //ST.REV
//packet[13] = 00 unknown
for(uint8_t i=0;i<PINECONE_PAYLOAD_SIZE-1;i++)
packet[14] += packet[i];
// Send
XN297_SetPower();
XN297_SetTxRxMode(TX_EN);
XN297_WriteEnhancedPayload(packet, PINECONE_PAYLOAD_SIZE,false);
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < PINECONE_PAYLOAD_SIZE; i++)
debug("%02X ", packet[i]);
debugln();
#endif
}
static void __attribute__((unused)) PINECONE_initialize_txid()
{
#ifdef FORCE_PINECONE_ORIGINAL_ID
rx_tx_addr[0] = 0xD0;
rx_tx_addr[1] = 0x06;
rx_tx_addr[2] = 0x00;
rx_tx_addr[3] = 0x00;
rx_tx_addr[4] = 0x81;
hopping_frequency[0] = 45;
hopping_frequency[1] = 59;
hopping_frequency[2] = 52;
hopping_frequency[3] = 67;
#endif
}
static void __attribute__((unused)) PINECONE_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_250K);
//Bind address
XN297_SetTXAddr((uint8_t*)"\x01\x03\x05\x07\x09", 5);
XN297_SetRXAddr((uint8_t*)"\x01\x03\x05\x07\x09", PINECONE_PAYLOAD_SIZE);
XN297_HoppingCalib(PINECONE_RF_NUM_CHANNELS);
}
uint16_t PINECONE_callback()
{
bool rx;
switch(phase)
{
case PINECONE_DATA:
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#ifdef MULTI_SYNC
telemetry_set_input_sync(PINECONE_PACKET_PERIOD);
#endif
PINECONE_send_packet();
if(rx)
{
uint8_t val=XN297_ReadEnhancedPayload(packet_in, PINECONE_PAYLOAD_SIZE);
debug("RX %d ",val);
if(val==0)
rf_ch_num = 1;
else
{
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < PINECONE_PAYLOAD_SIZE; i++)
debug("%02X ", packet_in[i]);
debugln();
#endif
//could check the validity of the packet by looking at the sum...
}
//else
// debug("NOK");
debugln("");
}
phase++;
return PINECONE_WRITE_TIME;
default: //PINECONE_RX
//Wait for the packet transmission to finish
while(XN297_IsPacketSent()==false);
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = PINECONE_DATA;
return PINECONE_PACKET_PERIOD - PINECONE_WRITE_TIME;
}
return 0;
}
void PINECONE_init()
{
PINECONE_initialize_txid();
PINECONE_RF_init();
bind_counter = IS_BIND_IN_PROGRESS ? PINECONE_BIND_COUNT : 1;
phase = PINECONE_DATA;
hopping_frequency_no = 0;
rf_ch_num=0;
bind_counter = 2000;
}
#endif

View File

@ -232,7 +232,7 @@ static void __attribute__((unused)) RLINK_send_packet()
packet[1] |= 0x21; //air 0x21 on dump but it looks to support telemetry at least RSSI
break;
case RLINK_DUMBORC:
packet[1] = 0x00; //always 0x00 on dump
packet[1] |= 0x01; //always 0x00 on dump but does appear to support telemtry on newer transmitters
break;
}
@ -384,8 +384,9 @@ uint16_t RLINK_callback()
debug("Telem:");
#endif
CC2500_ReadData(packet_in, len);
if(packet_in[0]==RLINK_RX_PACKET_LEN && (packet_in[len-1] & 0x80) && memcmp(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN)==0 && packet_in[6]==packet[1])
if(packet_in[0]==RLINK_RX_PACKET_LEN && (packet_in[len-1] & 0x80) && memcmp(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN)==0 && (packet_in[6]==packet[1] || sub_protocol == RLINK_DUMBORC))
{//Correct telemetry received: length, CRC, ID and type
//packet_in[6] is 0x00 on almost all DumboRC RX so assume it is always valid
#ifdef RLINK_DEBUG_TELEM
for(uint8_t i=0;i<len;i++)
debug(" %02X",packet_in[i]);

View File

@ -20,21 +20,21 @@ Multiprotocol is distributed in the hope that it will be useful,
//#define FORCE_SGF22_ORIGINAL_ID
#define SGF22_PACKET_PERIOD 11950 //10240
#define SGF22_BIND_RF_CHANNEL 78
#define SGF22_PAYLOAD_SIZE 12
#define SGF22_BIND_COUNT 50
#define SGF22_RF_NUM_CHANNELS 4
#define SGF22_F22S_BIND_RF_CHANNEL 10
#define SGF22_J20_BIND_RF_CHANNEL 28
#define SGF22_PACKET_PERIOD 11950 //10240
#define SGF22_BIND_RF_CHANNEL 78
#define SGF22_PAYLOAD_SIZE 12
#define SGF22_BIND_COUNT 50
#define SGF22_RF_NUM_CHANNELS 4
#define SGF22_F22S_BIND_RF_CHANNEL 10
#define SGF22_J20_BIND_RF_CHANNEL 28
//packet[8]
#define SGF22_FLAG_3D 0x00
#define SGF22_FLAG_LIGHT 0x04
#define SGF22_FLAG_ROLL 0x08
#define SGF22_FLAG_VIDEO 0x10
#define SGF22_FLAG_6G 0x40
#define SGF22_FLAG_VERTICAL 0xC0
#define SGF22_FLAG_3D 0x00
#define SGF22_FLAG_LIGHT 0x04
#define SGF22_FLAG_ROLL 0x08
#define SGF22_FLAG_VIDEO 0x10
#define SGF22_FLAG_6G 0x40
#define SGF22_FLAG_VERTICAL 0xC0
#define SGF22_J20_FLAG_HORIZONTAL 0x80
//#define SGF22_J20_FLAG_SPEED 0x01 // Up/Down trim, not implemented
@ -44,9 +44,18 @@ Multiprotocol is distributed in the hope that it will be useful,
//packet[9]
#define SGF22_FLAG_TRIMRESET 0x04
#define SGF22_FLAG_PHOTO 0x40 // #define SGF22_J20_FLAG_INVERT 0x40
#define SGF22_J20_FLAG_FIXHEIGHT 0x80
#define SGF22_FLAG_TRIMRESET 0x04
#define SGF22_FLAG_PHOTO 0x40 // #define SGF22_J20_FLAG_INVERT 0x40
#define SGF22_J20_FLAG_FIXHEIGHT 0x80
#define SGF22_WRITE_TIME 1000
enum {
SGF22_DATA1,
SGF22_DATA2,
SGF22_DATA3,
SGF22_RX,
};
static void __attribute__((unused)) SGF22_send_packet()
{
@ -148,34 +157,97 @@ static void __attribute__((unused)) SGF22_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
XN297_SetTXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", 5);
#ifdef SGF22_HUB_TELEMETRY
XN297_SetRXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", SGF22_PAYLOAD_SIZE);
#endif
const uint8_t bind_chan[] = {SGF22_BIND_RF_CHANNEL, SGF22_F22S_BIND_RF_CHANNEL, SGF22_J20_BIND_RF_CHANNEL};
XN297_RFChannel(bind_chan[sub_protocol]); // Set bind channel
}
uint16_t SGF22_callback()
{
if(phase == 0)
#ifdef SGF22_HUB_TELEMETRY
bool rx = false;
static uint8_t telem_count = 0;
#endif
switch(phase)
{
phase++;
#ifdef MULTI_SYNC
telemetry_set_input_sync(SGF22_PACKET_PERIOD);
#endif
SGF22_send_packet();
if(IS_BIND_IN_PROGRESS)
{
if(--bind_counter==0)
BIND_DONE;
}
}
else
{//send 3 times in total the same packet
NRF24L01_Strobe(REUSE_TX_PL);
phase++;
if(phase > 2)
{
phase = 0;
return SGF22_PACKET_PERIOD - 2*1550;
}
case SGF22_DATA1:
#ifdef MULTI_SYNC
telemetry_set_input_sync(SGF22_PACKET_PERIOD);
#endif
#ifdef SGF22_HUB_TELEMETRY
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#endif
SGF22_send_packet();
if(IS_BIND_IN_PROGRESS)
{
if(--bind_counter==0)
BIND_DONE;
}
#ifdef SGF22_HUB_TELEMETRY
if(rx)
{
uint8_t p_len = XN297_ReadEnhancedPayload(packet_in, SGF22_PAYLOAD_SIZE);
if(p_len == 3 && packet_in[0] == rx_tx_addr[2] && packet_in[1] == rx_tx_addr[3])
{//packets: 00 0B 00 -> 00 0B 01
telemetry_link = 1;
v_lipo1 = packet_in[2] ? 0 : 255; //2.9V for 1S, 7.0V for 2S
telemetry_lost = 0;
telem_count = 0;
}
#if 0
debug("L %d ",p_len);
debug("RX");
for(uint8_t i=0; i<SGF22_PAYLOAD_SIZE; i++)
debug(" %02X",packet_in[i]);
debugln("");
#endif
}
if(telem_count > 4*63) // Around 3.5sec with no telemetry
telemetry_lost = 1;
else
{
telem_count++;
if(!telemetry_lost && (telem_count & 0x3F) == 0)
{// Should have received a telem packet but... Send telem to the radio to keep it alive
telemetry_link = 1;
#if 0
debugln("Miss");
#endif
}
}
#endif
phase++;
break;
case SGF22_DATA2:
case SGF22_DATA3:
//send 3 times in total the same packet
XN297_ReSendPayload();
phase++;
break;
default: //SGF22_RX
#ifdef SGF22_HUB_TELEMETRY
/*{ // Wait for packet to be sent before switching to receive mode
uint16_t start=(uint16_t)micros(), count=0;
while ((uint16_t)((uint16_t)micros()-(uint16_t)start) < 500)
{
if(XN297_IsPacketSent())
break;
count++;
}
debugln("%d",count);
}*/
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
#endif
phase = SGF22_DATA1;
return SGF22_PACKET_PERIOD - 3*1550;
}
return 1550;
}
@ -187,7 +259,11 @@ void SGF22_init()
SGF22_RF_init();
bind_counter=SGF22_BIND_COUNT;
packet_sent = packet_count = 0x26; // TX2:26 TX3:26
phase = 0;
phase = SGF22_DATA1;
#ifdef SGF22_HUB_TELEMETRY
RX_RSSI = 100; // Dummy value
telemetry_lost = 1;
#endif
}
#endif

View File

@ -0,0 +1,232 @@
/*
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/>.
*/
#if defined(SHENQI2_NRF24L01_INO)
#include "iface_xn297.h"
//#define FORCE_SHENQI2_ORIGINAL_ID
#define SHENQI2_PAYLOAD_SIZE 8
#define SHENQI2_RF_NUM_CHANNELS 16
#define SHENQI2_BIND_COUNT 2000
#define SHENQI2_WRITE_TIME 650
#define SHENQI2_BIND_CHANNEL 44
#define SHENQI2_PACKET_PERIOD 8210
enum {
SHENQI2_BIND = 0,
SHENQI2_BIND_RX,
SHENQI2_DATA,
};
static void __attribute__((unused)) SHENQI2_send_packet()
{
if(bind_counter)
{
bind_counter--;
if(!bind_counter)
BIND_DONE;
}
memset(packet, 0x00, SHENQI2_PAYLOAD_SIZE);
packet_count &= 0x0F;
packet[0] = packet_count;
memcpy(&packet[1],rx_tx_addr,5);
if(IS_BIND_DONE)
{//Normal
uint8_t val = convert_channel_8b(CH2);
if(val < 0x70)
val = 0x30;
else if(val < 0x80)
val = 0x00;
else
{
val &= 0x7F;
val >>= 2;
}
if(Channel_data[CH1] > 1024+50)
val |= 0x40;
else if(Channel_data[CH1] < 1024-50)
val |= 0x80;
packet[6] = val;
//packet[7] = 0x00; // ??
}
else
packet[0] |= 0x30;
// Send
XN297_SetPower();
XN297_SetTxRxMode(TX_EN);
XN297_WriteEnhancedPayload(packet, SHENQI2_PAYLOAD_SIZE, false);
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < SHENQI2_PAYLOAD_SIZE; i++)
debug("%02X ", packet[i]);
debugln();
#endif
}
static void __attribute__((unused)) SHENQI2_initialize_txid()
{
#ifdef FORCE_SHENQI2_ORIGINAL_ID
//TXID
rx_tx_addr[0] = 0x51;
rx_tx_addr[1] = 0x70;
rx_tx_addr[2] = 0x02;
//RXID
rx_tx_addr[3] = 0x46;
rx_tx_addr[4] = 0xBE;
#endif
rx_tx_addr[3] = 0x00;
rx_tx_addr[4] = 0x00;
//Freq
memcpy(hopping_frequency,(uint8_t*)"\x05\x09\x0E\x0F\x17\x1C\x21\x27\x2A\x2C\x33\x39\x3D\x42\x48\x4C",16);
}
static void __attribute__((unused)) SHENQI2_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
//Address
XN297_SetTXAddr((uint8_t*)"\x74\xD1\x3A\xF5\x6C", 5);
XN297_SetRXAddr((uint8_t*)"\x74\xD1\x3A\xF5\x6C", SHENQI2_PAYLOAD_SIZE);
XN297_RFChannel(SHENQI2_BIND_CHANNEL);
}
uint16_t SHENQI2_callback()
{
static bool rx=false;
switch(phase)
{
case SHENQI2_BIND:
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
SHENQI2_send_packet();
packet_count++;
if(rx)
{
uint8_t val=XN297_ReadEnhancedPayload(packet_in, SHENQI2_PAYLOAD_SIZE);
if(val == SHENQI2_PAYLOAD_SIZE)
{
if(memcmp(rx_tx_addr, packet_in, 3) == 0)
{//Good packet with our TXID
BIND_DONE;
rx_tx_addr[3] = packet_in[3];
rx_tx_addr[4] = packet_in[4];
packet_count = 0;
phase = SHENQI2_DATA;
}
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < SHENQI2_PAYLOAD_SIZE; i++)
debug(" %02X", packet_in[i]);
debugln();
#endif
}
}
phase++;
return SHENQI2_WRITE_TIME;
case SHENQI2_BIND_RX:
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = SHENQI2_BIND;
return SHENQI2_PACKET_PERIOD - SHENQI2_WRITE_TIME;
default: //SHENQI2_DATA
//Since I don't know the order of the channels, I'm hopping on all the channels quickly
//Refresh rate from the motorcycle perspective is 32ms instead of 8ms...
XN297_Hopping(hopping_frequency_no);
hopping_frequency_no++;
hopping_frequency_no &= 0x0F;
SHENQI2_send_packet();
if(hopping_frequency_no%4 == 0)
packet_count++;
return SHENQI2_PACKET_PERIOD/4;
}
return 0;
}
void SHENQI2_init()
{
BIND_IN_PROGRESS;
SHENQI2_initialize_txid();
SHENQI2_RF_init();
bind_counter = SHENQI2_BIND_COUNT;
phase = SHENQI2_BIND;
hopping_frequency_no = 0;
}
#endif
/*
XN297 1Mb Enhanced,Acked,Scrambled
Bind
---
RX on channel: 44, Time: 2890us P: 34 51 70 02 00 00 00 00
RX on channel: 44, Time: 1780us P: 34 51 70 02 00 00 00 00
RX on channel: 44, Time: 1773us P: 34 51 70 02 00 00 00 00
RX on channel: 44, Time: 1772us P: 34 51 70 02 00 00 00 00
RX on channel: 44, Time: 2889us P: 35 51 70 02 00 00 00 00
RX on channel: 44, Time: 1769us P: 35 51 70 02 00 00 00 00
RX on channel: 44, Time: 1774us P: 35 51 70 02 00 00 00 00
RX on channel: 44, Time: 1771us P: 35 51 70 02 00 00 00 00
RX on channel: 44, Time: 2894us P: 36 51 70 02 00 00 00 00
A= 74 D1 3A F5 6C
RF:44
Timing: 1772µs between the same 4 packets, 2892µs to the next packet, 8208µs between 2 packets
Request ack, if no ack repeat the packet 4 times
P[0] = counter 00..0F | 30 bind
P[1] = TXID[0]
P[2] = TXID[1]
P[3] = TXID[2]
P[4] = RXID[0]
P[5] = RXID[1]
P[6] = TH 00..1F, Break 30, 40 ST_right, 80 ST_left
P[7] = 00?
Answer from motorcycle:
P: 51 70 02 46 BE 00 00 00
P[0] = TXID[0]
P[1] = TXID[1]
P[2] = TXID[2]
P[3] = RXID[0]
P[4] = RXID[1]
P[5] = 00
P[6] = 00
P[7] = 00
Normal packets
---
A= 74 D1 3A F5 6C
RF:5,9,14,15,23,28,33,39,42,44,51,57,61,66,72,76
RF:\x05\x09\x0E\x0F\x17\x1C\x21\x27\x2A\x2C\x33\x39\x3D\x42\x48\x4C
- order of the channels is unknown and vary over time
- send 16 times on each channel and switch (counter 00..0F)
Timing:1772µs between the same 4 packets, 2892µs to the next packet, 8208µs between 2 packets
Timing:8208 between packets if acked
P: 00 51 70 02 46 BE 00 00
P[0] = counter 00..0F
P[1] = TXID[0]
P[2] = TXID[1]
P[3] = TXID[2]
P[4] = RXID[0]
P[5] = RXID[1]
P[6] = TH 00..1F, Break 30, 40 ST_right, 80 ST_left
P[7] = 00?
*/

View File

@ -19,6 +19,7 @@
#include "iface_nrf250k.h"
//#define SLT_Q200_FORCE_ID
//#define SLT_V1_4_FORCE_ID
// For code readability
#define SLT_PAYLOADSIZE_V1 7
@ -73,12 +74,12 @@ static void __attribute__((unused)) SLT_set_freq(void)
}
// Unique freq
uint8_t max_freq=0x50; //V1 and V2
if(sub_protocol==Q200)
uint8_t max_freq = 0x50; //V1 and V2
if(sub_protocol == Q200)
max_freq=45;
for (uint8_t i = 0; i < SLT_NFREQCHANNELS; ++i)
{
if(sub_protocol==Q200 && hopping_frequency[i] >= max_freq)
if(sub_protocol == Q200 && hopping_frequency[i] >= max_freq)
hopping_frequency[i] = hopping_frequency[i] - max_freq + 0x03;
uint8_t done = 0;
while (!done)
@ -94,15 +95,15 @@ static void __attribute__((unused)) SLT_set_freq(void)
}
}
}
#if 0
#ifdef DEBUG_SERIAL
debug("CH:");
for (uint8_t i = 0; i < SLT_NFREQCHANNELS; ++i)
debug(" %02X", hopping_frequency[i]);
debug(" %02X(%d)", hopping_frequency[i], hopping_frequency[i]);
debugln();
#endif
//Bind channel
hopping_frequency[SLT_NFREQCHANNELS]=SLT_BIND_CHANNEL;
hopping_frequency[SLT_NFREQCHANNELS] = SLT_BIND_CHANNEL;
//Calib all channels
NRF250K_HoppingCalib(SLT_NFREQCHANNELS+1);
@ -153,35 +154,38 @@ static void __attribute__((unused)) SLT_build_packet()
//->V1 stops here
if(sub_protocol==Q200)
if(sub_protocol == Q200)
packet[6] = GET_FLAG(CH9_SW , FLAG_Q200_FMODE)
|GET_FLAG(CH10_SW, FLAG_Q200_FLIP)
|GET_FLAG(CH11_SW, FLAG_Q200_VIDON)
|GET_FLAG(CH12_SW, FLAG_Q200_VIDOFF);
else if(sub_protocol==MR100 || sub_protocol==Q100)
else if(sub_protocol == MR100 || sub_protocol == Q100)
packet[6] = GET_FLAG(CH9_SW , FLAG_MR100_FMODE)
|GET_FLAG(CH10_SW, FLAG_MR100_FLIP)
|GET_FLAG(CH11_SW, FLAG_MR100_VIDEO) // Does not exist on the Q100 but...
|GET_FLAG(CH12_SW, FLAG_MR100_PICTURE); // Does not exist on the Q100 but...
packet[7]=convert_channel_8b(CH7);
packet[8]=convert_channel_8b(CH8);
if(sub_protocol==RF_SIM) {
packet[9]=convert_channel_8b(CH9);
packet[10]=convert_channel_8b(CH10);
} else {
packet[9]=0xAA; //normal mode for Q100/Q200, unknown for V2/MR100
packet[10]=0x00; //normal mode for Q100/Q200, unknown for V2/MR100
}
if((sub_protocol==Q100 || sub_protocol==Q200) && CH13_SW)
{//Calibrate
packet[9]=0x77; //enter calibration
if(calib_counter>=20 && calib_counter<=25) // 7 packets for Q100 / 3 packets for Q200
packet[10]=0x20; //launch calibration
calib_counter++;
if(calib_counter>250) calib_counter=250;
packet[7] = convert_channel_8b(CH7);
packet[8] = convert_channel_8b(CH8);
if(sub_protocol == RF_SIM)
{
packet[9] = convert_channel_8b(CH9);
packet[10] = convert_channel_8b(CH10);
}
else
calib_counter=0;
{
packet[9] = 0xAA; //normal mode for Q100/Q200, unknown for V2/MR100
packet[10] = 0x00; //normal mode for Q100/Q200, unknown for V2/MR100
}
if((sub_protocol == Q100 || sub_protocol == Q200) && CH13_SW)
{//Calibrate
packet[9] = 0x77; //enter calibration
if(calib_counter >= 20 && calib_counter <= 25) // 7 packets for Q100 / 3 packets for Q200
packet[10] = 0x20; //launch calibration
calib_counter++;
if(calib_counter > 250) calib_counter = 250;
}
else
calib_counter = 0;
}
static void __attribute__((unused)) SLT_send_bind_packet()
@ -192,8 +196,8 @@ static void __attribute__((unused)) SLT_send_bind_packet()
NRF250K_SetPower();
BIND_DONE;
NRF250K_SetTXAddr((uint8_t *)"\x7E\xB8\x63\xA9", SLT_TXID_SIZE);
memcpy((void*)packet,(void*)rx_tx_addr,SLT_TXID_SIZE);
if(phase==SLT_BIND2)
memcpy((void*)packet, (void*)rx_tx_addr, SLT_TXID_SIZE);
if(phase == SLT_BIND2)
SLT_send_packet(SLT_TXID_SIZE);
else // SLT_BIND1
SLT_send_packet(SLT_PAYLOADSIZE_V2);
@ -224,9 +228,9 @@ uint16_t SLT_callback()
case SLT_DATA2:
phase++;
SLT_send_packet(packet_length);
if(sub_protocol==SLT_V1)
if(sub_protocol == SLT_V1)
return SLT_V1_TIMING_PACKET;
if(sub_protocol==SLT_V1_4)
if(sub_protocol == SLT_V1_4)
{
phase++; //Packets are sent two times only
return SLT_V1_4_TIMING_PACKET;
@ -238,24 +242,24 @@ uint16_t SLT_callback()
if (++packet_count >= 100)
{// Send bind packet
packet_count = 0;
if(sub_protocol==SLT_V1||sub_protocol==SLT_V1_4)
if(sub_protocol == SLT_V1 || sub_protocol == SLT_V1_4)
{
phase=SLT_BIND2;
phase = SLT_BIND2;
return SLT_V1_TIMING_BIND2;
}
//V2
phase=SLT_BIND1;
phase = SLT_BIND1;
return SLT_V2_TIMING_BIND1;
}
else
{// Continue to send normal packets
phase = SLT_BUILD;
if(sub_protocol==SLT_V1)
return 20000-SLT_TIMING_BUILD;
if(sub_protocol == SLT_V1)
return 20000 - SLT_TIMING_BUILD;
if(sub_protocol==SLT_V1_4)
return 18000-SLT_TIMING_BUILD-SLT_V1_4_TIMING_PACKET;
return 18000 - SLT_TIMING_BUILD - SLT_V1_4_TIMING_PACKET;
//V2
return 13730-SLT_TIMING_BUILD;
return 13730 - SLT_TIMING_BUILD;
}
case SLT_BIND1:
SLT_send_bind_packet();
@ -264,12 +268,12 @@ uint16_t SLT_callback()
case SLT_BIND2:
SLT_send_bind_packet();
phase = SLT_BUILD;
if(sub_protocol==SLT_V1)
return 20000-SLT_TIMING_BUILD-SLT_V1_TIMING_BIND2;
if(sub_protocol==SLT_V1_4)
return 18000-SLT_TIMING_BUILD-SLT_V1_TIMING_BIND2-SLT_V1_4_TIMING_PACKET;
if(sub_protocol == SLT_V1)
return 20000 - SLT_TIMING_BUILD - SLT_V1_TIMING_BIND2;
if(sub_protocol == SLT_V1_4)
return 18000 - SLT_TIMING_BUILD - SLT_V1_TIMING_BIND2 - SLT_V1_4_TIMING_PACKET;
//V2
return 13730-SLT_TIMING_BUILD-SLT_V2_TIMING_BIND1-SLT_V2_TIMING_BIND2;
return 13730 - SLT_TIMING_BUILD - SLT_V2_TIMING_BIND1 - SLT_V2_TIMING_BIND2;
}
return 19000;
}
@ -280,35 +284,26 @@ void SLT_init()
packet_count = 0;
packet_sent = 0;
hopping_frequency_no = 0;
if(sub_protocol==Q200)
{ //Q200: Force high part of the ID otherwise it won't bind
rx_tx_addr[0]=0x01;
rx_tx_addr[1]=0x02;
#ifdef SLT_Q200_FORCE_ID // ID taken from TX dumps
rx_tx_addr[0]=0x01;rx_tx_addr[1]=0x02;rx_tx_addr[2]=0x6A;rx_tx_addr[3]=0x31;
/* rx_tx_addr[0]=0x01;rx_tx_addr[1]=0x02;rx_tx_addr[2]=0x0B;rx_tx_addr[3]=0x57;*/
#endif
}
SLT_RF_init();
SLT_set_freq();
phase = SLT_BUILD;
if(sub_protocol==SLT_V1)
if(sub_protocol == SLT_V1)
{
packet_length = SLT_PAYLOADSIZE_V1;
#ifdef MULTI_SYNC
packet_period = 20000+2*SLT_V1_TIMING_PACKET; //22ms
#endif
}
else if(sub_protocol==SLT_V1_4)
else if(sub_protocol == SLT_V1_4)
{
packet_length = SLT_PAYLOADSIZE_V1_4;
#ifdef MULTI_SYNC
packet_period = 18000; //18ms
#endif
//Test IDs
MProtocol_id = MProtocol_id_master ^ (1<<RX_num);
set_rx_tx_addr(MProtocol_id);
debugln("Try ID: %lx", MProtocol_id);
//Force high part of the ID otherwise the RF frequencies do not match, only tested the 2 last bytes...
rx_tx_addr[0]=0xF4;
rx_tx_addr[1]=0x71;
#ifdef SLT_V1_4_FORCE_ID // ID taken from TX dumps
memcpy(rx_tx_addr,"\xF4\x71\x8D\x01",SLT_TXID_SIZE);
#endif
}
else //V2
{
@ -317,6 +312,21 @@ void SLT_init()
packet_period = 13730+2*SLT_V2_TIMING_PACKET; //~18ms
#endif
}
if(sub_protocol == Q200)
{ //Q200: Force high part of the ID otherwise it won't bind
rx_tx_addr[0]=0x01;
rx_tx_addr[1]=0x02;
#ifdef SLT_Q200_FORCE_ID // ID taken from TX dumps
rx_tx_addr[0]=0x01;rx_tx_addr[1]=0x02;rx_tx_addr[2]=0x6A;rx_tx_addr[3]=0x31;
/* rx_tx_addr[0]=0x01;rx_tx_addr[1]=0x02;rx_tx_addr[2]=0x0B;rx_tx_addr[3]=0x57;*/
#endif
}
SLT_RF_init();
SLT_set_freq();
phase = SLT_BUILD;
}
#endif

View File

@ -0,0 +1,184 @@
/*
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/>.
*/
//Models: UDIRC UD160x(PRO), Pinecone Models SG-160x, Eachine EAT15
#if defined(UDIRC_CCNRF_INO)
#include "iface_xn297.h"
#define FORCE_UDIRC_ORIGINAL_ID
#define UDIRC_PAYLOAD_SIZE 15
#define UDIRC_RF_NUM_CHANNELS 4
#define UDIRC_PACKET_PERIOD 21000
#define UDIRC_BIND_COUNT 2000
#define UDIRC_P1_P2_TIME 5000
#define UDIRC_WRITE_TIME 1500
enum {
UDIRC_DATA1=0,
UDIRC_DATA2,
UDIRC_DATA3,
UDIRC_RX,
};
static void __attribute__((unused)) UDIRC_send_packet()
{
if(rf_ch_num==0)
{
XN297_Hopping(hopping_frequency_no);
debug("H %d ",hopping_frequency_no);
hopping_frequency_no++;
hopping_frequency_no &= 3;
}
memset(&packet[3], 0x00, 12);
if(bind_counter)
{//Bind in progress
bind_counter--;
if(bind_counter)
{//Bind
packet[0] = 0x01;
memcpy(&packet[1],rx_tx_addr,5);
}
else
{//Switch to normal
rf_ch_num = 1;
BIND_DONE;
XN297_SetTXAddr(rx_tx_addr, 5);
XN297_SetRXAddr(rx_tx_addr, UDIRC_PAYLOAD_SIZE);
}
}
if(!bind_counter)
{//Normal
packet[0] = 0x08;
//Channels SG-16xx: ST/TH/CH4 /CH3 /UNK/UNK/UNK/UNK/GYRO/ST_TRIM/ST_DR
//Channels EAT15 : ST/TH/RATE/LIGHT/UNK/UNK/UNK/UNK/GYRO/ST_TRIM/ST_DR
for(uint8_t i=0; i<12; i++)
packet[i+1] = convert_channel_16b_limit(i,0,200);
//Just for now let's set the additional channels to 0
packet[5] = packet[6] = packet[7] = packet[8] = 0;
}
packet[12] = GET_FLAG(CH12_SW, 0x40) //TH.REV
|GET_FLAG(CH13_SW, 0x80); //ST.REV
//packet[13] = 00; //Unknown, future flags?
for(uint8_t i=0;i<UDIRC_PAYLOAD_SIZE-1;i++)
packet[14] += packet[i];
// Send
XN297_SetFreqOffset();
XN297_SetPower();
XN297_SetTxRxMode(TX_EN);
XN297_WriteEnhancedPayload(packet, UDIRC_PAYLOAD_SIZE,false);
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < UDIRC_PAYLOAD_SIZE; i++)
debug("%02X ", packet[i]);
debugln();
#endif
}
static void __attribute__((unused)) UDIRC_initialize_txid()
{
#ifdef FORCE_UDIRC_ORIGINAL_ID
if(RX_num)
{
rx_tx_addr[0] = 0xD0;
rx_tx_addr[1] = 0x06;
rx_tx_addr[2] = 0x00;
rx_tx_addr[3] = 0x00;
rx_tx_addr[4] = 0x81;
}
else
{
rx_tx_addr[0] = 0xF6;
rx_tx_addr[1] = 0x96;
rx_tx_addr[2] = 0x01;
rx_tx_addr[3] = 0x00;
rx_tx_addr[4] = 0x81;
}
hopping_frequency[0] = 45;
hopping_frequency[1] = 59;
hopping_frequency[2] = 52;
hopping_frequency[3] = 67;
#endif
}
static void __attribute__((unused)) UDIRC_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_250K);
//Bind address
XN297_SetTXAddr((uint8_t*)"\x01\x03\x05\x07\x09", 5);
XN297_SetRXAddr((uint8_t*)"\x01\x03\x05\x07\x09", UDIRC_PAYLOAD_SIZE);
XN297_HoppingCalib(UDIRC_RF_NUM_CHANNELS);
}
uint16_t UDIRC_callback()
{
bool rx;
switch(phase)
{
case UDIRC_DATA1:
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#ifdef MULTI_SYNC
telemetry_set_input_sync(UDIRC_PACKET_PERIOD);
#endif
UDIRC_send_packet();
if(rx)
{
uint8_t val=XN297_ReadEnhancedPayload(packet_in, UDIRC_PAYLOAD_SIZE);
debug("RX(%d):",val);
if(val != 255)
{
rf_ch_num = 1;
if(bind_counter)
bind_counter=1;
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < UDIRC_PAYLOAD_SIZE; i++)
debug(" %02X", packet_in[i]);
#endif
}
debugln("");
}
phase++;
return UDIRC_P1_P2_TIME;
case UDIRC_DATA2:
//Resend packet
XN297_ReSendPayload();
phase++;
return UDIRC_WRITE_TIME;
default: //UDIRC_RX
//Wait for the packet transmission to finish
while(XN297_IsPacketSent()==false);
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = UDIRC_DATA1;
return UDIRC_PACKET_PERIOD - UDIRC_P1_P2_TIME - UDIRC_WRITE_TIME;
}
return 0;
}
void UDIRC_init()
{
UDIRC_initialize_txid();
UDIRC_RF_init();
bind_counter = IS_BIND_IN_PROGRESS ? UDIRC_BIND_COUNT : 1;
phase = UDIRC_DATA1;
hopping_frequency_no = 0;
rf_ch_num = 0;
}
#endif

View File

@ -244,7 +244,7 @@ uint16_t V761_callback()
else
{
packet_count++;
if(!telemetry_lost && !rx && (packet_count%64) == 0)
if(!telemetry_lost && !rx && (packet_count & 0x3F) == 0)
{// Should have received a telem packet but... Send telem to the radio to keep it alive
telemetry_link = 1;
#ifdef V761_TELEM_DEBUG

View File

@ -326,6 +326,7 @@
#undef HONTAI_NRF24L01_INO
#undef JIABAILE_NRF24L01_INO
#undef JJRC345_NRF24L01_INO
#undef KAMTOM_NRF24L01_INO
#undef KN_NRF24L01_INO
#undef KYOSHO2_NRF24L01_INO
#undef LOLI_NRF24L01_INO
@ -336,6 +337,7 @@
#undef REALACC_NRF24L01_INO
#undef SGF22_NRF24L01_INO
#undef SHENQI_NRF24L01_INO
#undef SHENQI2_NRF24L01_INO
#undef SYMAX_NRF24L01_INO
#undef V2X2_NRF24L01_INO
#undef V761_NRF24L01_INO
@ -355,7 +357,9 @@
#undef Q303_CCNRF_INO
#undef Q90C_CCNRF_INO
#undef SLT_CCNRF_INO
#undef UDIRC_CCNRF_INO
#undef V911S_CCNRF_INO
#undef WL91X_CCNRF_INO
#undef XK_CCNRF_INO
#undef XK2_CCNRF_INO
#endif
@ -386,11 +390,18 @@
#undef LOSI_CYRF6936_INO //Need DSM to be enabled
#undef TRAXXAS_CYRF6936_INO
#undef EAZYRC_NRF24L01_INO
#undef KYOSHO2_NRF24L01_INO
//#undef KYOSHO2_NRF24L01_INO
#undef KYOSHO3_CYRF6936_INO
#undef MOULDKG_NRF24L01_INO
#undef SHENQI_NRF24L01_INO
#undef SHENQI2_NRF24L01_INO
#undef JIABAILE_NRF24L01_INO
#undef UDIRC_CCNRF_INO
#undef KAMTOM_NRF24L01_INO
#undef WL91X_CCNRF_INO
//Save flash space...
#undef CABELL_NRF24L01_INO
#undef REDPINE_CC2500_INO
#endif
#ifdef MULTI_SURFACE
@ -486,6 +497,10 @@
#undef PROPEL_HUB_TELEMETRY
#undef OMP_HUB_TELEMETRY
#undef V761_HUB_TELEMETRY
#undef FX_HUB_TELEMETRY
#undef XK2_HUB_TELEMETRY
#undef SGF22_HUB_TELEMETRY
#undef KAMTOM_HUB_TELEMETRY
#undef YUXIANG_HUB_TELEMETRY
#undef RLINK_HUB_TELEMETRY
#undef DSM_RX_CYRF6936_INO
@ -525,6 +540,18 @@
#if not defined(V761_NRF24L01_INO)
#undef V761_HUB_TELEMETRY
#endif
#if not defined(FX_NRF24L01_INO)
#undef FX_HUB_TELEMETRY
#endif
#if not defined(XK2_CCNRF_INO)
#undef XK2_HUB_TELEMETRY
#endif
#if not defined(SGF22_NRF24L01_INO)
#undef SGF22_HUB_TELEMETRY
#endif
#if not defined(KAMTOM_NRF24L01_INO)
#undef KAMTOM_HUB_TELEMETRY
#endif
#if not defined(YUXIANG_NRF24L01_INO)
#undef YUXIANG_HUB_TELEMETRY
#endif
@ -585,7 +612,7 @@
//protocols using FRSKYD user frames
#undef HUB_TELEMETRY
#endif
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(RLINK_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY) && not defined(DEVO_HUB_TELEMETRY) && not defined(PROPEL_HUB_TELEMETRY) && not defined(OMP_HUB_TELEMETRY) && not defined(V761_HUB_TELEMETRY) && not defined(YUXIANG_HUB_TELEMETRY) && not defined(WFLY2_HUB_TELEMETRY) && not defined(LOLI_HUB_TELEMETRY) && not defined(MLINK_HUB_TELEMETRY) && not defined(MLINK_FW_TELEMETRY) && not defined(MT99XX_HUB_TELEMETRY) && not defined(MULTI_CONFIG_INO)
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(RLINK_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY) && not defined(DEVO_HUB_TELEMETRY) && not defined(PROPEL_HUB_TELEMETRY) && not defined(OMP_HUB_TELEMETRY) && not defined(V761_HUB_TELEMETRY) && not defined(SGF22_HUB_TELEMETRY) && not defined(XK2_HUB_TELEMETRY) && not defined(FX_HUB_TELEMETRY) && not defined(KAMTOM_HUB_TELEMETRY) && not defined(YUXIANG_HUB_TELEMETRY) && not defined(WFLY2_HUB_TELEMETRY) && not defined(LOLI_HUB_TELEMETRY) && not defined(MLINK_HUB_TELEMETRY) && not defined(MLINK_FW_TELEMETRY) && not defined(MT99XX_HUB_TELEMETRY) && not defined(MULTI_CONFIG_INO)
#undef TELEMETRY
#undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY

View File

@ -0,0 +1,96 @@
/*
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/>.
*/
#if defined(WL91X_CCNRF_INO)
#include "iface_xn297.h"
//#define FORCE_WL91X_ORIGINAL_ID
#define WL91X_PAYLOAD_SIZE 9
#define WL91X_RF_NUM_CHANNELS 3
#define WL91X_PACKET_PERIOD 2594
static void __attribute__((unused)) WL91X_send_packet()
{
uint8_t val;
//RF freq
XN297_Hopping(hopping_frequency_no++);
hopping_frequency_no %= WL91X_RF_NUM_CHANNELS;
//Sticks
val = convert_channel_16b_limit(CH2,0x21,0xE0); //THR forward 00..5F, backward 80..DF
if(val < 128) val = 127 - val;
packet[0] = val - 0x80;
val = convert_channel_s8b(CH1); //ST right 00..7F, left 80..FF
packet[1] = val - 0x80;
//Trims
val = convert_channel_s8b(CH3); //ST_Trim centered=80, increment/decrement=4, right 04..7C, left 84..FC
packet[2] = val - 0x80;
packet[3] = convert_channel_16b_limit(CH4,0x00,0x70); //TH_Trim increment/decrement=3, 00..39..6F
//TX_ID
memcpy(&packet[4], rx_tx_addr, 4);
//Checksum
val = 0;
for(uint8_t i=0; i<WL91X_PAYLOAD_SIZE-1; i++)
val += packet[i];
packet[8] = val;
//Send
XN297_SetPower();
XN297_SetFreqOffset();
XN297_SetTxRxMode(TX_EN);
XN297_WritePayload(packet, WL91X_PAYLOAD_SIZE);
#ifdef DEBUG_SERIAL
for(uint8_t i=0; i < WL91X_PAYLOAD_SIZE; i++)
debug("%02X ", packet[i]);
debugln();
#endif
}
static void __attribute__((unused)) WL91X_RF_init()
{
XN297_Configure(XN297_CRCEN, XN297_UNSCRAMBLED, XN297_250K);
XN297_HoppingCalib(WL91X_RF_NUM_CHANNELS);
XN297_SetTXAddr((uint8_t*)"\x46\x14\x7B\x08", 4);
}
static void __attribute__((unused)) WL91X_initialize_txid()
{
#ifdef FORCE_WL91X_ORIGINAL_ID
memcpy(rx_tx_addr, (uint8_t*)"\x00\x1E\x33\x02",4);
#endif
memcpy(hopping_frequency, (uint8_t*)"\x1A\x3B\x3B",3); //26,59,59
}
uint16_t WL91X_callback()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(WL91X_PACKET_PERIOD);
#endif
WL91X_send_packet();
return WL91X_PACKET_PERIOD;
}
void WL91X_init()
{
BIND_DONE; //No bind for this protocol
WL91X_initialize_txid();
WL91X_RF_init();
hopping_frequency_no = 0;
}
#endif

View File

@ -21,19 +21,30 @@ Multiprotocol is distributed in the hope that it will be useful,
//#define FORCE_XK2_ID
//#define FORCE_XK2_P10_ID
#define XK2_RF_BIND_CHANNEL 71
#define XK2_RF_BIND_CHANNEL 71
#define XK2_P10_RF_BIND_CHANNEL 69
#define XK2_PAYLOAD_SIZE 9
#define XK2_PACKET_PERIOD 4911
#define XK2_RF_NUM_CHANNELS 4
#define XK2_PAYLOAD_SIZE 9
#define XK2_PACKET_PERIOD 4911
#define XK2_RF_NUM_CHANNELS 4
#define XK2_WRITE_TIME 1000
enum {
XK2_BIND1,
XK2_BIND2,
XK2_DATA_PREP,
XK2_DATA
XK2_DATA,
XK2_RX,
};
static uint8_t __attribute__((unused)) XK2_checksum(uint8_t init)
{
for(uint8_t i=0; i<XK2_PAYLOAD_SIZE-1; i++)
init += packet[i];
if(sub_protocol == XK2_P10)
init += 0x10;
return init;
}
static void __attribute__((unused)) XK2_send_packet()
{
static uint8_t trim_ch=0;
@ -47,8 +58,6 @@ static void __attribute__((unused)) XK2_send_packet()
//memcpy(&packet[4], rx_id , 3);
//Unknown
packet[7] = 0x00;
//Checksum seed
packet[8] = 0xC0;
}
else
{
@ -71,21 +80,19 @@ static void __attribute__((unused)) XK2_send_packet()
}
//Flags
packet[5] = GET_FLAG(CH5_SW, 0x01) //Rate
| GET_FLAG(CH6_SW, 0x08) //Mode
| GET_FLAG(CH7_SW, 0x20) //Hover
| GET_FLAG(CH8_SW, 0x40); //Light
//Telemetry not received=00, Telemetry received=01 but sometimes switch to 1 even if telemetry is not there...
packet[6] = 0x00;
if(CH6_SW)
packet[5] |= 0x10; //Gyro off (senior mode)
else if(Channel_data[CH6] > CHANNEL_MIN_COMMAND)
packet[5] |= 0x08; //3D
//Requiest telemetry flag
packet[6] = 0x01;
//RXID checksum
packet[7] = crc8; //Sum RX_ID[0..2]
//Checksum seed
packet[8] = num_ch; //Based on TX ID
}
//Checksum
for(uint8_t i=0; i<XK2_PAYLOAD_SIZE-1; i++)
packet[8] += packet[i];
if(sub_protocol == XK2_P10)
packet[8] += 0x10;
packet[8] = XK2_checksum(IS_BIND_IN_PROGRESS ? 0xC0 : num_ch);
// Send
XN297_SetFreqOffset();
@ -156,6 +163,8 @@ static void __attribute__((unused)) XK2_initialize_txid()
uint16_t XK2_callback()
{
static bool rx = false;
switch(phase)
{
case XK2_BIND1:
@ -174,13 +183,8 @@ uint16_t XK2_callback()
debug(" %02X",packet[i]);
debugln("");
#endif
crc8 = 0xBF;
for(uint8_t i=0; i<XK2_PAYLOAD_SIZE-1; i++)
crc8 += packet[i];
if(sub_protocol == XK2_P10)
crc8 += 0x10;
if(crc8 != packet[8])
{
if(XK2_checksum(0xBF) != packet[8])
{//Wrong checksum
phase = XK2_BIND1;
return 1000;
}
@ -200,28 +204,72 @@ uint16_t XK2_callback()
}
return 1000;
case XK2_DATA_PREP:
crc8=eeprom_read_byte((EE_ADDR)(XK2_EEPROM_OFFSET+RX_num));
crc8 = eeprom_read_byte((EE_ADDR)(XK2_EEPROM_OFFSET+RX_num));
debugln("R:RX_ID=%02X",crc8);
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(TX_EN);
XN297_SetTXAddr(rx_tx_addr, 5);
#ifdef XK2_HUB_TELEMETRY
XN297_SetRXAddr(rx_tx_addr, XK2_PAYLOAD_SIZE);
#endif
BIND_DONE;
phase++;
case XK2_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(XK2_PACKET_PERIOD);
#endif
#ifdef XK2_HUB_TELEMETRY
rx = XN297_IsRX();
XN297_SetTxRxMode(TXRX_OFF);
#endif
XK2_send_packet();
#ifdef XK2_HUB_TELEMETRY
if(rx)
{
XN297_ReadPayload(packet, XK2_PAYLOAD_SIZE);
#if 0
debug("RX");
for(uint8_t i=0; i<XK2_PAYLOAD_SIZE; i++)
debug(" %02X",packet[i]);
debugln("");
#endif
if(XK2_checksum(0xCC) == packet[8] && memcmp(packet, rx_tx_addr, 3) == 0)
{//Good checksum and TXID
//packets: E5 20 F2 00 00 00 00 00 C3 -> E5 20 F2 80 00 00 00 00 43
telemetry_link = 1;
v_lipo1 = packet[3] ? 137:162; // low voltage 7.1V
}
}
#endif
if(bind_counter)
{
bind_counter--;
if(bind_counter == 0)
{
phase = XK2_DATA_PREP;
//phase = XK2_BIND1;
}
break;
}
XK2_send_packet();
#ifndef XK2_HUB_TELEMETRY
break;
#else
phase++;
return XK2_WRITE_TIME;
default: //XK2_RX
/*{ // Wait for packet to be sent before switching to receive mode
uint16_t start=(uint16_t)micros(), count=0;
while ((uint16_t)((uint16_t)micros()-(uint16_t)start) < 500)
{
if(XN297_IsPacketSent())
break;
count++;
}
debugln("%d",count);
}*/
//Switch to RX
XN297_SetTxRxMode(TXRX_OFF);
XN297_SetTxRxMode(RX_EN);
phase = XK2_DATA;
return XK2_PACKET_PERIOD-XK2_WRITE_TIME;
#endif
}
return XK2_PACKET_PERIOD;
}
@ -238,6 +286,9 @@ void XK2_init()
phase = XK2_DATA_PREP;
bind_counter = 0;
hopping_frequency_no = 0;
#ifdef XK2_HUB_TELEMETRY
RX_RSSI = 100; // Dummy value
#endif
}
#endif

View File

@ -207,6 +207,27 @@ static void __attribute__((unused)) XN297_SetTxRxMode(enum TXRX_State mode)
#endif
}
#ifdef CC2500_INSTALLED
uint8_t XN297_Buffer[32];
uint8_t XN297_Buffer_Len = 0;
static void __attribute__((unused)) XN297_SendCC2500Payload()
{
// stop TX/RX
CC2500_Strobe(CC2500_SIDLE);
// flush tx FIFO
CC2500_Strobe(CC2500_SFTX);
// packet length
CC2500_WriteReg(CC2500_06_PKTLEN, XN297_Buffer_Len + 4); // Packet len, fix packet len
// xn297L preamble
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, (uint8_t*)"\x0C\x71\x0F\x55", 4);
// xn297 packet
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, XN297_Buffer, XN297_Buffer_Len);
// transmit
CC2500_Strobe(CC2500_STX);
}
#endif
static void __attribute__((unused)) XN297_SendPayload(uint8_t* msg, uint8_t len)
{
#ifdef NRF24L01_INSTALLED
@ -220,22 +241,25 @@ static void __attribute__((unused)) XN297_SendPayload(uint8_t* msg, uint8_t len)
#ifdef CC2500_INSTALLED
if(xn297_rf == XN297_CC2500)
{
// stop TX/RX
CC2500_Strobe(CC2500_SIDLE);
// flush tx FIFO
CC2500_Strobe(CC2500_SFTX);
// packet length
CC2500_WriteReg(CC2500_06_PKTLEN, len + 4); // Packet len, fix packet len
// xn297L preamble
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, (uint8_t*)"\x0C\x71\x0F\x55", 4);
// xn297 packet
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, msg, len);
// transmit
CC2500_Strobe(CC2500_STX);
memcpy(XN297_Buffer, msg, len);
XN297_Buffer_Len = len;
XN297_SendCC2500Payload();
}
#endif
}
static void __attribute__((unused)) XN297_ReSendPayload()
{
#ifdef NRF24L01_INSTALLED
if(xn297_rf == XN297_NRF)
NRF24L01_Strobe(NRF24L01_E3_REUSE_TX_PL);
#endif
#ifdef CC2500_INSTALLED
if(xn297_rf == XN297_CC2500)
XN297_SendCC2500Payload();
#endif
}
static void __attribute__((unused)) XN297_WritePayload(uint8_t* msg, uint8_t len)
{
uint8_t buf[32];
@ -329,9 +353,9 @@ static void __attribute__((unused)) XN297_WriteEnhancedPayload(uint8_t* msg, uin
last++;
buf[last] = bit_reverse(msg[len-1]) << 6; // last 2 bit of payload
if(xn297_scramble_enabled)
buf[last] ^= xn297_scramble[scramble_index++] & 0xc0;
}
if(xn297_scramble_enabled)
buf[last] ^= xn297_scramble[scramble_index++] & 0xc0;
// crc
if (xn297_crc)
@ -351,8 +375,7 @@ static void __attribute__((unused)) XN297_WriteEnhancedPayload(uint8_t* msg, uin
buf[last++] = (crc & 0xff) << 6;
}
pid++;
if(pid>3)
pid=0;
pid &= 0x03;
// send packet
XN297_SendPayload(buf, last);

View File

@ -211,7 +211,7 @@
#define FRSKYL_CC2500_INO
#define FRSKYD_CC2500_INO
#define FRSKYV_CC2500_INO
#define FRSKYX_CC2500_INO
#define FRSKYX_CC2500_INO //Include FRSKYX2 protocol
#define FRSKY_RX_CC2500_INO
#define HITEC_CC2500_INO
#define HOTT_CC2500_INO
@ -246,6 +246,7 @@
#define HONTAI_NRF24L01_INO
#define JIABAILE_NRF24L01_INO
#define JJRC345_NRF24L01_INO
#define KAMTOM_NRF24L01_INO
#define KN_NRF24L01_INO
#define KYOSHO2_NRF24L01_INO
#define LOLI_NRF24L01_INO
@ -256,6 +257,7 @@
#define REALACC_NRF24L01_INO
#define SGF22_NRF24L01_INO
#define SHENQI_NRF24L01_INO
#define SHENQI2_NRF24L01_INO
#define SYMAX_NRF24L01_INO
#define V2X2_NRF24L01_INO
#define V761_NRF24L01_INO
@ -273,7 +275,9 @@
#define Q303_CCNRF_INO
#define Q90C_CCNRF_INO
#define SLT_CCNRF_INO
#define UDIRC_CCNRF_INO
#define V911S_CCNRF_INO
#define WL91X_CCNRF_INO
#define XK_CCNRF_INO
#define XK2_CCNRF_INO
@ -298,11 +302,6 @@
//Enable DSM Forward Programming
#define DSM_FWD_PGM
//AFHDS2A specific settings
//-------------------------
//When enabled (remove the "//"), the below setting makes LQI (Link Quality Indicator) available on one of the RX ouput channel (5-14).
//#define AFHDS2A_LQI_CH 14
/**************************/
/*** FAILSAFE SETTINGS ***/
/**************************/
@ -349,14 +348,18 @@
#define NCC1701_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define OMP_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define V761_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define YUXIANG_HUB_TELEMETRY
#define KAMTOM_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define FX_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define XK2_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define SGF22_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define YUXIANG_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define PROPEL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define CABELL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define RLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define WFLY2_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define LOLI_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define MT99XX_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
//#define MLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
//#define MLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define MLINK_FW_TELEMETRY // Forward received telemetry packet directly to TX to be decoded by erskyTX and OpenTX
//#define HITEC_HUB_TELEMETRY // Use FrSkyD Hub format to send basic telemetry to the radios which can decode it like er9x, erskyTX and OpenTX
#define HITEC_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX
@ -562,10 +565,9 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PPM_IBUS
PWM_SBUS
PPM_SBUS
PWM_IB16
PPM_IB16
PWM_SB16
PPM_SB16
AFHDS2A_GYRO_OFF
AFHDS2A_GYRO_ON
AFHDS2A_GYRO_ON_REV
PROTO_AFHDS2A_RX
NONE
PROTO_ASSAN
@ -695,6 +697,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
FX620
FX9630
Q560
QF012
PROTO_FY326
FY326
FY319
@ -744,6 +747,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
SKYTMBLR
PROTO_JOYSWAY
NONE
PROTO_KAMTOM
NONE
PROTO_KF606
KF606_KF606
KF606_MIG320
@ -773,8 +778,9 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_MLINK
NONE
PROTO_MOULDKG
MOULDKG_ANALOG
MOULDKG_DIGIT
MOULDKG_ANALOG4
MOULDKG_DIGIT4
MOULDKG_ANALOG6
PROTO_MT99XX
MT99
H7
@ -830,6 +836,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
J20
PROTO_SHENQI
NONE
PROTO_SHENQI2
NONE
PROTO_SKYARTEC
NONE
PROTO_SLT
@ -845,6 +853,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
SYMAX5C
PROTO_TRAXXAS
NONE
PROTO_UDIRC
NONE
PROTO_V2X2
V2X2
JXD506

View File

@ -28,6 +28,7 @@ static void __attribute__((unused)) XN297_SetTXAddr(const uint8_t*, uint8_t);
static void __attribute__((unused)) XN297_SetRXAddr(const uint8_t*, uint8_t);
static void __attribute__((unused)) XN297_SetTxRxMode(enum TXRX_State);
static void __attribute__((unused)) XN297_SendPayload(uint8_t*, uint8_t);
static void __attribute__((unused)) XN297_ReSendPayload();
static void __attribute__((unused)) XN297_WritePayload(uint8_t*, uint8_t);
static void __attribute__((unused)) XN297_WriteEnhancedPayload(uint8_t*, uint8_t, uint8_t);
static bool __attribute__((unused)) XN297_IsRX();

View File

@ -61,104 +61,107 @@ You've upgraded the module but the radio does not display the name of the protoc
# Available Protocol Table of Contents (Listed Alphabetically)
Protocol Name|Protocol Number|Sub_Proto 0|Sub_Proto 1|Sub_Proto 2|Sub_Proto 3|Sub_Proto 4|Sub_Proto 5|Sub_Proto 6|Sub_Proto 7|RF Module|Emulation
---|---|---|---|---|---|---|---|---|---|---|---
[Assan](Protocols_Details.md#ASSAN---24)|24|||||||||NRF24L01|
[Bayang](Protocols_Details.md#BAYANG---14)|14|Bayang|H8S3D|X16_AH|IRDRONE|DHD_D4|QX100|||NRF24L01|XN297
[Bayang RX](Protocols_Details.md#BAYANG-RX---59)|59|Multi|CPPM|||||||NRF24L01|XN297
[BlueFly](Protocols_Details.md#BLUEFLY---95)|95|||||||||NRF24L01|
[Bugs](Protocols_Details.md#BUGS---41)|41|||||||||A7105|
[BugsMini](Protocols_Details.md#BUGSMINI---42)|42|BUGSMINI|BUGS3H|||||||NRF24L01|XN297
[Cabell](Protocols_Details.md#Cabell---34)|34|Cabell_V3|C_TELEM|-|-|-|-|F_SAFE|UNBIND|NRF24L01|
CFlie|38|CFlie||||||||NRF24L01|
[CG023](Protocols_Details.md#CG023---13)|13|CG023|YD829|||||||NRF24L01|XN297
[Corona](Protocols_Details.md#CORONA---37)|37|COR_V1|COR_V2|FD_V3||||||CC2500|
[CX10](Protocols_Details.md#CX10---12)|12|GREEN|BLUE|DM007|-|J3015_1|J3015_2|MK33041||NRF24L01|XN297
[Devo](Protocols_Details.md#DEVO---7)|7|Devo|8CH|10CH|12CH|6CH|7CH|||CYRF6936|
[DM002](Protocols_Details.md#DM002---33)|33|||||||||NRF24L01|XN297
[DSM](Protocols_Details.md#DSM---6)|6|DSM2_1F|DSM2_2F|DSMX_1F|DSMX_2F|AUTO|DSMR_1F|DSM2SFC||CYRF6936|
[DSM_RX](Protocols_Details.md#DSM_RX---70)|70|Multi|CPPM|||||||CYRF6936|
[E010R5](Protocols_Details.md#E010R5---81)|81|||||||||CYRF6936|RF2500
[E016H](Protocols_Details.md#E016H---85)|85|||||||||NRF24L01|XN297
[E016HV2](Protocols_Details.md#E016HV2---80)|80|||||||||CC2500/NRF24L01|unknown
[E01X](Protocols_Details.md#E01X---45)|45|E012|E015|||||||CYRF6936|HS6200
[E129](Protocols_Details.md#E129---83)|83|E129|C186|||||||CYRF6936|RF2500
[EazyRC](Protocols_Details.md#EazyRC---61)|61|||||||||NRF24L01|XN297L
[ESky](Protocols_Details.md#ESKY---16)|16|ESky|ET4|||||||NRF24L01|
[ESky150](Protocols_Details.md#ESKY150---35)|35|||||||||NRF24L01|
[ESky150V2](Protocols_Details.md#ESKY150V2---69)|69|||||||||CC2500|NRF51822
[Flysky](Protocols_Details.md#FLYSKY---1)|1|Flysky|V9x9|V6x6|V912|CX20||||A7105|
[Flysky AFHDS2A](Protocols_Details.md#FLYSKY-AFHDS2A---28)|28|PWM_IBUS|PPM_IBUS|PWM_SBUS|PPM_SBUS|PWM_IBUS16|PPM_IBUS16|PWM_SBUS16|PPM_SBUS16|A7105|
[Flysky AFHDS2A RX](Protocols_Details.md#FLYSKY-AFHDS2A-RX---56)|56|Multi|CPPM|||||||A7105|
[FQ777](Protocols_Details.md#FQ777---23)|23|||||||||NRF24L01|SSV7241
[FrskyD](Protocols_Details.md#FRSKYD---3)|3|D8|Cloned|||||||CC2500|
[FrskyL](Protocols_Details.md#FRSKYL---67)|67|LR12|LR12 6CH|||||||CC2500|
[FrskyR9](Protocols_Details.md#FRSKYR9---65)|65|FrskyR9|R9_915|R9_868||||||SX1276|
[FrskyV](Protocols_Details.md#FRSKYV---25)|25|||||||||CC2500|
[FrskyX](Protocols_Details.md#FRSKYX---15)|15|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500|
[FrskyX2](Protocols_Details.md#FRSKYX2---64)|64|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500|
[Frsky_RX](Protocols_Details.md#FRSKY_RX---55)|55|Multi|CloneTX|EraseTX|CPPM|||||CC2500|
[Futaba/SFHSS](Protocols_Details.md#Futaba---21)|21|SFHSS||||||||CC2500|
[FX](Protocols_Details.md#FX---58)|28|816|620|9630|Q560|||||NRF24L01|
[FY326](Protocols_Details.md#FY326---20)|20|FY326|FY319|||||||NRF24L01|
[GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|XN297L
[GW008](Protocols_Details.md#GW008---32)|32|||||||||NRF24L01|XN297
[H36](Protocols_Details.md#H36---103)|H36|||||||||NRF24L01|XN297
[H8_3D](Protocols_Details.md#H8_3D---36)|36|H8_3D|H20H|H20Mini|H30Mini|||||NRF24L01|XN297
[Height](Protocols_Details.md#HEIGHT---53)|53|5ch|8ch|||||||A7105|
[Hisky](Protocols_Details.md#HISKY---4)|4|Hisky|HK310|||||||NRF24L01|
[Hitec](Protocols_Details.md#HITEC---39)|39|OPT_FW|OPT_HUB|MINIMA||||||CC2500|
[Hontai](Protocols_Details.md#HONTAI---26)|26|HONTAI|JJRCX1|X5C1|FQ777_951|XKK170||||NRF24L01|XN297
[HoTT](Protocols_Details.md#HoTT---57)|57|Sync|No_Sync|||||||CC2500|
[Hubsan](Protocols_Details.md#HUBSAN---2)|2|H107|H301|H501||||||A7105|
[J6Pro](Protocols_Details.md#J6Pro---22)|22|||||||||CYRF6936|
[JIABAILE](Protocols_Details.md#JIABAILE---102)|102|Std|Gyro|||||||NRF24L01|XN297
[JJRC345](Protocols_Details.md#JJRC345---71)|71|JJRC345|SkyTmblr|||||||NRF24L01|XN297
[JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297
[KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01|
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
[Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01|
[Kyosho3](Protocols_Details.md#Kyosho3---98)|98|ASF||||||||CYRF6936|
[LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01|
[Losi](Protocols_Details.md#Losi---89)|89|||||||||CYRF6936|
[MJXq](Protocols_Details.md#MJXQ---18)|18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297
[MLINK](Protocols_Details.md#MLINK---78)|78|||||||||CYRF6936|
[MouldKg](Protocols_Details.md#mouldkg---90)|90|Analog|Digit|||||||NRF24L01|XN297
[MT99xx](Protocols_Details.md#MT99XX---17)|17|MT|H7|YZ|LS|FY805|A180|DRAGON|F949G|NRF24L01|XN297
[MT99xx2](Protocols_Details.md#MT99XX2---92)|92|PA18|SU35|||||||NRF24L01|XN297
[NCC1701](Protocols_Details.md#NCC1701---44)|44|||||||||NRF24L01|
[OMP](Protocols_Details.md#OMP---77)|77|||||||||CC2500&NRF24L01|XN297L
[OpenLRS](Protocols_Details.md#OpenLRS---27)|27|||||||||None|
[Pelikan](Protocols_Details.md#Pelikan---60)|60|Pro|Lite|SCX24||||||A7105|
[Potensic](Protocols_Details.md#Potensic---51)|51|A20||||||||NRF24L01|XN297
[PROPEL](Protocols_Details.md#PROPEL---66)|66|74-Z||||||||NRF24L01|
[Q2X2](Protocols_Details.md#Q2X2---29)|29|Q222|Q242|Q282||||||NRF24L01|
[Q303](Protocols_Details.md#Q303---31)|31|Q303|CX35|CX10D|CX10WD|||||NRF24L01|XN297
[Q90C](Protocols_Details.md#Q90C---72)|72|Q90C*||||||||NRF24L01|XN297
[RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface|Air|DumboRC|RC4G|||||CC2500|
[Realacc](Protocols_Details.md#Realacc---76)|76|R11||||||||NRF24L01|
[Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|XN297
[Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500|
[Scorpio](Protocols_Details.md#Scorpio---94)|94|||||||||CYRF6936|
[SGF22](Protocols_Details.md#SGF22---97)|97|F22|F22S|J20||||||NRF24L01|XN297
[Shenqi](Protocols_Details.md#Shenqi---19)|19|Shenqi||||||||NRF24L01|LT8900
[Skyartec](Protocols_Details.md#Skyartec---68)|68|||||||||CC2500|CC2500
[SLT](Protocols_Details.md#SLT---11)|11|SLT_V1|SLT_V2|Q100|Q200|MR100|V1_4CH|RF_SIM||NRF24L01|CC2500
[SymaX](Protocols_Details.md#Symax---10)|10|SYMAX|SYMAX5C|||||||NRF24L01|
[Traxxas](Protocols_Details.md#Traxxas---43)|43|TQ2|TQ1|||||||CYRF6936|
[V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|MR101||||||NRF24L01|
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|TOPRC||||||NRF24L01|XN297
[V911S](Protocols_Details.md#V911S---46)|46|V911S*|E119*|||||||NRF24L01|XN297
[WFLY](Protocols_Details.md#WFLY---40)|40|WFR0x||||||||CYRF6936|
[WFLY2](Protocols_Details.md#WFLY2---79)|79|RF20x||||||||A7105|
[WK2x01](Protocols_Details.md#WK2X01---30)|30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936|
[XERALL](Protocols_Details.md#XERALL---91)|91|Tank||||||||NRF24L01|XN297
[XK](Protocols_Details.md#XK---62)|62|X450|X420|Cars||||||NRF24L011&CC2500|XN297
[XK2](Protocols_Details.md#XK2---99)|99|X4|P10|||||||NRF24L01&CC2500|XN297
[YD717](Protocols_Details.md#YD717---8)|8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01|
[YuXiang](Protocols_Details.md#YuXiang---100)|100|||||||||NRF24L01|XN297
[ZSX](Protocols_Details.md#ZSX---52)|52|280||||||||NRF24L01|XN297
Protocol Name|Build|Protocol Number|Sub_Proto 0|Sub_Proto 1|Sub_Proto 2|Sub_Proto 3|Sub_Proto 4|Sub_Proto 5|Sub_Proto 6|Sub_Proto 7|RF Module|Emulation
---|---|---|---|---|---|---|---|---|---|---|---|---
[Assan](Protocols_Details.md#ASSAN---24)|AIR/SFC|24|||||||||NRF24L01|
[Bayang](Protocols_Details.md#BAYANG---14)|AIR/SFC|14|Bayang|H8S3D|X16_AH|IRDRONE|DHD_D4|QX100|||NRF24L01|XN297
[Bayang RX](Protocols_Details.md#BAYANG-RX---59)|AIR/SFC|59|Multi|CPPM|||||||NRF24L01|XN297
[BlueFly](Protocols_Details.md#BLUEFLY---95)||95|||||||||NRF24L01|
[Bugs](Protocols_Details.md#BUGS---41)|AIR|41|||||||||A7105|
[BugsMini](Protocols_Details.md#BUGSMINI---42)|AIR|42|BUGSMINI|BUGS3H|||||||NRF24L01|XN297
[Cabell](Protocols_Details.md#Cabell---34)||34|Cabell_V3|C_TELEM|-|-|-|-|F_SAFE|UNBIND|NRF24L01|
CFlie|AIR|38|CFlie||||||||NRF24L01|
[CG023](Protocols_Details.md#CG023---13)|AIR|13|CG023|YD829|||||||NRF24L01|XN297
[Corona](Protocols_Details.md#CORONA---37)|AIR/SFC|37|COR_V1|COR_V2|FD_V3||||||CC2500|
[CX10](Protocols_Details.md#CX10---12)|AIR|12|GREEN|BLUE|DM007|-|J3015_1|J3015_2|MK33041||NRF24L01|XN297
[Devo](Protocols_Details.md#DEVO---7)|AIR/SFC|7|Devo|8CH|10CH|12CH|6CH|7CH|||CYRF6936|
[DM002](Protocols_Details.md#DM002---33)|AIR|33|||||||||NRF24L01|XN297
[DSM](Protocols_Details.md#DSM---6)|AIR/SFC|6|DSM2_1F|DSM2_2F|DSMX_1F|DSMX_2F|AUTO|DSMR_1F|DSM2SFC||CYRF6936|
[DSM_RX](Protocols_Details.md#DSM_RX---70)|AIR/SFC|70|Multi|CPPM|||||||CYRF6936|
[E010R5](Protocols_Details.md#E010R5---81)|AIR|81|||||||||CYRF6936|RF2500
[E016H](Protocols_Details.md#E016H---85)||85|||||||||NRF24L01|XN297
[E016HV2](Protocols_Details.md#E016HV2---80)||80|||||||||CC2500/NRF24L01|unknown
[E01X](Protocols_Details.md#E01X---45)||45|E012|E015|||||||CYRF6936|HS6200
[E129](Protocols_Details.md#E129---83)||83|E129|C186|||||||CYRF6936|RF2500
[EazyRC](Protocols_Details.md#EazyRC---61)||61|||||||||NRF24L01|XN297L
[ESky](Protocols_Details.md#ESKY---16)||16|ESky|ET4|||||||NRF24L01|
[ESky150](Protocols_Details.md#ESKY150---35)||35|||||||||NRF24L01|
[ESky150V2](Protocols_Details.md#ESKY150V2---69)||69|||||||||CC2500|NRF51822
[Flysky](Protocols_Details.md#FLYSKY---1)||1|Flysky|V9x9|V6x6|V912|CX20||||A7105|
[Flysky AFHDS2A](Protocols_Details.md#FLYSKY-AFHDS2A---28)||28|PWM_IBUS|PPM_IBUS|PWM_SBUS|PPM_SBUS|Gyro_Off|Gyro_On|Gyro_On_Rev||A7105|
[Flysky AFHDS2A RX](Protocols_Details.md#FLYSKY-AFHDS2A-RX---56)||56|Multi|CPPM|||||||A7105|
[FQ777](Protocols_Details.md#FQ777---23)||23|||||||||NRF24L01|SSV7241
[FrskyD](Protocols_Details.md#FRSKYD---3)||3|D8|Cloned|||||||CC2500|
[FrskyL](Protocols_Details.md#FRSKYL---67)||67|LR12|LR12 6CH|||||||CC2500|
[FrskyR9](Protocols_Details.md#FRSKYR9---65)||65|FrskyR9|R9_915|R9_868||||||SX1276|
[FrskyV](Protocols_Details.md#FRSKYV---25)||25|||||||||CC2500|
[FrskyX](Protocols_Details.md#FRSKYX---15)||15|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500|
[FrskyX2](Protocols_Details.md#FRSKYX2---64)||64|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500|
[Frsky_RX](Protocols_Details.md#FRSKY_RX---55)||55|Multi|CloneTX|EraseTX|CPPM|||||CC2500|
[Futaba/SFHSS](Protocols_Details.md#Futaba---21)||21|SFHSS||||||||CC2500|
[FX](Protocols_Details.md#FX---58)||28|816|620|9630|Q560|QF012||||NRF24L01|
[FY326](Protocols_Details.md#FY326---20)||20|FY326|FY319|||||||NRF24L01|
[GD00X](Protocols_Details.md#GD00X---47)||47|GD_V1*|GD_V2*|||||||NRF24L01|XN297L
[GW008](Protocols_Details.md#GW008---32)||32|||||||||NRF24L01|XN297
[H36](Protocols_Details.md#H36---103)||H36|||||||||NRF24L01|XN297
[H8_3D](Protocols_Details.md#H8_3D---36)||36|H8_3D|H20H|H20Mini|H30Mini|||||NRF24L01|XN297
[Height](Protocols_Details.md#HEIGHT---53)||53|5ch|8ch|||||||A7105|
[Hisky](Protocols_Details.md#HISKY---4)||4|Hisky|HK310|||||||NRF24L01|
[Hitec](Protocols_Details.md#HITEC---39)||39|OPT_FW|OPT_HUB|MINIMA||||||CC2500|
[Hontai](Protocols_Details.md#HONTAI---26)||26|HONTAI|JJRCX1|X5C1|FQ777_951|XKK170||||NRF24L01|XN297
[HoTT](Protocols_Details.md#HoTT---57)||57|Sync|No_Sync|||||||CC2500|
[Hubsan](Protocols_Details.md#HUBSAN---2)||2|H107|H301|H501||||||A7105|
[J6Pro](Protocols_Details.md#J6Pro---22)||22|||||||||CYRF6936|
[JIABAILE](Protocols_Details.md#JIABAILE---102)||102|Std|Gyro|||||||NRF24L01|XN297
[JJRC345](Protocols_Details.md#JJRC345---71)||71|JJRC345|SkyTmblr|||||||NRF24L01|XN297
[JOYSWAY](Protocols_Details.md#JOYSWAY---84)||84|||||||||NRF24L01|XN297
[KAMTOM](Protocols_Details.md#KAMTOM---104)||104|||||||||NRF24L01|XN297
[KF606](Protocols_Details.md#KF606---49)||49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297
[KN](Protocols_Details.md#KN---9)||9|WLTOYS|FEILUN|||||||NRF24L01|
[Kyosho](Protocols_Details.md#Kyosho---73)||73|FHSS|Hype|||||||A7105|
[Kyosho2](Protocols_Details.md#Kyosho2---93)||93|KT-17||||||||NRF24L01|
[Kyosho3](Protocols_Details.md#Kyosho3---98)||98|ASF||||||||CYRF6936|
[LOLI](Protocols_Details.md#LOLI---82)||82|||||||||NRF24L01|
[Losi](Protocols_Details.md#Losi---89)||89|||||||||CYRF6936|
[MJXq](Protocols_Details.md#MJXQ---18)||18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297
[MLINK](Protocols_Details.md#MLINK---78)||78|||||||||CYRF6936|
[MouldKg](Protocols_Details.md#mouldkg---90)||90|A4444|D4444|A664||||||NRF24L01|XN297
[MT99xx](Protocols_Details.md#MT99XX---17)||17|MT|H7|YZ|LS|FY805|A180|DRAGON|F949G|NRF24L01|XN297
[MT99xx2](Protocols_Details.md#MT99XX2---92)||92|PA18|SU35|||||||NRF24L01|XN297
[NCC1701](Protocols_Details.md#NCC1701---44)||44|||||||||NRF24L01|
[OMP](Protocols_Details.md#OMP---77)||77|||||||||CC2500&NRF24L01|XN297L
[OpenLRS](Protocols_Details.md#OpenLRS---27)||27|||||||||None|
[Pelikan](Protocols_Details.md#Pelikan---60)||60|Pro|Lite|SCX24||||||A7105|
[Potensic](Protocols_Details.md#Potensic---51)||51|A20||||||||NRF24L01|XN297
[PROPEL](Protocols_Details.md#PROPEL---66)||66|74-Z||||||||NRF24L01|
[Q2X2](Protocols_Details.md#Q2X2---29)||29|Q222|Q242|Q282||||||NRF24L01|
[Q303](Protocols_Details.md#Q303---31)||31|Q303|CX35|CX10D|CX10WD|||||NRF24L01|XN297
[Q90C](Protocols_Details.md#Q90C---72)||72|Q90C*||||||||NRF24L01|XN297
[RadioLink](Protocols_Details.md#RadioLink---74)||74|Surface|Air|DumboRC|RC4G|||||CC2500|
[Realacc](Protocols_Details.md#Realacc---76)||76|R11||||||||NRF24L01|
[Redpine](Protocols_Details.md#Redpine---50)||50|FAST|SLOW|||||||NRF24L01|XN297
[Scanner](Protocols_Details.md#Scanner---54)||54|||||||||CC2500|
[Scorpio](Protocols_Details.md#Scorpio---94)||94|||||||||CYRF6936|
[SGF22](Protocols_Details.md#SGF22---97)||97|F22|F22S|J20||||||NRF24L01|XN297
[Shenqi](Protocols_Details.md#Shenqi---19)||19|Shenqi||||||||NRF24L01|LT8900
[Shenqi2](Protocols_Details.md#Shenqi2---105)||105|Shenqi2||||||||NRF24L01|XN297
[Skyartec](Protocols_Details.md#Skyartec---68)||68|||||||||CC2500|CC2500
[SLT](Protocols_Details.md#SLT---11)||11|SLT_V1|SLT_V2|Q100|Q200|MR100|V1_4CH|RF_SIM||NRF24L01|CC2500
[SymaX](Protocols_Details.md#Symax---10)||10|SYMAX|SYMAX5C|||||||NRF24L01|
[Traxxas](Protocols_Details.md#Traxxas---43)||43|TQ2|TQ1|||||||CYRF6936|
[V2x2](Protocols_Details.md#V2X2---5)||5|V2x2|JXD506|MR101||||||NRF24L01|
[V761](Protocols_Details.md#V761---48)||48|3CH|4CH|TOPRC||||||NRF24L01|XN297
[V911S](Protocols_Details.md#V911S---46)||46|V911S*|E119*|||||||NRF24L01|XN297
[WFLY](Protocols_Details.md#WFLY---40)||40|WFR0x||||||||CYRF6936|
[WFLY2](Protocols_Details.md#WFLY2---79)||79|RF20x||||||||A7105|
[WK2x01](Protocols_Details.md#WK2X01---30)||30|WK2801|WK2401|W6_5_1|W6_6_1|W6_HEL|W6_HEL_I|||CYRF6936|
[WL91X](Protocols_Details.md#WL91X---106)||106|||||||||NRF24L011&CC2500|XN297
[XERALL](Protocols_Details.md#XERALL---91)||91|Tank||||||||NRF24L01|XN297
[XK](Protocols_Details.md#XK---62)||62|X450|X420|Cars||||||NRF24L011&CC2500|XN297
[XK2](Protocols_Details.md#XK2---99)||99|X4|P10|||||||NRF24L01&CC2500|XN297
[YD717](Protocols_Details.md#YD717---8)||8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01|
[YuXiang](Protocols_Details.md#YuXiang---100)||100|||||||||NRF24L01|XN297
[ZSX](Protocols_Details.md#ZSX---52)||52|280||||||||NRF24L01|XN297
* "*" Sub Protocols designated by * suffix are using a XN297L@250kbps which will be emulated by default with the NRF24L01. If option (freq tune) is diffrent from 0, the CC2500 module (if installed) will be used instead. Each specific sub protocol has a more detailed explanation.
# A7105 RF Module
@ -224,36 +227,59 @@ Telemetry enabled protocol:
- if using erskyTX and OpenTX: full telemetry information available
- if telemetry is incomplete (missing RX RSSI for example), it means that you have to upgrade your RX firmware to version 1.6 or later. You can do it from an original Flysky TX or using a STLink like explained in [this tutorial](https://www.rcgroups.com/forums/showthread.php?2677694-How-to-upgrade-Flysky-Turnigy-iA6B-RX-to-firmware-1-6-with-a-ST-Link).
LQI: Link Quality Indicator which is sent back to the RX on CH17
Option is used to change the servo refresh rate. A value of 0 gives 50Hz (min), 70 gives 400Hz (max). Specific refresh rate value can be calculated like this option=(refresh_rate-50)/5.
**RX_Num is used to give a number a given RX. You must use a different RX_Num per RX. A maximum of 64 AFHDS2A RXs are supported.**
AFHDS2A_LQI_CH is a feature which is disabled by defaut in the _config.h file. When enabled, it makes LQI (Link Quality Indicator) available on one of the RX ouput channel (5-14).
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14
---|---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14
RX output will match the Flysky standard AETR independently of the input configuration AETR, RETA... unless on OpenTX 2.3.3+ you use the "Disable channel mapping" feature on the GUI.
### Sub_protocol PWM_IBUS - *0*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14CH15|CH16|LQI
RX output will match the Flysky standard AETR.
### Sub_protocol PPM_IBUS - *1*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14CH15|CH16|LQI
RX output will match the Flysky standard AETR.
### Sub_protocol PWM_SBUS - *2*
### Sub_protocol PPM_SBUS - *3*
As stated above.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14CH15|CH16|LQI
### Sub_protocol PWM_IBUS16 - *4*
### Sub_protocol PPM_IBUS16 - *5*
### Sub_protocol PWM_SBUS16 - *6*
### Sub_protocol PPM_SBUS16 - *7*
RX output will match the Flysky standard AETR.
3 additional channels. Need recent or updated RXs.
### Sub_protocol Gyro_Off - *3*
RXs: FS-BS6, FS-BS4
CH15|CH16|CH17
---|---|---
CH15|CH16|LQI
Gyro is off
LQI: Link Quality Indicator
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|-|-|-|-|LQI
### Sub_protocol Gyro_On - *4*
RXs: FS-BS6, FS-BS4
Gyro is on
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|ST_Gain|TH_Gain|Priority|Calib|LQI
### Sub_protocol Gyro_On_Rev - *5*
RXs: FS-BS6, FS-BS4
Gyro is on and reversed
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16|CH17
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|ST_Gain|TH_Gain|Priority|Calib|LQI
## FLYSKY AFHDS2A RX - *56*
The Flysky AFHDS2A receiver protocol enables master/slave trainning, separate access from 2 different radios to the same model,...
@ -1182,16 +1208,22 @@ If only a NRF24L01 is installed then this sub protocol might be problematic beca
## MT99XX - *17*
Autobind protocol
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS
CC2500: only YZ is supported.
CC2500: only YZ and F949G are supported.
### Sub_protocol MT99 - *0*
Models: MT99xx
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|ATrim|ETrim
### Sub_protocol H7 - *1*
Models: Eachine H7, Cheerson CX023
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|ATrim|ETrim
### Sub_protocol YZ - *2*
Model: Yi Zhan i6S
@ -1201,63 +1233,71 @@ If a CC2500 is installed it will be used for this sub protocol. Option in this c
If only a NRF24L01 is installed then this sub protocol might be problematic because it is using the xn297L emulation with a transmission speed of 250kbps which doesn't work very well with every NRF24L01, this is an hardware issue with the authenticity and accuracy of the components.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|LED|PICTURE|VIDEO|HEADLESS|ATrim|ETrim
### Sub_protocol LS - *3*
Models: LS114, 124, 215
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|INVERT|PICTURE|VIDEO|HEADLESS
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|INVERT|PICTURE|VIDEO|HEADLESS|ATrim|ETrim
### Sub_protocol FY805 - *4*
Model: FY805
**Only 1 ID available**
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP||||HEADLESS
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP||||HEADLESS|ATrim|ETrim
### Sub_protocol A180 - *5*
Model: XK A180, A120, F949S, F959
A180:
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|3D6G|RATE
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|3D6G|RATE||||ATrim|ETrim
A120:
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|RATE|LED
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|RATE|LED||||ATrim|ETrim
F949S:
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|RATE|RXLED|3D6G
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|RATE|RXLED|3D6G|||ATrim|ETrim
### Sub_protocol DRAGON - *6*
Model: Eachine Mini Wing Dragon, Eachine Mini Cessna
Telemetry is supported: A1 = battery voltage with a Ratio of 25.5, A2=battery low flag (0=off,>0=on) and RSSI = dummy value of 100
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|MODE|RTH
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|MODE|RTH||||ATrim|ETrim
MODE: -100%=Beginner, 0%=Intermediate, +100%=Advanced
### Sub_protocol F949G - *7*
If a CC2500 is installed it will be used for this sub protocol. Option in this case is used for fine frequency tuning like any CC2500 protocols so check the [Frequency Tuning page](/docs/Frequency_Tuning.md).
If only a NRF24L01 is installed then this sub protocol might be problematic because it is using the xn297L emulation with a transmission speed of 250kbps which doesn't work very well with every NRF24L01, this is an hardware issue with the authenticity and accuracy of the components.
Model: F949G
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|6G3D|Light
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|6G3D|Light||||ATrim|ETrim
Model: KFPLAN Z-Series like Z61 BF109, Z54 A380,...
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|-|Rate|Light|Unk1|Unk2
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R||Rate|Light|Unk1|Unk2|ATrim|ETrim
Unk1&2: long press right/left
@ -1266,20 +1306,18 @@ Unk1&2: long press right/left
### Sub_protocol PA18 - *0*
Model: PA18 mini
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|MODE|FLIP|RTH
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|MODE|FLIP|RTH|||ATrim|ETrim
MODE: -100% beginner, 0% intermediate, +100% Expert
### Sub_protocol SU35 - *1*
Model: QF009 SU35
CH6 - LED, CH7 - LED Flash, CH8 - Invert, CH9 - Rate
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|MODE|LED|LED_FLASH|INVERT|RATE
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11
---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|MODE|LED|LED_FLASH|INVERT|RATE|ATrim|ETrim
MODE: -100% 6G, +100% 3D
@ -1439,11 +1477,14 @@ FLIP: sets model into flip mode for approx 5 seconds at each throw of switch (re
MODE: -100% level, +100% acro
### Sub_protocol V1_4CH - *5*
Transmitters: SLT2 and SLT2 DLC, Receivers: SPMXSE2825RX, SPMXSBER1025G, SPMXSE4510RX, ...
CH1|CH2|CH3|CH4
---|---|---|---
CH1|CH2|CH3|CH4
CH4 is used for DSC settings: -35% off to +15% full
### Sub_protocol RF_SIM - *6*
Models: the SLT-dongle included in RealFlight 7.5
@ -1481,6 +1522,14 @@ A|E|T|R|CALIB|RATE|6G_3D|6GSENIOR|LIGHT
A280 -> 6GSENIOR: -100% - 6G, +100% - Senior mode (turn off gyro), LIGHT: cycle the light through on-flash-off when the CH9 value is changed from -100% to 100%
## WL91X - *106*
Models: WLtoys WL911, WL913, WL915 and may be others...
CH1|CH2|CH3|CH4
---|---|---|---
ST|TH|ST_TR|TH_TR
## XK - *62*
CC2500: only X450 is supported.
@ -1530,8 +1579,12 @@ A|E|T|R|Rate|Mode|Hover|Light
The plane does not need to be bound each time if it is powered on **after** the radio/protocol is on.
Telemetry is supported. The plane sends a battery status of good->empty which is visible in A1 (good=8.4V->empty=7.1V) and RSSI gets a dummy value of 100.
The rudder trim is driven from the rudder channel to increase the range (Original TX rudder has no range once the motor has been turned on...).
Mode: -100%=6G, 0%=3D, +100%=Gyro off (Senior mode)
### Sub_protocol X4 - *0*
Transmitter: XK X4-A160, X5S, model: XK A160S, XK A280, XK A300
@ -1785,18 +1838,22 @@ FMODE and AUX7 have 4 positions: -100%..-50%=>0, -50%..5%=>1, 5%..50%=>2, 50%..1
## FX - *58*
FEI XIONG
CH1|CH2|CH3|CH4
---|---|---|---
A|-|T|-
### Sub_protocol 816 - *0*
Model: FX816 P38, B17
Only 8 TX IDs available
CH1|CH2|CH3|CH4
---|---|---|---
A|-|T|-
### Sub_protocol 620 - *1*
Model: FX620 SU35
CH1|CH2|CH3|CH4
---|---|---|---
A|-|T|-
### Sub_protocol 9630 - *2*
Model: FX9630, FX9603, QIDI-550
@ -1819,6 +1876,19 @@ FLIP is a toggle channel meaning that -100% to +100% is a command and +100% to -
Gyro: -100%=6G, 0%=3D+Gyro, +100%=3D
### Sub_protocol QF012 - *4*
Model: QF012 SBD Dauntless
Telemetry supported. The plane sends a battery status of good->empty which is visible in A1 (good=4.2V->empty=3.1V) and RSSI gets a dummy value of 100.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|---
A|E|T|R|FLIP|GYRO|Invert|Reset
Gyro: -100%=6G, 0%=3D+Gyro, +100%=3D
Reset: Restore fine tunning midpoint
## FY326 - *20*
### Sub_protocol FY326 - *0*
@ -1981,6 +2051,15 @@ Model: DF-Models SkyTumbler
RTH not supported
## KAMTOM - *104*
Models: KAMTOM RC Racing KM24xx (KM32xx?), Pinecone SG-24xx
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
ST|TH|UNK1|UNK2|ST_TR|TH_TR|TH_DR
Low battery telemetry in A1 with 0 = low batt
## KYOSHO2 - *93*
Model: TX KT-17, Minium Edge 540, Minium Citabria
@ -2017,6 +2096,9 @@ CH16| CH8 | -100% | 0% | - | - | -
## MouldKg - *90*
Mould King 2.4GHz TX: Technic Brick models
### Sub_protocol A4444 - *0*
Model: 4 analog ports brick
Up to 4 bricks can be controlled at the same time.
Option field | Value
@ -2032,17 +2114,52 @@ To associate a brick to a RX number (RX_num above), set this RX number under the
Example: I want to control 2 bricks. I select RX number 1, set option to 1 and launch a bind on the first brick. I select RX number 2, set option to 1 and launch a bind on the second brick. Now to control both bricks I set RX number to 1 and option to 2. Therefore brick1 will react to channels CH1 to CH4 and brick2 to channel CH5 to CH8.
On another model I can control 4 other bricks, bind each brick to RX number 3 to 6 and then finaly set RX number to 3 and option to 4 to contol the 4 bricks with CH1 to CH16.
### Sub_protocol Analog - *0*
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
Brick1_A|Brick1_B|Brick1_C|Brick1_D|Brick2_A|Brick2_B|Brick2_C|Brick2_D|Brick3_A|Brick3_B|Brick3_C|Brick3_D|Brick4_A|Brick4_B|Brick4_C|Brick4_D
### Sub_protocol D4444 - *1*
Model: 4 digital ports brick and Integrated power module
Up to 4 bricks can be controlled at the same time.
Option field | Value
-------------|------
0|The module will act like the original radio which will bind every time and attach to the first brick in bind mode
1|The module will control the brick number RX_num
2|The module will control the brick number RX_num and RX_num+1
3|The module will control the brick number RX_num, RX_num+1 and RX_num+2
4|The module will control the brick number RX_num, RX_num+1, RX_num+2 and RX_num+3
To associate a brick to a RX number (RX_num above), set this RX number under the protocol, set option to 1, launch a bind and power on the brick you want to control. Repeat this for every brick using a different RX number each time and then indicate the number of bricks to be controlled using the Option field.
Example: I want to control 2 bricks. I select RX number 1, set option to 1 and launch a bind on the first brick. I select RX number 2, set option to 1 and launch a bind on the second brick. Now to control both bricks I set RX number to 1 and option to 2. Therefore brick1 will react to channels CH1 to CH4 and brick2 to channel CH5 to CH8.
On another model I can control 4 other bricks, bind each brick to RX number 3 to 6 and then finaly set RX number to 3 and option to 4 to contol the 4 bricks with CH1 to CH16.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
Brick1_A|Brick1_B|Brick1_C|Brick1_D|Brick2_A|Brick2_B|Brick2_C|Brick2_D|Brick3_A|Brick3_B|Brick3_C|Brick3_D|Brick4_A|Brick4_B|Brick4_C|Brick4_D
### Sub_protocol Digit - *1*
### Sub_protocol A664 - *2*
Model: 4/6 analog ports brick
Up to 3 bricks can be controlled at the same time. The bricks can be either 4 or 6 ports but only the 2 first bricks will be sent 6 channels, the last brick will only be sent 4 channels.
Option field | Value
-------------|------
0|The module will act like the original radio which will bind every time and attach to the first brick in bind mode
1|The module will control the brick number RX_num
2|The module will control the brick number RX_num and RX_num+1
3|The module will control the brick number RX_num, RX_num+1 and RX_num+2
To associate a brick to a RX number (RX_num above), set this RX number under the protocol, set option to 1, launch a bind and power on the brick you want to control. Repeat this for every brick using a different RX number each time and then indicate the number of bricks to be controlled using the Option field.
Example: I want to control 2 bricks. I select RX number 1, set option to 1 and launch a bind on the first brick. I select RX number 2, set option to 1 and launch a bind on the second brick. Now to control both bricks I set RX number to 1 and option to 2. Therefore brick1 will react to channels CH1 to CH4 and brick2 to channel CH5 to CH8.
On another model I can control 3 other bricks, bind each brick to RX number 3 to 5 and then finaly set RX number to 3 and option to 3 to contol the 4 bricks with CH1 to CH16.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---
Brick1_A|Brick1_B|Brick1_C|Brick1_D|Brick2_A|Brick2_B|Brick2_C|Brick2_D|Brick3_A|Brick3_B|Brick3_C|Brick3_D|Brick4_A|Brick4_B|Brick4_C|Brick4_D
Brick1_A|Brick1_B|Brick1_C|Brick1_D|Brick1_E|Brick1_F|Brick2_A|Brick2_B|Brick2_C|Brick2_D|Brick2_E|Brick2_F|Brick3_A|Brick3_B|Brick3_C|Brick3_D
## NCC1701 - *44*
Model: Air Hogs Star Trek USS Enterprise NCC-1701-A
@ -2121,6 +2238,8 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
---|---|---|---|---|---|---|---|---|---|---|---
A|E|T|R|MODE|FLIP|LIGHT|PHOTO|VIDEO|TRIMRESET|BAL|BALHIG
Telemetry is supported. The plane sends a battery status of good->empty which is visible in A1 (good=13.2V->empty=0V) and RSSI gets a dummy value of 100.
### Sub_protocol F22
Model: SG F22
@ -2151,6 +2270,15 @@ CH1|CH2|CH3|CH4
Throttle +100%=full forward,0%=stop,-100%=full backward.
## Shenqi2 - *105*
Autobind protocol
Model: Shenqiwei 1/20 Mini Motorcycle
CH1|CH2
---|---
ST|TH
## Symax - *10*
Autobind protocol

View File

@ -108,7 +108,7 @@ The images below indicate the pin layout and the location of the ground pin on t
|:---:|:---:|:---:|
<img src="images/V2b_ISP.jpeg" width="189" height="200" /> | <img src="images/MPTM_PCB_2.3d_ISP.png" width="486" height="201" /> | <img src="images/ProMini_ISP.png" width="195" height="200" /> |
You are now ready to plug in the USB programmer to the computer. If you are looking for a good working USBasp Windows driver, [use this one](http://www.protostack.com/download/USBasp-win-driver-x86-x64-v3.0.7.zip).
You are now ready to plug in the USB programmer to the computer. If you are looking for a good working USBasp Windows driver, [use this one](https://protostack.com.au/download/USBasp-win-driver-x86-x64-v3.0.7.zip).
### Burn bootloader and set fuses
The bootloader only needs to be burned once, unless you decide to switch from one option to the other (or it is accidentally erased). If you have already burned the bootloader / set the fuses you can skip this step.