首页 > 其他 > 详细

#define GPFCON (* (volatile unsigned long * )0x56000050 )

时间:2015-11-11 23:43:27      阅读:300      评论:0      收藏:0      [点我收藏+]
int   a;
int   *p;
p   = &a;
*p = 0x100;   //a=0x100


p   = (int *)0x56000050;
*p =0x100;
*(  ( int * ) 0x56000050) = 0x100

加上volatile是为了防止编译器优化这个寄存器

 

#define GPBCON (*(volatile unsigned long *)0x56000010)
#define GPBDAT (*(volatile unsigned long *)0x56000014)

#define GPB5_out (1<<(5*2))
#define GPB6_out (1<<(6*2))
#define GPB7_out (1<<(7*2))
#define GPB8_out (1<<(8*2))

GPBCON = GPB5_out | GPB6_out | GPB7_out | GPB8_out;

#define GPFCON (* (volatile unsigned long * )0x56000050 )

原文:http://www.cnblogs.com/yygsj/p/4957508.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!