www.pudn.com > TIMPDACPDMA.zip > 位带操作.h, change:2014-04-01,size:435b


#define BITBAND(addr,bitnum) ddr&0xf0000000)+0x2000000+((addr&0xfffff)<<5)+(bitnum<<2)) 
 
#define MEN_ADDR(addr) *((volatile unsigned long *) (addr)) 
 
#define BIT_ADDR(addr,bitnum) MEN_ADDR(BITBAND(addr,bitnum)) 
 
#define GPIOA_ODR_Addr (GPIOA_BASE+12)  //0X4001080C 
#define GPIOA_IDR_Addr (GPIOA_BASE+ 8)  //0X40010808 
 
#define PAout(n) BIT_ADDR(GPIOA_ODR_Addr,n)  //ê?3? 
#define PAin(n)  BIT_ADDR(GPIOA_IDR_Addr,n)  //ê?è?