找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3370|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

基于stm32搭載rtthread的停機(jī)喚醒實(shí)驗(yàn)源碼

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:440987 發(fā)表于 2018-12-6 16:01 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
如題,本程序使用stm32f103rctc(正*原子mini板),使用rtt操作系統(tǒng),進(jìn)入停機(jī)模式及喚醒

單片機(jī)源程序如下:
  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. }
復(fù)制代碼

所有資料51hei提供下載:
stm32f10x_Low_Power.rar (1.18 MB, 下載次數(shù): 36)


評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂1 踩
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表