makes GPIO_PIN_RST optional for the sx1276
[ExpressLRS.git] / src / lib / OTA / OTA.h
blob2a3d0820e12234a468f24837715bdaa71d6f004d
1 #ifndef H_OTA
2 #define H_OTA
4 #include <functional>
5 #include "CRSF.h"
7 // expresslrs packet header types
8 // 00 -> standard channel data packet
9 // 01 -> MSP data packet
10 // 11 -> TLM packet
11 // 10 -> sync packet
12 #define RC_DATA_PACKET 0b00
13 #define MSP_DATA_PACKET 0b01
14 #define TLM_PACKET 0b11
15 #define SYNC_PACKET 0b10
17 // Mask used to XOR the ModelId into the SYNC packet for ModelMatch
18 #define MODELMATCH_MASK 0x3f
20 enum OtaSwitchMode_e { sm1Bit, smHybrid, smHybridWide };
21 void OtaSetSwitchMode(OtaSwitchMode_e mode);
22 extern OtaSwitchMode_e OtaSwitchModeCurrent;
24 #if defined(TARGET_TX) || defined(UNIT_TEST)
25 typedef std::function<void (volatile uint8_t* Buffer, CRSF *crsf, bool TelemetryStatus, uint8_t nonce, uint8_t tlmDenom)> PackChannelData_t;
26 extern PackChannelData_t PackChannelData;
27 #if defined(UNIT_TEST)
28 void OtaSetHybrid8NextSwitchIndex(uint8_t idx);
29 #endif
30 #endif
32 #if defined(TARGET_RX) || defined(UNIT_TEST)
33 typedef std::function<bool (volatile uint8_t* Buffer, CRSF *crsf, uint8_t nonce, uint8_t tlmDenom)> UnpackChannelData_t;
34 extern UnpackChannelData_t UnpackChannelData;
35 #endif
37 #endif // H_OTA