cortex-M3一直到M0上,位带操作应该怎样转变
时间:10-02
整理:3721RD
点击:
#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))
#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))
#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))
#define PCout(n) BIT_ADDR(GPIOC_ODR_Addr,n)
就是上面这几个宏定义,实在是搞不懂了,请大家帮我看看
#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))
#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))
#define PCout(n) BIT_ADDR(GPIOC_ODR_Addr,n)
就是上面这几个宏定义,实在是搞不懂了,请大家帮我看看
想把这个移植到cortex-M0上,这几个宏定义应该怎么转变