mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 18:28:15 +00:00
OMP: new protocol intial release
Untested!!!
This commit is contained in:
parent
4e0fccfc63
commit
b1e4daf1c2
@ -73,3 +73,4 @@
|
||||
73,Kyosho
|
||||
74,RadioLink,Surface
|
||||
76,Realacc,R11
|
||||
77,OMP
|
@ -89,6 +89,7 @@ const char STR_SKYARTEC[] ="Skyartc";
|
||||
const char STR_KYOSHO[] ="Kyosho";
|
||||
const char STR_RLINK[] ="RadLink";
|
||||
const char STR_REALACC[] ="Realacc";
|
||||
const char STR_OMP[] ="OMP";
|
||||
const char STR_TEST[] ="Test";
|
||||
const char STR_FAKE[] ="Fake";
|
||||
|
||||
@ -307,6 +308,9 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(NCC1701_NRF24L01_INO)
|
||||
{PROTO_NCC1701, STR_NCC1701, 0, NO_SUBTYPE, OPTION_NONE },
|
||||
#endif
|
||||
#if defined(OMP_NRF24L01_INO)
|
||||
{PROTO_OMP, STR_OMP, 0, NO_SUBTYPE, OPTION_RFTUNE },
|
||||
#endif
|
||||
#if defined(PELIKAN_A7105_INO)
|
||||
{PROTO_PELIKAN, STR_PELIKAN , 2, STR_SUBTYPE_PELIKAN, OPTION_NONE },
|
||||
#endif
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 1
|
||||
#define VERSION_PATCH_LEVEL 55
|
||||
#define VERSION_PATCH_LEVEL 56
|
||||
|
||||
//******************
|
||||
// Protocols
|
||||
@ -102,6 +102,7 @@ enum PROTOCOLS
|
||||
PROTO_KYOSHO = 73, // =>A7105
|
||||
PROTO_RLINK = 74, // =>CC2500
|
||||
PROTO_REALACC = 76, // =>NRF24L01
|
||||
PROTO_OMP = 77, // =>NRF24L01
|
||||
|
||||
PROTO_FAKE = 126, // =>CC2500+NRF24L01
|
||||
PROTO_TEST = 127, // =>CC2500
|
||||
@ -811,6 +812,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
KYOSHO 73
|
||||
RLINK 74
|
||||
REALACC 76
|
||||
OMP 77
|
||||
BindBit=> 0x80 1=Bind/0=No
|
||||
AutoBindBit=> 0x40 1=Yes /0=No
|
||||
RangeCheck=> 0x20 1=Yes /0=No
|
||||
|
@ -1604,6 +1604,12 @@ static void protocol_init()
|
||||
remote_callback = REALACC_callback;
|
||||
break;
|
||||
#endif
|
||||
#if defined(OMP_NRF24L01_INO)
|
||||
case PROTO_OMP:
|
||||
next_callback=initOMP();
|
||||
remote_callback = OMP_callback;
|
||||
break;
|
||||
#endif
|
||||
#if defined(TEST_CC2500_INO)
|
||||
case PROTO_TEST:
|
||||
next_callback=initTEST();
|
||||
|
135
Multiprotocol/OMP_nrf24l01.ino
Normal file
135
Multiprotocol/OMP_nrf24l01.ino
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
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(OMP_NRF24L01_INO)
|
||||
|
||||
#include "iface_nrf250k.h"
|
||||
|
||||
#define FORCE_OMP_ORIGINAL_ID
|
||||
|
||||
#define OMP_INITIAL_WAIT 500
|
||||
#define OMP_PACKET_PERIOD 5000
|
||||
#define OMP_RF_BIND_CHANNEL 35
|
||||
#define OMP_RF_NUM_CHANNELS 8
|
||||
#define OMP_PAYLOAD_SIZE 16
|
||||
#define OMP_BIND_COUNT 600 //3sec
|
||||
|
||||
static void __attribute__((unused)) OMP_send_packet()
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
memcpy(packet,"BND",3);
|
||||
memcpy(&packet[3],rx_tx_addr,5);
|
||||
memcpy(&packet[8],hopping_frequency,8);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(packet,0x00,OMP_PAYLOAD_SIZE);
|
||||
|
||||
//hopping frequency
|
||||
packet[0 ] = hopping_frequency_no; // |0x40 to request RX telemetry
|
||||
XN297L_Hopping(hopping_frequency_no);
|
||||
hopping_frequency_no++;
|
||||
hopping_frequency_no &= OMP_RF_NUM_CHANNELS-1; // 8 RF channels
|
||||
|
||||
//flags
|
||||
packet[1 ] = 0x08 //unknown
|
||||
| GET_FLAG(CH5_SW, 0x20); // HOLD
|
||||
|
||||
packet[2 ] = 0x40; //unknown
|
||||
|
||||
if(Channel_data[CH6] > CHANNEL_MAX_COMMAND)
|
||||
packet[2 ] |= 0x20; // IDLE2
|
||||
else if(Channel_data[CH6] > CHANNEL_MIN_COMMAND)
|
||||
packet[1 ] |= 0x40; // IDLE1
|
||||
|
||||
if(Channel_data[CH7] > CHANNEL_MAX_COMMAND)
|
||||
packet[2 ] |= 0x08; // 3D
|
||||
else if(Channel_data[CH7] > CHANNEL_MIN_COMMAND)
|
||||
packet[2 ] |= 0x04; // ATTITUDE
|
||||
|
||||
//trims??
|
||||
//packet[3..6]
|
||||
|
||||
//channels TAER packed 11bits
|
||||
uint16_t channel=convert_channel_16b_limit(THROTTLE,0,2047);
|
||||
packet[7 ] = channel;
|
||||
packet[8 ] = channel>>8;
|
||||
channel=convert_channel_16b_limit(AILERON,0,2047);
|
||||
packet[8 ] |= channel<<3;
|
||||
packet[9 ] = channel>>5;
|
||||
channel=convert_channel_16b_limit(ELEVATOR,0,2047);
|
||||
packet[10] |= channel<<6;
|
||||
packet[11] = channel>>2;
|
||||
packet[12] = channel>>10;
|
||||
channel=convert_channel_16b_limit(RUDDER,0,2047);
|
||||
packet[12] |= channel<<1;
|
||||
packet[13] = channel>>8;
|
||||
|
||||
//unknown
|
||||
//packet[13] = 0x00;
|
||||
//packet[14] = 0x00;
|
||||
packet[15] = 0x04;
|
||||
}
|
||||
|
||||
XN297L_SetPower(); // Set tx_power
|
||||
XN297L_SetFreqOffset(); // Set frequency offset
|
||||
XN297L_WriteEnhancedPayload(packet, OMP_PAYLOAD_SIZE, IS_BIND_IN_PROGRESS);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) OMP_init()
|
||||
{
|
||||
XN297L_Init();
|
||||
XN297L_SetTXAddr((uint8_t*)"FLPBD", 5);
|
||||
XN297L_HoppingCalib(OMP_RF_NUM_CHANNELS); // Calibrate all channels
|
||||
XN297L_RFChannel(OMP_RF_BIND_CHANNEL); // Set bind channel
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) OMP_initialize_txid()
|
||||
{
|
||||
calc_fh_channels(OMP_RF_NUM_CHANNELS);
|
||||
#ifdef FORCE_OMP_ORIGINAL_ID
|
||||
rx_tx_addr[0]=0x4E;
|
||||
rx_tx_addr[1]=0x72;
|
||||
rx_tx_addr[2]=0x8E;
|
||||
rx_tx_addr[3]=0x70;
|
||||
rx_tx_addr[4]=0x62;
|
||||
for(uint8_t i=0; i<OMP_RF_NUM_CHANNELS;i++)
|
||||
hopping_frequency[i]=(i+3)*5;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t OMP_callback()
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
if(--bind_counter==0)
|
||||
BIND_DONE;
|
||||
OMP_send_packet();
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(OMP_PACKET_PERIOD);
|
||||
#endif
|
||||
return OMP_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
uint16_t initOMP()
|
||||
{
|
||||
OMP_initialize_txid();
|
||||
OMP_init();
|
||||
hopping_frequency_no = 0;
|
||||
bind_counter=OMP_BIND_COUNT;
|
||||
return OMP_INITIAL_WAIT;
|
||||
}
|
||||
|
||||
#endif
|
@ -281,6 +281,7 @@
|
||||
#undef MJXQ_NRF24L01_INO
|
||||
#undef MT99XX_NRF24L01_INO
|
||||
#undef NCC1701_NRF24L01_INO
|
||||
#undef OMP_NRF24L01_INO
|
||||
#undef POTENSIC_NRF24L01_INO
|
||||
#undef PROPEL_NRF24L01_INO
|
||||
#undef Q303_NRF24L01_INO
|
||||
|
@ -227,6 +227,7 @@
|
||||
#define MJXQ_NRF24L01_INO
|
||||
#define MT99XX_NRF24L01_INO
|
||||
#define NCC1701_NRF24L01_INO
|
||||
#define OMP_NRF24L01_INO
|
||||
#define POTENSIC_NRF24L01_INO
|
||||
#define PROPEL_NRF24L01_INO
|
||||
#define Q303_NRF24L01_INO
|
||||
@ -683,6 +684,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
FY805
|
||||
PROTO_NCC1701
|
||||
NONE
|
||||
PROTO_OMP
|
||||
NONE
|
||||
PROTO_PELIKAN
|
||||
PELIKAN_PRO
|
||||
PELIKAN_LITE
|
||||
|
@ -93,7 +93,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[Frsky_RX](Protocols_Details.md#FRSKY_RX---55)|55|RX|CloneTX|||||||CC2500|
|
||||
[FX816](Protocols_Details.md#FX816---58)|28|FX816|P38|||||||NRF24L01|
|
||||
[FY326](Protocols_Details.md#FY326---20)|20|FY326|FY319|||||||NRF24L01|
|
||||
[GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|
|
||||
[GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|XN297L
|
||||
[GW008](Protocols_Details.md#GW008---32)|32|GW008||||||||NRF24L01|XN297
|
||||
[H8_3D](Protocols_Details.md#H8_3D---36)|36|H8_3D|H20H|H20Mini|H30Mini|||||NRF24L01|XN297
|
||||
[Height](Protocols_Details.md#HEIGHT---53)|53|5ch|8ch|||||||A7105|
|
||||
@ -110,6 +110,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[MJXq](Protocols_Details.md#MJXQ---18)|18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297
|
||||
[MT99xx](Protocols_Details.md#MT99XX---17)|17|MT|H7|YZ|LS|FY805||||NRF24L01|XN297
|
||||
[NCC1701](Protocols_Details.md#NCC1701---44)|44|NCC1701||||||||NRF24L01|
|
||||
[OMP](Protocols_Details.md#OMP---77)|77|||||||||NRF24L01|XN297L
|
||||
[OpenLRS](Protocols_Details.md#OpenLRS---27)|27|||||||||None|
|
||||
[Pelikan](Protocols_Details.md#Pelikan---60)|60|Pro|Lite|||||||A7105|
|
||||
[Potensic](Protocols_Details.md#Potensic---51)|51|A20||||||||NRF24L01|XN297
|
||||
@ -1277,6 +1278,21 @@ CH1|CH2|CH3|CH4|CH5
|
||||
---|---|---|---|---
|
||||
A|E|T|R|Warp
|
||||
|
||||
## OMP - *77*
|
||||
Model: OMPHOBBY M2
|
||||
|
||||
This protocol is known to be problematic because it's using the xn297L emulation with a transmission speed of 250kbps therefore it doesn't work very well with every modules, this is an hardware issue with the accuracy of the components.
|
||||
|
||||
If the model does not respond well to inputs or hard to bind, you can try to switch the emulation from the default NRF24L01 RF component to the CC2500 by using an option value (freq tuning) different from 0. Option in this case is used for fine frequency tuning like any CC2500 protocols so check the [Frequency Tuning page](/docs/Frequency_Tuning.md).
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7
|
||||
---|---|---|---|---|---|---
|
||||
A|E|T|R|HOLD|IDLE|MODE
|
||||
|
||||
IDLE= 3 pos switch: -100% Idle0, 0% Idle1, +100% Idle2
|
||||
|
||||
MODE= 3 pos switch -100% Attitude, 0% Attitude, +100% 3D
|
||||
|
||||
## Potensic - *51*
|
||||
Model: Potensic A20
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user