Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / rx / spektrum.h
blob3825be93bcecc7f4cfa35aa1fd4317410956486e
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #define SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT 12
24 #define SPEKTRUM_2048_CHANNEL_COUNT 12
25 #define SPEKTRUM_1024_CHANNEL_COUNT 7
27 #define SPEKTRUM_SAT_BIND_DISABLED 0
28 #define SPEKTRUM_SAT_BIND_MAX 10
30 #define SPEK_FRAME_SIZE 16
31 #define SRXL_FRAME_OVERHEAD 5
32 #define SRXL_FRAME_SIZE_MAX (SPEK_FRAME_SIZE + SRXL_FRAME_OVERHEAD)
34 #define SPEKTRUM_NEEDED_FRAME_INTERVAL 5000
35 #define SPEKTRUM_TELEMETRY_FRAME_DELAY 1000 // Gap between received Rc frame and transmited TM frame, uS
37 #define SPEKTRUM_BAUDRATE 115200
40 // Spektrum system type values
41 #define SPEKTRUM_DSM2_22 0x01
42 #define SPEKTRUM_DSM2_11 0x12
43 #define SPEKTRUM_DSMX_22 0xa2
44 #define SPEKTRUM_DSMX_11 0xb2
46 extern uint32_t spekChannelData[SPEKTRUM_MAX_SUPPORTED_CHANNEL_COUNT];
48 extern bool srxlEnabled;
49 extern int32_t resolution;
50 extern uint8_t rssi_channel; // Stores the RX RSSI channel.
52 void spektrumBind(rxConfig_t *rxConfig);
53 bool spektrumInit(const rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig);
55 void srxlRxWriteTelemetryData(const void *data, int len);
56 bool srxlRxIsActive(void);