1234567891011121314151617181920212223242526 |
- #ifndef __HW_UART_H__
- #define __HW_UART_H__
- #define HW_DMA_UART_NUMBER 3
- #define UART_CTRL_SET_SPEED 0x01 //设置串口速度
- #define UART_CTRL_SET_RDFIN_TIME 0x02 //设置串口接收完成判断时间
- #define UART_CTRL_SET_WRFIN_TIME 0x03 //设置串口发送完成判断时间
- #define UART_CTRL_GET_SPEED 0x81 //获取当前速度
- #define UART_CTRL_GET_RDFIN_TIME 0x82 //获取当前串口接收完成时间
- #define UART_CTRL_GET_WRFIN_TIME 0x83 //获取当前串口写入完成时间
- #define UART_CTRL_GET_RDFIN 0x84 //串口接收是否完成,如果完成会返回接收长度
- #define UART_CTRL_GET_WRFIN 0x85 //串口发送是否完成
- #define hw_dma_uart_read(a,b,c) hw_dma_uart_begin_read(a,b,c)
- #define hw_dma_uart_write(a,b,c) hw_dma_uart_begin_write(a,b,c)
- void hw_dma_uart_init(int clk);
- int hw_dma_uart_begin_write(unsigned char uart_index, const char *buffer, int size);
- int hw_dma_uart_write_finish(unsigned char uart_index);
- int hw_dma_uart_begin_read(unsigned char uart_index,unsigned char *buffer, int size);
- int hw_dma_uart_read_finish(unsigned char uart_index);
- int hw_dma_uart_control(unsigned char uart_index,char cmd, void * argv);
- #endif
|