|
初学者一个关于.h中定义的一些问题,高人指点。
[复制链接]
#ifndef __44B0X_H__
#define __44B0X_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "option.h"
/* System */
#define rSYSCFG (*(volatile unsigned *)0x1c00000)
/* Cache */
#define rNCACHBE0 (*(volatile unsigned *)0x1c00004)
#define rNCACHBE1 (*(volatile unsigned *)0x1c00008)
/* Bus control */
#define rSBUSCON (*(volatile unsigned *)0x1c40000)
/* Memory control */
#define rBWSCON (*(volatile unsigned *)0x1c80000)
#define rBANKCON0 (*(volatile unsigned *)0x1c80004)
#define rBANKCON1 (*(volatile unsigned *)0x1c80008)
#define rBANKCON2 (*(volatile unsigned *)0x1c8000c)
#define rBANKCON3 (*(volatile unsigned *)0x1c80010)
#define rBANKCON4 (*(volatile unsigned *)0x1c80014)
#define rBANKCON5 (*(volatile unsigned *)0x1c80018)
#define rBANKCON6 (*(volatile unsigned *)0x1c8001c)
#define rBANKCON7 (*(volatile unsigned *)0x1c80020)
#define rREFRESH (*(volatile unsigned *)0x1c80024)
#define rBANKSIZE (*(volatile unsigned *)0x1c80028)
#define rMRSRB6 (*(volatile unsigned *)0x1c8002c)
#define rMRSRB7 (*(volatile unsigned *)0x1c80030)
/* UART */
#define rULCON0 (*(volatile unsigned *)0x1d00000)
#define rULCON1 (*(volatile unsigned *)0x1d04000)
#define rUCON0 (*(volatile unsigned *)0x1d00004)
#define rUCON1 (*(volatile unsigned *)0x1d04004)
#define rUFCON0 (*(volatile unsigned *)0x1d00008)
#define rUFCON1 (*(volatile unsigned *)0x1d04008)
#define rUMCON0 (*(volatile unsigned *)0x1d0000c)
#define rUMCON1 (*(volatile unsigned *)0x1d0400c)
#define rUTRSTAT0 (*(volatile unsigned *)0x1d00010)
#define rUTRSTAT1 (*(volatile unsigned *)0x1d04010)
#define rUERSTAT0 (*(volatile unsigned *)0x1d00014)
#define rUERSTAT1 (*(volatile unsigned *)0x1d04014)
#define rUFSTAT0 (*(volatile unsigned *)0x1d00018)
#define rUFSTAT1 (*(volatile unsigned *)0x1d04018)
#define rUMSTAT0 (*(volatile unsigned *)0x1d0001c)
#define rUMSTAT1 (*(volatile unsigned *)0x1d0401c)
#define rUBRDIV0 (*(volatile unsigned *)0x1d00028)
#define rUBRDIV1 (*(volatile unsigned *)0x1d04028)
#ifdef __BIG_ENDIAN
#define rUTXH0 (*(volatile unsigned char *)0x1d00023)
#define rUTXH1 (*(volatile unsigned char *)0x1d04023)
#define rURXH0 (*(volatile unsigned char *)0x1d00027)
#define rURXH1 (*(volatile unsigned char *)0x1d04027)
#define WrUTXH0(ch) (*(volatile unsigned char *)(0x1d00023))=(unsigned char)(ch)
#define WrUTXH1(ch) (*(volatile unsigned char *)(0x1d04023))=(unsigned char)(ch)
#define RdURXH0() (*(volatile unsigned char *)(0x1d00027))
#define RdURXH1() (*(volatile unsigned char *)(0x1d04027))
#define UTXH0 (0x1d00020+3) //byte_access address by BDMA
#define UTXH1 (0x1d04020+3)
#define URXH0 (0x1d00024+3)
#define URXH1 (0x1d04024+3)
#else //Little Endian
#define rUTXH0 (*(volatile unsigned char *)0x1d00020)
#define rUTXH1 (*(volatile unsigned char *)0x1d04020)
#define rURXH0 (*(volatile unsigned char *)0x1d00024)
#define rURXH1 (*(volatile unsigned char *)0x1d04024)
#define WrUTXH0(ch) (*(volatile unsigned char *)0x1d00020)=(unsigned char)(ch)
#define WrUTXH1(ch) (*(volatile unsigned char *)0x1d04020)=(unsigned char)(ch)
#define RdURXH0() (*(volatile unsigned char *)0x1d00024)
#define RdURXH1() (*(volatile unsigned char *)0x1d04024)
#define UTXH0 (0x1d00020) //byte_access address by BDMA
#define UTXH1 (0x1d04020)
#define URXH0 (0x1d00024)
#define URXH1 (0x1d04024)
#endif
/* SIO */
#define rSIOCON (*(volatile unsigned *)0x1d14000)
#define rSIODAT (*(volatile unsigned *)0x1d14004)
#define rSBRDR (*(volatile unsigned *)0x1d14008)
#define rIVTCNT (*(volatile unsigned *)0x1d1400c)
#define rDCNTZ (*(volatile unsigned *)0x1d14010)
/* IIS */
#define rIISCON (*(volatile unsigned *)0x1d18000)
#define rIISMOD (*(volatile unsigned *)0x1d18004)
#define rIISPSR (*(volatile unsigned *)0x1d18008)
#define rIISFCON (*(volatile unsigned *)0x1d1800c)
#ifdef __BIG_ENDIAN
#define rIISFIF ((volatile unsigned short *)0x1d18012)
#else //Little Endian
#define rIISFIF ((volatile unsigned short *)0x1d18010)
#endif
|
|