请教一个单片机 C 程序的简单问题,请各位大神赐教
typedef struct{
unsigned char PIN0: 1;
unsigned char PIN1: 1;
unsigned char PIN2: 1;
unsigned char PIN3: 1;
unsigned char PIN4: 1;
unsigned char PIN5: 1;
unsigned char PIN6: 1;
unsigned char PIN7: 1;
} F320_Port0_type;
volatile F320_Port0_type *F320_Port0 = 0x80; // 单片机的P0口的地位为0x80
void main()
{
P0MDOUT = 0x01; // 把P0.0口设置成输出
F320_Port0->PIN0 = 0; // 我想让P0.0口输出低电平,但实际测试下来还是高电平
while(1);
}
实际上,我就是想用结构体定义的方法来定义寄存器。各位大神帮我看看哪里出了问题,非常感谢。
Thank you in advance!