Skip to content

Commit

Permalink
FX/Q560 new sub protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed May 17, 2024
1 parent 2bdbd70 commit 54ae77e
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 16 deletions.
1 change: 1 addition & 0 deletions Lua_scripts/MultiChan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
58,0,FX,816,1
58,1,FX,620,1
58,2,FX,9630,1,Rate,Gyro,TrimR,TrimA,TrimE
58,3,FX,Q560,1,FLIP,Gyro,LEDs
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
Expand Down
33 changes: 22 additions & 11 deletions Multiprotocol/FX_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Multiprotocol is distributed in the hope that it will be useful,
#define FX620_PAYLOAD_SIZE 7
#define FX620_CH_OFFSET 1

#define FX9630_PACKET_PERIOD 8124
#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
Expand All @@ -51,14 +51,19 @@ static void __attribute__((unused)) FX_send_packet()
if(IS_BIND_DONE)
{
XN297_Hopping(hopping_frequency_no++);
if(sub_protocol == FX9630)
{
if(sub_protocol >= FX9630)
{ // FX9630 & FX_Q560
XN297_SetTXAddr(rx_tx_addr, 4);
if (hopping_frequency_no >= FX9630_NUM_CHANNELS)
{
hopping_frequency_no = 0;
trim_ch++;
if(trim_ch > 3) trim_ch = 0;
if(sub_protocol == FX9630)
{
trim_ch++;
if(trim_ch > 3) trim_ch = 0;
}
else // FX_Q560
trim_ch = 0;
}
}
else // FX816 and FX620
Expand All @@ -71,8 +76,8 @@ static void __attribute__((unused)) FX_send_packet()

//Channels
uint8_t val;
if (sub_protocol == FX9630)
{
if (sub_protocol >= FX9630)
{ // FX9630 & FX_Q560
packet[0] = convert_channel_8b(THROTTLE);
packet[1] = convert_channel_8b(AILERON);
packet[2] = 0xFF - convert_channel_8b(ELEVATOR);
Expand All @@ -83,7 +88,9 @@ static void __attribute__((unused)) FX_send_packet()
| GET_FLAG(CH5_SW, 0x01) // DR toggle swich: 0 small throw, 1 large throw
// FX9630 =>0:6G small throw, 1:6G large throw, 2:3D
// QIDI-550=>0:3D, 1:6G, 2:Torque
| ((Channel_data[CH6] < CHANNEL_MIN_COMMAND ? 0x00 : (Channel_data[CH6] > CHANNEL_MAX_COMMAND ? 0x02 : 0x01)) << 1);
| (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, 0x10);
}
else // FX816 and FX620
{
Expand Down Expand Up @@ -123,7 +130,7 @@ static void __attribute__((unused)) FX_send_packet()
packet[5] = 0xAB; // Is it based on ID??
}
}
else // FX9630
else // FX9630 & FX_Q560
{
if(IS_BIND_IN_PROGRESS)
{
Expand Down Expand Up @@ -175,7 +182,7 @@ static void __attribute__((unused)) FX_RF_init()
packet_period = FX620_BIND_PACKET_PERIOD;
packet_length = FX620_PAYLOAD_SIZE;
}
else // FX9630
else // FX9630 & FX_Q560
{
XN297_SetTXAddr((uint8_t *)"\x56\x78\x90\x12", 4);
XN297_RFChannel(FX9630_BIND_CHANNEL);
Expand Down Expand Up @@ -207,7 +214,7 @@ 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
else // FX9630 & FX_Q560
{
#ifdef FORCE_FX9630_ID
memcpy(rx_tx_addr,(uint8_t*)"\xCE\x31\x9B\x73", 4);
Expand All @@ -220,6 +227,10 @@ static void __attribute__((unused)) FX_initialize_txid()
#ifdef FORCE_QIDI_ID
memcpy(rx_tx_addr,(uint8_t*)"\x23\xDC\x76\xA2", 4);
memcpy(hopping_frequency,"\x08\x25\x33", FX9630_NUM_CHANNELS); //Original dump=>08=0x08,37=0x25,51=0x33

//QIDI-560 #1
//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 ???
}
Expand Down
2 changes: 1 addition & 1 deletion Multiprotocol/Multi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
58,FX,816,620,9630,Q560
59,Bayang_RX,Multi,CPPM
60,Pelikan,Pro,Lite,SCX24
61,EazyRC
Expand Down
4 changes: 2 additions & 2 deletions Multiprotocol/Multi_Protos.ino
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
const char STR_SUBTYPE_MOULDKG[] = "\x06""Analog""Digit\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";
const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630""Q560";
#define NO_SUBTYPE nullptr

#ifdef SEND_CPPM
Expand Down Expand Up @@ -333,7 +333,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, 3, OPTION_NONE, 0, 0, SW_NRF, FX_init, FX_callback },
{PROTO_FX, STR_FX, STR_SUBTYPE_FX, 4, 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 },
Expand Down
3 changes: 2 additions & 1 deletion Multiprotocol/Multiprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 4
#define VERSION_PATCH_LEVEL 8
#define VERSION_PATCH_LEVEL 9

#define MODE_SERIAL 0

Expand Down Expand Up @@ -479,6 +479,7 @@ enum FX
FX816 = 0,
FX620 = 1,
FX9630 = 2,
FX_Q560 = 3,
};

#define NONE 0
Expand Down
1 change: 1 addition & 0 deletions Multiprotocol/_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
FX816
FX620
FX9630
Q560
PROTO_FY326
FY326
FY319
Expand Down
11 changes: 10 additions & 1 deletion Protocols_Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ Only 8 TX IDs available
Model: FX620 SU35

### Sub_protocol 9630 - *2*
Model: FX9630, FX9603, QIDI-550 and QIDI-560
Model: FX9630, FX9603, QIDI-550

CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
Expand All @@ -1745,6 +1745,15 @@ FX9630 and FX9603 Gyro: -100%=6G small throw, 0%=6G large throw, +100%=3D

QIDI-550 Gyro: -100%=3D, 0%=6G, +100%=Torque

### Sub_protocol Q560 - *2*
Model: QIDI-560

CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|FLIP|GYRO|LEDs

FLIP and LEDs are toggle channels meaning that -100% to +100% is a command and +100% to -100% is also a command

## FY326 - *20*

### Sub_protocol FY326 - *0*
Expand Down

0 comments on commit 54ae77e

Please sign in to comment.