FX/QF012 telemetry

This commit is contained in:
pascallanger 2025-03-21 21:48:29 +01:00
parent 889e01c7c6
commit 2ac4745c62
2 changed files with 15 additions and 9 deletions

View File

@ -40,6 +40,9 @@ Multiprotocol is distributed in the hope that it will be useful,
#define FX9630_NUM_CHANNELS 3 #define FX9630_NUM_CHANNELS 3
#define FX9630_WRITE_TIME 500 #define FX9630_WRITE_TIME 500
#define FX_QF012_BIND_PACKET_PERIOD 12194
#define FX_QF012_RX_PAYLOAD_SIZE 3
//#define FORCE_FX620_ID //#define FORCE_FX620_ID
//#define FORCE_FX9630_ID //#define FORCE_FX9630_ID
//#define FORCE_QIDI_ID //#define FORCE_QIDI_ID
@ -83,7 +86,7 @@ static void __attribute__((unused)) FX_send_packet()
//Channels //Channels
uint8_t val; uint8_t val;
if (sub_protocol >= FX9630) if (sub_protocol >= FX9630)
{ // FX9630 & FX_Q560 { // FX9630 & FX_Q560 & FX_QF012
packet[0] = convert_channel_8b(THROTTLE); packet[0] = convert_channel_8b(THROTTLE);
packet[1] = convert_channel_8b(AILERON); packet[1] = convert_channel_8b(AILERON);
packet[2] = 0xFF - convert_channel_8b(ELEVATOR); packet[2] = 0xFF - convert_channel_8b(ELEVATOR);
@ -102,7 +105,7 @@ static void __attribute__((unused)) FX_send_packet()
packet[5] |= GET_FLAG(CH7_SW, 0x40) // QF012 invert flight packet[5] |= GET_FLAG(CH7_SW, 0x40) // QF012 invert flight
| GET_FLAG(CH8_SW, 0x80); // QF012 Restore fine tunning midpoint | GET_FLAG(CH8_SW, 0x80); // QF012 Restore fine tunning midpoint
} }
else // FX816 and FX620 else // FX816 & FX620
{ {
uint8_t offset=sub_protocol == FX816 ? FX816_CH_OFFSET:FX620_CH_OFFSET; uint8_t offset=sub_protocol == FX816 ? FX816_CH_OFFSET:FX620_CH_OFFSET;
val=convert_channel_8b(AILERON); val=convert_channel_8b(AILERON);
@ -140,7 +143,7 @@ static void __attribute__((unused)) FX_send_packet()
packet[5] = 0xAB; // Is it based on ID?? packet[5] = 0xAB; // Is it based on ID??
} }
} }
else // FX9630 & FX_Q560 else // FX9630 & FX_Q560 & FX_QF012
{ {
if(IS_BIND_IN_PROGRESS) if(IS_BIND_IN_PROGRESS)
{ {
@ -196,7 +199,7 @@ static void __attribute__((unused)) FX_RF_init()
{ {
XN297_SetTXAddr((uint8_t *)"\x56\x78\x90\x12", 4); XN297_SetTXAddr((uint8_t *)"\x56\x78\x90\x12", 4);
XN297_RFChannel(FX9630_BIND_CHANNEL); XN297_RFChannel(FX9630_BIND_CHANNEL);
packet_period = FX9630_BIND_PACKET_PERIOD; packet_period = sub_protocol == FX_QF012 ? FX_QF012_BIND_PACKET_PERIOD : FX9630_BIND_PACKET_PERIOD;
packet_length = FX9630_PAYLOAD_SIZE; packet_length = FX9630_PAYLOAD_SIZE;
} }
} }
@ -273,7 +276,7 @@ uint16_t FX_callback()
{ // FX9630 & FX_Q560 & FX_QF012 { // FX9630 & FX_Q560 & FX_QF012
XN297_SetTXAddr(rx_tx_addr, 4); XN297_SetTXAddr(rx_tx_addr, 4);
#ifdef FX_HUB_TELEMETRY #ifdef FX_HUB_TELEMETRY
XN297_SetRXAddr(rx_tx_addr,packet_length); XN297_SetRXAddr(rx_tx_addr, FX_QF012_RX_PAYLOAD_SIZE);
#endif #endif
} }
} }
@ -284,12 +287,13 @@ uint16_t FX_callback()
if(rx) if(rx)
{ {
debug("RX"); debug("RX");
if(XN297_ReadPayload(packet_in, packet_length)) if(XN297_ReadPayload(packet_in, FX_QF012_RX_PAYLOAD_SIZE))
{//Good CRC {//Good CRC
//packets: A5 00 11 -> A5 01 11
telemetry_link = 1; telemetry_link = 1;
//v_lipo1 = packet_in[1] == 0x03 ? 0x00:0xFF; // low voltage v_lipo1 = packet_in[1] == 0x01 ? 60:81; // low voltage
#if 1 #if 0
for(uint8_t i=0; i < packet_length; i++) for(uint8_t i=0; i < FX_QF012_RX_PAYLOAD_SIZE; i++)
debug(" %02X", packet_in[i]); debug(" %02X", packet_in[i]);
#endif #endif
} }

View File

@ -1877,6 +1877,8 @@ Gyro: -100%=6G, 0%=3D+Gyro, +100%=3D
### Sub_protocol QF012 - *4* ### Sub_protocol QF012 - *4*
Model: QF012 SBD Dauntless Model: QF012 SBD Dauntless
Telemetry supported and gives a battery status of ok/empty in A1 (4.2V -> 3.1V) and RSSI gets a dummy value of 100.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8 CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8
---|---|---|---|---|---|---|--- ---|---|---|---|---|---|---|---
A|E|T|R|FLIP|GYRO|Invert|Reset A|E|T|R|FLIP|GYRO|Invert|Reset