RCC->APB2ENR | =1<<4; //使能PORTC时钟 GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;//设置为推挽输出 GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;//最大输出速度为50MZH GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIOB->ODR | =3<<8; //PB8 PB9 输出高 GPIOC->ODR | =1<<13; //PC13 输出高}2、添加有关操作RGB灯的GPIO口宏定义,方便操作和调动。 |