| 1234567891011121314151617181920212223 |
- #ifndef __MID_CPLD_USART_H
- #define __MID_CPLD_USART_H
- #include <stdint.h>
- /* 本模块专用 USART3:PB10=TX, PB11=RX, 波特率 921600 */
- #define MID_CPLD_USART_STREAM_SIZE 4096
- #define MID_CPLD_USART_RX_DMA_SIZE 1024
- #define MID_CPLD_USART_TX_TASK_PRIORITY 3
- #define MID_CPLD_USART_TX_TASK_STACK 512
- void Mid_cpld_usart_init(void);
- uint32_t Mid_cpld_usart_send(const uint8_t *data, uint32_t len);
- uint16_t Mid_cpld_usart_available(void);
- uint32_t Mid_cpld_usart_read(uint8_t *buf, uint32_t len);
- /* RX 接收错误自愈次数(FE/NE/PE/ORE/RTO)。>0 表示曾因接收错误中止 RX DMA 后又
- * 重新拉起 —— 用于区分"超时"是对端没回, 还是本端接收通道中途出过问题。 */
- uint32_t Mid_cpld_usart_rx_err(void);
- #endif /* __MID_CPLD_USART_H */
|