STM32中文参考手册中SPI模式的配置如下:
但在SD卡读写和Flash读写中原子哥提供的代码中都用GPIO_Mde_AF_PP,那么:
1.如果按照参考手册的配置方法应该怎么配置呢?
2.这种配置方式相比于手册中的配置方式有什么优势呢?
我的配置方式有什么问题呢?
[mw_shl_code=c,true]GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
//GPIO_SetBits(GPIOB,GPIO_Pin_13|GPIO_Pin_15);[/mw_shl_code]
|