mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 18:28:15 +00:00
RadioLink: preparation for final
This commit is contained in:
parent
695264d59a
commit
354878d542
@ -125,7 +125,7 @@ const char STR_SUBTYPE_GD00X[] = "\x05""GD_V1""GD_V2";
|
||||
const char STR_SUBTYPE_REDPINE[] = "\x04""Fast""Slow";
|
||||
const char STR_SUBTYPE_POTENSIC[] = "\x03""A20";
|
||||
const char STR_SUBTYPE_ZSX[] = "\x07""280JJRC";
|
||||
const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410""FZ8xx";
|
||||
const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410";
|
||||
const char STR_SUBTYPE_FX816[] = "\x03""P38";
|
||||
const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ""NRF\0 ";
|
||||
const char STR_SUBTYPE_ESKY150[] = "\x03""4ch""7ch";
|
||||
@ -225,7 +225,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{PROTO_AFHDS2A_RX, STR_AFHDS2A_RX,0, NO_SUBTYPE, OPTION_NONE },
|
||||
#endif
|
||||
#if defined(FLYZONE_A7105_INO)
|
||||
{PROTO_FLYZONE, STR_FLYZONE, 2, STR_SUBTYPE_FLYZONE, OPTION_NONE },
|
||||
{PROTO_FLYZONE, STR_FLYZONE, 1, STR_SUBTYPE_FLYZONE, OPTION_NONE },
|
||||
#endif
|
||||
#if defined(FQ777_NRF24L01_INO)
|
||||
{PROTO_FQ777, STR_FQ777, 0, NO_SUBTYPE, OPTION_NONE },
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 1
|
||||
#define VERSION_PATCH_LEVEL 46
|
||||
#define VERSION_PATCH_LEVEL 47
|
||||
|
||||
//******************
|
||||
// Protocols
|
||||
|
@ -31,6 +31,50 @@ enum {
|
||||
RLINK_RX2 = 0x02,
|
||||
};
|
||||
|
||||
const PROGMEM uint8_t RLINK_hopping[][8] = {
|
||||
/* 00 */ { 0x1F, 0x89, 0x25, 0x06, 0x4E, 0xBD, 0x3A, 0xC7 },
|
||||
/* 01 */ { 0xBC, 0xFE, 0x59, 0x84, 0x37, 0xA1, 0xD0, 0x62 }
|
||||
};
|
||||
|
||||
static void __attribute__((unused)) RLINK_load_hopp(uint8_t num)
|
||||
{
|
||||
uint8_t inc=3*(rx_tx_addr[0]&3);
|
||||
|
||||
for (uint8_t i = 0; i < RLINK_HOP>>1; i++)
|
||||
{
|
||||
uint8_t val=pgm_read_byte_near(&RLINK_hopping[num][i]);
|
||||
hopping_frequency[ i<<1 ]=12*(val>>4 )+inc;
|
||||
hopping_frequency[(i<<1)+1]=12*(val&0x0F)+inc;
|
||||
}
|
||||
|
||||
// replace one of the channel randomely
|
||||
rf_ch_num=random(0xfefefefe)%0x11; // 0x00..0x10
|
||||
if(inc==9) inc=6; // frequency exception
|
||||
hopping_frequency[rf_ch_num]=12*16+inc;
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) RLINK_init()
|
||||
{
|
||||
// channels order depend on ID and currently unknown...
|
||||
#ifdef RLINK_FORCE_ID
|
||||
//surface RC6GS
|
||||
memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN);
|
||||
RLINK_load_hopp(0);
|
||||
//air T8FB
|
||||
//memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN);
|
||||
//RLINK_load_hopp(1);
|
||||
#endif
|
||||
|
||||
debug("ID:");
|
||||
for(uint8_t i=0;i<RLINK_TX_ID_LEN;i++)
|
||||
debug(" 0x%02X",rx_tx_addr[i]);
|
||||
debugln("");
|
||||
debug("Hop(%d):", rf_ch_num);
|
||||
for(uint8_t i=0;i<RLINK_HOP;i++)
|
||||
debug(" 0x%02X",hopping_frequency[i]);
|
||||
debugln("");
|
||||
}
|
||||
|
||||
const PROGMEM uint8_t RLINK_init_values[] = {
|
||||
/* 00 */ 0x5B, 0x06, 0x5C, 0x07, 0xAB, 0xCD, 0x40, 0x04,
|
||||
/* 08 */ 0x45, 0x00, 0x00, 0x06, 0x00, 0x5C, 0x62, 0x76,
|
||||
@ -39,36 +83,6 @@ const PROGMEM uint8_t RLINK_init_values[] = {
|
||||
/* 20 */ 0xF8, 0x56, 0x10, 0xA9, 0x0A, 0x00, 0x11
|
||||
};
|
||||
|
||||
static void __attribute__((unused)) RLINK_init()
|
||||
{
|
||||
hopping_frequency[RLINK_HOP]=16;
|
||||
// channels order depend on ID and currently unknown...
|
||||
#ifdef RLINK_FORCE_ID
|
||||
//surface
|
||||
memcpy(rx_tx_addr,"\x3A\x99\x22\x3A",RLINK_TX_ID_LEN);
|
||||
memcpy(hopping_frequency,"\x1\xF\x8\x9\x2\x5\x0\x6\x4\xE\xB\xD\x3\xA\xC\x7",RLINK_HOP); //end value is value*12+6
|
||||
//air
|
||||
memcpy(rx_tx_addr,"\xFC\x11\x0D\x20",RLINK_TX_ID_LEN);
|
||||
memcpy(hopping_frequency,"\xB\xC\xF\xE\x5\x9\x8\x4\x3\x7\xA\x1\xD\x0\x6\x2",RLINK_HOP); //end value is value*12
|
||||
#endif
|
||||
|
||||
// set channels value based on ID
|
||||
for(uint8_t i=0;i<=RLINK_HOP;i++)
|
||||
hopping_frequency[i]=3*(4*hopping_frequency[i]+(rx_tx_addr[0]&3));
|
||||
|
||||
// replace one of the channel randomely
|
||||
rf_ch_num=random(0xfefefefe)&0x0F; // 0x00..0x0F
|
||||
if(hopping_frequency[RLINK_HOP]==0xC9)
|
||||
hopping_frequency[rf_ch_num]=0xC6;
|
||||
else
|
||||
hopping_frequency[rf_ch_num]=hopping_frequency[RLINK_HOP];
|
||||
|
||||
debug("Hop(%d):", rf_ch_num);
|
||||
for(uint8_t i=0;i<RLINK_HOP;i++)
|
||||
debug(" 0x%02X",hopping_frequency[i]);
|
||||
debugln("");
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) RLINK_rf_init()
|
||||
{
|
||||
CC2500_Strobe(CC2500_SIDLE);
|
||||
@ -105,14 +119,15 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet()
|
||||
packet[0] = RLINK_TX_PACKET_LEN;
|
||||
// header
|
||||
if(sub_protocol)
|
||||
packet[1] = 0x21; //air 0x21 on dump but it looks to support telemetry
|
||||
packet[1] = 0x21; //air 0x21 on dump but it looks to support telemetry at least RSSI
|
||||
else
|
||||
{//surface
|
||||
packet[1] = 0x00;
|
||||
packet[1] = 0x01;
|
||||
//radiolink additionnal ID which is working only on a small set of RXs
|
||||
//if(RX_num) packet[1] |= ((RX_num+2)<<4)+4; // RX number limited to 10 values, 0 is a wildcard
|
||||
}
|
||||
packet[1] |= packet_count>3?0x03:0x01; // packet type: 0x01 normal, 0x03 request telemetry
|
||||
if(packet_count>3)
|
||||
packet[1] |= 0x02; // 0x02 telemetry request flag
|
||||
|
||||
// ID
|
||||
memcpy(&packet[2],rx_tx_addr,RLINK_TX_ID_LEN);
|
||||
@ -142,7 +157,7 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet()
|
||||
packet[29]= pseudo >> 8;
|
||||
packet[30]= 0x00; // unknown
|
||||
packet[31]= 0x00; // unknown
|
||||
packet[32]= rf_ch_num; // value equal to 0xC6 in the RF table
|
||||
packet[32]= rf_ch_num; // index of value changed in the RF table
|
||||
|
||||
// check
|
||||
uint8_t sum=0;
|
||||
@ -157,13 +172,14 @@ static void __attribute__((unused)) RLINK_TIMING_RFSEND_packet()
|
||||
packet_count++;
|
||||
if(packet_count>5) packet_count=0;
|
||||
|
||||
//debug("P(%02X):",hopping_frequency[pseudo & 0x0F]);
|
||||
//for(uint8_t i=0;i<RLINK_TX_PACKET_LEN+1;i++)
|
||||
//debugln("C= 0x%02X",hopping_frequency[pseudo & 0x0F]);
|
||||
//debug("P=");
|
||||
//for(uint8_t i=1;i<RLINK_TX_PACKET_LEN+1;i++)
|
||||
// debug(" 0x%02X",packet[i]);
|
||||
//debugln("");
|
||||
}
|
||||
|
||||
#define RLINK_TIMING_PROTO 20000
|
||||
#define RLINK_TIMING_PROTO 20000-100 // -100 for compatibility with R8EF
|
||||
#define RLINK_TIMING_RFSEND 10500
|
||||
#define RLINK_TIMING_CHECK 2000
|
||||
uint16_t RLINK_callback()
|
||||
@ -181,8 +197,9 @@ uint16_t RLINK_callback()
|
||||
#else
|
||||
if(!(packet[1]&0x02))
|
||||
return RLINK_TIMING_PROTO; //Normal packet
|
||||
//Telemetry packet
|
||||
phase++; // RX1
|
||||
return RLINK_TIMING_RFSEND; //Telemetry packet
|
||||
return RLINK_TIMING_RFSEND;
|
||||
case RLINK_RX1:
|
||||
CC2500_Strobe(CC2500_SIDLE);
|
||||
CC2500_Strobe(CC2500_SFRX);
|
||||
@ -218,9 +235,12 @@ uint16_t RLINK_callback()
|
||||
if (millis() - pps_timer >= 2000)
|
||||
{//1 telemetry packet every 100ms
|
||||
pps_timer = millis();
|
||||
if(pps_counter<20)
|
||||
pps_counter*=5;
|
||||
else
|
||||
pps_counter=100;
|
||||
debugln("%d pps", pps_counter);
|
||||
TX_LQI = pps_counter; //Max=100%
|
||||
TX_LQI = pps_counter; //0..100%
|
||||
pps_counter = 0;
|
||||
}
|
||||
CC2500_SetTxRxMode(TX_EN);
|
||||
|
@ -117,7 +117,7 @@ CFlie|38|CFlie||||||||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||||||||CC2500|
|
||||
[RadioLink](Protocols_Details.md#RadioLink---74)|74|Surface|Air|||||||CC2500|
|
||||
[Redpine](Protocols_Details.md#Redpine---50)|50|FAST|SLOW|||||||NRF24L01|
|
||||
[Scanner](Protocols_Details.md#Scanner---54)|54|||||||||CC2500|
|
||||
[SFHSS](Protocols_Details.md#SFHSS---21)|21|SFHSS||||||||CC2500|
|
||||
@ -558,7 +558,7 @@ CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|FS_CH1|FS_CH2|FS_CH3|FS_CH4|FS_CH5|FS_CH6|FS_CH7
|
||||
FS=FailSafe
|
||||
|
||||
### Sub_protocol Surface - *0*
|
||||
Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM
|
||||
Surface protocol. TXs: RC4GS,RC6GS. Compatible RXs:R7FG(Std),R6FG,R6F,R8EF,R8FM,R8F,R4FGM and more
|
||||
|
||||
**Only 1 ID for now**
|
||||
|
||||
@ -566,6 +566,13 @@ CH1=Steering, CH2=Throttle, CH8=Gyro gain
|
||||
|
||||
Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%), A1=RX_Batt, A2=Batt
|
||||
|
||||
### Sub_protocol Air - *1*
|
||||
Surface protocol. TXs: T8FB,. Compatible RXs:R8EF,R8FM,R4FG,R4F and more
|
||||
|
||||
**Only 1 ID for now**
|
||||
|
||||
Telemetry: RX_RSSI (for the original value add -256), TX_RSSI, TX_QLY (0..100%)
|
||||
|
||||
## SFHSS - *21*
|
||||
Models: Futaba RXs and XK models.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user