初级会员
积分 158
金钱 158
注册时间 2016-11-1
在线时间 27 小时
1 金钱
#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) //0x40010000
#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800) //0x40010800
#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)
#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000)
#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400)
#define GPIOE_BASE (APB2PERIPH_BASE + 0x1800)
#define GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)
#define GPIOG_BASE (APB2PERIPH_BASE + 0x2000) //0x40012000
#define GPIOA_ODR_ADDR (GPIOA_BASE+0x0C) //0x4001080C
#define GPIOB_ODR_ADDR (GPIOB_BASE+0x0C) //0x40010C0C
#define GPIOC_ODR_ADDR (GPIOC_BASE+0x0C) //0x4001100C
#define GPIOD_ODR_ADDR (GPIOD_BASE+0x0C) //0x4001140C
#define GPIOE_ODR_ADDR (GPIOE_BASE+0x0C) //0x4001180C
#define GPIOF_ODR_ADDR (GPIOF_BASE+0x0C) //0x40011C0C
#define GPIOG_ODR_ADDR (GPIOG_BASE+0x0C) // 0x4001200C
前面一直是直接用位带操作,现在想整理下,根据前面的#define ,黄色标亮部分的注释应该是对的吧,看开发指南中的注释分别是0x40011A0C和0x40011E0C,求指导!
我来回答