DSP5509结构体问题

2019-08-01 17:33发布

typedef int             int16;
typedef long            int32;
typedef unsigned int    Uint16;
typedef unsigned long   Uint32;
typedef float           float32;
typedef long double     float64;

//ioport unsigned int *clkmd;
//clkmd=(unsigned int *)0x1c00;
#define       clkmd        *(volatile ioport unsigned int *)0x01C00

typedef struct{
Uint16 LOCK:1;
Uint16 BREAKLN:1;
Uint16 BYPASSDIV:2;
Uint16 PLLENABLE:1;
Uint16 PLLDIV:2;
Uint16 PLLMULT:4;
Uint16 TEST:1;
Uint16 IOB:1;
Uint16 IAI:1;
Uint16 Rsvd:1;
}clkmd_BITS;

union{
Uint16 all;
struct clkmd_BITS bit;
}clkmd_REG;
clkmd_REG *clkmd;
DSP5509结构体应该怎么定义啊???联合体不能定义指针,那么DSP2812是用什么方法把联合体地址设为寄存器地址的???


友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
2条回答
huangfeng33
1楼-- · 2019-08-01 18:52
这个看官方例程,官方例程里面广泛的使用了结构体和共用体,2系列所有DSP的寄存器访问都是用的结构体和共用体实现。
小木欧尼
2楼-- · 2019-08-01 19:48
哦哦 很强大啊

一周热门 更多>