初级会员

- 积分
- 64
- 金钱
- 64
- 注册时间
- 2017-3-16
- 在线时间
- 9 小时
|
1金钱
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; //PB12上拉 防止W25X的干扰
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure); //初始化指定IO
GPIO_SetBits(GPIOB,GPIO_Pin_12);//上拉
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7|GPIO_Pin_8; //PG8 7 推挽
GPIO_Init(GPIOG, &GPIO_InitStructure);//初始化指定IO
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD; //PG6 输入
GPIO_Init(GPIOG, &GPIO_InitStructure);
GPIO_ResetBits(GPIOG,GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8);//PG6,7,8上拉
|
最佳答案
查看完整内容[请看2#楼]
论坛里就有帖子讲I/O口工作模式的,为什么不搜一搜?
http://www.openedv.com/forum.php?mod=viewthread&tid=21980&extra=page%3D2%26filter%3Ddigest%26digest%3D1
|