我想用nGCS2作片选,LDADDR0-LDADDR7作地址线,LDDATA0-LDDATA7作数据线进行CPLD的读写数据.于是我定义了下面的结构体:
#define NGCS2_BASE 0XA4000080
#define NGCS2_PHY_BASE 0x10000080
///定义CPLD控制寄存器地址
typedef struct {
unsigned int gCSSLTAABC;
unsigned int gCSSLTBABC;
unsigned int gCSENTA;
unsigned int gCSENTB;
unsigned int gCSSLP;
unsigned int gCSADSOURCE;
}CPLD_CONTEXT;
#define NGCS2_BASE 0XA4000000 注意這裡的地址是0x100对齐的.
#define NGCS2_PHY_BASE 0x10000000
///定义CPLD控制寄存器地址
typedef struct {
unsigned int gCSSLTAABC;
unsigned int gCSSLTBABC;
unsigned int gCSENTA;
unsigned int gCSENTB;
unsigned int gCSSLP;
unsigned int gCSADSOURCE;
}CPLD_CONTEXT;