led.c

来自「STM32正交编码器完整程序」· C语言 代码 · 共 17 行

C
17
字号
/******************************************************
  2011年12月19日  黄旭磊  嘉职院实验室
  实验室快乐的时光	 ^ _ ^
  *****************************************************/

#include "led.h"
void LED_GPIO_Config(void)
{
		 GPIO_InitTypeDef GPIO_InitStructure;
		 RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOF, ENABLE);//使能pc端口时钟
		 GPIO_InitStructure.GPIO_Pin  = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9;	 //	 
		 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//工作速率
		 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // 推挽输出
		 GPIO_Init(GPIOF,&GPIO_InitStructure); //端口结构
		 GPIO_SetBits(GPIOF, GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9); 	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?