drv_usart.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __DRV_USART_H__
  2. #define __DRV_USART_H__
  3. #include "rkfifo.h"
  4. #include "stdint.h"
  5. //struct stm32_uart_config
  6. //{
  7. // USART_TypeDef *uartx;
  8. // GPIO_TypeDef *_tx_port;
  9. // GPIO_TypeDef *_rx_port;
  10. // uint8_t _uart_irq_channel;
  11. // uint16_t _tx_pin;
  12. // uint16_t _rx_pin;
  13. // uint8_t *_dma_tx_buff;
  14. // uint32_t _dma_tx_buff_size;
  15. // uint8_t *_dma_rx_buff;
  16. // uint32_t _dma_rx_buff_size;
  17. // DMA_Stream_TypeDef *_tx_dma;
  18. // uint32_t _tx_dma_channel;
  19. // uint32_t _tx_dma_tcif;
  20. // uint32_t _tx_dma_teif;
  21. // uint8_t _tx_dma_irq_channel;
  22. // DMA_Stream_TypeDef *_rx_dma;
  23. // uint32_t _rx_dma_channel;
  24. // uint32_t _rx_dma_tcif;
  25. // uint32_t _rx_dma_teif;
  26. // uint8_t _rx_dma_irq_channel;
  27. // rkfifo_t _rx_fifo;
  28. // uint8_t *_rx_fifo_buff;
  29. // uint32_t _rx_fifo_buff_size;
  30. // rkfifo_t _tx_fifo;
  31. // uint8_t *_tx_fifo_buff;
  32. // uint32_t _tx_fifo_buff_size;
  33. //};
  34. //struct stm32_uart_ops
  35. //{
  36. // int (*init)(uint32_t bps);
  37. // uint32_t (*write)(const void *pdata, uint32_t len);
  38. // uint32_t (*read)(void *pdata, uint32_t len);
  39. //};
  40. //struct stm32_uart
  41. //{
  42. // struct stm32_uart_ops *ops;
  43. // struct stm32_uart_config *_config;
  44. //};
  45. //struct stm32_uart *uart_find(const char *name);
  46. #endif