2019-03-24 15:33发布
原帖由 yuanyc5877 于 2011-10-11 21:22 发表 谢谢,就用这个HWREGB在试,可能是前面没搞对,我再看看。再次感谢
参考一下hw_types.h里面的定义吧
//*****************************************************************************//// Macros for hardware access, both direct and via the bit-band region.////*****************************************************************************#define HWREG(x) (*((volatile unsigned long *)(x)))#define HWREGH(x) (*((volatile unsigned short *)(x)))#define HWREGB(x) (*((volatile unsigned char *)(x)))#define HWREGBITW(x, b) HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))#define HWREGBITH(x, b) HWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 | (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))#define HWREGBITB(x, b) HWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 | (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
最多设置5个标签!
参考一下hw_types.h里面的定义吧
//*****************************************************************************
//
// Macros for hardware access, both direct and via the bit-band region.
//
//*****************************************************************************
#define HWREG(x)
(*((volatile unsigned long *)(x)))
#define HWREGH(x)
(*((volatile unsigned short *)(x)))
#define HWREGB(x)
(*((volatile unsigned char *)(x)))
#define HWREGBITW(x, b)
HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 |
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
#define HWREGBITH(x, b)
HWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 |
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
#define HWREGBITB(x, b)
HWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 |
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
一周热门 更多>