26 lines
696 B
C
26 lines
696 B
C
# ifndef CONFIG
|
||
# define CONFIG
|
||
# include "config.h"
|
||
# endif
|
||
|
||
/* UART 接收缓冲 (放在 xdata) */
|
||
static uint8 __xdata uart_rx_buf[UART_BUF_SIZE];
|
||
|
||
void UART_Init(void);
|
||
void SBUS_Init(void);
|
||
void CRFS_Init(void);
|
||
|
||
void UART_Receive(void) __interrupt(4);
|
||
|
||
void UART_SendByte(uint8 dat);
|
||
void UART_SendString(uint8 size, char *str);
|
||
void UART_ParseCommand(void);
|
||
|
||
/* 转换数据为sbus信号输出
|
||
* sbus为25字节固定信号,数据结构如下:
|
||
* Byte 1 | 帧头(固定为0x0F)
|
||
* Byte 2-23 | 数据通道(16个11位数据)
|
||
* Byte 24 | 标志位(包含帧丢失、故障保护等)
|
||
* Byte 25 | 帧尾(固定为0x00)
|
||
*/
|
||
void SBUS_Update(RFDATA dat); |