资深版主
 
- 积分
- 10568
- 金钱
- 10568
- 注册时间
- 2017-2-18
- 在线时间
- 1913 小时
|
发表于 2020-2-25 23:17:56
|
显示全部楼层
本帖最后由 peng1554 于 2020-2-26 11:44 编辑
- <p> GPIO_InitTypeDef GPIO_InitStructure1;
- GPIO_InitTypeDef* GPIO_InitStructure = NULL;
- GPIO_InitStructure = &GPIO_InitStructure1;
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE); //使能PB,PE端口时钟
- (*GPIO_InitStructure).GPIO_Pin = GPIO_Pin_5; //LED0-->PB.5 端口配置
- (*GPIO_InitStructure).GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
- (*GPIO_InitStructure).GPIO_Speed = GPIO_Speed_50MHz; //IO口速度为50MHz
- GPIO_Init(GPIOB, GPIO_InitStructure); //根据设定参数初始化GPIOB.5
- GPIO_SetBits(GPIOB,GPIO_Pin_5);
- (*GPIO_InitStructure).GPIO_Pin = GPIO_Pin_5; //LED1-->PE.5 端口配置, 推挽输出
- GPIO_Init(GPIOE, GPIO_InitStructure); //推挽输出 ,IO口速度为50MHz
- GPIO_SetBits(GPIOE,GPIO_Pin_5); //PE.5 输出高 </p><p>
- </p><p>
- </p><p>这样写就可以了</p>
复制代码
|
|