⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 power-intro.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Introduction</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="eCos Power Management Support"HREF="services-power.html"><LINKREL="PREVIOUS"TITLE="eCos Power Management Support"HREF="services-power.html"><LINKREL="NEXT"TITLE="Power Management Information"HREF="power-info.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="services-power.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="power-info.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="POWER-INTRO">Introduction</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN15587"></A><H2>Name</H2>Introduction&nbsp;--&nbsp;eCos support for Power Management</DIV><DIVCLASS="REFSECT1"><ANAME="POWER-INTRO-INTRO"></A><H2>Introduction</H2><P>The eCos Power Management package provides a framework forincorporating power management facilities in an embedded application.However its functionality is deliberately limited.</P><P></P><OLTYPE="1"><LI><P>The package does not contain any support for controlling the currentpower mode of any given processor, device or board. Instead it is theresponsibility of the appropriate HAL or device driver package toimplement such support, by implementing <ICLASS="FIRSTTERM">powercontrollers</I>. The power management package groups thesepower controllers together and provides an interface for manipulatingthem.</P></LI><LI><P>The package does not contain any power management policy support.Specifically, including this package in an application does not byitself ever cause the system to go into low-power mode. Instead it isthe responsibility of a separate policy module, provided byhigher-level application code or by some other package, to decide whenit would be appropriate to switch from one power mode to another. Thepower management package then provides the mechanisms for making ithappen.</P></LI></OL></DIV><DIVCLASS="REFSECT1"><ANAME="POWER-INTRO-INCLUDE"></A><H2>Including Power Management</H2><P>The power management package is never included automatically in aneCos configuration: it is not part of any target specification or ofany template. Instead it must be added explicitly to a configurationif the intended application requires power management functionality.When using the command-line <BCLASS="COMMAND">ecosconfig</B> tool thiscan be achieved using a command such as:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ ecosconfig add power</PRE></TD></TR></TABLE><P>The generic eCos user documentation should be consulted for moreinformation on how to use the various tools. The functionalityprovided by the power management package is defined in the header file<TTCLASS="FILENAME">cyg/power/power.h</TT>. This headerfile can be used by both C and C++ code.</P></DIV><DIVCLASS="REFSECT1"><ANAME="POWER-INTRO-MODES"></A><H2>Power Modes</H2><P>There are four defined modes of operation:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT>active</DT><DD><P>The system is fully operational, and power consumption is expected tobe high.</P></DD><DT>idle</DT><DD><P>There has been little or no activity for a short period of time. It isup to the policy module to determine what constitutes a short periodof time, but typically it will be some tenths of a second or somesmall number of seconds. A possible action when entering idle mode isto reduce the system's clock speed, thus reducing the power drawn bythe cpu.</P><P>Note that typically this power mode is not entered automaticallywhenever the idle thread starts running. Instead it is entered whenthe policy module discovers that for a certain period of time thesystem has been spending most of its time in the idle thread.Theoretically it is possible to implement a policy module that wouldcause a switch to idle mode as soon as the idle thread starts running,but that could result in a great many power mode changes for noimmediate benefit.</P></DD><DT>sleep</DT><DD><P>The system has been idle for a significant period of time, perhapssome tens of seconds. It is desirable to shut down any hardware thatis drawing a significant amount of power, for example a screenbacklight.</P></DD><DT>off</DT><DD><P>The system is powered down. Power consumption should be minimized.Some special action may be needed before the system comes back up, forexample the user may need to press a specific button.</P></DD></DL></DIV><P>The exact transitions that will happen are decided by the policymodule. One policy module might include transitions from active toidle, from idle to sleep, from sleep to off, and from any of idle,sleep or off directly back to active. Another policy module mightonly use the active and off states, bypassing the intermediate ones.</P></DIV><DIVCLASS="REFSECT1"><ANAME="POWER-INTRO-CONTROLLERS"></A><H2>Power Controllers</H2><P>The power management package operates primarily on power controllers.The main functionality provided by a power controller is to switch thepower mode for some part of the system, for example the lcd display orthe cpu. A power controller consists primarily of a function whichwill be invoked to switch the power mode for the part of the overallsystem being controlled, plus some auxiliary data. A typical systemwill include a number of different power controllers:</P><P></P><OLTYPE="1"><LI><P>Usually there will be one power controller<TTCLASS="VARNAME">power_controller_cpu</TT> associated with the processoror with the target platform, and provided by the corresponding HALpackage. It is this controller which is responsible for switching offthe system when entering the <SPANCLASS="TYPE">off</SPAN> mode, which makes itsomewhat special: attempting to switch off the cpu before otherdevices like the lcd display does not make sense because the cpu wouldno longer be executing any instructions for the latter operation.Therefore this power controller has to be invoked last when switchingto a lower-power mode, and similarly when switching back to ahigher-power mode it will be invoked first.</P><P>It should be noted that providing power management support is not ahard requirement when porting eCos to a new processor or platform, andmany eCos ports predate the availability of power management support.Therefore for any given platform it is distinctly possible that<TT

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -