uart.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:3k
- #ifndef _J_UART_H_
- #define _J_UART_H_
- #include "stddefs.h" /* STAPI includes */
- #include "stuart.h"
- #include "stpio.h"
- #define KB_UART_DEVICES 2
- #define KB_UART_ASC_DEVICE_TYPE STUART_RTSCTS
- enum
- {
- KB_UART_ASC_DEVICE_0 = 0,
- KB_UART_ASC_DEVICE_1,
- KB_UART_ASC_DEVICE_2,
- KB_UART_ASC_DEVICE_3,
- KB_UART_ASC_DEVICE_4,
- KB_UART_ASC_DEVICE_NOT_USED
- };
- #define KB_UART_ASC_0_TXD_BIT PIO_BIT_0
- #define KB_UART_ASC_0_RXD_BIT PIO_BIT_1
- #define KB_UART_ASC_0_TXD_DEV KB_PIO_DEVICE_0
- #define KB_UART_ASC_0_RXD_DEV KB_PIO_DEVICE_0
- #define KB_UART_ASC_0_RTS_BIT PIO_BIT_4
- #define KB_UART_ASC_0_CTS_BIT PIO_BIT_5
- #define KB_UART_ASC_0_RTS_DEV KB_PIO_DEVICE_0
- #define KB_UART_ASC_0_CTS_DEV KB_PIO_DEVICE_0
- #define KB_UART_ASC_1_TXD_BIT PIO_BIT_0
- #define KB_UART_ASC_1_RXD_BIT PIO_BIT_1
- #define KB_UART_ASC_1_TXD_DEV KB_PIO_DEVICE_2
- #define KB_UART_ASC_1_RXD_DEV KB_PIO_DEVICE_2
- #define KB_UART_ASC_1_RTS_BIT PIO_BIT_2
- #define KB_UART_ASC_1_CTS_BIT PIO_BIT_3
- #define KB_UART_ASC_1_RTS_DEV KB_PIO_DEVICE_2
- #define KB_UART_ASC_1_CTS_DEV KB_PIO_DEVICE_2
- #define KB_UART_DATA_DEV KB_UART_ASC_DEVICE_1
- #define KB_UART_SC0_DEV KB_UART_ASC_DEVICE_0
- #define KB_UART_TBX_DEVICE KB_UART_DATA_DEV
- #define KB_UART_DATA_BASE_ADDRESS ASC_1_BASE_ADDRESS
- #define KB_UART_DATA_INTERRUPT ASC_1_INTERRUPT
- #define KB_UART_DATA_INTERRUPT_LEVEL ASC_1_INTERRUPT_LEVEL
- #define KB_UART_DATA_RXD_BIT KB_UART_ASC_1_RXD_BIT
- #define KB_UART_DATA_RXD_DEV KB_UART_ASC_1_RXD_DEV
- #define KB_UART_DATA_TXD_BIT KB_UART_ASC_1_TXD_BIT
- #define KB_UART_DATA_TXD_DEV KB_UART_ASC_1_TXD_DEV
- #define KB_UART_DATA_CTS_BIT KB_UART_ASC_1_CTS_BIT
- #define KB_UART_DATA_CTS_DEV KB_UART_ASC_1_CTS_DEV
- #define KB_UART_DATA_RTS_BIT KB_UART_ASC_1_RTS_BIT
- #define KB_UART_DATA_RTS_DEV KB_UART_ASC_1_RTS_DEV
- #define KB_UART_SC0_BASE_ADDRESS ASC_0_BASE_ADDRESS
- #define KB_UART_SC0_INTERRUPT ASC_0_INTERRUPT
- #define KB_UART_SC0_INTERRUPT_LEVEL ASC_0_INTERRUPT_LEVEL
- #define KB_UART_SC0_RXD_BIT KB_UART_ASC_0_RXD_BIT
- #define KB_UART_SC0_RXD_DEV KB_UART_ASC_0_RXD_DEV
- #define KB_UART_SC0_TXD_BIT KB_UART_ASC_0_TXD_BIT
- #define KB_UART_SC0_TXD_DEV KB_UART_ASC_0_TXD_DEV
- #define KB_UART_SC0_CTS_BIT KB_UART_ASC_0_CTS_BIT
- #define KB_UART_SC0_CTS_DEV KB_UART_ASC_0_CTS_DEV
- #define KB_UART_SC0_RTS_BIT KB_UART_ASC_0_RTS_BIT
- #define KB_UART_SC0_RTS_DEV KB_UART_ASC_0_RTS_DEV
- ST_ErrorCode_t KB_UartSetup(void);
- #endif /* _J_UART_H_ */
- /* EOF */