">

久久青草精品38国产 - 一级特黄大片在线播放 - 精品国产免费观看久久久 - 亚洲一区二区观看播放

歡迎光臨上海紫卓電子科技有限公司! 固話:021-31007998    熱線:18721906708
手機(jī)  |   地圖  |   RSS
STM32要使用JTMS(PA13)、 JTCK(PA14)作為普通I/O口
分類:?jiǎn)纹瑱C(jī)瀏覽量:853 TAG:

在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);                       

}


上海紫卓電子科技有限公司

地址:上海市嘉定工業(yè)區(qū)葉城路925號(hào)B區(qū)4幢J

網(wǎng)址:www.haitaojiaren.cn

電話:021-31007998

傳真:021-31007998

郵件:569998567@qq.com

在線咨詢: 569998567

QQ在線咨詢
銷售電話:
18721906708
021-31007998
569998567