mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-09-13 16:11:05 +00:00
Compare commits
No commits in common. "5ce6c6f544729d2a9d8dc91970b971b1918cf315" and "dcbc557bf712dde9eeb50b2ffb54ee6b9155ce9c" have entirely different histories.
5ce6c6f544
...
dcbc557bf7
@ -530,7 +530,7 @@ void MT99XX_init(void)
|
|||||||
bind_counter = MT99XX_BIND_COUNT;
|
bind_counter = MT99XX_BIND_COUNT;
|
||||||
if(IS_BIND_DONE)
|
if(IS_BIND_DONE)
|
||||||
{
|
{
|
||||||
if(sub_protocol != A180 && sub_protocol != DRAGON && sub_protocol != F949G && sub_protocol != PA18+8 && sub_protocol != SU35+8)
|
if(sub_protocol != A180 && sub_protocol != DRAGON && sub_protocol != F949G && sub_protocol != PA18+8)
|
||||||
BIND_IN_PROGRESS; // autobind protocol
|
BIND_IN_PROGRESS; // autobind protocol
|
||||||
else
|
else
|
||||||
bind_counter = 1;
|
bind_counter = 1;
|
||||||
|
@ -118,7 +118,6 @@ const char STR_UDIRC[] ="UDIRC";
|
|||||||
const char STR_JIABAILE[] ="JIABAILE";
|
const char STR_JIABAILE[] ="JIABAILE";
|
||||||
const char STR_KAMTOM[] ="KAMTOM";
|
const char STR_KAMTOM[] ="KAMTOM";
|
||||||
const char STR_WL91X[] ="WL91x";
|
const char STR_WL91X[] ="WL91x";
|
||||||
const char STR_WPL[] ="WPL";
|
|
||||||
|
|
||||||
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
|
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
|
||||||
const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501";
|
const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501";
|
||||||
@ -189,7 +188,7 @@ 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_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
|
||||||
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
|
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
|
||||||
const char STR_SUBTYPE_FX[] = "\x05""816\0 ""620\0 ""9630\0""Q560\0""QF012";
|
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""CX10";
|
const char STR_SUBTYPE_SGF22[] = "\x04""F22\0""F22S""J20\0";
|
||||||
const char STR_SUBTYPE_JIABAILE[] = "\x04""Std\0""Gyro";
|
const char STR_SUBTYPE_JIABAILE[] = "\x04""Std\0""Gyro";
|
||||||
#define NO_SUBTYPE nullptr
|
#define NO_SUBTYPE nullptr
|
||||||
|
|
||||||
@ -474,7 +473,7 @@ const mm_protocol_definition multi_protocols[] = {
|
|||||||
{PROTO_SCORPIO, STR_SCORPIO, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, SCORPIO_init, SCORPIO_callback },
|
{PROTO_SCORPIO, STR_SCORPIO, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, SCORPIO_init, SCORPIO_callback },
|
||||||
#endif
|
#endif
|
||||||
#if defined(SGF22_NRF24L01_INO)
|
#if defined(SGF22_NRF24L01_INO)
|
||||||
{PROTO_SGF22, STR_SGF22, STR_SUBTYPE_SGF22, 4, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback },
|
{PROTO_SGF22, STR_SGF22, STR_SUBTYPE_SGF22, 3, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback },
|
||||||
#endif
|
#endif
|
||||||
#if defined(SHENQI_NRF24L01_INO)
|
#if defined(SHENQI_NRF24L01_INO)
|
||||||
{PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback },
|
{PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback },
|
||||||
@ -519,9 +518,7 @@ const mm_protocol_definition multi_protocols[] = {
|
|||||||
#if defined(WL91X_CCNRF_INO)
|
#if defined(WL91X_CCNRF_INO)
|
||||||
{PROTO_WL91X, STR_WL91X, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, WL91X_init, WL91X_callback },
|
{PROTO_WL91X, STR_WL91X, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, WL91X_init, WL91X_callback },
|
||||||
#endif
|
#endif
|
||||||
#if defined(WPL_NRF24L01_INO)
|
|
||||||
{PROTO_WPL, STR_WPL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, WPL_init, WPL_callback },
|
|
||||||
#endif
|
|
||||||
#if defined(XERALL_NRF24L01_INO)
|
#if defined(XERALL_NRF24L01_INO)
|
||||||
{PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback },
|
{PROTO_XERALL, STR_XERALL, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, XERALL_init, XERALL_callback },
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_REVISION 4
|
#define VERSION_REVISION 4
|
||||||
#define VERSION_PATCH_LEVEL 52
|
#define VERSION_PATCH_LEVEL 50
|
||||||
|
|
||||||
#define MODE_SERIAL 0
|
#define MODE_SERIAL 0
|
||||||
|
|
||||||
@ -134,7 +134,6 @@ enum PROTOCOLS
|
|||||||
PROTO_KAMTOM = 104, // =>NRF24L01
|
PROTO_KAMTOM = 104, // =>NRF24L01
|
||||||
PROTO_SHENQI2 = 105, // =>NRF24L01
|
PROTO_SHENQI2 = 105, // =>NRF24L01
|
||||||
PROTO_WL91X = 106, // =>CC2500 & NRF24L01
|
PROTO_WL91X = 106, // =>CC2500 & NRF24L01
|
||||||
PROTO_WPL = 107, // =>NRF24L01
|
|
||||||
|
|
||||||
PROTO_NANORF = 126, // =>NRF24L01
|
PROTO_NANORF = 126, // =>NRF24L01
|
||||||
PROTO_TEST = 127, // =>CC2500
|
PROTO_TEST = 127, // =>CC2500
|
||||||
@ -499,7 +498,6 @@ enum SGF22
|
|||||||
SGF22_F22 = 0,
|
SGF22_F22 = 0,
|
||||||
SGF22_F22S = 1,
|
SGF22_F22S = 1,
|
||||||
SGF22_J20 = 2,
|
SGF22_J20 = 2,
|
||||||
SGF22_CX10 = 3,
|
|
||||||
};
|
};
|
||||||
enum JIABAILE
|
enum JIABAILE
|
||||||
{
|
{
|
||||||
|
@ -19,16 +19,14 @@ Multiprotocol is distributed in the hope that it will be useful,
|
|||||||
#include "iface_xn297.h"
|
#include "iface_xn297.h"
|
||||||
|
|
||||||
//#define FORCE_SGF22_ORIGINAL_ID
|
//#define FORCE_SGF22_ORIGINAL_ID
|
||||||
#define FORCE_SGF22_CX10_ORIGINAL_ID
|
|
||||||
|
|
||||||
#define SGF22_PACKET_PERIOD 11950 //10240
|
#define SGF22_PACKET_PERIOD 11950 //10240
|
||||||
|
#define SGF22_BIND_RF_CHANNEL 78
|
||||||
#define SGF22_PAYLOAD_SIZE 12
|
#define SGF22_PAYLOAD_SIZE 12
|
||||||
#define SGF22_BIND_COUNT 50
|
#define SGF22_BIND_COUNT 50
|
||||||
#define SGF22_RF_NUM_CHANNELS 4
|
#define SGF22_RF_NUM_CHANNELS 4
|
||||||
#define SGF22_BIND_RF_CHANNEL 78
|
|
||||||
#define SGF22_F22S_BIND_RF_CHANNEL 10
|
#define SGF22_F22S_BIND_RF_CHANNEL 10
|
||||||
#define SGF22_J20_BIND_RF_CHANNEL 28
|
#define SGF22_J20_BIND_RF_CHANNEL 28
|
||||||
#define SGF22_CX10_BIND_RF_CHANNEL 48
|
|
||||||
|
|
||||||
//packet[8]
|
//packet[8]
|
||||||
#define SGF22_FLAG_3D 0x00
|
#define SGF22_FLAG_3D 0x00
|
||||||
@ -81,8 +79,6 @@ static void __attribute__((unused)) SGF22_send_packet()
|
|||||||
packet_sent = 0;
|
packet_sent = 0;
|
||||||
//packet
|
//packet
|
||||||
packet[0] = 0x1B;
|
packet[0] = 0x1B;
|
||||||
if (sub_protocol != SGF22_CX10)
|
|
||||||
{//SGF22_F22,SGF22_F22S,SGF22_J20
|
|
||||||
packet[8] = SGF22_FLAG_3D // CH5 -100%, F22 & F22S - 3D mode, J20 - Gyro off
|
packet[8] = SGF22_FLAG_3D // CH5 -100%, F22 & F22S - 3D mode, J20 - Gyro off
|
||||||
| GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll
|
| GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll
|
||||||
| GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light in the stock TX
|
| GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light in the stock TX
|
||||||
@ -93,19 +89,6 @@ static void __attribute__((unused)) SGF22_send_packet()
|
|||||||
packet[8] |= SGF22_FLAG_VERTICAL; // CH5 100%, vertical mode (torque)
|
packet[8] |= SGF22_FLAG_VERTICAL; // CH5 100%, vertical mode (torque)
|
||||||
else if(Channel_data[CH5] > CHANNEL_MIN_COMMAND )
|
else if(Channel_data[CH5] > CHANNEL_MIN_COMMAND )
|
||||||
packet[8] |= ( sub_protocol == SGF22_J20 ? SGF22_J20_FLAG_HORIZONTAL : SGF22_FLAG_6G ); // CH5 0%, F22 & F22S - 6G mode, J20 - Horizontal mode
|
packet[8] |= ( sub_protocol == SGF22_J20 ? SGF22_J20_FLAG_HORIZONTAL : SGF22_FLAG_6G ); // CH5 0%, F22 & F22S - 6G mode, J20 - Horizontal mode
|
||||||
}
|
|
||||||
else //SGF22_CX10 114548
|
|
||||||
{
|
|
||||||
if(CH6_SW)
|
|
||||||
flags = 0x06; // high rate
|
|
||||||
else
|
|
||||||
if(Channel_data[CH6] < CHANNEL_MIN_COMMAND)
|
|
||||||
flags = 0x04; // low rate
|
|
||||||
else
|
|
||||||
flags = 0x05; // mid rate
|
|
||||||
packet[8] = flags
|
|
||||||
| GET_FLAG(CH5_SW, 0x08); // flip
|
|
||||||
}
|
|
||||||
packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO) // F22: photo, press in throttle trim in the stock TX, J20: invert flight
|
packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO) // F22: photo, press in throttle trim in the stock TX, J20: invert flight
|
||||||
| GET_FLAG(CH10_SW, ( sub_protocol == SGF22_J20 ? SGF22_J20_FLAG_FIXHEIGHT : SGF22_FLAG_TRIMRESET )) ; // F22: Both sticks down inwards in the stock TX, J20: Altitude hold
|
| GET_FLAG(CH10_SW, ( sub_protocol == SGF22_J20 ? SGF22_J20_FLAG_FIXHEIGHT : SGF22_FLAG_TRIMRESET )) ; // F22: Both sticks down inwards in the stock TX, J20: Altitude hold
|
||||||
packet[10] = 0x42; // no fine tune
|
packet[10] = 0x42; // no fine tune
|
||||||
@ -115,8 +98,6 @@ static void __attribute__((unused)) SGF22_send_packet()
|
|||||||
packet[0] += 6;
|
packet[0] += 6;
|
||||||
else if (sub_protocol == SGF22_J20)
|
else if (sub_protocol == SGF22_J20)
|
||||||
packet[0] += 3;
|
packet[0] += 3;
|
||||||
else if (sub_protocol == SGF22_CX10)
|
|
||||||
packet[0] += 0x6A;
|
|
||||||
packet[1] = packet_count; // sequence
|
packet[1] = packet_count; // sequence
|
||||||
packet[2] = rx_tx_addr[2];
|
packet[2] = rx_tx_addr[2];
|
||||||
packet[3] = rx_tx_addr[3];
|
packet[3] = rx_tx_addr[3];
|
||||||
@ -127,10 +108,7 @@ static void __attribute__((unused)) SGF22_send_packet()
|
|||||||
|
|
||||||
XN297_SetPower();
|
XN297_SetPower();
|
||||||
XN297_SetTxRxMode(TX_EN);
|
XN297_SetTxRxMode(TX_EN);
|
||||||
if (sub_protocol != SGF22_CX10)
|
|
||||||
XN297_WriteEnhancedPayload(packet, SGF22_PAYLOAD_SIZE,0);
|
XN297_WriteEnhancedPayload(packet, SGF22_PAYLOAD_SIZE,0);
|
||||||
else
|
|
||||||
XN297_WritePayload(packet, SGF22_PAYLOAD_SIZE);
|
|
||||||
#if 0
|
#if 0
|
||||||
debug_time("");
|
debug_time("");
|
||||||
for(uint8_t i=0; i<SGF22_PAYLOAD_SIZE; i++)
|
for(uint8_t i=0; i<SGF22_PAYLOAD_SIZE; i++)
|
||||||
@ -154,7 +132,7 @@ static void __attribute__((unused)) SGF22_initialize_txid()
|
|||||||
{ 0x18, 0x37, 0x27, 0x47 } };
|
{ 0x18, 0x37, 0x27, 0x47 } };
|
||||||
memcpy(hopping_frequency, &hop[val], SGF22_RF_NUM_CHANNELS);
|
memcpy(hopping_frequency, &hop[val], SGF22_RF_NUM_CHANNELS);
|
||||||
|
|
||||||
/*//Same code size...
|
/*//Same code sze...
|
||||||
hopping_frequency[0] = 0x0C + 3 * val;
|
hopping_frequency[0] = 0x0C + 3 * val;
|
||||||
hopping_frequency[1] = hopping_frequency[0] + 0x1E;
|
hopping_frequency[1] = hopping_frequency[0] + 0x1E;
|
||||||
if(val > 1) hopping_frequency[1]++;
|
if(val > 1) hopping_frequency[1]++;
|
||||||
@ -167,20 +145,6 @@ static void __attribute__((unused)) SGF22_initialize_txid()
|
|||||||
rx_tx_addr[3] = 0x61; // TX2:51 TX3:0C
|
rx_tx_addr[3] = 0x61; // TX2:51 TX3:0C
|
||||||
memcpy(hopping_frequency,"\x15\x34\x24\x44", SGF22_RF_NUM_CHANNELS); //Original dump=>21=0x15,52=0x34,36=0x24,68=0x44
|
memcpy(hopping_frequency,"\x15\x34\x24\x44", SGF22_RF_NUM_CHANNELS); //Original dump=>21=0x15,52=0x34,36=0x24,68=0x44
|
||||||
#endif
|
#endif
|
||||||
#ifdef FORCE_SGF22_CX10_ORIGINAL_ID
|
|
||||||
if(rx_tx_addr[3] & 1)
|
|
||||||
{
|
|
||||||
rx_tx_addr[2] = 0x4C;
|
|
||||||
rx_tx_addr[3] = 0xD7;
|
|
||||||
memcpy(hopping_frequency, "\x37\x42\x47\x3c", SGF22_RF_NUM_CHANNELS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rx_tx_addr[2] = 0x50;
|
|
||||||
rx_tx_addr[3] = 0xE1;
|
|
||||||
memcpy(hopping_frequency, "\x3b\x4b\x46\x41", SGF22_RF_NUM_CHANNELS);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if 0
|
#if 0
|
||||||
debug("ID: %02X %02X, C: ",rx_tx_addr[2],rx_tx_addr[3]);
|
debug("ID: %02X %02X, C: ",rx_tx_addr[2],rx_tx_addr[3]);
|
||||||
for(uint8_t i=0; i<SGF22_RF_NUM_CHANNELS; i++)
|
for(uint8_t i=0; i<SGF22_RF_NUM_CHANNELS; i++)
|
||||||
@ -197,7 +161,7 @@ static void __attribute__((unused)) SGF22_RF_init()
|
|||||||
XN297_SetRXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", SGF22_PAYLOAD_SIZE);
|
XN297_SetRXAddr((uint8_t*)"\xC7\x95\x3C\xBB\xA5", SGF22_PAYLOAD_SIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const uint8_t bind_chan[] = {SGF22_BIND_RF_CHANNEL, SGF22_F22S_BIND_RF_CHANNEL, SGF22_J20_BIND_RF_CHANNEL, SGF22_CX10_BIND_RF_CHANNEL};
|
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
|
XN297_RFChannel(bind_chan[sub_protocol]); // Set bind channel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,6 @@
|
|||||||
#undef SYMAX_NRF24L01_INO
|
#undef SYMAX_NRF24L01_INO
|
||||||
#undef V2X2_NRF24L01_INO
|
#undef V2X2_NRF24L01_INO
|
||||||
#undef V761_NRF24L01_INO
|
#undef V761_NRF24L01_INO
|
||||||
#undef WPL_NRF24L01_INO
|
|
||||||
#undef XERALL_NRF24L01_INO
|
#undef XERALL_NRF24L01_INO
|
||||||
#undef YD717_NRF24L01_INO
|
#undef YD717_NRF24L01_INO
|
||||||
#undef YUXIANG_NRF24L01_INO
|
#undef YUXIANG_NRF24L01_INO
|
||||||
@ -400,7 +399,6 @@
|
|||||||
#undef UDIRC_CCNRF_INO
|
#undef UDIRC_CCNRF_INO
|
||||||
#undef KAMTOM_NRF24L01_INO
|
#undef KAMTOM_NRF24L01_INO
|
||||||
#undef WL91X_CCNRF_INO
|
#undef WL91X_CCNRF_INO
|
||||||
#undef WPL_NRF24L01_INO
|
|
||||||
//Save flash space...
|
//Save flash space...
|
||||||
#undef CABELL_NRF24L01_INO
|
#undef CABELL_NRF24L01_INO
|
||||||
#undef REDPINE_CC2500_INO
|
#undef REDPINE_CC2500_INO
|
||||||
|
@ -1,158 +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/>.
|
|
||||||
*/
|
|
||||||
// Compatible with WPL "Basic" TX models D12, D12KM, D22, D32, D42, D14
|
|
||||||
|
|
||||||
#if defined(WPL_NRF24L01_INO)
|
|
||||||
|
|
||||||
#include "iface_xn297.h"
|
|
||||||
|
|
||||||
#define FORCE_WPL_ORIGINAL_ID
|
|
||||||
|
|
||||||
#define WPL_PACKET_PERIOD 9875
|
|
||||||
#define WPL_RF_NUM_CHANNELS 4
|
|
||||||
#define WPL_PAYLOAD_SIZE 16
|
|
||||||
#define WPL_BIND_COUNT 303 //3sec
|
|
||||||
|
|
||||||
static void __attribute__((unused)) WPL_send_packet()
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
debug("no:%d, rf:%d, ",hopping_frequency_no + (IS_BIND_IN_PROGRESS?0:4),hopping_frequency[hopping_frequency_no + (IS_BIND_IN_PROGRESS?0:4)]);
|
|
||||||
#endif
|
|
||||||
XN297_Hopping(hopping_frequency_no + (IS_BIND_IN_PROGRESS?0:4) );
|
|
||||||
hopping_frequency_no++;
|
|
||||||
hopping_frequency_no &= WPL_RF_NUM_CHANNELS-1; // 4 RF channels
|
|
||||||
|
|
||||||
memset(&packet[8],0,7);
|
|
||||||
packet[0] = 0x94; //??
|
|
||||||
packet[1] = 0x16; //??
|
|
||||||
packet[2] = 0xCC; //??
|
|
||||||
|
|
||||||
if(IS_BIND_IN_PROGRESS)
|
|
||||||
{
|
|
||||||
memcpy(&packet[3],rx_tx_addr,5);
|
|
||||||
packet[9] = 0x08; // ?? Not bound + Headlights on
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
packet[3 ] = convert_channel_s8b(CH1); // Throttle
|
|
||||||
packet[4 ] = convert_channel_s8b(CH2); // Steering
|
|
||||||
packet[5 ] = convert_channel_16b_limit(CH3,0x22,0x5E); // Steering trim
|
|
||||||
packet[6 ] = rx_tx_addr[3]; // 0x32??
|
|
||||||
packet[7 ] = convert_channel_s8b(CH4); // Aux
|
|
||||||
packet[9 ] = 0x80 // ?? Bound
|
|
||||||
| GET_FLAG(CH5_SW, 0x08) // Headlights 100%=on
|
|
||||||
| GET_FLAG(CH6_SW, 0x04) // Throttle rate 100%=high
|
|
||||||
| GET_FLAG(CH7_SW, 0x02); // Steering rate 100%=high
|
|
||||||
}
|
|
||||||
uint8_t sum = 0x66;
|
|
||||||
for(uint8_t i=0;i<WPL_PAYLOAD_SIZE-1;i++)
|
|
||||||
sum += packet[i];
|
|
||||||
packet[WPL_PAYLOAD_SIZE-1] = sum;
|
|
||||||
// Send
|
|
||||||
XN297_SetPower();
|
|
||||||
XN297_SetTxRxMode(TX_EN);
|
|
||||||
XN297_WritePayload(packet, WPL_PAYLOAD_SIZE);
|
|
||||||
#if 0
|
|
||||||
for(uint8_t i=0; i<WPL_PAYLOAD_SIZE; i++)
|
|
||||||
debug(" %02X",packet[i]);
|
|
||||||
debugln("");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __attribute__((unused)) WPL_RF_init()
|
|
||||||
{
|
|
||||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
|
||||||
XN297_SetTXAddr((uint8_t*)"\x69\xA5\x37\x4D\x8B", 5);
|
|
||||||
XN297_HoppingCalib(WPL_RF_NUM_CHANNELS*2); // Calibrate bind and normal channels
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __attribute__((unused)) WPL_initialize_txid()
|
|
||||||
{
|
|
||||||
//Bind frequencies
|
|
||||||
memcpy(hopping_frequency ,"\x17\x25\x46\x36", WPL_RF_NUM_CHANNELS); //23=17, 37=25, 70=46, 54=36
|
|
||||||
#ifdef FORCE_WPL_ORIGINAL_ID
|
|
||||||
//Original ID
|
|
||||||
memcpy(rx_tx_addr,"\x96\x2A\xA9\x32\xB4",5);
|
|
||||||
//Normal frequencies
|
|
||||||
memcpy(hopping_frequency+4,"\x0C\x2A\x3D\x1D", WPL_RF_NUM_CHANNELS); //12=0C, 42=2A, 61=3D, 29=1D
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t WPL_callback()
|
|
||||||
{
|
|
||||||
#ifdef MULTI_SYNC
|
|
||||||
telemetry_set_input_sync(WPL_PACKET_PERIOD);
|
|
||||||
#endif
|
|
||||||
if(bind_counter)
|
|
||||||
if(--bind_counter==0)
|
|
||||||
{
|
|
||||||
BIND_DONE;
|
|
||||||
XN297_SetTXAddr(rx_tx_addr, 5);
|
|
||||||
}
|
|
||||||
WPL_send_packet();
|
|
||||||
return WPL_PACKET_PERIOD;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WPL_init()
|
|
||||||
{
|
|
||||||
BIND_IN_PROGRESS; // autobind protocol
|
|
||||||
WPL_initialize_txid();
|
|
||||||
WPL_RF_init();
|
|
||||||
hopping_frequency_no = 0;
|
|
||||||
bind_counter=WPL_BIND_COUNT;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/* https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/issues/1120
|
|
||||||
Bind packet
|
|
||||||
-----------
|
|
||||||
XN297 1Mb Scrambled
|
|
||||||
Bind address: 69 A5 37 4D 8B
|
|
||||||
RF channels: 23, 37, 70, 54
|
|
||||||
Timing: 9875µs
|
|
||||||
Payload 16 bytes: 94 16 CC 96 2A A9 32 B4 00 08 00 00 00 00 00 33
|
|
||||||
|
|
||||||
P[0] = 94 ??
|
|
||||||
P[1] = 16 ??
|
|
||||||
P[2] = CC ??
|
|
||||||
P[3..7] = Normal address
|
|
||||||
P[8] = 00 ??
|
|
||||||
P[9] = 08 ?? not bound?, Throttle and Steering rate low, Headlights on
|
|
||||||
P[10..14] = 00 ??
|
|
||||||
P[15] = sum(P[0..14])+66 why 66...
|
|
||||||
|
|
||||||
Normal packet
|
|
||||||
-----------
|
|
||||||
XN297 1Mb Scrambled
|
|
||||||
Normal address: 96 2A A9 32 B4
|
|
||||||
RF channels: 12=0C, 42=2A, 61=3D, 29=1D -> no idea where they come from...
|
|
||||||
Timing: 9875µs
|
|
||||||
Payload 16 bytes: 94 16 CC 80 80 38 32 80 00 88 00 00 00 00 00 4E
|
|
||||||
P[0] = 94 ??
|
|
||||||
P[1] = 16 ??
|
|
||||||
P[2] = CC ??
|
|
||||||
P[3] = Throttle, not enough data on dumps... Same coding as Steering?
|
|
||||||
P[4] = Steering, not enough data on dumps, looks like one side goes from 7F to 00 and the other 80 to FF which would be s8b
|
|
||||||
P[5] = Steering trim 22..5E, mid gives 40 not 38... Was the trim centered on the other dumps with value 38?
|
|
||||||
P[6] = 32 ?? Left over from the bind packet TX_ADDR[3]?
|
|
||||||
P[7] = 80 ?? Additional channel? It moves at the same time as the trim but my guess is that it is an unconnected channel.
|
|
||||||
P[8] = 00 ??
|
|
||||||
P[9] = 80 ?? bound?, Throttle and Steering rate low, Headlights off
|
|
||||||
|02 -> Steering rate high
|
|
||||||
|04 -> Throttle rate high
|
|
||||||
|08 -> Headlights on
|
|
||||||
P[10..14] = 00 ??
|
|
||||||
P[15] = sum(P[0..14])+66 why 66...
|
|
||||||
*/
|
|
@ -261,7 +261,6 @@
|
|||||||
#define SYMAX_NRF24L01_INO
|
#define SYMAX_NRF24L01_INO
|
||||||
#define V2X2_NRF24L01_INO
|
#define V2X2_NRF24L01_INO
|
||||||
#define V761_NRF24L01_INO
|
#define V761_NRF24L01_INO
|
||||||
#define WPL_NRF24L01_INO
|
|
||||||
#define XERALL_NRF24L01_INO
|
#define XERALL_NRF24L01_INO
|
||||||
#define YD717_NRF24L01_INO
|
#define YD717_NRF24L01_INO
|
||||||
#define YUXIANG_NRF24L01_INO
|
#define YUXIANG_NRF24L01_INO
|
||||||
@ -835,7 +834,6 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
|||||||
SGF22
|
SGF22
|
||||||
F22S
|
F22S
|
||||||
J20
|
J20
|
||||||
CX10
|
|
||||||
PROTO_SHENQI
|
PROTO_SHENQI
|
||||||
NONE
|
NONE
|
||||||
PROTO_SHENQI2
|
PROTO_SHENQI2
|
||||||
@ -878,8 +876,6 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
|||||||
W6_6_1
|
W6_6_1
|
||||||
W6_HEL
|
W6_HEL
|
||||||
W6_HEL_I
|
W6_HEL_I
|
||||||
PROTO_WPL
|
|
||||||
NONE
|
|
||||||
PROTO_XERALL
|
PROTO_XERALL
|
||||||
NONE
|
NONE
|
||||||
PROTO_XK
|
PROTO_XK
|
||||||
|
@ -142,7 +142,7 @@ CFlie|AIR|38|CFlie||||||||NRF24L01|
|
|||||||
[Redpine](Protocols_Details.md#Redpine---50)||50|FAST|SLOW|||||||NRF24L01|XN297
|
[Redpine](Protocols_Details.md#Redpine---50)||50|FAST|SLOW|||||||NRF24L01|XN297
|
||||||
[Scanner](Protocols_Details.md#Scanner---54)||54|||||||||CC2500|
|
[Scanner](Protocols_Details.md#Scanner---54)||54|||||||||CC2500|
|
||||||
[Scorpio](Protocols_Details.md#Scorpio---94)||94|||||||||CYRF6936|
|
[Scorpio](Protocols_Details.md#Scorpio---94)||94|||||||||CYRF6936|
|
||||||
[SGF22](Protocols_Details.md#SGF22---97)||97|F22|F22S|J20|CX10|||||NRF24L01|XN297
|
[SGF22](Protocols_Details.md#SGF22---97)||97|F22|F22S|J20||||||NRF24L01|XN297
|
||||||
[Shenqi](Protocols_Details.md#Shenqi---19)||19|Shenqi||||||||NRF24L01|LT8900
|
[Shenqi](Protocols_Details.md#Shenqi---19)||19|Shenqi||||||||NRF24L01|LT8900
|
||||||
[Shenqi2](Protocols_Details.md#Shenqi2---105)||105|Shenqi2||||||||NRF24L01|XN297
|
[Shenqi2](Protocols_Details.md#Shenqi2---105)||105|Shenqi2||||||||NRF24L01|XN297
|
||||||
[Skyartec](Protocols_Details.md#Skyartec---68)||68|||||||||CC2500|CC2500
|
[Skyartec](Protocols_Details.md#Skyartec---68)||68|||||||||CC2500|CC2500
|
||||||
@ -155,10 +155,9 @@ CFlie|AIR|38|CFlie||||||||NRF24L01|
|
|||||||
[WFLY](Protocols_Details.md#WFLY---40)||40|WFR0x||||||||CYRF6936|
|
[WFLY](Protocols_Details.md#WFLY---40)||40|WFR0x||||||||CYRF6936|
|
||||||
[WFLY2](Protocols_Details.md#WFLY2---79)||79|RF20x||||||||A7105|
|
[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|
|
[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|||||||||NRF24L01&CC2500|XN297
|
[WL91X](Protocols_Details.md#WL91X---106)||106|||||||||NRF24L011&CC2500|XN297
|
||||||
[WPL](Protocols_Details.md#WPL---107)||107|||||||||NRF24L01|XN297
|
|
||||||
[XERALL](Protocols_Details.md#XERALL---91)||91|Tank||||||||NRF24L01|XN297
|
[XERALL](Protocols_Details.md#XERALL---91)||91|Tank||||||||NRF24L01|XN297
|
||||||
[XK](Protocols_Details.md#XK---62)||62|X450|X420|Cars||||||NRF24L01&CC2500|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
|
[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|
|
[YD717](Protocols_Details.md#YD717---8)||8|YD717|SKYWLKR|SYMAX4|XINXUN|NIHUI||||NRF24L01|
|
||||||
[YuXiang](Protocols_Details.md#YuXiang---100)||100|||||||||NRF24L01|XN297
|
[YuXiang](Protocols_Details.md#YuXiang---100)||100|||||||||NRF24L01|XN297
|
||||||
@ -2253,19 +2252,12 @@ Manual CH11=-100% & CH12=-100%, Balance CH11=+100% & CH12=-100%, Large Angle Bal
|
|||||||
### Sub_protocol F22S
|
### Sub_protocol F22S
|
||||||
Model: ParkTen F22S
|
Model: ParkTen F22S
|
||||||
|
|
||||||
Mode -100% = 3D, 0% = 6G
|
F22S: Mode -100% = 3D, 0% = 6G
|
||||||
|
|
||||||
### Sub_protocol J20
|
### Sub_protocol J20
|
||||||
Model: KF700 J20
|
Model: KF700 J20
|
||||||
|
|
||||||
Mode -100% = Gyro off, 0% = Horizontal, 100% = Vertical. CH8 - Invert, CH10 - Fix Height (Altitude hold)
|
J20: Mode -100% = Gyro off, 0% = Horizontal, 100% = Vertical. CH8 - Invert, CH10 - Fix Height (Altitude hold)
|
||||||
|
|
||||||
### Sub_protocol CX10
|
|
||||||
Model: Cheerson CX-10 with red PCB
|
|
||||||
|
|
||||||
**Only 2 IDs available**, use RX num to cycle through them.
|
|
||||||
|
|
||||||
Mode -100% = Low, 0% = Medium, 100% = High
|
|
||||||
|
|
||||||
## Shenqi - *19*
|
## Shenqi - *19*
|
||||||
Autobind protocol
|
Autobind protocol
|
||||||
@ -2371,19 +2363,6 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
|||||||
---|---|---|---|---|---|---|---|---
|
---|---|---|---|---|---|---|---|---
|
||||||
A|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
|
A|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
|
||||||
|
|
||||||
## WPL - *107*
|
|
||||||
TX: "Basic", Models: D12 / D12KM / D22 / D32 / D42 / D14
|
|
||||||
|
|
||||||
**Only 1 ID** available. If you have a TX contact me on GitHub or RCGroups.
|
|
||||||
|
|
||||||
Autobind protocol
|
|
||||||
|
|
||||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7
|
|
||||||
---|---|---|---|---|---|---
|
|
||||||
TH|ST|ST_Trim|Aux|Light|TH_Rate|ST_Rate
|
|
||||||
|
|
||||||
Light: -100%=Off, +100%=On, Rate: -100%=Low, +100%=High
|
|
||||||
|
|
||||||
## XERALL - *91*
|
## XERALL - *91*
|
||||||
Model: Xerall TankCopter
|
Model: Xerall TankCopter
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user