uart.h 684 B

1234567891011121314151617181920212223242526272829303132
  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 UART1_DMA DMA2
  12. #define UART1_DMA_RXCH DMA_CH5
  13. #define UART1_DMA_TXCH DMA_CH7
  14. #define UART3_DMA DMA2
  15. #define UART3_DMA_RXCH DMA_CH2
  16. #define UART3_DMA_TXCH DMA_CH6
  17. #define MAX_MSG_NUM 10
  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