| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef __DRV_USART_H__
- #define __DRV_USART_H__
- #include "rkfifo.h"
- #include "stdint.h"
- #if 0
- struct stm32_uart_config
- {
- USART_TypeDef *uartx;
- GPIO_TypeDef *_tx_port;
- GPIO_TypeDef *_rx_port;
- uint8_t _uart_irq_channel;
- uint16_t _tx_pin;
- uint16_t _rx_pin;
- uint8_t *_dma_tx_buff;
- uint32_t _dma_tx_buff_size;
- uint8_t *_dma_rx_buff;
- uint32_t _dma_rx_buff_size;
- DMA_Stream_TypeDef *_tx_dma;
- uint32_t _tx_dma_channel;
- uint32_t _tx_dma_tcif;
- uint32_t _tx_dma_teif;
- uint8_t _tx_dma_irq_channel;
- DMA_Stream_TypeDef *_rx_dma;
- uint32_t _rx_dma_channel;
- uint32_t _rx_dma_tcif;
- uint32_t _rx_dma_teif;
- uint8_t _rx_dma_irq_channel;
- rkfifo_t _rx_fifo;
- uint8_t *_rx_fifo_buff;
- uint32_t _rx_fifo_buff_size;
- rkfifo_t _tx_fifo;
- uint8_t *_tx_fifo_buff;
- uint32_t _tx_fifo_buff_size;
- };
- struct stm32_uart_ops
- {
- int (*init)(uint32_t bps);
- uint32_t (*write)(const void *pdata, uint32_t len);
- uint32_t (*read)(void *pdata, uint32_t len);
- };
- struct stm32_uart
- {
- struct stm32_uart_ops *ops;
- struct stm32_uart_config *_config;
- };
- struct stm32_uart *uart_find(const char *name);
- #endif
- #endif
|