mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-25 21:03:15 +00:00
Compare commits
19 Commits
v1.3.4.31
...
fa055e991c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa055e991c | ||
|
|
5437d88642 | ||
|
|
d800f2c333 | ||
|
|
78f6af6448 | ||
|
|
b04d4a54f7 | ||
|
|
ed65c81add | ||
|
|
9bdc24c42a | ||
|
|
7107d46d29 | ||
|
|
825f560cbb | ||
|
|
ccaec304d5 | ||
|
|
22d45349cc | ||
|
|
5f26d624ad | ||
|
|
496c07943f | ||
|
|
af87b0f6d1 | ||
|
|
2918e63fb4 | ||
|
|
ed63ef7efe | ||
|
|
36d25c7773 | ||
|
|
a3ef2b94d4 | ||
|
|
ad8b45773d |
@@ -229,5 +229,7 @@
|
||||
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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
185
Multiprotocol/Kamtom_nrf24l01.ino
Normal file
185
Multiprotocol/Kamtom_nrf24l01.ino
Normal 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
|
||||
@@ -112,6 +112,9 @@ void KYOSHO3_init()
|
||||
debugln("RF CH: %02X",hopping_frequency[0]);
|
||||
#endif
|
||||
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
CYRF_ConfigRFChannel(0x04);
|
||||
else
|
||||
CYRF_ConfigRFChannel(hopping_frequency[0]);
|
||||
|
||||
bind_counter = 8217;
|
||||
|
||||
@@ -99,3 +99,5 @@
|
||||
100,YuXiang
|
||||
102,JIABAILE,STD,GYRO
|
||||
103,H36
|
||||
104,KAMTOM
|
||||
105,Shenqi2
|
||||
@@ -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,9 @@ 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_UDIRC[] ="UDIRC";
|
||||
const char STR_JIABAILE[] ="JIABAILE";
|
||||
const char STR_KAMTOM[] ="KAMTOM";
|
||||
|
||||
const char STR_SUBTYPE_FLYSKY[] = "\x04""Std\0""V9x9""V6x6""V912""CX20";
|
||||
const char STR_SUBTYPE_HUBSAN[] = "\x04""H107""H301""H501";
|
||||
@@ -391,6 +393,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
|
||||
@@ -436,9 +441,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 +477,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 +492,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
|
||||
|
||||
@@ -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 42
|
||||
|
||||
#define MODE_SERIAL 0
|
||||
|
||||
@@ -128,9 +128,11 @@ 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_NANORF = 126, // =>NRF24L01
|
||||
PROTO_TEST = 127, // =>CC2500
|
||||
|
||||
@@ -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
|
||||
@@ -169,7 +169,7 @@ uint16_t SGF22_callback()
|
||||
}
|
||||
else
|
||||
{//send 3 times in total the same packet
|
||||
NRF24L01_Strobe(REUSE_TX_PL);
|
||||
XN297_ReSendPayload();
|
||||
phase++;
|
||||
if(phase > 2)
|
||||
{
|
||||
|
||||
232
Multiprotocol/SHENQI2_nrf24l01.ino
Normal file
232
Multiprotocol/SHENQI2_nrf24l01.ino
Normal 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?
|
||||
*/
|
||||
@@ -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
|
||||
|
||||
184
Multiprotocol/UDIRC_ccnrf.ino
Normal file
184
Multiprotocol/UDIRC_ccnrf.ino
Normal 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
|
||||
@@ -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,6 +357,7 @@
|
||||
#undef Q303_CCNRF_INO
|
||||
#undef Q90C_CCNRF_INO
|
||||
#undef SLT_CCNRF_INO
|
||||
#undef UDIRC_CCNRF_INO
|
||||
#undef V911S_CCNRF_INO
|
||||
#undef XK_CCNRF_INO
|
||||
#undef XK2_CCNRF_INO
|
||||
@@ -390,7 +393,10 @@
|
||||
#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
|
||||
#endif
|
||||
|
||||
#ifdef MULTI_SURFACE
|
||||
@@ -486,6 +492,7 @@
|
||||
#undef PROPEL_HUB_TELEMETRY
|
||||
#undef OMP_HUB_TELEMETRY
|
||||
#undef V761_HUB_TELEMETRY
|
||||
#undef KAMTOM_HUB_TELEMETRY
|
||||
#undef YUXIANG_HUB_TELEMETRY
|
||||
#undef RLINK_HUB_TELEMETRY
|
||||
#undef DSM_RX_CYRF6936_INO
|
||||
@@ -525,6 +532,9 @@
|
||||
#if not defined(V761_NRF24L01_INO)
|
||||
#undef V761_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 +595,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(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
|
||||
|
||||
@@ -200,7 +200,7 @@ 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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -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,6 +275,7 @@
|
||||
#define Q303_CCNRF_INO
|
||||
#define Q90C_CCNRF_INO
|
||||
#define SLT_CCNRF_INO
|
||||
#define UDIRC_CCNRF_INO
|
||||
#define V911S_CCNRF_INO
|
||||
#define XK_CCNRF_INO
|
||||
#define XK2_CCNRF_INO
|
||||
@@ -349,6 +352,7 @@
|
||||
#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 KAMTOM_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
|
||||
#define YUXIANG_HUB_TELEMETRY
|
||||
#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
|
||||
@@ -744,6 +748,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
SKYTMBLR
|
||||
PROTO_JOYSWAY
|
||||
NONE
|
||||
PROTO_KAMTOM
|
||||
NONE
|
||||
PROTO_KF606
|
||||
KF606_KF606
|
||||
KF606_MIG320
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -115,6 +115,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[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|
|
||||
@@ -143,6 +144,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[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|
|
||||
@@ -1439,11 +1441,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
|
||||
|
||||
@@ -1981,6 +1986,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
|
||||
|
||||
@@ -2151,6 +2165,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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user