STM32F107VCT6的GPIO配置
时间:11-10
来源:互联网
点击:
输出配置
#define LED_GPIO GPIOC
#define LED_PIN GPIO_Pin_9
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
//LED
GPIO_InitStructure.GPIO_Pin = LED_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽式输出
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(LED_GPIO, &GPIO_InitStructure);
GPIO_WriteBit(LED_GPIO, LED_PIN, Bit_RESET);
}
输入配置
#define MON_GPIO GPIOC
#define MON_PIN GPIO_Pin_9
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
//监视管脚
GPIO_InitStructure.GPIO_Pin = MON_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD; //GPIO_Mode_IN_FLOATING浮空输入模式
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(MON_GPIO, &GPIO_InitStructure);
}
STM32F107VCT6GPIO配 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)