Compare commits

..

8 Commits

Author SHA1 Message Date
pascallanger
23478d3d21 Update Protocols_Details.md 2020-05-08 22:50:52 +02:00
Pascal Langer
ba72b6dedd eSky150v2 last minute typo... 2020-05-08 20:01:33 +02:00
Pascal Langer
103f595891 New protocol eSky 150 v2
Protocol: 69
No sub protocol
No extended limit
RX outputs is be set automatically to the eSky default TAER
16 channels
2020-05-08 19:55:16 +02:00
Pascal Langer
957d623b4b FrSky D16 LBT v1.x & 2.1: adjust thresholds to match ETSI requirements 2020-05-02 18:20:47 +02:00
Pascal Langer
2be757e609 Skyartec: small changes 2020-04-22 15:02:06 +02:00
Pascal Langer
c4be660a05 Skyartec: activate cc2500 rf tune 2020-04-21 18:27:15 +02:00
Pascal Langer
c1c5f9fe3a Hide Proto Scanner 2020-04-21 12:15:53 +02:00
Pascal Langer
53c0637a85 Fix a bug introduced with Alpha protocols ordering 2020-04-21 11:43:48 +02:00
13 changed files with 343 additions and 60 deletions

View File

@@ -150,6 +150,11 @@ void CC2500_SetPower()
#else #else
power=CC2500_HIGH_POWER; power=CC2500_HIGH_POWER;
#endif #endif
if(IS_LBT_POWER_on)
{
power=CC2500_LBT_POWER;
LBT_POWER_off; // Only accept once
}
if(IS_RANGE_FLAG_on) if(IS_RANGE_FLAG_on)
power=CC2500_RANGE_POWER; power=CC2500_RANGE_POWER;
if(prev_power != power) if(prev_power != power)

View File

@@ -0,0 +1,141 @@
/*
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(ESKY150V2_CC2500_INO)
#include "iface_nrf250k.h"
//#define ESKY150V2_FORCE_ID
#define ESKY150V2_PAYLOADSIZE 40
#define ESKY150V2_BINDPAYLOADSIZE 150
#define ESKY150V2_NFREQCHANNELS 70
#define ESKY150V2_TXID_SIZE 4
#define ESKY150V2_BIND_CHANNEL 0x00
#define ESKY150V2_PACKET_PERIOD 10000
#define ESKY150V2_BINDING_PACKET_PERIOD 57000
#ifdef ESKY150V2_FORCE_ID
const uint8_t PROGMEM ESKY150V2_hop[ESKY150V2_NFREQCHANNELS]= {
0x07, 0x47, 0x09, 0x27, 0x0B, 0x42, 0x0D, 0x35, 0x17, 0x40, 0x26, 0x3D, 0x16, 0x43, 0x06, 0x2A, 0x24, 0x44,
0x0E, 0x38, 0x20, 0x48, 0x22, 0x2D, 0x2B, 0x39, 0x0F, 0x36, 0x23, 0x46, 0x14, 0x3B, 0x1A, 0x41, 0x10, 0x2E,
0x1E, 0x28, 0x0C, 0x49, 0x1D, 0x3E, 0x29, 0x2C, 0x25, 0x30, 0x1C, 0x2F, 0x1B, 0x33, 0x13, 0x31, 0x0A, 0x37,
0x12, 0x3C, 0x18, 0x4B, 0x11, 0x45, 0x21, 0x4A, 0x1F, 0x3F, 0x15, 0x32, 0x08, 0x3A, 0x19, 0x34 };
/*const uint8_t PROGMEM ESKY150V2_hop2[40]= {
0x19, 0x23, 0x13, 0x1B, 0x09, 0x22, 0x14, 0x27, 0x06, 0x26, 0x16, 0x24, 0x0B, 0x2A, 0x0E, 0x1C, 0x11, 0x1E,
0x08, 0x29, 0x0D, 0x28, 0x18, 0x2D, 0x12, 0x20, 0x0C, 0x1A, 0x10, 0x1D, 0x07, 0x2C, 0x0A, 0x2B, 0x0F, 0x25,
0x15, 0x1F, 0x17, 0x21 };*/
#endif
static void __attribute__((unused)) ESKY150V2_set_freq(void)
{
calc_fh_channels(ESKY150V2_NFREQCHANNELS);
#ifdef ESKY150V2_FORCE_ID
for(uint8_t i=0; i<ESKY150V2_NFREQCHANNELS; i++)
hopping_frequency[i]=pgm_read_byte_near( &ESKY150V2_hop[i] );
#endif
//Bind channel
hopping_frequency[ESKY150V2_NFREQCHANNELS]=ESKY150V2_BIND_CHANNEL;
//Calib all channels
NRF250K_SetFreqOffset(); // Set frequency offset
NRF250K_HoppingCalib(ESKY150V2_NFREQCHANNELS+1);
}
static void __attribute__((unused)) ESKY150V2_send_packet()
{
NRF250K_SetFreqOffset(); // Set frequency offset
NRF250K_Hopping(hopping_frequency_no);
if (++hopping_frequency_no >= ESKY150V2_NFREQCHANNELS)
hopping_frequency_no = 0;
NRF250K_SetPower(); //Set power level
packet[0] = 0xFA; // Unknown
packet[1] = 0x41; // Unknown
packet[2] = 0x08; // Unknown
packet[3] = 0x00; // Unknown
for(uint8_t i=0;i<16;i++)
{
uint16_t channel=convert_channel_16b_limit(CH_TAER[i],200,1000);
packet[4+2*i] = channel;
packet[5+2*i] = channel>>8;
}
NRF250K_WritePayload(packet, ESKY150V2_PAYLOADSIZE);
}
uint16_t ESKY150V2_callback()
{
if(option==0) option=1; //Trick the RF component auto select system
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(ESKY150V2_PACKET_PERIOD);
#endif
ESKY150V2_send_packet();
}
else
{
BIND_DONE; //Need full power for bind to work...
NRF250K_SetPower(); //Set power level
BIND_IN_PROGRESS;
NRF250K_WritePayload(packet, ESKY150V2_BINDPAYLOADSIZE);
if (--bind_counter == 0)
{
BIND_DONE;
// Change TX address from bind to normal mode
NRF250K_SetTXAddr(rx_tx_addr, ESKY150V2_TXID_SIZE);
memset(packet,0x00,ESKY150V2_PAYLOADSIZE);
}
return 30000; //ESKY150V2_BINDING_PACKET_PERIOD;
}
return ESKY150V2_PACKET_PERIOD;
}
uint16_t initESKY150V2()
{
if(option==0) option=1; // Trick the RF component auto select system
NRF250K_Init();
ESKY150V2_set_freq();
hopping_frequency_no = 0;
#ifdef ESKY150V2_FORCE_ID // ID taken from TX dump
rx_tx_addr[0]=0x87;rx_tx_addr[1]=0x5B;rx_tx_addr[2]=0x2C;rx_tx_addr[3]=0x5D;
#endif
memset(packet,0x00,ESKY150V2_BINDPAYLOADSIZE);
if(IS_BIND_IN_PROGRESS)
{
NRF250K_SetTXAddr((uint8_t *)"\x73\x73\x74\x63", ESKY150V2_TXID_SIZE); //Bind address
NRF250K_Hopping(ESKY150V2_NFREQCHANNELS); //Bind channel
memcpy(packet,"\x73\x73\x74\x63", ESKY150V2_TXID_SIZE);
memcpy(&packet[ESKY150V2_TXID_SIZE],rx_tx_addr, ESKY150V2_TXID_SIZE);
packet[8]=0x41; //Unknown
packet[9]=0x88; //Unknown
packet[10]=0x41; //Unknown
memset(&packet[11],0xAA,4); //Unknown
memcpy(&packet[15],hopping_frequency,ESKY150V2_NFREQCHANNELS); // hop table
//for(uint8_t i=0; i<40; i++) // Does not seem to be needed
// packet[i+85]=pgm_read_byte_near( &ESKY150V2_hop2[i] );
bind_counter=100;
}
else
NRF250K_SetTXAddr(rx_tx_addr, ESKY150V2_TXID_SIZE);
return 50000;
}
#endif

View File

@@ -302,10 +302,10 @@ uint16_t ReadFrSkyX()
uint8_t rssi_level=convert_channel_8b(CH16)>>1; //CH16 0..127 uint8_t rssi_level=convert_channel_8b(CH16)>>1; //CH16 0..127
if ( rssi > rssi_level && rssi < 128) //test rssi level dynamically if ( rssi > rssi_level && rssi < 128) //test rssi level dynamically
#else #else
if ( rssi > 72 && rssi < 128) //LBT and RSSI between -36 and -8.5 dBm if ( rssi > 14 && rssi < 128) // if RSSI above -65dBm (12=-70) => ETSI requirement
#endif #endif
{ {
POWER_FLAG_off; // Reduce to low power before transmitting LBT_POWER_on; // Reduce to low power before transmitting
debugln("Busy %d %d",hopping_frequency_no,rssi); debugln("Busy %d %d",hopping_frequency_no,rssi);
} }
} }

View File

@@ -44,7 +44,7 @@
44,NCC1701 44,NCC1701
45,E01X,E012,E015,E016H 45,E01X,E012,E015,E016H
46,V911S,V911S,E119 46,V911S,V911S,E119
47,GD00X,GD_V1,GD_V2 47,GD00x,GD_V1,GD_V2
48,V761 48,V761
49,KF606 49,KF606
50,Redpine,Fast,Slow 50,Redpine,Fast,Slow
@@ -66,3 +66,4 @@
66,PROPEL,74-Z 66,PROPEL,74-Z
67,LR12,LR12,LR12_6ch 67,LR12,LR12,LR12_6ch
68,Skyartec 68,Skyartec
69,ESKYv2,150V2

View File

@@ -51,6 +51,7 @@ const char STR_GW008[] ="GW008";
const char STR_DM002[] ="DM002"; const char STR_DM002[] ="DM002";
const char STR_CABELL[] ="Cabell"; const char STR_CABELL[] ="Cabell";
const char STR_ESKY150[] ="Esky150"; const char STR_ESKY150[] ="Esky150";
const char STR_ESKY150V2[] ="EskyV2";
const char STR_H8_3D[] ="H8 3D"; const char STR_H8_3D[] ="H8 3D";
const char STR_CORONA[] ="Corona"; const char STR_CORONA[] ="Corona";
const char STR_CFLIE[] ="CFlie"; const char STR_CFLIE[] ="CFlie";
@@ -62,7 +63,7 @@ const char STR_TRAXXAS[] ="Traxxas";
const char STR_NCC1701[] ="NCC1701"; const char STR_NCC1701[] ="NCC1701";
const char STR_E01X[] ="E01X"; const char STR_E01X[] ="E01X";
const char STR_V911S[] ="V911S"; const char STR_V911S[] ="V911S";
const char STR_GD00X[] ="GD00X"; const char STR_GD00X[] ="GD00x";
const char STR_V761[] ="V761"; const char STR_V761[] ="V761";
const char STR_KF606[] ="KF606"; const char STR_KF606[] ="KF606";
const char STR_REDPINE[] ="Redpine"; const char STR_REDPINE[] ="Redpine";
@@ -121,6 +122,7 @@ const char STR_SUBTYPE_FLYZONE[] = "\x05""FZ410";
const char STR_SUBTYPE_FX816[] = "\x03""P38"; const char STR_SUBTYPE_FX816[] = "\x03""P38";
const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 "; const char STR_SUBTYPE_XN297DUMP[] = "\x07""250Kbps""1Mbps\0 ""2Mbps\0 ""Auto\0 ";
const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH"; const char STR_SUBTYPE_ESKY150[] = "\x03""4CH""7CH";
const char STR_SUBTYPE_ESKY150V2[] = "\x05""150V2";
const char STR_SUBTYPE_V911S[] = "\x05""V911S""E119\0"; const char STR_SUBTYPE_V911S[] = "\x05""V911S""E119\0";
const char STR_SUBTYPE_XK[] = "\x04""X450""X420"; const char STR_SUBTYPE_XK[] = "\x04""X450""X420";
const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch"; const char STR_SUBTYPE_FRSKYR9[] = "\x07""915MHz\0""868MHz\0""915 8ch""868 8ch";
@@ -128,6 +130,7 @@ const char STR_SUBTYPE_ESKY[] = "\x03""Std""ET4";
const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z"; const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z";
const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX"; const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX";
const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch"; const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch";
const char STR_SUBTYPE_WFLY[] = "\x06""WFR0xS";
enum enum
{ {
@@ -194,6 +197,9 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(ESKY150_NRF24L01_INO) #if defined(ESKY150_NRF24L01_INO)
{PROTO_ESKY150, STR_ESKY150, 2, STR_SUBTYPE_ESKY150, OPTION_NONE }, {PROTO_ESKY150, STR_ESKY150, 2, STR_SUBTYPE_ESKY150, OPTION_NONE },
#endif #endif
#if defined(ESKY150V2_CC2500_INO)
{PROTO_ESKY150V2, STR_ESKY150V2, 1, STR_SUBTYPE_ESKY150V2, OPTION_RFTUNE },
#endif
#if defined(FLYSKY_A7105_INO) #if defined(FLYSKY_A7105_INO)
{PROTO_FLYSKY, STR_FLYSKY, 5, STR_SUBTYPE_FLYSKY, OPTION_NONE }, {PROTO_FLYSKY, STR_FLYSKY, 5, STR_SUBTYPE_FLYSKY, OPTION_NONE },
#endif #endif
@@ -297,7 +303,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_REDPINE, STR_REDPINE, 2, STR_SUBTYPE_REDPINE, OPTION_RFTUNE }, {PROTO_REDPINE, STR_REDPINE, 2, STR_SUBTYPE_REDPINE, OPTION_RFTUNE },
#endif #endif
#if defined(SCANNER_CC2500_INO) #if defined(SCANNER_CC2500_INO)
{PROTO_SCANNER, STR_SCANNER, 0, NO_SUBTYPE, OPTION_NONE }, // {PROTO_SCANNER, STR_SCANNER, 0, NO_SUBTYPE, OPTION_NONE },
#endif #endif
#if defined(SFHSS_CC2500_INO) #if defined(SFHSS_CC2500_INO)
{PROTO_SFHSS, STR_SFHSS, 0, NO_SUBTYPE, OPTION_RFTUNE }, {PROTO_SFHSS, STR_SFHSS, 0, NO_SUBTYPE, OPTION_RFTUNE },
@@ -306,7 +312,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_SHENQI, STR_SHENQI, 0, NO_SUBTYPE, OPTION_NONE }, {PROTO_SHENQI, STR_SHENQI, 0, NO_SUBTYPE, OPTION_NONE },
#endif #endif
#if defined(SKYARTEC_CC2500_INO) #if defined(SKYARTEC_CC2500_INO)
{PROTO_SKYARTEC, STR_SKYARTEC, 0, NO_SUBTYPE, OPTION_NONE }, {PROTO_SKYARTEC, STR_SKYARTEC, 0, NO_SUBTYPE, OPTION_RFTUNE },
#endif #endif
#if defined(SLT_NRF24L01_INO) #if defined(SLT_NRF24L01_INO)
{PROTO_SLT, STR_SLT, 5, STR_SUBTYPE_SLT, OPTION_RFTUNE }, {PROTO_SLT, STR_SLT, 5, STR_SUBTYPE_SLT, OPTION_RFTUNE },
@@ -330,7 +336,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_V911S, STR_V911S, 2, STR_SUBTYPE_V911S, OPTION_RFTUNE }, {PROTO_V911S, STR_V911S, 2, STR_SUBTYPE_V911S, OPTION_RFTUNE },
#endif #endif
#if defined(WFLY_CYRF6936_INO) #if defined(WFLY_CYRF6936_INO)
{PROTO_WFLY, STR_WFLY, 0, NO_SUBTYPE, OPTION_NONE }, {PROTO_WFLY, STR_WFLY, 1, STR_SUBTYPE_WFLY, OPTION_NONE },
#endif #endif
#if defined(WK2x01_CYRF6936_INO) #if defined(WK2x01_CYRF6936_INO)
{PROTO_WK2x01, STR_WK2x01, 6, STR_SUBTYPE_WK2x01, OPTION_NONE }, {PROTO_WK2x01, STR_WK2x01, 6, STR_SUBTYPE_WK2x01, OPTION_NONE },
@@ -350,7 +356,4 @@ const mm_protocol_definition multi_protocols[] = {
{0x00, nullptr, 0, nullptr, 0 } {0x00, nullptr, 0, nullptr, 0 }
}; };
#endif #endif

View File

@@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 89 #define VERSION_PATCH_LEVEL 95
//****************** //******************
// Protocols // Protocols
@@ -95,6 +95,7 @@ enum PROTOCOLS
PROTO_PROPEL = 66, // =>NRF24L01 PROTO_PROPEL = 66, // =>NRF24L01
PROTO_FRSKYL = 67, // =>CC2500 PROTO_FRSKYL = 67, // =>CC2500
PROTO_SKYARTEC = 68, // =>CC2500 PROTO_SKYARTEC = 68, // =>CC2500
PROTO_ESKY150V2 = 69, // =>CC2500+NRF24L01
}; };
enum Flysky enum Flysky
@@ -397,7 +398,7 @@ enum MultiPacketTypes
//*** Tests *** //*** Tests ***
//*************** //***************
#define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 ) #define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 )
#define IS_CHMAP_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_DSM || protocol==PROTO_SLT || protocol==PROTO_FLYSKY || protocol==PROTO_ESKY || protocol==PROTO_J6PRO || protocol==PROTO_PELIKAN || protocol==PROTO_SKYARTEC ) #define IS_CHMAP_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_SFHSS || protocol==PROTO_WK2x01 || protocol== PROTO_DSM || protocol==PROTO_SLT || protocol==PROTO_FLYSKY || protocol==PROTO_ESKY || protocol==PROTO_J6PRO || protocol==PROTO_PELIKAN || protocol==PROTO_SKYARTEC || protocol==PROTO_ESKY150V2 )
//*************** //***************
//*** Flags *** //*** Flags ***
@@ -487,6 +488,11 @@ enum MultiPacketTypes
#define DISABLE_TELEM_on protocol_flags3 |= _BV(3) #define DISABLE_TELEM_on protocol_flags3 |= _BV(3)
#define IS_DISABLE_TELEM_on ( ( protocol_flags3 & _BV(3) ) !=0 ) #define IS_DISABLE_TELEM_on ( ( protocol_flags3 & _BV(3) ) !=0 )
#define IS_DISABLE_TELEM_off ( ( protocol_flags3 & _BV(3) ) ==0 ) #define IS_DISABLE_TELEM_off ( ( protocol_flags3 & _BV(3) ) ==0 )
//LBT power
#define LBT_POWER_off protocol_flags3 &= ~_BV(7)
#define LBT_POWER_on protocol_flags3 |= _BV(7)
#define IS_LBT_POWER_on ( ( protocol_flags3 & _BV(7) ) !=0 )
#define IS_LBT_POWER_off ( ( protocol_flags3 & _BV(7) ) ==0 )
// Failsafe // Failsafe
@@ -611,6 +617,7 @@ enum CC2500_POWER
CC2500_POWER_17 = 0xFF // +1dbm CC2500_POWER_17 = 0xFF // +1dbm
}; };
#define CC2500_HIGH_POWER CC2500_POWER_17 #define CC2500_HIGH_POWER CC2500_POWER_17
#define CC2500_LBT_POWER CC2500_POWER_14
#define CC2500_LOW_POWER CC2500_POWER_13 #define CC2500_LOW_POWER CC2500_POWER_13
#define CC2500_RANGE_POWER CC2500_POWER_1 #define CC2500_RANGE_POWER CC2500_POWER_1
#define CC2500_BIND_POWER CC2500_POWER_1 #define CC2500_BIND_POWER CC2500_POWER_1
@@ -754,6 +761,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
PROPEL 66 PROPEL 66
FRSKYL 67 FRSKYL 67
SKYARTEC 68 SKYARTEC 68
ESKY150V2 69
BindBit=> 0x80 1=Bind/0=No BindBit=> 0x80 1=Bind/0=No
AutoBindBit=> 0x40 1=Yes /0=No AutoBindBit=> 0x40 1=Yes /0=No
RangeCheck=> 0x20 1=Yes /0=No RangeCheck=> 0x20 1=Yes /0=No
@@ -1036,6 +1044,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
OPTION_RFCHAN 8 OPTION_RFCHAN 8
[19&0x0F] Number of sub protocols [19&0x0F] Number of sub protocols
[20..27] Sub protocol name [8], not null terminated if sub prototcol len == 8 [20..27] Sub protocol name [8], not null terminated if sub prototcol len == 8
If the current protocol is invalid [12..27] are all 0x00.
more information can be added by specifing a longer length of the type, the TX will just ignore these bytes more information can be added by specifing a longer length of the type, the TX will just ignore these bytes

View File

@@ -75,7 +75,11 @@ uint32_t blink=0,last_signal=0;
// //
uint16_t counter; uint16_t counter;
uint8_t channel; uint8_t channel;
uint8_t packet[50]; #ifdef ESKY150V2_CC2500_INO
uint8_t packet[150];
#else
uint8_t packet[50];
#endif
#define NUM_CHN 16 #define NUM_CHN 16
// Servo data // Servo data
@@ -97,7 +101,7 @@ uint16_t packet_period;
uint8_t packet_count; uint8_t packet_count;
uint8_t packet_sent; uint8_t packet_sent;
uint8_t packet_length; uint8_t packet_length;
#ifdef HOTT_CC2500_INO #if defined(HOTT_CC2500_INO) || defined(ESKY150V2_CC2500_INO)
uint8_t hopping_frequency[75]; uint8_t hopping_frequency[75];
#else #else
uint8_t hopping_frequency[50]; uint8_t hopping_frequency[50];
@@ -1211,6 +1215,14 @@ static void protocol_init()
remote_callback = FrSky_Rx_callback; remote_callback = FrSky_Rx_callback;
break; break;
#endif #endif
#if defined(ESKY150V2_CC2500_INO)
case PROTO_ESKY150V2:
PE1_off;
PE2_on; //antenna RF2
next_callback = initESKY150V2();
remote_callback = ESKY150V2_callback;
break;
#endif
#endif #endif
#ifdef CYRF6936_INSTALLED #ifdef CYRF6936_INSTALLED
#if defined(DSM_CYRF6936_INO) #if defined(DSM_CYRF6936_INO)
@@ -2183,6 +2195,51 @@ static uint32_t random_id(uint16_t address, uint8_t create_new)
#endif #endif
} }
// Generate frequency hopping sequence in the range [02..77]
static void __attribute__((unused)) calc_fh_channels(uint8_t num_ch)
{
uint8_t idx = 0;
uint32_t rnd = MProtocol_id;
uint8_t max=(num_ch/3)+2;
while (idx < num_ch)
{
uint8_t i;
uint8_t count_2_26 = 0, count_27_50 = 0, count_51_74 = 0;
rnd = rnd * 0x0019660D + 0x3C6EF35F; // Randomization
// Use least-significant byte. 73 is prime, so channels 76..77 are unused
uint8_t next_ch = ((rnd >> 8) % 73) + 2;
// Keep a distance of 5 between consecutive channels
if (idx !=0)
{
if(hopping_frequency[idx-1]>next_ch)
{
if(hopping_frequency[idx-1]-next_ch<5)
continue;
}
else
if(next_ch-hopping_frequency[idx-1]<5)
continue;
}
// Check that it's not duplicated and spread uniformly
for (i = 0; i < idx; i++) {
if(hopping_frequency[i] == next_ch)
break;
if(hopping_frequency[i] <= 26)
count_2_26++;
else if (hopping_frequency[i] <= 50)
count_27_50++;
else
count_51_74++;
}
if (i != idx)
continue;
if ( (next_ch <= 26 && count_2_26 < max) || (next_ch >= 27 && next_ch <= 50 && count_27_50 < max) || (next_ch >= 51 && count_51_74 < max) )
hopping_frequency[idx++] = next_ch;//find hopping frequency
}
}
/**************************/ /**************************/
/**************************/ /**************************/
/** Interrupt routines **/ /** Interrupt routines **/

View File

@@ -383,7 +383,11 @@ static void __attribute__((unused)) NRF250K_WritePayload(uint8_t* msg, uint8_t l
} }
//CC2500 //CC2500
#ifdef CC2500_INSTALLED #ifdef CC2500_INSTALLED
#if defined(ESKY150V2_CC2500_INO)
uint8_t buf[158];
#else
uint8_t buf[35]; uint8_t buf[35];
#endif
uint8_t last = 0; uint8_t last = 0;
uint8_t i; uint8_t i;
@@ -417,10 +421,40 @@ static void __attribute__((unused)) NRF250K_WritePayload(uint8_t* msg, uint8_t l
CC2500_Strobe(CC2500_SFTX); CC2500_Strobe(CC2500_SFTX);
// packet length // packet length
CC2500_WriteReg(CC2500_3F_TXFIFO, last); CC2500_WriteReg(CC2500_3F_TXFIFO, last);
// nrf packet // transmit nrf packet
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buf, last); uint8_t *buff=buf;
// transmit uint8_t status;
if(last>63)
{
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buff, 63);
CC2500_Strobe(CC2500_STX); CC2500_Strobe(CC2500_STX);
last-=63;
buff+=63;
while(last)
{//Loop until all the data is sent
do
{// Wait for the FIFO to become available
status=CC2500_ReadReg(CC2500_3A_TXBYTES | CC2500_READ_BURST);
}
while((status&0x7F)>31 && (status&0x80)==0);
if(last>31)
{//Send 31 bytes
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buff, 31);
last-=31;
buff+=31;
}
else
{//Send last bytes
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buff, last);
last=0;
}
}
}
else
{//Send packet
CC2500_WriteRegisterMulti(CC2500_3F_TXFIFO, buff, last);
CC2500_Strobe(CC2500_STX);
}
#endif #endif
} }

View File

@@ -19,7 +19,6 @@
//#define SKYARTEC_FORCE_ID //#define SKYARTEC_FORCE_ID
#define SKYARTEC_BIND_CHANNEL 0x7D
#define SKYARTEC_COARSE 0x00 #define SKYARTEC_COARSE 0x00
#define SKYARTEC_TX_ADDR rx_tx_addr[1] #define SKYARTEC_TX_ADDR rx_tx_addr[1]
#define SKYARTEC_TX_CHANNEL rx_tx_addr[0] #define SKYARTEC_TX_CHANNEL rx_tx_addr[0]
@@ -41,7 +40,7 @@ enum {
const PROGMEM uint8_t SKYARTEC_init_values[] = { const PROGMEM uint8_t SKYARTEC_init_values[] = {
/* 04 */ 0x13, 0x18, 0xFF, 0x05, /* 04 */ 0x13, 0x18, 0xFF, 0x05,
/* 08 */ 0x05, 0x43, SKYARTEC_BIND_CHANNEL, 0x09, 0x00, 0x5D, 0x93, 0xB1 + SKYARTEC_COARSE, /* 08 */ 0x05, 0x43, 0xCD, 0x09, 0x00, 0x5D, 0x93, 0xB1 + SKYARTEC_COARSE,
/* 10 */ 0x2D, 0x20, 0x73, 0x22, 0xF8, 0x50, 0x07, 0x30, /* 10 */ 0x2D, 0x20, 0x73, 0x22, 0xF8, 0x50, 0x07, 0x30,
/* 18 */ 0x18, 0x1D, 0x1C, 0xC7, 0x00, 0xB2, 0x87, 0x6B, /* 18 */ 0x18, 0x1D, 0x1C, 0xC7, 0x00, 0xB2, 0x87, 0x6B,
/* 20 */ 0xF8, 0xB6, 0x10, 0xEA, 0x0A, 0x00, 0x11, 0x41, /* 20 */ 0xF8, 0xB6, 0x10, 0xEA, 0x0A, 0x00, 0x11, 0x41,
@@ -60,6 +59,10 @@ static void __attribute__((unused)) SKYARTEC_rf_init()
CC2500_SetTxRxMode(TX_EN); CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower(); CC2500_SetPower();
CC2500_Strobe(CC2500_SFTX);
CC2500_Strobe(CC2500_SFRX);
CC2500_Strobe(CC2500_SXOFF);
CC2500_Strobe(CC2500_SIDLE);
} }
static void __attribute__((unused)) SKYARTEC_send_data_packet() static void __attribute__((unused)) SKYARTEC_send_data_packet()
@@ -78,13 +81,12 @@ static void __attribute__((unused)) SKYARTEC_send_data_packet()
} }
//checks //checks
uint8_t xor1 = 0; uint8_t xor1 = 0;
for(uint8_t i = 3; i <= 16; i++)
xor1 ^= packet[i];
packet[17] = xor1;
uint8_t xor2 = 0;
for(uint8_t i = 3; i <= 14; i++) for(uint8_t i = 3; i <= 14; i++)
xor2 ^= packet[i]; xor1 ^= packet[i];
packet[18] = xor2; packet[18] = xor1;
xor1 ^= packet[15];
xor1 ^= packet[16];
packet[17] = xor1;
packet[19] = packet[3] + packet[5] + packet[7] + packet[9] + packet[11] + packet[13]; packet[19] = packet[3] + packet[5] + packet[7] + packet[9] + packet[11] + packet[13];
CC2500_WriteReg(CC2500_04_SYNC1, rx_tx_addr[3]); CC2500_WriteReg(CC2500_04_SYNC1, rx_tx_addr[3]);
@@ -101,7 +103,10 @@ static void __attribute__((unused)) SKYARTEC_send_bind_packet()
packet[1] = 0x7d; packet[1] = 0x7d;
packet[2] = 0x01; packet[2] = 0x01;
packet[3] = 0x01; packet[3] = 0x01;
memcpy(&packet[4], rx_tx_addr, 4); packet[4] = rx_tx_addr[0];
packet[5] = rx_tx_addr[1];
packet[6] = rx_tx_addr[2];
packet[7] = rx_tx_addr[3];
packet[8] = 0x00; packet[8] = 0x00;
packet[9] = 0x00; packet[9] = 0x00;
packet[10] = SKYARTEC_TX_ADDR; packet[10] = SKYARTEC_TX_ADDR;
@@ -112,7 +117,7 @@ static void __attribute__((unused)) SKYARTEC_send_bind_packet()
CC2500_WriteReg(CC2500_04_SYNC1, 0x7d); CC2500_WriteReg(CC2500_04_SYNC1, 0x7d);
CC2500_WriteReg(CC2500_05_SYNC0, 0x7d); CC2500_WriteReg(CC2500_05_SYNC0, 0x7d);
CC2500_WriteReg(CC2500_09_ADDR, 0x7d); CC2500_WriteReg(CC2500_09_ADDR, 0x7d);
CC2500_WriteReg(CC2500_0A_CHANNR, SKYARTEC_BIND_CHANNEL); CC2500_WriteReg(CC2500_0A_CHANNR, 0x7d);
CC2500_WriteData(packet, 12); CC2500_WriteData(packet, 12);
} }
@@ -158,7 +163,7 @@ uint16_t initSKYARTEC()
{ {
SKYARTEC_rf_init(); SKYARTEC_rf_init();
#ifdef SKYARTEC_FORCEID #ifdef SKYARTEC_FORCE_ID
memset(rx_tx_addr,0x00,4); memset(rx_tx_addr,0x00,4);
#endif #endif
if(rx_tx_addr[0]==0) rx_tx_addr[0]=0xB2; if(rx_tx_addr[0]==0) rx_tx_addr[0]=0xB2;

View File

@@ -140,8 +140,11 @@ static void multi_send_status()
{ {
flags |= 0x04; flags |= 0x04;
#ifdef MULTI_NAMES #ifdef MULTI_NAMES
if(multi_protocols_index == 0xFF||remote_callback==0) if(multi_protocols_index == 0xFF)
{
if(protocol!=PROTO_SCANNER)
flags &= ~0x04; //Invalid protocol flags &= ~0x04; //Invalid protocol
}
else if(sub_protocol&0x07) else if(sub_protocol&0x07)
{ {
uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto; uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto;
@@ -182,7 +185,14 @@ static void multi_send_status()
#ifdef MULTI_NAMES #ifdef MULTI_NAMES
if(multi_protocols_index == 0xFF) // selection out of list... send first available protocol if(multi_protocols_index == 0xFF) // selection out of list... send first available protocol
multi_protocols_index=0; {
Serial_write(multi_protocols[0].protocol); // begining of list
Serial_write(multi_protocols[0].protocol); // begining of list
for(uint8_t i=0;i<16;i++)
Serial_write(0x00); // everything else is invalid
}
else
{
// Protocol next/prev // Protocol next/prev
if(multi_protocols[multi_protocols_index+1].protocol != 0) if(multi_protocols[multi_protocols_index+1].protocol != 0)
Serial_write(multi_protocols[multi_protocols_index+1].protocol); // next protocol number Serial_write(multi_protocols[multi_protocols_index+1].protocol); // next protocol number
@@ -208,6 +218,7 @@ static void multi_send_status()
} }
for(;j<8;j++) for(;j<8;j++)
Serial_write(0x00); Serial_write(0x00);
}
// Channels function // Channels function
//TODO //TODO
#endif #endif

View File

@@ -212,6 +212,7 @@
#endif #endif
#ifndef CC2500_INSTALLED #ifndef CC2500_INSTALLED
#undef CORONA_CC2500_INO #undef CORONA_CC2500_INO
#undef ESKY150V2_CC2500_INO
#undef FRSKYD_CC2500_INO #undef FRSKYD_CC2500_INO
#undef FRSKYL_CC2500_INO #undef FRSKYL_CC2500_INO
#undef FRSKYV_CC2500_INO #undef FRSKYV_CC2500_INO
@@ -237,6 +238,7 @@
#undef E01X_NRF24L01_INO #undef E01X_NRF24L01_INO
#undef ESKY_NRF24L01_INO #undef ESKY_NRF24L01_INO
#undef ESKY150_NRF24L01_INO #undef ESKY150_NRF24L01_INO
#undef ESKY150V2_CC2500_INO // Use both CC2500 and NRF code
#undef FQ777_NRF24L01_INO #undef FQ777_NRF24L01_INO
#undef FX816_NRF24L01_INO #undef FX816_NRF24L01_INO
#undef FY326_NRF24L01_INO #undef FY326_NRF24L01_INO

View File

@@ -177,6 +177,7 @@
//The protocols below need a CC2500 to be installed //The protocols below need a CC2500 to be installed
#define CORONA_CC2500_INO #define CORONA_CC2500_INO
#define ESKY150V2_CC2500_INO //Need both CC2500 and NRF
#define FRSKYL_CC2500_INO #define FRSKYL_CC2500_INO
#define FRSKYD_CC2500_INO #define FRSKYD_CC2500_INO
#define FRSKYV_CC2500_INO #define FRSKYV_CC2500_INO
@@ -552,6 +553,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_ESKY150 PROTO_ESKY150
ESKY150_4CH ESKY150_4CH
ESKY150_7CH ESKY150_7CH
PROTO_ESKY150V2
NONE
PROTO_FLYSKY PROTO_FLYSKY
Flysky Flysky
V9X9 V9X9

View File

@@ -82,6 +82,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[E01X](Protocols_Details.md#E01X---45)|45|E012|E015|E016H||||||NRF24L01|XN297/HS6200 [E01X](Protocols_Details.md#E01X---45)|45|E012|E015|E016H||||||NRF24L01|XN297/HS6200
[ESky](Protocols_Details.md#ESKY---16)|16|ESky|Std|ET4||||||NRF24L01| [ESky](Protocols_Details.md#ESKY---16)|16|ESky|Std|ET4||||||NRF24L01|
[ESky150](Protocols_Details.md#ESKY150---35)|35|ESKY150||||||||NRF24L01| [ESky150](Protocols_Details.md#ESKY150---35)|35|ESKY150||||||||NRF24L01|
[ESky150V2](Protocols_Details.md#ESKY150V2---69)|69|||||||||CC2500|NRF24L01
[Flysky](Protocols_Details.md#FLYSKY---1)|1|Flysky|V9x9|V6x6|V912|CX20||||A7105| [Flysky](Protocols_Details.md#FLYSKY---1)|1|Flysky|V9x9|V6x6|V912|CX20||||A7105|
[Flysky AFHDS2A](Protocols_Details.md#FLYSKY-AFHDS2A---28)|28|PWM_IBUS|PPM_IBUS|PWM_SBUS|PPM_SBUS|||||A7105| [Flysky AFHDS2A](Protocols_Details.md#FLYSKY-AFHDS2A---28)|28|PWM_IBUS|PPM_IBUS|PWM_SBUS|PPM_SBUS|||||A7105|
[Flysky AFHDS2A RX](Protocols_Details.md#FLYSKY-AFHDS2A-RX---56)|56|||||||||A7105| [Flysky AFHDS2A RX](Protocols_Details.md#FLYSKY-AFHDS2A-RX---56)|56|||||||||A7105|
@@ -936,6 +937,17 @@ A|E|T|R|FMODE|AUX6|AUX7
FMODE and AUX7 have 4 positions: -100%..-50%=>0, -50%..5%=>1, 5%..50%=>2, 50%..100%=>3 FMODE and AUX7 have 4 positions: -100%..-50%=>0, -50%..5%=>1, 5%..50%=>2, 50%..100%=>3
## ESKY150V2 - *69*
ESky protocol for small models: 150 V2, F150 V2, Blade 70s(?)
Notes:
- RX output will match the eSky standard TAER independently of the input configuration AETR, RETA... unless on OpenTX 2.3.3+ you use the "Disable channel mapping" feature on the GUI.
- To run this protocol you need both CC2500 and NRF24L01 to be enabled for code reasons, only the CC2500 is really used.
CH1|CH2|CH3|CH4|CH5 |CH6 |CH7 |CH8 |CH9 |CH10|CH11|CH12|CH13|CH14|CH15|CH16
---|---|---|---|----|----|----|----|----|----|----|----|----|----|----|----
A|E|T|R|CH5 |CH6 |CH7 |CH8 |CH9 |CH10|CH11|CH12|CH13|CH14|CH15|CH16
## FX816 - *58* ## FX816 - *58*
Model: FEI XIONG FX816 P38 Model: FEI XIONG FX816 P38
@@ -1254,7 +1266,7 @@ Model: Shenqiwei 1/20 Mini Motorcycle
CH1|CH2|CH3|CH4 CH1|CH2|CH3|CH4
---|---|---|--- ---|---|---|---
| |T|R -|-|T|R
Throttle +100%=full forward,0%=stop,-100%=full backward. Throttle +100%=full forward,0%=stop,-100%=full backward.
@@ -1438,7 +1450,7 @@ Autobind protocol
CH1|CH2|CH3|CH4|CH5 CH1|CH2|CH3|CH4|CH5
---|---|---|---|--- ---|---|---|---|---
||T|R|LIGHT -|-|T|R|LIGHT
# SX1276 RF Module # SX1276 RF Module