📄 au1500sio.h
字号:
/* au1500Sio.h - Au1x00 UART tty driver header */
/*
* This file has been developed or significantly modified by the
* MIPS Center of Excellence Dedicated Engineering Staff.
* This notice is as per the MIPS Center of Excellence Master Partner
* Agreement, do not remove this notice without checking first with
* WR/Platforms MIPS Center of Excellence engineering management.
*/
/* Copyright 1984-2001 Wind River Systems, Inc. */
/*
modification history
--------------------
01b,12mar05,fhc adopted from pb1500/au1000Sio.c
01a,01feb01,ejd written
*/
#ifndef __INCau1500Sioh
#define __INCau1500Sioh
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASMLANGUAGE
#endif
/* Register content definitions */
/* uart_inten */
#define UART_INTEN_MIE (1<<3)
#define UART_INTEN_LIE (1<<2)
#define UART_INTEN_TIE (1<<1)
#define UART_INTEN_RIE (1<<0)
/* uart_intcause */
#define UART_INTCAUSE_IID (7<<1)
#define UART_INTCAUSE_IP (1<<0)
#define UART_INTCAUSE_IID_MS (0<<1)
#define UART_INTCAUSE_IID_TBA (1<<1)
#define UART_INTCAUSE_IID_RDA (2<<1)
#define UART_INTCAUSE_IID_RLS (3<<1)
#define UART_INTCAUSE_IID_CTO (6<<1)
/* uart_fifoctrl */
#define UART_FIFOCTRL_RFT (3<<6)
#define UART_FIFOCTRL_TFT (3<<4)
#define UART_FIFOCTRL_MS (1<<3)
#define UART_FIFOCTRL_TR (1<<2)
#define UART_FIFOCTRL_RR (1<<1)
#define UART_FIFOCTRL_FE (1<<0)
#define UART_FIFOCTRL_RFT_1 (0<<6)
#define UART_FIFOCTRL_RFT_4 (1<<6)
#define UART_FIFOCTRL_RFT_8 (2<<6)
#define UART_FIFOCTRL_RFT_14 (3<<6)
#define UART_FIFOCTRL_TFT_0 (0<<4)
#define UART_FIFOCTRL_TFT_4 (1<<4)
#define UART_FIFOCTRL_TFT_8 (2<<4)
#define UART_FIFOCTRL_TFT_12 (3<<4)
/* uart_linectrl */
#define UART_LINECTRL_SB (1<<6)
#define UART_LINECTRL_PAR (3<<4)
#define UART_LINECTRL_PE (1<<3)
#define UART_LINECTRL_ST (1<<2)
#define UART_LINECTRL_WLS (3<<0)
#define UART_LINECTRL_PAR_O (0<<4)
#define UART_LINECTRL_PAR_E (1<<4)
#define UART_LINECTRL_PAR_M (2<<4)
#define UART_LINECTRL_PAR_Z (3<<4)
#define UART_LINECTRL_WLS_5 (0<<0)
#define UART_LINECTRL_WLS_6 (1<<0)
#define UART_LINECTRL_WLS_7 (2<<0)
#define UART_LINECTRL_WLS_8 (3<<0)
/* uart_mdmctrl */
#define UART_MDMCTRL_LB (1<<4)
#define UART_MDMCTRL_I1 (1<<3)
#define UART_MDMCTRL_I0 (1<<2)
#define UART_MDMCTRL_RT (1<<1)
#define UART_MDMCTRL_DT (1<<0)
/* uart_linestat */
#define UART_LINESTAT_RF (1<<7)
#define UART_LINESTAT_TE (1<<6)
#define UART_LINESTAT_TT (1<<5)
#define UART_LINESTAT_BI (1<<4)
#define UART_LINESTAT_FE (1<<3)
#define UART_LINESTAT_PE (1<<2)
#define UART_LINESTAT_OE (1<<1)
#define UART_LINESTAT_DR (1<<0)
/* uart_mdmstat */
#define UART_MDMSTAT_CD (1<<7)
#define UART_MDMSTAT_RI (1<<6)
#define UART_MDMSTAT_DS (1<<5)
#define UART_MDMSTAT_CT (1<<4)
#define UART_MDMSTAT_DD (1<<3)
#define UART_MDMSTAT_TRI (1<<2)
#define UART_MDMSTAT_DR (1<<1)
#define UART_MDMSTAT_DC (1<<0)
/* uart_enable */
#define UART_ENABLE_E (1<<1)
#define UART_ENABLE_CE (1<<0)
/* structures */
#ifndef _ASMLANGUAGE
typedef volatile struct
{
UINT32 uart_rxdata;
UINT32 uart_txdata;
UINT32 uart_inten;
UINT32 uart_intcause;
UINT32 uart_fifoctrl;
UINT32 uart_linectrl;
UINT32 uart_mdmctrl;
UINT32 uart_linestat;
UINT32 uart_mdmstat;
UINT32 reserved0;
UINT32 uart_clkdiv;
UINT32 reserved1[53];
UINT32 uart_enable;
} AU1000_UART;
typedef struct
{
/* always goes first */
SIO_DRV_FUNCS * pDrvFuncs; /* driver functions */
/* callbacks */
STATUS (*getTxChar) (); /* pointer to xmitr function */
STATUS (*putRcvChar) (); /* pointer to rcvr function */
void * getTxArg;
void * putRcvArg;
AU1000_UART *regs; /* UART registers */
UINT8 level; /* 8259a interrupt level for this device */
UINT8 ier; /* copy of interrupt enable register */
UINT8 lcr; /* copy of line control register */
UINT8 mcr; /* copy of modem control register */
UINT8 pad1;
UINT16 channelMode; /* such as INT, POLL modes */
UINT16 regDelta; /* register address spacing */
int baudRate; /* UART baud rate */
UINT32 xtal; /* UART clock frequency */
UINT32 options; /* hardware setup options */
} AUSIO_CHAN;
extern void auSioInt (AUSIO_CHAN *);
extern void auSioDevInit (AUSIO_CHAN *);
#endif /* _ASMLANGUAGE */
#ifdef __cplusplus
}
#endif
#endif /* __INCau1500Sioh */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -