找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2738|回复: 0
收起左侧

基于stm32搭载rtthread的停机唤醒实验源码

[复制链接]
ID:440987 发表于 2018-12-6 16:01 | 显示全部楼层 |阅读模式
如题,本程序使用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)

评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表