初级会员

- 积分
- 128
- 金钱
- 128
- 注册时间
- 2014-4-4
- 在线时间
- 1 小时
|
5金钱
如何设置GPIO的引脚为低功耗的模拟输入,但是不影响Jlink下载程序,我试着跳过Jlink使用的那几个GPIO口的设置,但是还是不行,有谁做过类似的调试么,给个意见。。。。。
void lowpower_gpio_set(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode =GPIO_Mode_AIN;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_Init(GPIOE, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2
|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_InitStructure.GPIO_Mode =GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2
|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;
GPIO_InitStructure.GPIO_Mode =GPIO_Mode_AIN;
GPIO_Init(GPIOB, &GPIO_InitStructure);
ADC_DMACmd(ADC1, DISABLE);
ADC_Cmd(ADC1, DISABLE);
DMA_Cmd(DMA1_Channel1, DISABLE);
TIM_Cmd(TIM2, DISABLE);
TIM_Cmd(TIM3, DISABLE);
TIM_Cmd(TIM4, DISABLE);
TIM_Cmd(TIM5, DISABLE);
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC | RCC_AHBPeriph_DMA1, DISABLE);
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA |
RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOD |
RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO |
RCC_APB2Periph_ADC1, DISABLE);
RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3 |
RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM5 , DISABLE);
}
|
|