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;
时间: 2024-10-10 06:12:58