|

楼主 |
发表于 2019-11-26 09:30:21
|
显示全部楼层
下面贴上代码:
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);//we need to use gpio's interrupt,so enable the AFIO clock;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
// GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);//全部重定义(此时用st-link下载,需在上电瞬间,或一直按着硬件复位键)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);//部分重定义
// GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST,DISABLE);仅PB4重定义
//init the gpio porta.15 as output push and pull,DIR_L
GPIO_Init_struct_temp.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_Init_struct_temp.GPIO_Pin=GPIO_Pin_15;
GPIO_Init_struct_temp.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_Init_struct_temp);
GPIO_SetBits(GPIOA,GPIO_Pin_15);//init the direction"I don't konw if this direction is right"
结束,附件是全部的main函数包括初始化函数代码 |
|