标题: 基于stm32搭载rtthread的停机唤醒实验源码 [打印本页]

作者: Roomen0    时间: 2018-12-6 16:01
标题: 基于stm32搭载rtthread的停机唤醒实验源码
如题,本程序使用stm32f103rctc(正*原子mini板),使用rtt操作系统,进入停机模式及唤醒

单片机源程序如下:
  1. /*
  2. * File      : main.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date           Author       Notes
  12. * 2015-07-29     Arda.Fu      first implementation
  13. */
  14. #include <rtthread.h>
  15. #include <rtdevice.h>
  16. #include "wake_up.h"

  17. int main(void)
  18. {
  19.     WKUP_Init();
  20. //    rt_pin_mode(25,PIN_MODE_INPUT_PULLUP);
  21. //    rt_pin_mode(50,PIN_MODE_INPUT_PULLUP);
  22.    
  23.     rt_pin_mode(27,PIN_MODE_INPUT_PULLUP);//key
  24.    
  25.     rt_pin_mode(55,PIN_MODE_OUTPUT);//beep
  26.     rt_pin_write(55,1);
  27.    
  28.     rt_pin_mode(56,PIN_MODE_OUTPUT);//led
  29.     rt_pin_write(56,0);
  30.     /* user app entry */
  31.     while(1)
  32.     {
  33.         if(rt_pin_read(25) == 0 ||rt_pin_read(50) == 0)
  34.         {
  35.             Sys_Enter_Standby();
  36.         }
  37.         rt_thread_delay(rt_tick_from_millisecond(1));
  38.     }
  39.     return 0;
  40. }
复制代码

所有资料51hei提供下载:
stm32f10x_Low_Power.rar (1.18 MB, 下载次数: 36)







欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1