<dl id="b4zrn"><label id="b4zrn"></label></dl><thead id="b4zrn"></thead>

    <blockquote id="b4zrn"></blockquote>

      <strike id="b4zrn"></strike>
        1. <div id="b4zrn"><label id="b4zrn"></label></div>
          您好,歡迎訪問(wèn)上海意泓電子科技有限責(zé)任公司網(wǎng)站!
          4新聞資訊
          您的位置: 首頁(yè) ->  新聞資訊 -> 單片機(jī)

          ?STM32要使用JTMS(PA13)、 JTCK(PA14)作為普通I/O口

          文章出處:?jiǎn)纹瑱C(jī) 責(zé)任編輯:上海意泓電子科技有限責(zé)任公司 發(fā)表時(shí)間:
          2020
          11-10

          在STM32要使用JTMS(PA13)、  JTCK(PA14)作為普通I/O口的時(shí)候,要在初始化前添加如下代碼(順序不能顛倒):

            RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);

          GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable , ENABLE);


          如:

          void LED_Init(void)
          {
           
           GPIO_InitTypeDef  GPIO_InitStructure;
               
              
              
              RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO, ENABLE);  
          GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable , ENABLE);

              GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;                
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;     
           GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
           GPIO_Init(GPIOA, &GPIO_InitStructure);
           GPIO_SetBits(GPIOA,GPIO_Pin_8);                       

           GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;           
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;      
           GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
           GPIO_Init(GPIOA, &GPIO_InitStructure);
           GPIO_ResetBits(GPIOA,GPIO_Pin_13);                         
              
          GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;                 
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;          
           GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
           GPIO_Init(GPIOA, &GPIO_InitStructure);
           GPIO_ResetBits(GPIOA,GPIO_Pin_14);        

           GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;              
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;       
           GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
           GPIO_Init(GPIOA, &GPIO_InitStructure);
           GPIO_ResetBits(GPIOA,GPIO_Pin_6);            

           RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);  

           GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;               
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;       
           GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
           GPIO_Init(GPIOD, &GPIO_InitStructure);    
           GPIO_SetBits(GPIOD,GPIO_Pin_2);                       

          }


          上海意泓電子科技有限責(zé)任公司 版權(quán)所有 未經(jīng)授權(quán)禁止復(fù)制或鏡像

          CopyRight 2020-2025 m.frontgate.com.cn All rights reserved   滬ICP備2021005866號(hào)

          久艹视频在线观看这里只有精品,国语自产拍在线视频普通话94,久久婷婷综合缴情亚洲狠狠,亚洲不卡永远在线精品无码
          <dl id="b4zrn"><label id="b4zrn"></label></dl><thead id="b4zrn"></thead>

            <blockquote id="b4zrn"></blockquote>

              <strike id="b4zrn"></strike>
                1. <div id="b4zrn"><label id="b4zrn"></label></div>