RCC_APB2PeriphResetCmd(0X01FC,DISABLE)

RCC_APB2PeriphResetCmd(0X01FC,DISABLE); //复位所有 IO 口

//系统进入待机模式
void Sys_Enter_Standby(void)
{    
 RCC_APB2PeriphResetCmd(0X01FC,DISABLE); //复位所有IO口
 Sys_Standby();
}


 

/**
  * @brief  Forces or releases High Speed APB (APB2) peripheral reset.
  * @param  RCC_APB2Periph: specifies the APB2 peripheral to reset.
  *   This parameter can be any combination of the following values:
  *     @arg RCC_APB2Periph_AFIO, RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB,
  *          RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, RCC_APB2Periph_GPIOE,
  *          RCC_APB2Periph_GPIOF, RCC_APB2Periph_GPIOG, RCC_APB2Periph_ADC1,
  *          RCC_APB2Periph_ADC2, RCC_APB2Periph_TIM1, RCC_APB2Periph_SPI1,
  *          RCC_APB2Periph_TIM8, RCC_APB2Periph_USART1, RCC_APB2Periph_ADC3,
  *          RCC_APB2Periph_TIM15, RCC_APB2Periph_TIM16, RCC_APB2Periph_TIM17,
  *          RCC_APB2Periph_TIM9, RCC_APB2Periph_TIM10, RCC_APB2Periph_TIM11  
  * @param  NewState: new state of the specified peripheral reset.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
0X01FC 是一个十六进制数,它对应的二进制表示是 0000 0001 1111 1100。在 STM32 系列的微控制器中,RCC_APB2RSTR 寄存器的每一位都对应一个特定的外设。通过设置寄存器中的位,可以启用或禁用相应外设的复位功能。 根据这个二进制值,我们可以知道该代码禁用了 RCC_APB2PeriphRSTR 寄存器中对应位置为 1 的外设的复位功能。具体来说,根据 STM32 参考手册的 RCC_APB2PeriphRSTR 寄存器描述,这些位对应的外设如下: - Bit 1 对应外设 AFIO(Alternate Function IO) - Bit 2 对应外设 IOPA(IO Port A) - Bit 3 对应外设 IOPB(IO Port B) - Bit 4 对应外设 IOPC(IO Port C) - Bit 5 对应外设 IOPD(IO Port D) - Bit 6 对应外设 IOPE(IO Port E) - Bit 7 对应外设 IOPF(IO Port F) - Bit 8 对应外设 IOPG(IO Port G) - Bit 9 对应外设 ADC1(Analog to Digital Converter 1) - Bit 10 对应外设 ADC2(Analog to Digital Converter 2) - Bit 11 对应外设 TIM1(Timer 1) - Bit 12 对应外设 SPI1(Serial Peripheral Interface 1) - Bit 13 对应外设 TIM8(Timer 8) - Bit 14 对应外设 USART1(Universal Synchronous/Asynchronous Receiver Transmitter 1) - Bit 15 对应外设 ADC3(Analog to Digital Converter 3) - Bit 16 对应外设 TIM9(Timer 9) - Bit 17 对应外设 TIM10(Timer 10) - Bit 18 对应外设 TIM11(Timer 11) 因此,通过将 RCC_APB2PeriphRSTR 寄存器的值设置为 0X01FC,可以禁用这些外设的复位功能。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值