APM:Libraries
serial_4way.h
Go to the documentation of this file.
1 /*
2  * based on Cleanflight 4way driver
3  *
4 */
5 #pragma once
6 
7 #include <stdint.h>
8 #include <stdbool.h>
9 
10 #include <AP_HAL/AP_HAL.h>
11 #include <hal.h>
12 #include <systick.h>
13 
14 #include "serial_4way_impl.h"
15 
16 #define USE_SERIAL_4WAY_BLHELI_BOOTLOADER
17 #define USE_SERIAL_4WAY_SK_BOOTLOADER
18 
19 #define imC2 0
20 #define imSIL_BLB 1
21 #define imATM_BLB 2
22 #define imSK 3
23 #define imARM_BLB 4
24 
25 
26 
27 typedef union __attribute__ ((packed)) {
28  uint8_t bytes[2];
29  uint16_t word;
31 
32 typedef union __attribute__ ((packed)) {
33  uint8_t bytes[4];
34  uint16_t words[2];
35  uint32_t dword;
37 
38 
39 extern uint16_t _crc_xmodem_update (uint16_t crc, uint8_t data);
40 extern bool isMcuConnected(void);
41 
42 extern uint8_t esc4wayInit(const uint8_t *output_channels, uint8_t nm);
43 
44 // rem: App: Wait at least appx. 500 ms for BLHeli to jump into
45 // bootloader mode before try to connect any ESC
46 // Start to activate here
47 extern void esc4wayProcess(AP_HAL::UARTDriver *uartPort);
48 
uint8_32_u
Definition: serial_4way.h:36
union __attribute__((packed))
Definition: serial_4way.h:27
bool isMcuConnected(void)
static const uint8_t * output_channels
Definition: RCOutput.cpp:143
uint8_16_u
Definition: serial_4way.h:30
void esc4wayProcess(AP_HAL::UARTDriver *uartPort)
uint16_t _crc_xmodem_update(uint16_t crc, uint8_t data)
uint8_t esc4wayInit(const uint8_t *output_channels, uint8_t nm)