📄 power-attached.html
字号:
<!-- 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>Attached and Detached Controllers</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="Support for Policy Modules"HREF="power-policy.html"><LINKREL="NEXT"TITLE="Implementing a Power Controller"HREF="power-controller.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="power-policy.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="power-controller.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="POWER-ATTACHED">Attached and Detached Controllers</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN15902"></A><H2>Name</H2>Attached and Detached Controllers -- control which power controllers are affected by global changes</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN15905"><H2>Synopsis</H2><DIVCLASS="FUNCSYNOPSIS"><ANAME="AEN15906"><P></P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="FUNCSYNOPSISINFO">#include <cyg/power/power.h></PRE></TD></TR></TABLE><P><CODE><CODECLASS="FUNCDEF"> cyg_bool power_get_controller_attached </CODE>( PowerController* controller );</CODE></P><P><CODE><CODECLASS="FUNCDEF"> void power_set_controller_attached </CODE>( PowerController* controller , cyg_bool new_state );</CODE></P><P></P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN15920"></A><H2>Detaching Power Controllers</H2><P>By default the global operation <TTCLASS="FUNCTION">power_set_mode</TT>affects all power controllers. There may be circumstances when this isnot desirable. For example if a particular device is not currentlybeing used then it can be left switched off: the rest of the systemcould be moving between <SPANCLASS="TYPE">active</SPAN>, <SPANCLASS="TYPE">idle</SPAN> and<SPANCLASS="TYPE">sleep</SPAN> modes, but there is no point in invoking the powercontroller for the unused device. To support this the power managementpackage supports the concept of attached and detached controllers. Bydefault all controllers are attached, and hence will be affected byglobal mode changes. A specific controller can be detached using thefunction <TTCLASS="FUNCTION">power_set_controller_attached</TT>. Thisfunction takes two arguments, one to specify a particular controllerand another to specify the desired new state.<TTCLASS="FUNCTION">power_get_controller_attached</TT> can be used todetermine whether or not a specific controller is currently attached.</P><P>The attached or detached state of a controller only affects whathappens during a global mode change, in other words following a callto <TTCLASS="FUNCTION">power_set_mode</TT>. It is still possible tomanipulate a detached controller using<TTCLASS="FUNCTION">power_set_controller_mode</TT> or<TTCLASS="FUNCTION">power_set_controller_mode_now</TT>.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="power-policy.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="power-controller.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Support for Policy Modules</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="services-power.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Implementing a Power Controller</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -