| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /******************************************************************************
- 版权所有:
- 文件名称: uart.c
- 文件版本: 01.01
- 创建作者:
- 创建日期: 2008-06-25
- 功能说明: UART驱动程序头文件
- 其它说明:
- 修改记录:
- */
- #ifndef __UART_H__
- #define __UART_H__
- /*------------------------------ 头文件 -------------------------------------
- */
- #include "bspconfig.h"
- /*------------------------------ 宏定义 -------------------------------------
- */
- //奇偶校验宏定义
- #ifndef PARITY_NONE
- #define PARITY_NONE 0 // 无校验
- #endif
- #ifndef PARITY_EVEN
- #define PARITY_EVEN 1 // 偶校验
- #endif
- #ifndef PARITY_ODD
- #define PARITY_ODD 2 // 奇校验
- #endif
- #ifndef PARITY_NONE_1
- #define PARITY_NONE_1 0 // 无校验
- #endif
- // 内核输出此变量,让应用不使用控制台串口
- extern int g_con_uart_index;
- extern s8 UART_CHANNEL[];
- int uart_init(void);
- int uart_open(int channel, uint32_t baudRate, int setting);
- void uart_close(int channel);
- int uart_select(int channel);
- char uart_getchar(int channel);
- void uart_putchar(int channel, char ch);
- void uart_puts(int channel, char *ch);
- int uart_write(int channel, const char *data, int count);
- int uart_read(int channel, char *data, int count);
- int uart_test(void);
- #endif /* __UART_H__ */
- /*------------------------------ 文件结束 -------------------------------------
- */
|