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/>.
20 #define EXBUS_HEADER_LEN 6
21 #define EXBUS_CRC_LEN 2
22 #define EXBUS_OVERHEAD (EXBUS_HEADER_LEN + EXBUS_CRC_LEN)
23 #define EXBUS_MAX_CHANNEL_FRAME_SIZE (EXBUS_HEADER_LEN + JETIEXBUS_CHANNEL_COUNT*2 + EXBUS_CRC_LEN)
24 #define EXBUS_MAX_REQUEST_FRAME_SIZE 9
26 #define EXBUS_EX_REQUEST (0x3A)
29 EXBUS_HEADER_SYNC
= 0,
32 EXBUS_HEADER_PACKET_ID
,
40 EXBUS_STATE_IN_PROGRESS
,
45 extern uint8_t jetiExBusRequestState
;
46 extern uint32_t jetiTimeStampRequest
;
47 extern uint8_t jetiExBusRequestFrame
[EXBUS_MAX_REQUEST_FRAME_SIZE
];
49 extern struct serialPort_s
*jetiExBusPort
;
51 uint16_t jetiExBusCalcCRC16(uint8_t *pt
, uint8_t msgLen
);
52 bool jetiExBusInit(const rxConfig_t
*rxConfig
, rxRuntimeConfig_t
*rxRuntimeConfig
);