hw_dma_uart.h 1.2 KB

1234567891011121314151617181920212223242526
  1. #ifndef __HW_UART_H__
  2. #define __HW_UART_H__
  3. #define HW_DMA_UART_NUMBER 3
  4. #define UART_CTRL_SET_SPEED 0x01 //设置串口速度
  5. #define UART_CTRL_SET_RDFIN_TIME 0x02 //设置串口接收完成判断时间
  6. #define UART_CTRL_SET_WRFIN_TIME 0x03 //设置串口发送完成判断时间
  7. #define UART_CTRL_GET_SPEED 0x81 //获取当前速度
  8. #define UART_CTRL_GET_RDFIN_TIME 0x82 //获取当前串口接收完成时间
  9. #define UART_CTRL_GET_WRFIN_TIME 0x83 //获取当前串口写入完成时间
  10. #define UART_CTRL_GET_RDFIN 0x84 //串口接收是否完成,如果完成会返回接收长度
  11. #define UART_CTRL_GET_WRFIN 0x85 //串口发送是否完成
  12. #define hw_dma_uart_read(a,b,c) hw_dma_uart_begin_read(a,b,c)
  13. #define hw_dma_uart_write(a,b,c) hw_dma_uart_begin_write(a,b,c)
  14. void hw_dma_uart_init(int clk);
  15. int hw_dma_uart_begin_write(unsigned char uart_index, const char *buffer, int size);
  16. int hw_dma_uart_write_finish(unsigned char uart_index);
  17. int hw_dma_uart_begin_read(unsigned char uart_index,unsigned char *buffer, int size);
  18. int hw_dma_uart_read_finish(unsigned char uart_index);
  19. int hw_dma_uart_control(unsigned char uart_index,char cmd, void * argv);
  20. #endif