diff --git a/Multiprotocol/AFHDS2A_Rx_a7105.ino b/Multiprotocol/AFHDS2A_Rx_a7105.ino new file mode 100644 index 0000000..4ce9b6d --- /dev/null +++ b/Multiprotocol/AFHDS2A_Rx_a7105.ino @@ -0,0 +1,30 @@ +/* + 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 . + */ + +#if defined(AFHDS2A_RX_A7105_INO) + +#include "iface_a7105.h" + +uint16_t initAFHDS2A_Rx() +{ + return 1000; +} + +uint16_t AFHDS2A_Rx_callback() +{ + return 1000; +} + +#endif diff --git a/Multiprotocol/Multi.txt b/Multiprotocol/Multi.txt index bd9d6c3..b866d0b 100644 --- a/Multiprotocol/Multi.txt +++ b/Multiprotocol/Multi.txt @@ -53,4 +53,5 @@ 53,Flyzone,FZ-410 54,Scanner 55,FrskyX_RX,FCC,EU_LBT +56,AFHDS2A_RX 63,XN_DUMP,250K,1M,2M diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 5b7c5a0..9f47a6f 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -82,6 +82,7 @@ enum PROTOCOLS PROTO_FLYZONE = 53, // =>A7105 PROTO_SCANNER = 54, // =>CC2500 PROTO_FRSKYX_RX = 55, // =>CC2500 + PROTO_AFHDS2A_RX= 56, // =>A7105 PROTO_XN297DUMP = 63, // =>NRF24L01 }; @@ -575,7 +576,8 @@ enum { #define AFHDS2A_EEPROM_OFFSET 50 // RX ID, 4 bytes per model id, end is 50+64=114 #define BUGS_EEPROM_OFFSET 114 // RX ID, 2 bytes per model id, end is 114+32=146 #define BUGSMINI_EEPROM_OFFSET 146 // RX ID, 2 bytes per model id, end is 146+32=178 -#define FRSKYX_RX_EEPROM_OFFSET 178 // (3) TX ID + (1) freq_tune + (47) channels, 51 bytes per model, end is 178+51=229 +#define FRSKYX_RX_EEPROM_OFFSET 178 // (3) TX ID + (1) freq_tune + (47) channels, 51 bytes, end is 178+51=229 +#define AFHDS2A_RX_EEPROM_OFFSET 229 // (4) TX ID + (16) channels, 20 bytes, end is 229+20=249 //#define CONFIG_EEPROM_OFFSET 210 // Current configuration of the multimodule //**************************************** diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 8315f79..403d4a2 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1003,6 +1003,13 @@ static void protocol_init() remote_callback = ReadFlyzone; break; #endif + #if defined(AFHDS2A_RX_A7105_INO) + case PROTO_AFHDS2A_RX: + PE1_off; //antenna RF1 + next_callback = initAFHDS2A_Rx(); + remote_callback = AFHDS2A_Rx_callback; + break; + #endif #endif #ifdef CC2500_INSTALLED #if defined(FRSKYD_CC2500_INO) diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 4479c9b..7ced7b1 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -174,6 +174,7 @@ #undef AFHDS2A_A7105_INO #undef BUGS_A7105_INO #undef FLYZONE_A7105_INO + #undef AFHDS2A_RX_A7105_INO #endif #ifndef CYRF6936_INSTALLED #undef DEVO_CYRF6936_INO @@ -254,6 +255,8 @@ #undef SCANNER_CC2500_INO #undef FRSKYX_RX_TELEMETRY #undef FRSKYX_RX_CC2500_INO + #undef AFHDS2A_RX_TELEMETRY + #undef AFHDS2A_RX_A7105_INO #else #if defined(MULTI_TELEMETRY) && defined(MULTI_STATUS) #error You should choose either MULTI_TELEMETRY or MULTI_STATUS but not both. @@ -266,6 +269,10 @@ #undef FRSKYX_RX_TELEMETRY #undef FRSKYX_RX_CC2500_INO #endif + #if not defined(AFHDS2A_RX_A7105_INO) || not defined(AFHDS2A_RX_TELEMETRY) + #undef AFHDS2A_RX_TELEMETRY + #undef AFHDS2A_RX_A7105_INO + #endif #if not defined(BAYANG_NRF24L01_INO) #undef BAYANG_HUB_TELEMETRY #endif diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 6f71e8c..8c4b757 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -157,6 +157,7 @@ //The protocols below need an A7105 to be installed #define AFHDS2A_A7105_INO +#define AFHDS2A_RX_A7105_INO #define BUGS_A7105_INO #define FLYSKY_A7105_INO #define FLYZONE_A7105_INO @@ -286,6 +287,7 @@ #define HITEC_FW_TELEMETRY // Under development: Forward received telemetry packets to be decoded by ersky9x and OpenTX #define SCANNER_TELEMETRY // Forward spectrum scanner data to TX #define FRSKYX_RX_TELEMETRY // Forward channels data to TX +#define AFHDS2A_RX_TELEMETRY // Forward channels data to TX //SPORT_POLLING is an implementation of the same polling routine as XJT module for sport telemetry bidirectional communication. //This is useful for passing sport control frames from TX to RX(ex: changing Betaflight PID or VTX channels on the fly using LUA scripts with OpentX). @@ -476,6 +478,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= { PPM_IBUS PWM_SBUS PPM_SBUS + PROTO_AFHDS2A_RX + NONE PROTO_ASSAN NONE PROTO_BAYANG