<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > stm32快速學(xué)習(xí)2——點(diǎn)亮LED

          stm32快速學(xué)習(xí)2——點(diǎn)亮LED

          作者: 時間:2016-11-17 來源:網(wǎng)絡(luò) 收藏
          點(diǎn)亮LED

          首先使能時鐘RCC
          然后再設(shè)置IO口
          下面是用到的函數(shù)可在 UM0427 用戶手冊 固件函數(shù)庫 中查到,有詳盡解釋

          #include "stm32f10x.h"

          本文引用地址:http://www.ex-cimer.com/article/201611/315446.htm

          void RCC_Configuration(void);
          void GPIO_Configuration(void);

          int main(void)
          {
          RCC_Configuration();
          GPIO_Configuration();

          GPIO_SetBits(GPIOA, GPIO_Pin_0);
          GPIO_SetBits(GPIOA, GPIO_Pin_1);
          while(1);
          }

          void RCC_Configuration(void)
          {
          RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);
          }


          void GPIO_Configuration(void)
          {
          GPIO_InitTypeDef GPIO_InitStructure;
          GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
          GPIO_Init(GPIOA, &GPIO_InitStructure);
          }



          關(guān)鍵詞: stm32點(diǎn)亮LE

          評論


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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();