当前位置: 技术问答>linux和unix
一个芯片手册中看到的c语言问题,大家指教。
来源: 互联网 发布时间:2016-04-28
本文导语: struct vmivme_2540_regs { unsigned short bid; unsigned short rev; unsigned short cmd; unsignode; struct CH_CB { unsigned char command; unsigned char gate_edge; unsigned char vme_irq; unsigned char vme_vec; union { unsigned char cp_b[12]; unsign...
struct vmivme_2540_regs {
unsigned short bid;
unsigned short rev;
unsigned short cmd;
unsignode;
struct CH_CB {
unsigned char command;
unsigned char gate_edge;
unsigned char vme_irq;
unsigned char vme_vec;
union {
unsigned char cp_b[12];
unsigned short cp_w[6];
unsigned int cp_l[3];ed short response;
unsigned char resp_irq;
unsigned char resp_vec;
unsigned char channel;
unsigned char contdisc;
unsigned short mflag;
unsigned char mchan;
unsigned char mc
float cp_f[3];
} cp;
} ch_ccb[24];
struct TMR_CB {
unsigned char tcmd;
unsigned char tgate;
unsigned char vme_irq;
unsigned char vme_vec;
union {
unsigned char tp_b[12];
unsigned short tp_w[6];
unsigned int tp_l[3];
float tp_f[3];
} tp;
} tmr_ccb[6];
unsigned char cd[24];
unsigned char flg[24];
};
typedef struct vmivme_2540_regs ICC;
以上为某芯片手册中看到的关于一个.h的头文件的定义。
想问那些嵌套是错了,还是代表什么含义?
小弟初学,大家指教。
unsigned short bid;
unsigned short rev;
unsigned short cmd;
unsignode;
struct CH_CB {
unsigned char command;
unsigned char gate_edge;
unsigned char vme_irq;
unsigned char vme_vec;
union {
unsigned char cp_b[12];
unsigned short cp_w[6];
unsigned int cp_l[3];ed short response;
unsigned char resp_irq;
unsigned char resp_vec;
unsigned char channel;
unsigned char contdisc;
unsigned short mflag;
unsigned char mchan;
unsigned char mc
float cp_f[3];
} cp;
} ch_ccb[24];
struct TMR_CB {
unsigned char tcmd;
unsigned char tgate;
unsigned char vme_irq;
unsigned char vme_vec;
union {
unsigned char tp_b[12];
unsigned short tp_w[6];
unsigned int tp_l[3];
float tp_f[3];
} tp;
} tmr_ccb[6];
unsigned char cd[24];
unsigned char flg[24];
};
typedef struct vmivme_2540_regs ICC;
以上为某芯片手册中看到的关于一个.h的头文件的定义。
想问那些嵌套是错了,还是代表什么含义?
小弟初学,大家指教。
|
结构里套结构没什么问题吧
|
中间哪里肯定少了一个“}”, "{ }"是配对使用的! 把这个结构放到代码中,编译会报错的
good luck!
good luck!