uart.h 720 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __UART_H
  2. #define __UART_H
  3. #include "includes.h"
  4. #include "interface.h"
  5. #include "stm32f4xx_usart.h"
  6. #include "string.h"
  7. #define UART1_REC_LEN 128
  8. #define UART1_TX_LEN 128
  9. #define UART3_REC_LEN 128
  10. #define UART3_TX_LEN 128
  11. #define MAX_MSG_NUM 10
  12. #define UART1_DMA DMA_Channel_4
  13. #define UART1_DMA_RXCH DMA2_Stream5
  14. #define UART1_DMA_TXCH DMA2_Stream7
  15. #define UART3_DMA DMA_Channel_4
  16. #define UART3_DMA_RXCH DMA1_Stream1
  17. #define UART3_DMA_TXCH DMA1_Stream3
  18. typedef struct
  19. {
  20. INT8U buf[128];
  21. INT8U len;
  22. } UartFrame_TypeDef;
  23. void uart1_init(void);
  24. void uart3_init(void);
  25. void Uart1_dma_Send_Data(const INT8U *buf, INT16U len);
  26. void Uart3_dma_Send_Data(const INT8U *buf, INT16U len);
  27. #endif