本帖最后由 a868247 于 2013-1-7 11:06 编辑
#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))
#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))
#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))
#define GPIOA_IDR_Addr (GPIOA_BASE+8) //
#define GPIOB_IDR_Addr (GPIOB_BASE+8) //
#define PAin(n) BIT_ADDR(GPIOA_IDR_Addr,n) //"输入 "
#define PBin(n) BIT_ADDR(GPIOB_IDR_Addr,n) //"输入 "
|