码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-11-11 23:45:40      阅读:942      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!