mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Fixed H8_3D protocol. Minor optimisations to other protocols
This commit is contained in:
parent
796979b7a1
commit
c445ae8102
8 changed files with 49 additions and 52 deletions
|
@ -252,6 +252,18 @@ void NRF24L01_Initialize(uint8_t baseConfig)
|
||||||
// now in Standby mode
|
// now in Standby mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Common setup of registers
|
||||||
|
*/
|
||||||
|
void NRF24L01_Setup(void)
|
||||||
|
{
|
||||||
|
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No auto acknowledgment
|
||||||
|
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, BV(NRF24L01_02_EN_RXADDR_ERX_P0));
|
||||||
|
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, NRF24L01_03_SETUP_AW_5BYTES); // 5-byte RX/TX address
|
||||||
|
NRF24L01_WriteReg(NRF24L01_08_OBSERVE_TX, 0x00);
|
||||||
|
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enter standby mode
|
* Enter standby mode
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -136,6 +136,7 @@ void NRF24L01_FlushRx(void);
|
||||||
|
|
||||||
// Utility functions
|
// Utility functions
|
||||||
|
|
||||||
|
void NRF24L01_Setup(void);
|
||||||
void NRF24L01_SetStandbyMode(void);
|
void NRF24L01_SetStandbyMode(void);
|
||||||
void NRF24L01_SetRxMode(void);
|
void NRF24L01_SetRxMode(void);
|
||||||
void NRF24L01_SetTxMode(void);
|
void NRF24L01_SetTxMode(void);
|
||||||
|
|
|
@ -392,7 +392,6 @@ static const char * const lookupTableNRF24RX[] = {
|
||||||
"CX10",
|
"CX10",
|
||||||
"CX10A",
|
"CX10A",
|
||||||
"H8_3D",
|
"H8_3D",
|
||||||
"H8_3D_DEV",
|
|
||||||
"REF"
|
"REF"
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -522,7 +521,6 @@ typedef struct cliLookupTableConfig_s {
|
||||||
typedef union {
|
typedef union {
|
||||||
cliLookupTableConfig_t lookup;
|
cliLookupTableConfig_t lookup;
|
||||||
cliMinMaxConfig_t minmax;
|
cliMinMaxConfig_t minmax;
|
||||||
|
|
||||||
} cliValueConfig_t;
|
} cliValueConfig_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -85,6 +85,7 @@ STATIC_UNIT_TESTED protocol_state_t protocolState;
|
||||||
static uint8_t payloadSize;
|
static uint8_t payloadSize;
|
||||||
#define ACK_TO_SEND_COUNT 8
|
#define ACK_TO_SEND_COUNT 8
|
||||||
|
|
||||||
|
#define CRC_LEN 2
|
||||||
#define RX_TX_ADDR_LEN 5
|
#define RX_TX_ADDR_LEN 5
|
||||||
//STATIC_UNIT_TESTED uint8_t rxTxAddr[RX_TX_ADDR_LEN] = {0xcc, 0xcc, 0xcc, 0xcc, 0xcc};
|
//STATIC_UNIT_TESTED uint8_t rxTxAddr[RX_TX_ADDR_LEN] = {0xcc, 0xcc, 0xcc, 0xcc, 0xcc};
|
||||||
STATIC_UNIT_TESTED uint8_t txAddr[RX_TX_ADDR_LEN] = {0x55, 0x0F, 0x71, 0x0C, 0x00}; // converted XN297 address, 0xC710F55 (28 bit)
|
STATIC_UNIT_TESTED uint8_t txAddr[RX_TX_ADDR_LEN] = {0x55, 0x0F, 0x71, 0x0C, 0x00}; // converted XN297 address, 0xC710F55 (28 bit)
|
||||||
|
@ -97,8 +98,10 @@ STATIC_UNIT_TESTED uint8_t txId[TX_ID_LEN];
|
||||||
STATIC_UNIT_TESTED uint8_t cx10RfChannelIndex = 0;
|
STATIC_UNIT_TESTED uint8_t cx10RfChannelIndex = 0;
|
||||||
STATIC_UNIT_TESTED uint8_t cx10RfChannels[RF_CHANNEL_COUNT]; // channels are set using txId from bind packet
|
STATIC_UNIT_TESTED uint8_t cx10RfChannels[RF_CHANNEL_COUNT]; // channels are set using txId from bind packet
|
||||||
|
|
||||||
|
#define CX10_PROTOCOL_HOP_TIMEOUT 1500 // 1.5ms
|
||||||
|
#define CX10A_PROTOCOL_HOP_TIMEOUT 6500 // 6.5ms
|
||||||
|
static uint32_t hopTimeout;
|
||||||
static uint32_t timeOfLastHop;
|
static uint32_t timeOfLastHop;
|
||||||
static const uint32_t hopTimeout = 5000; // 5ms
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if it is a bind packet.
|
* Returns true if it is a bind packet.
|
||||||
|
@ -179,8 +182,8 @@ nrf24_received_t cx10DataReceived(uint8_t *payload)
|
||||||
|
|
||||||
switch (protocolState) {
|
switch (protocolState) {
|
||||||
case STATE_BIND:
|
case STATE_BIND:
|
||||||
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize + 2)) {
|
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize + CRC_LEN)) {
|
||||||
XN297_UnscramblePayload(payload, payloadSize + 2, rxAddr);
|
XN297_UnscramblePayload(payload, payloadSize + CRC_LEN, rxAddr);
|
||||||
const bool bindPacket = cx10CheckBindPacket(payload);
|
const bool bindPacket = cx10CheckBindPacket(payload);
|
||||||
if (bindPacket) {
|
if (bindPacket) {
|
||||||
// set the hopping channels as determined by the txId received in the bind packet
|
// set the hopping channels as determined by the txId received in the bind packet
|
||||||
|
@ -232,8 +235,8 @@ nrf24_received_t cx10DataReceived(uint8_t *payload)
|
||||||
case STATE_DATA:
|
case STATE_DATA:
|
||||||
timeNowUs = micros();
|
timeNowUs = micros();
|
||||||
// read the payload, processing of payload is deferred
|
// read the payload, processing of payload is deferred
|
||||||
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize + 2)) {
|
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize + CRC_LEN)) {
|
||||||
XN297_UnscramblePayload(payload, payloadSize + 2, rxAddr);
|
XN297_UnscramblePayload(payload, payloadSize + CRC_LEN, rxAddr);
|
||||||
cx10HopToNextChannel();
|
cx10HopToNextChannel();
|
||||||
timeOfLastHop = timeNowUs;
|
timeOfLastHop = timeNowUs;
|
||||||
ret = NRF24_RECEIVED_DATA;
|
ret = NRF24_RECEIVED_DATA;
|
||||||
|
@ -251,12 +254,11 @@ void cx10Nrf24Init(nrf24_protocol_t protocol)
|
||||||
cx10Protocol = protocol;
|
cx10Protocol = protocol;
|
||||||
protocolState = STATE_BIND;
|
protocolState = STATE_BIND;
|
||||||
payloadSize = (protocol == NRF24RX_CX10) ? CX10_PROTOCOL_PAYLOAD_SIZE : CX10A_PROTOCOL_PAYLOAD_SIZE;
|
payloadSize = (protocol == NRF24RX_CX10) ? CX10_PROTOCOL_PAYLOAD_SIZE : CX10A_PROTOCOL_PAYLOAD_SIZE;
|
||||||
|
hopTimeout = (protocol == NRF24RX_CX10) ? CX10_PROTOCOL_HOP_TIMEOUT : CX10A_PROTOCOL_HOP_TIMEOUT;
|
||||||
|
|
||||||
NRF24L01_Initialize(0); // sets PWR_UP, no CRC
|
NRF24L01_Initialize(0); // sets PWR_UP, no CRC
|
||||||
|
NRF24L01_Setup();
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0);
|
|
||||||
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, BV(NRF24L01_02_EN_RXADDR_ERX_P0)); // Enable data pipe 0 only
|
|
||||||
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, NRF24L01_03_SETUP_AW_5BYTES); // 5-byte RX/TX address
|
|
||||||
NRF24L01_SetChannel(CX10_RF_BIND_CHANNEL);
|
NRF24L01_SetChannel(CX10_RF_BIND_CHANNEL);
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_1Mbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_1Mbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
||||||
|
@ -265,10 +267,7 @@ void cx10Nrf24Init(nrf24_protocol_t protocol)
|
||||||
NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, txAddr, RX_TX_ADDR_LEN);
|
NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, txAddr, RX_TX_ADDR_LEN);
|
||||||
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxAddr, RX_TX_ADDR_LEN);
|
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxAddr, RX_TX_ADDR_LEN);
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_08_OBSERVE_TX, 0x00);
|
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize + CRC_LEN); // payload + 2 bytes CRC
|
||||||
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize + 2); // payload + 2 bytes CRC
|
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
|
|
||||||
|
|
||||||
NRF24L01_SetRxMode(); // enter receive mode to start listening for packets
|
NRF24L01_SetRxMode(); // enter receive mode to start listening for packets
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,6 @@
|
||||||
#define FLAG_CAMERA_UP 0x04 // on payload[18]
|
#define FLAG_CAMERA_UP 0x04 // on payload[18]
|
||||||
#define FLAG_CAMERA_DOWN 0x08 // on payload[18]
|
#define FLAG_CAMERA_DOWN 0x08 // on payload[18]
|
||||||
|
|
||||||
STATIC_UNIT_TESTED nrf24_protocol_t h8_3dProtocol;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
STATE_BIND = 0,
|
STATE_BIND = 0,
|
||||||
STATE_DATA
|
STATE_DATA
|
||||||
|
@ -181,7 +179,7 @@ static void h8_3dHopToNextChannel(void)
|
||||||
// The hopping channels are determined by the txId
|
// The hopping channels are determined by the txId
|
||||||
void h8_3dSetHoppingChannels(const uint8_t* txId)
|
void h8_3dSetHoppingChannels(const uint8_t* txId)
|
||||||
{
|
{
|
||||||
#ifndef XXX
|
#ifdef XXX
|
||||||
for (int ii = 0; ii < H8_3D_RF_CHANNEL_COUNT; ++ii) {
|
for (int ii = 0; ii < H8_3D_RF_CHANNEL_COUNT; ++ii) {
|
||||||
h8_3dRfChannels[ii] = 0x06 + (0x0f * ii) + ((txId[ii] >> 4) + (txId[ii] & 0x0f)) % 0x0f;
|
h8_3dRfChannels[ii] = 0x06 + (0x0f * ii) + ((txId[ii] >> 4) + (txId[ii] & 0x0f)) % 0x0f;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +235,7 @@ nrf24_received_t h8_3dDataReceived(uint8_t *payload)
|
||||||
case STATE_DATA:
|
case STATE_DATA:
|
||||||
// read the payload, processing of payload is deferred
|
// read the payload, processing of payload is deferred
|
||||||
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize)) {
|
if (NRF24L01_ReadPayloadIfAvailable(payload, payloadSize)) {
|
||||||
const uint16_t crc = XN297_UnscramblePayload(payload - CRC_LEN, payloadSize, rxTxAddrXN297);
|
const uint16_t crc = XN297_UnscramblePayload(payload, payloadSize - CRC_LEN, rxTxAddrXN297);
|
||||||
if (crcOK(crc, payload)) {
|
if (crcOK(crc, payload)) {
|
||||||
ret = NRF24_RECEIVED_DATA;
|
ret = NRF24_RECEIVED_DATA;
|
||||||
}
|
}
|
||||||
|
@ -252,29 +250,24 @@ nrf24_received_t h8_3dDataReceived(uint8_t *payload)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void h8_3dNrf24Init(nrf24_protocol_t protocol, const uint8_t* nrf24_id)
|
void h8_3dNrf24Init(nrf24_protocol_t protocol, uint32_t nrf24_id)
|
||||||
{
|
{
|
||||||
h8_3dProtocol = protocol;
|
UNUSED(protocol);
|
||||||
protocolState = STATE_BIND;
|
protocolState = STATE_BIND;
|
||||||
|
|
||||||
NRF24L01_Initialize(0); // sets PWR_UP, no CRC - hardware CRC not used for XN297
|
NRF24L01_Initialize(0); // sets PWR_UP, no CRC - hardware CRC not used for XN297
|
||||||
|
NRF24L01_Setup();
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0); // No auto acknowledgment
|
|
||||||
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, BV(NRF24L01_02_EN_RXADDR_ERX_P0));
|
|
||||||
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, NRF24L01_03_SETUP_AW_5BYTES); // 5-byte RX/TX address
|
|
||||||
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_1Mbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_1Mbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
||||||
// RX_ADDR for pipes P1-P5 are left at default values
|
// RX_ADDR for pipes P1-P5 are left at default values
|
||||||
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxTxAddrXN297, RX_TX_ADDR_LEN);
|
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxTxAddrXN297, RX_TX_ADDR_LEN);
|
||||||
if ((nrf24_id[0] | nrf24_id[1] | nrf24_id[2] | nrf24_id[3]) == 0) {
|
if (nrf24_id == 0) {
|
||||||
h8_3dRfChannelIndex = H8_3D_RF_BIND_CHANNEL_START;
|
h8_3dRfChannelIndex = H8_3D_RF_BIND_CHANNEL_START;
|
||||||
NRF24L01_SetChannel(H8_3D_RF_BIND_CHANNEL_START);
|
NRF24L01_SetChannel(H8_3D_RF_BIND_CHANNEL_START);
|
||||||
} else {
|
} else {
|
||||||
h8_3dSetBound(nrf24_id);
|
h8_3dSetBound((uint8_t*)&nrf24_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_08_OBSERVE_TX, 0x00);
|
|
||||||
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
|
|
||||||
|
|
||||||
payloadSize = H8_3D_PROTOCOL_PAYLOAD_SIZE + CRC_LEN; // payload + 2 bytes CRC
|
payloadSize = H8_3D_PROTOCOL_PAYLOAD_SIZE + CRC_LEN; // payload + 2 bytes CRC
|
||||||
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize); // payload + 2 bytes CRC
|
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize); // payload + 2 bytes CRC
|
||||||
|
|
||||||
|
@ -284,6 +277,6 @@ void h8_3dNrf24Init(nrf24_protocol_t protocol, const uint8_t* nrf24_id)
|
||||||
void h8_3dInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
void h8_3dInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
{
|
{
|
||||||
rxRuntimeConfig->channelCount = RC_CHANNEL_COUNT;
|
rxRuntimeConfig->channelCount = RC_CHANNEL_COUNT;
|
||||||
h8_3dNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, rxConfig->nrf24rx_id);
|
h8_3dNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -220,34 +220,25 @@ nrf24_received_t refDataReceived(uint8_t *payload)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void refNrf24Init(nrf24_protocol_t protocol, const uint8_t* nrf24_id)
|
void refNrf24Init(nrf24_protocol_t protocol, uint32_t nrf24_id)
|
||||||
{
|
{
|
||||||
UNUSED(protocol);
|
UNUSED(protocol);
|
||||||
UNUSED(nrf24_id);
|
|
||||||
|
|
||||||
NRF24L01_Initialize(BV(NRF24L01_00_CONFIG_EN_CRC) | BV( NRF24L01_00_CONFIG_CRCO)); // sets PWR_UP, EN_CRC, CRCO - 2 byte CRC
|
NRF24L01_Initialize(BV(NRF24L01_00_CONFIG_EN_CRC) | BV( NRF24L01_00_CONFIG_CRCO)); // sets PWR_UP, EN_CRC, CRCO - 2 byte CRC
|
||||||
|
NRF24L01_Setup();
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_01_EN_AA, 0x00); // No auto acknowledgment
|
if (nrf24_id == 0) {
|
||||||
NRF24L01_WriteReg(NRF24L01_02_EN_RXADDR, BV(NRF24L01_02_EN_RXADDR_ERX_P0));
|
|
||||||
NRF24L01_WriteReg(NRF24L01_03_SETUP_AW, NRF24L01_03_SETUP_AW_5BYTES); // 5-byte RX/TX address
|
|
||||||
//if ((nrf24_id != NULL) && ((nrf24_id[0] | nrf24_id[1] | nrf24_id[2] | nrf24_id[3] | nrf24_id[4]) == 0)) {
|
|
||||||
protocolState = STATE_BIND;
|
protocolState = STATE_BIND;
|
||||||
NRF24L01_SetChannel(REF_RF_BIND_CHANNEL);
|
NRF24L01_SetChannel(REF_RF_BIND_CHANNEL);
|
||||||
/*} else {
|
} else {
|
||||||
rxTxAddr[0] = nrf24_id[0];
|
memcpy(rxTxAddr, (uint8_t*)nrf24_id, sizeof(uint32_t));
|
||||||
rxTxAddr[1] = nrf24_id[1];
|
rxTxAddr[4] = 0xD2;
|
||||||
rxTxAddr[2] = nrf24_id[2];
|
refSetBound();
|
||||||
rxTxAddr[3] = nrf24_id[3];
|
}
|
||||||
rxTxAddr[4] = nrf24_id[4];
|
|
||||||
refSetBound(nrf24_id);
|
|
||||||
}*/
|
|
||||||
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_250Kbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
NRF24L01_WriteReg(NRF24L01_06_RF_SETUP, NRF24L01_06_RF_SETUP_RF_DR_250Kbps | NRF24L01_06_RF_SETUP_RF_PWR_n12dbm);
|
||||||
// RX_ADDR for pipes P1-P5 are left at default values
|
// RX_ADDR for pipes P1-P5 are left at default values
|
||||||
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxTxAddr, RX_TX_ADDR_LEN);
|
NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rxTxAddr, RX_TX_ADDR_LEN);
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_08_OBSERVE_TX, 0x00);
|
|
||||||
NRF24L01_WriteReg(NRF24L01_1C_DYNPD, 0x00); // Disable dynamic payload length on all pipes
|
|
||||||
|
|
||||||
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize);
|
NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, payloadSize);
|
||||||
NRF24L01_SetRxMode(); // enter receive mode to start listening for packets
|
NRF24L01_SetRxMode(); // enter receive mode to start listening for packets
|
||||||
}
|
}
|
||||||
|
@ -255,8 +246,8 @@ void refNrf24Init(nrf24_protocol_t protocol, const uint8_t* nrf24_id)
|
||||||
void refInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
void refInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig)
|
||||||
{
|
{
|
||||||
rxRuntimeConfig->channelCount = RC_CHANNEL_COUNT;
|
rxRuntimeConfig->channelCount = RC_CHANNEL_COUNT;
|
||||||
//refNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, rxConfig->nrf24rx_address);
|
//refNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, rxConfig->nrf24rx_id);
|
||||||
refNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, NULL);
|
refNrf24Init((nrf24_protocol_t)rxConfig->nrf24rx_protocol, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -108,12 +108,11 @@ typedef struct rxChannelRangeConfiguration_s {
|
||||||
uint16_t max;
|
uint16_t max;
|
||||||
} rxChannelRangeConfiguration_t;
|
} rxChannelRangeConfiguration_t;
|
||||||
|
|
||||||
#define NRF24RX_ID_LEN 5
|
|
||||||
typedef struct rxConfig_s {
|
typedef struct rxConfig_s {
|
||||||
uint8_t rcmap[MAX_MAPPABLE_RX_INPUTS]; // mapping of radio channels to internal RPYTA+ order
|
uint8_t rcmap[MAX_MAPPABLE_RX_INPUTS]; // mapping of radio channels to internal RPYTA+ order
|
||||||
uint8_t serialrx_provider; // type of UART-based receiver (0 = spek 10, 1 = spek 11, 2 = sbus). Must be enabled by FEATURE_RX_SERIAL first.
|
uint8_t serialrx_provider; // type of UART-based receiver (0 = spek 10, 1 = spek 11, 2 = sbus). Must be enabled by FEATURE_RX_SERIAL first.
|
||||||
uint8_t nrf24rx_protocol; // type of nrf24 protocol (0 = v202 250kbps). Must be enabled by FEATURE_RX_NRF24 first.
|
uint8_t nrf24rx_protocol; // type of nrf24 protocol (0 = v202 250kbps). Must be enabled by FEATURE_RX_NRF24 first.
|
||||||
uint8_t nrf24rx_id[NRF24RX_ID_LEN];
|
uint32_t nrf24rx_id;
|
||||||
uint8_t spektrum_sat_bind; // number of bind pulses for Spektrum satellite receivers
|
uint8_t spektrum_sat_bind; // number of bind pulses for Spektrum satellite receivers
|
||||||
uint8_t rssi_channel;
|
uint8_t rssi_channel;
|
||||||
uint8_t rssi_scale;
|
uint8_t rssi_scale;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define ACC
|
#define ACC
|
||||||
#define USE_ACC_MPU6050
|
#define USE_ACC_MPU6050
|
||||||
|
|
||||||
#define MAG
|
//#define MAG
|
||||||
#define USE_MAG_HMC5883
|
#define USE_MAG_HMC5883
|
||||||
|
|
||||||
#define USE_USART1
|
#define USE_USART1
|
||||||
|
@ -66,11 +66,15 @@
|
||||||
|
|
||||||
#define USE_RX_NRF24
|
#define USE_RX_NRF24
|
||||||
#define USE_RX_CX10
|
#define USE_RX_CX10
|
||||||
|
#define USE_RX_H8_3D
|
||||||
#define USE_RX_REF
|
#define USE_RX_REF
|
||||||
#define USE_RX_SYMA
|
#define USE_RX_SYMA
|
||||||
#define USE_RX_V202
|
#define USE_RX_V202
|
||||||
#define NRF24_DEFAULT_PROTOCOL NRF24RX_SYMA_X5C
|
//#define NRF24_DEFAULT_PROTOCOL NRF24RX_SYMA_X5C
|
||||||
//#define NRF24_DEFAULT_PROTOCOL NRF24RX_REF
|
//#define NRF24_DEFAULT_PROTOCOL NRF24RX_REF
|
||||||
|
//#define NRF24_DEFAULT_PROTOCOL NRF24RX_H8_3D
|
||||||
|
//#define NRF24_DEFAULT_PROTOCOL NRF24RX_CX10A
|
||||||
|
#define NRF24_DEFAULT_PROTOCOL NRF24RX_V202_1M
|
||||||
|
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_NRF24
|
#define DEFAULT_RX_FEATURE FEATURE_RX_NRF24
|
||||||
#define SKIP_RX_PWM_PPM
|
#define SKIP_RX_PWM_PPM
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue