在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            STM32 GPIO 配置

            作者: 時(shí)間:2016-12-03 來源:網(wǎng)絡(luò) 收藏
            固件庫 V3.5 IAR

            /*******************************************************************************
            * 函數(shù)名稱: GPIO_Configuration
            * 函數(shù)功能: 設(shè)置各GPIO端口功能
            * 參數(shù)變量: NONE
            * 全局變量: NONE
            * 調(diào)用函數(shù):
            * 修改時(shí)間:
            * 版 本: V1.0
            * 狀 態(tài):調(diào)試完成
            *******************************************************************************/
            void GPIO_Configuration(void)
            {
            RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|
            RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD|
            RCC_APB2Periph_GPIOE|
            RCC_APB2Periph_GPIOF, ENABLE); //開所有IO時(shí)鐘
            /******************I0 A ***************************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_0|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_5|GPIO_Pin_9; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOA,&GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_10; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ;//浮空輸入
            GPIO_Init(GPIOA,&GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            /******************I0 B ***************************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_5|
            GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_15; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOB, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_11|GPIO_Pin_14; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ;//浮空輸入
            GPIO_Init(GPIOB, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化
            /******************I0 C ***************************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_4|
            GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|
            GPIO_Pin_11|GPIO_Pin_12; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOC, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化


            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_13; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU ;//上拉輸入
            GPIO_Init(GPIOC, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_3; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ;//浮空輸入
            GPIO_Init(GPIOC, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化
            /******************I0 D ***************************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_3|GPIO_Pin_4|
            GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|
            GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOD, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_2; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU ;//上拉輸入
            GPIO_Init(GPIOD, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化
            /******************I0 E ***************************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4||GPIO_Pin_5; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOE, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_13; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU ;//上拉輸入
            GPIO_Init(GPIOE, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化

            /******************I0 F ***************************///開發(fā)板資源
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//IO模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//IO 輸出速度
            GPIO_Init(GPIOF, &GPIO_InitStructure); //使用的LED燈相關(guān)的GPIO口初始化
            GPIO_SetBits(GPIOF,GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9);//關(guān)閉所有的LED指示燈


            /*****************ADC IO 口***************/
            GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4|GPIO_Pin_6;//選擇IO 口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;//IO 模式設(shè)置
            GPIO_Init(GPIOA, &GPIO_InitStructure);//寫入 初始化值
            /*****************I2C 口***************/
            GPIO_InitStructure.GPIO_Pin =GPIO_Pin_6|GPIO_Pin_7; //選擇IO口
            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;//復(fù)用I2C 設(shè)置 輸出模式
            GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;//IO 輸出速度
            GPIO_Init(GPIOB, &GPIO_InitStructure); //

            本文引用地址:http://www.biyoush.com/article/201612/325205.htm

            }

            GPIO_ResetBits(GPIOF,GPIO_Pin_9);//GPIOF_9 =0;
            GPIO_SetBits(GPIOF,GPIO_Pin_9); //GPIOF_9 =1;



            關(guān)鍵詞: STM32GPIO配

            評(píng)論


            技術(shù)專區(qū)

            關(guān)閉