SN_STOP.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef SN_STOP_H
  2. #define SN_STOP_H
  3. #include "ciu32f003_std.h"
  4. #include "SN_GPIO.h"
  5. #include "SN_ADC.h"
  6. #include "SN_PWM.h"
  7. #include "SN_EXIT.h"
  8. #include "SN_TIM3_INIT.h"
  9. #include "SN_TIM1_INIT.h"
  10. #include "SN_UART.h"
  11. #include "SN_FLASH.h"
  12. #include "SN_RCC.h"
  13. #include "SN_SPI.h"
  14. #include "SN_DDQ.h"
  15. #include "i2c_bsp.h"
  16. #include <stdio.h>
  17. void SN_STOP_EN(void); //进入休眠
  18. void SN_LPtim_Rouse(uint16_t cnt); //使用定时器唤醒
  19. void SN_Exti_Rouse(void); //使用io唤醒
  20. void SN_LPtim_ARR(uint16_t cnt); //更新定时间
  21. void SN_LPtim_SN_LPtim_Stop(void); //停止lptim唤醒
  22. void SN_LPtim_SN_LPtim_EN(void); //启动lptim唤醒
  23. //休眠系统设置参数---------------------------------------------------------------------------------------
  24. #define LPtim_Div //唤醒的时钟
  25. #define LPtim_Div_colk_Source //时钟源, 推荐使用RCL
  26. #define LPTIM_PRESCALER_DIV_x LPTIM_PRESCALER_DIV1
  27. #define PMU_MODE PMU_MODE_STOP //PMU_MODE_STOP普通休眠 PMU_MODE_DEEPSTOP深度休眠
  28. // 休眠时间计算公式: (32k/LPTIM_PRESCALER_DIV_x )*CNT = 休眠时间
  29. //-------------------------------------------------------------------------------------------------------
  30. #endif