標(biāo)題: stm32 GPIO這樣配置對不對 板子壞了沒法驗證 大蝦 來吃小菜啦 [打印本頁]

作者: 八仙    時間: 2017-4-1 17:26
標(biāo)題: stm32 GPIO這樣配置對不對 板子壞了沒法驗證 大蝦 來吃小菜啦
這樣配置對不對  板子壞了沒法驗證 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。


#include "stm32f10x.h"
void LED_Init(void)
{
        GPIO_InitTypeDef GPIO_InitStructure;     //定義結(jié)構(gòu)體變量
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE ,ENABLE);     //使能PB5,PE5 時鐘
        
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;                  //選擇端口位
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;  //配置推挽輸出模式
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;  // IO輸出響應(yīng)時間


//端口所在位 輸出方式都一樣  嘗試一起初始化        不用再重復(fù)配置端口     (等待驗證這樣配置對不對)
        GPIO_Init (GPIOB, &GPIO_InitStructure);
        GPIO_Init (GPIOE, &GPIO_InitStructure);
}







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1