搞定了,修改了一下偏移量就好了。
__IO为uint32_t IDR / *!GPIO端口的输入数据寄存器,地址偏移:0x10 * /
|
__IO为uint32_t ODR; / *!GPIO端口输出数据寄存器,地址偏移:0x14的* /
|
#define GPIOA_ODR_Addr (GPIOA_BASE+20) //0x4001080C
#define GPIOB_ODR_Addr (GPIOB_BASE+20) //0x40010C0C
#define GPIOC_ODR_Addr (GPIOC_BASE+20) //0x4001100C
#define GPIOD_ODR_Addr (GPIOD_BASE+20) //0x4001140C
#define GPIOE_ODR_Addr (GPIOE_BASE+20) //0x4001180C
#define GPIOF_ODR_Addr (GPIOF_BASE+20) //0x40011A0C
#define GPIOG_ODR_Addr (GPIOG_BASE+20) //0x40011E0C
// 0x40020000
#define GPIOA_IDR_Addr (GPIOA_BASE+16) //0x40010808
#define GPIOB_IDR_Addr (GPIOB_BASE+16) //0x40010C08
#define GPIOC_IDR_Addr (GPIOC_BASE+16) //0x40011008
#define GPIOD_IDR_Addr (GPIOD_BASE+16) //0x40011408
#define GPIOE_IDR_Addr (GPIOE_BASE+16) //0x40011808
#define GPIOF_IDR_Addr (GPIOF_BASE+16) //0x40011A08
#define GPIOG_IDR_Addr (GPIOG_BASE+16) //0x40011E08 |