mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-05 04:57:54 +00:00
First HoTT version
This commit is contained in:
parent
7b281e47d6
commit
5856442e0f
@ -107,11 +107,41 @@ static void __attribute__((unused)) HOTT_tune_freq()
|
|||||||
uint8_t HOTT_hop[75]= { 48, 37, 16, 62, 9, 50, 42, 22, 68, 0, 55, 35, 21, 74, 1, 56, 31, 20, 70, 11, 45, 32, 24, 71, 8, 54, 38, 26, 61, 13, 53, 30, 15, 65, 7, 52, 34, 28, 60, 3, 47, 39, 18, 69, 2, 49, 44, 23, 72, 5, 51, 43, 19, 64, 12, 46, 33, 17, 67, 6, 58, 36, 29, 73, 14, 57, 41, 25, 63, 4, 59, 40, 27, 66, 10 };
|
uint8_t HOTT_hop[75]= { 48, 37, 16, 62, 9, 50, 42, 22, 68, 0, 55, 35, 21, 74, 1, 56, 31, 20, 70, 11, 45, 32, 24, 71, 8, 54, 38, 26, 61, 13, 53, 30, 15, 65, 7, 52, 34, 28, 60, 3, 47, 39, 18, 69, 2, 49, 44, 23, 72, 5, 51, 43, 19, 64, 12, 46, 33, 17, 67, 6, 58, 36, 29, 73, 14, 57, 41, 25, 63, 4, 59, 40, 27, 66, 10 };
|
||||||
uint16_t HOTT_hop_val = 0xC06B;
|
uint16_t HOTT_hop_val = 0xC06B;
|
||||||
|
|
||||||
// Channel values are PPM*2
|
static void __attribute__((unused)) HOTT_init()
|
||||||
|
{
|
||||||
|
packet[0] = HOTT_hop_val;
|
||||||
|
packet[1] = HOTT_hop_val>>8;
|
||||||
|
#ifdef HOTT_FORCE_ID
|
||||||
|
memcpy(rx_tx_addr,"\x7C\x94\x00\x0D\x50",5);
|
||||||
|
#endif
|
||||||
|
memset(&packet[30],0xFF,9);
|
||||||
|
packet[39]=0X07; // unknown
|
||||||
|
if(IS_BIND_IN_PROGRESS)
|
||||||
|
{
|
||||||
|
packet[28] = 0x80; // unknown 0x80 when bind starts then when RX replies start normal, 0x89/8A/8B/8C/8D/8E during normal packets
|
||||||
|
packet[29] = 0x02; // unknown 0x02 when bind starts then when RX replies cycle in sequence 0x1A/22/2A/0A/12, 0x02 during normal packets
|
||||||
|
memset(&packet[40],0xFA,5);
|
||||||
|
memcpy(&packet[45],rx_tx_addr,5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
packet[28] = 0x8C; // unknown 0x80 when bind starts then when RX replies start normal, 0x89/8A/8B/8C/8D/8E during normal packets
|
||||||
|
packet[29] = 0x02; // unknown 0x02 when bind starts then when RX replies cycle in sequence 0x1A/22/2A/0A/12, 0x02 during normal packets
|
||||||
|
memcpy(&packet[40],rx_tx_addr,5);
|
||||||
|
|
||||||
|
uint8_t addr=HOTT_EEPROM_OFFSET+RX_num*5;
|
||||||
|
for(uint8_t i=0;i<5;i++)
|
||||||
|
packet[45+i]=eeprom_read_byte((EE_ADDR)(addr+i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) HOTT_data_packet()
|
static void __attribute__((unused)) HOTT_data_packet()
|
||||||
{
|
{
|
||||||
packet[2] = hopping_frequency_no;
|
packet[2] = hopping_frequency_no;
|
||||||
packet[3] = 0x00; // unknown, may be for additional channels
|
|
||||||
|
packet[3] = 0x00; // unknown, may be for additional channels?
|
||||||
|
|
||||||
|
// Channel values are PPM*2
|
||||||
for(uint8_t i=4;i<28;i+=2)
|
for(uint8_t i=4;i<28;i+=2)
|
||||||
{
|
{
|
||||||
uint16_t val=Channel_data[(i-4)>>1];
|
uint16_t val=Channel_data[(i-4)>>1];
|
||||||
@ -120,9 +150,6 @@ static void __attribute__((unused)) HOTT_data_packet()
|
|||||||
packet[i+1] = val>>8;
|
packet[i+1] = val>>8;
|
||||||
}
|
}
|
||||||
|
|
||||||
packet[28] = 0x8C; // unknown
|
|
||||||
packet[29] = 0x02; // unknown
|
|
||||||
|
|
||||||
CC2500_SetTxRxMode(TX_EN);
|
CC2500_SetTxRxMode(TX_EN);
|
||||||
CC2500_SetPower();
|
CC2500_SetPower();
|
||||||
CC2500_WriteReg(CC2500_06_PKTLEN, 0x32);
|
CC2500_WriteReg(CC2500_06_PKTLEN, 0x32);
|
||||||
@ -182,11 +209,37 @@ uint16_t ReadHOTT()
|
|||||||
if (len==HOTT_RX_PACKET_LEN+2)
|
if (len==HOTT_RX_PACKET_LEN+2)
|
||||||
{
|
{
|
||||||
CC2500_ReadData(packet_in, len);
|
CC2500_ReadData(packet_in, len);
|
||||||
|
if(memcmp(rx_tx_addr,packet_in,5)==0)
|
||||||
|
{ // TX ID matches
|
||||||
|
if(IS_BIND_IN_PROGRESS)
|
||||||
|
{
|
||||||
|
debug("B:");
|
||||||
|
for(uint8_t i=0;i<HOTT_RX_PACKET_LEN;i++)
|
||||||
|
debug(" %02X", packet_in[i]);
|
||||||
|
debugln("");
|
||||||
|
uint8_t addr=HOTT_EEPROM_OFFSET+RX_num*5;
|
||||||
|
for(uint8_t i=0; i<5; i++)
|
||||||
|
eeprom_write_byte((EE_ADDR)(addr+i),packet_in[5+i]);
|
||||||
|
BIND_DONE;
|
||||||
|
HOTT_init();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //Telemetry
|
||||||
|
// (TXID)0x7C,0x94,0x00,0x0C,0x50
|
||||||
|
// (RXID)0x4D,0xF2,0x00,0x00,0xB1
|
||||||
|
// unknown 0x40 bind, 0x00 normal
|
||||||
|
// 0x0X telmetry page X=0,1,2,3,4
|
||||||
|
// Telem page 0 = 0x00, 0x33, 0x34, 0x46, 0x64, 0x33, 0x0A, 0x00, 0x00, 0x00
|
||||||
|
if(packet_in[11]==0)
|
||||||
|
{
|
||||||
debug("T:");
|
debug("T:");
|
||||||
for(uint8_t i=0;i<HOTT_RX_PACKET_LEN;i++)
|
for(uint8_t i=0;i<HOTT_RX_PACKET_LEN;i++)
|
||||||
debug(" %02X", packet_in[i]);
|
debug(" %02X", packet_in[i]);
|
||||||
debugln("");
|
debugln("");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
CC2500_Strobe(CC2500_SFRX); //Flush the RXFIFO
|
CC2500_Strobe(CC2500_SFRX); //Flush the RXFIFO
|
||||||
phase=HOTT_DATA1;
|
phase=HOTT_DATA1;
|
||||||
return 1000;
|
return 1000;
|
||||||
@ -194,18 +247,9 @@ uint16_t ReadHOTT()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) HOTT_init()
|
|
||||||
{
|
|
||||||
packet[0] = HOTT_hop_val;
|
|
||||||
packet[1] = HOTT_hop_val>>8;
|
|
||||||
memcpy(&packet[30],"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07\x7C\x94\x00\x0C\x50\x4D\xF2\x00\x00\xB1",20); //unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t initHOTT()
|
uint16_t initHOTT()
|
||||||
{
|
{
|
||||||
BIND_DONE; // Not a TX bind protocol
|
|
||||||
HOTT_init();
|
HOTT_init();
|
||||||
|
|
||||||
HOTT_rf_init();
|
HOTT_rf_init();
|
||||||
phase = HOTT_START;
|
phase = HOTT_START;
|
||||||
return 10000;
|
return 10000;
|
||||||
|
@ -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 33
|
#define VERSION_PATCH_LEVEL 34
|
||||||
|
|
||||||
//******************
|
//******************
|
||||||
// Protocols
|
// Protocols
|
||||||
@ -593,7 +593,8 @@ enum {
|
|||||||
#define FRSKY_RX_EEPROM_OFFSET 178 // (1) format + (3) TX ID + (1) freq_tune + (47) channels, 52 bytes, end is 178+52=230
|
#define FRSKY_RX_EEPROM_OFFSET 178 // (1) format + (3) TX ID + (1) freq_tune + (47) channels, 52 bytes, end is 178+52=230
|
||||||
#define AFHDS2A_RX_EEPROM_OFFSET 230 // (4) TX ID + (16) channels, 20 bytes, end is 230+20=250
|
#define AFHDS2A_RX_EEPROM_OFFSET 230 // (4) TX ID + (16) channels, 20 bytes, end is 230+20=250
|
||||||
#define AFHDS2A_EEPROM_OFFSET2 250 // RX ID, 4 bytes per model id, end is 250+192=442
|
#define AFHDS2A_EEPROM_OFFSET2 250 // RX ID, 4 bytes per model id, end is 250+192=442
|
||||||
//#define CONFIG_EEPROM_OFFSET 442 // Current configuration of the multimodule
|
#define HOTT_EEPROM_OFFSET 442 // RX ID, 5 bytes per model id, end is 320+442=762
|
||||||
|
//#define CONFIG_EEPROM_OFFSET 762 // Current configuration of the multimodule
|
||||||
|
|
||||||
//****************************************
|
//****************************************
|
||||||
//*** MULTI protocol serial definition ***
|
//*** MULTI protocol serial definition ***
|
||||||
@ -910,6 +911,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
|||||||
OPTION_FIXEDID 4
|
OPTION_FIXEDID 4
|
||||||
OPTION_TELEM 5
|
OPTION_TELEM 5
|
||||||
OPTION_SRVFREQ 6
|
OPTION_SRVFREQ 6
|
||||||
|
OPTION_MAXTHR 7
|
||||||
[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
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ uint8_t num_ch;
|
|||||||
#ifdef CC2500_INSTALLED
|
#ifdef CC2500_INSTALLED
|
||||||
#ifdef SCANNER_CC2500_INO
|
#ifdef SCANNER_CC2500_INO
|
||||||
uint8_t calData[255];
|
uint8_t calData[255];
|
||||||
#elif defined(HOTT_CC2500_IN0)
|
#elif defined(HOTT_CC2500_INO)
|
||||||
uint8_t calData[75];
|
uint8_t calData[75];
|
||||||
#else
|
#else
|
||||||
uint8_t calData[50];
|
uint8_t calData[50];
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
#define FRSKYX_CC2500_INO
|
#define FRSKYX_CC2500_INO
|
||||||
#define FRSKY_RX_CC2500_INO
|
#define FRSKY_RX_CC2500_INO
|
||||||
#define HITEC_CC2500_INO
|
#define HITEC_CC2500_INO
|
||||||
//#define HOTT_CC2500_INO
|
#define HOTT_CC2500_INO
|
||||||
#define SCANNER_CC2500_INO
|
#define SCANNER_CC2500_INO
|
||||||
#define SFHSS_CC2500_INO
|
#define SFHSS_CC2500_INO
|
||||||
#define REDPINE_CC2500_INO
|
#define REDPINE_CC2500_INO
|
||||||
@ -275,8 +275,8 @@
|
|||||||
//For STM32 and OrangeRX modules, comment to prevent the TX from forcing the serial telemetry polarity normal/invert.
|
//For STM32 and OrangeRX modules, comment to prevent the TX from forcing the serial telemetry polarity normal/invert.
|
||||||
#define INVERT_TELEMETRY_TX
|
#define INVERT_TELEMETRY_TX
|
||||||
|
|
||||||
//Uncomment if you don't want to send Multi status telemetry frames (Protocol available, Bind in progress, version...)
|
//Uncomment if you want to send Multi status telemetry frames (Protocol available, Bind in progress, version...)
|
||||||
//Use with er9x/erskyTX, for OpenTX MULTI_TELEMETRY below is preferred instead
|
//Use with er9x/erskyTX, for OpenTX you must select MULTI_TELEMETRY below
|
||||||
//#define MULTI_STATUS
|
//#define MULTI_STATUS
|
||||||
|
|
||||||
//Sends Multi status and allow OpenTX to autodetect the telemetry format. Comment to disable.
|
//Sends Multi status and allow OpenTX to autodetect the telemetry format. Comment to disable.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user