久久ER99热精品一区二区-久久精品99国产精品日本-久久精品免费一区二区三区-久久综合九色综合欧美狠狠

新聞中心

EEPW首頁 > 嵌入式系統 > 設計應用 > STM32F107VCT6的GPIO配置

STM32F107VCT6的GPIO配置

作者: 時間:2016-11-10 來源:網絡 收藏
輸出配置

#define LED_GPIO GPIOC
#define LED_PIN GPIO_Pin_9

本文引用地址:http://cqxgywz.com/article/201611/317517.htm

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配

評論


技術專區

關閉