- synchronize STM8 application and external flash layout updates\n- add assembly bootloader and assembly application test projects\n- add UART1 interrupt receive ring buffer\n- parse JDY-28M Mesh outer frames and source addresses\n- add CRC-16/MODBUS validation\n- implement relay control command 0x01 and response 0x81\n- support unicast and broadcast relay control frames\n- update host protocol, OTA documents, and serial tools
28 lines
679 B
C
28 lines
679 B
C
/**
|
|
* @file uart1.h
|
|
* @brief JDY-28M 使用的 UART1 抽象接口。
|
|
*/
|
|
#ifndef UART1_H
|
|
#define UART1_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/** 初始化 UART1,并开启接收中断和环形缓冲区。 */
|
|
void Uart1_Init(void);
|
|
|
|
/** UART任务入口;接收硬件由中断处理,此接口保留为空操作。 */
|
|
|
|
/** 向 UART1 发送一个字节。 */
|
|
void Uart1_WriteByte(uint8_t value);
|
|
|
|
/** 尝试读取一个接收字节,返回 1 表示读取成功。 */
|
|
uint8_t Uart1_ReadByte(uint8_t *value);
|
|
|
|
/** 返回接收环形缓冲区中尚未读取的字节数。 */
|
|
uint8_t Uart1_Available(void);
|
|
|
|
/** UART1 接收中断处理入口。 */
|
|
void Uart1_InterruptHandler(void);
|
|
|
|
#endif
|