2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #include "rx/crsf_protocol.h"
26 #define CRSF_PORT_OPTIONS (SERIAL_STOPBITS_1 | SERIAL_PARITY_NO)
27 #define CRSF_PORT_MODE MODE_RXTX
29 #define CRSF_MAX_CHANNEL 16
31 #define CRSF_RSSI_MIN (-130)
32 #define CRSF_RSSI_MAX 0
33 #define CRSF_SNR_MIN (-30)
34 #define CRSF_SNR_MAX 20
36 /* For documentation purposes
38 CRSF_RF_MODE_4_FPS = 0,
44 typedef struct crsfFrameDef_s
{
45 uint8_t deviceAddress
;
48 uint8_t payload
[CRSF_PAYLOAD_SIZE_MAX
+ 1]; // +1 for CRC at end of payload
51 typedef union crsfFrame_u
{
52 uint8_t bytes
[CRSF_FRAME_SIZE_MAX
];
56 void crsfRxWriteTelemetryData(const void *data
, int len
);
57 void crsfRxSendTelemetryData(void);
60 struct rxRuntimeState_s
;
61 bool crsfRxInit(const struct rxConfig_s
*initialRxConfig
, struct rxRuntimeState_s
*rxRuntimeState
);
62 bool crsfRxIsActive(void);