主要是标注问号那里不太懂。。。,多谢各位大神
typedef struct {
volatile Uint32 RBR;
volatile Uint32 IER;
volatile Uint32 IIR;
volatile Uint32 LCR;
volatile Uint32 MCR;
volatile Uint32 LSR;
Uint32 rsvd_18;
Uint32 rsvd_1c;
volatile Uint32 DLL;
volatile Uint32 DLH;
volatile Uint32 PID1;
volatile Uint32 PID2;
volatile Uint32 PWREMU_MGMT;
} UART_REGS;
#define THR RBR // THR & RBR occupy the same memory location
#define FCR IIR // FCR & IIR occupy the same memory location
typedef struct {
UART_REGS* regs; //?????
} UART_OBJ;
static UART_OBJ UART_MODULE_0 = { ( UART_REGS* )UART0_BASE };
static UART_OBJ UART_MODULE_1 = { ( UART_REGS* )UART1_BASE };
static UART_OBJ UART_MODULE_2 = { ( UART_REGS* )UART2_BASE };
noaming:
问号这里是定义一个结构体指针,即一个指针,指向一个结构体。