Set blackbox file handler to NULL after closing file
[inav.git] / src / main / rx / spektrum.h
blobc63396b4a9edce2b0a2854dd8191434a3c078c73
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT 12
21 #define SPEKTRUM_2048_CHANNEL_COUNT 12
22 #define SPEKTRUM_1024_CHANNEL_COUNT 7
24 #define SPEKTRUM_SAT_BIND_DISABLED 0
25 #define SPEKTRUM_SAT_BIND_MAX 10
27 #define SPEK_FRAME_SIZE 16
28 #define SRXL_FRAME_OVERHEAD 5
29 #define SRXL_FRAME_SIZE_MAX (SPEK_FRAME_SIZE + SRXL_FRAME_OVERHEAD)
31 #define SPEKTRUM_NEEDED_FRAME_INTERVAL 5000
33 #define SPEKTRUM_BAUDRATE 115200
35 extern bool srxlEnabled;
37 void spektrumBind(rxConfig_t *rxConfig);
38 bool spektrumInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig);
40 bool srxlTelemetryBufferEmpty(void);
41 void srxlRxWriteTelemetryData(const void *data, int len);
42 bool srxlRxIsActive(void);