一、位带
#define GPIOA 0x40010800
#define GPIOB 0x40010c00
#define GPIOC 0x40011000
#define GPIOD 0x40011400
#define GPIOE 0x40011800
#define GPIOF 0x40011c00
#define GPIOG 0x40012000
二、程序
typedef int s32;
typedef short s16;
typedef char s8;
typedef const int sc32; /*!< Read Only */
typedef const short sc16; /*!< Read Only */
typedef const char sc8; /*!< Read Only */
typedef volatile int vs32;
typedef volatile short vs16;
typedef volatile char vs8;
typedef const volatile int vsc32; /*!< Read Only */
typedef const volatile short vsc16; /*!< Read Only */
typedef const volatile char vsc8; /*!< Read Only */
typedef unsigned int u32;
typedef unsigned short u16;
typedef unsigned char u8;
typedef const unsigned int uc32; /*!< Read Only */
typedef const unsigned short uc16; /*!< Read Only */
typedef const unsigned char uc8; /*!< Read Only */
typedef volatile unsigned int vu32;
typedef volatile unsigned short vu16;
typedef volatile unsigned char vu8;
typedef const volatile unsigned int vuc32; /*!< Read Only */
typedef const volatile unsigned short vuc16; /*!< Read Only */
typedef const volatile unsigned char vuc8; /*!< Read Only */
#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))
三、增强效率
void Enhanced_c_e_e(void)
{
*(unsigned int*)0x4002103C|=0x00000080;
}
四、附件
|