初级会员

- 积分
- 84
- 金钱
- 84
- 注册时间
- 2016-12-27
- 在线时间
- 14 小时
|
发表于 2016-12-29 23:07:51
|
显示全部楼层
GPIO_InitTypeDef GPIO_InitStructure;//定义结构体GPIO_InitStructure
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF,ENABLE);
/*F9初始化*/
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOF,&GPIO_InitStructure);//&GPIO_InitStructure取地址
原子哥,请问一下为何GPIO_Init(GPIOF,&GPIO_InitStructure);。。。。。GPIOF不是取地址,而GPIO_InitStructure要取地址?这个没有理解,能帮解释一下吗??并且#define GPIOF ((GPIO_TypeDef *) GPIOF_BASE) 这句话中((GPIO_TypeDef *) GPIOF_BASE) 是说GPIOF_BASE是GPIO_TypeDef结构体变量的意思吗?GPIOF_BASE继续查找下去好像是表示一个地址值吧?我这些理解不了,能指导一下吗? |
|