Mid_cpld_usart.h 795 B

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