identifier "GPIOD" is undefined什么原因? 编译后最后一行报上面的错

GPIO_InitTypeDef GPIO_InitStructure;

/* Enable SPI1 and GPIO clocks */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1 | RCC_APB2Periph_GPIOA |
RCC_APB2Periph_GPIOD, ENABLE);

/* Configure SPI1 pins: SCK, MISO and MOSI */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);

/* Configure PD9 pin: CS pin ,PD10 : SD Power*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOD, &GPIO_InitStructure);

第1个回答  推荐于2018-03-04
stm32f10x_conf.h里看一下,GPIOD肯定被屏蔽掉了本回答被网友采纳
第2个回答  2013-08-25
把GPIOD的D去掉
第3个回答  2011-06-22
太复杂了
第4个回答  2014-11-06
没包含 stm32f10x.h
相似回答