Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 1 | page.title=Lights |
| 2 | pdk.version=1.0 |
| 3 | @jd:body |
| 4 | |
| 5 | <a name="toc"/> |
| 6 | <div style="padding:10px"> |
| 7 | <a href="#androidLightsIntroduction">Introduction</a><br/> |
| 8 | <a href="#androidLightsBuildingDriver">Building a Lights Library</a><br/> |
| 9 | <a href="#androidLightsInterface">Interface</a><br/></div></font></div> |
| 10 | |
| 11 | <a name="androidLightsIntroduction"></a><h2>Introduction</h2> |
| 12 | |
| 13 | <p>Android defines a user space C abstraction interface for LED hardware. The interface header is defined in |
| 14 | <code>hardware/libhardware/include/hardware/lights.h</code>. |
| 15 | In order to integrate LEDs with Android you need to build a shared library that implements this interface. |
| 16 | |
| 17 | The types of logical lights currently supported by Android include: |
| 18 | <ul> |
| 19 | <li>Backlight</li> |
| 20 | <li>Keyboard</li> |
| 21 | <li>Buttons</li> |
| 22 | <li>Battery</li> |
| 23 | <li>Notifications</li> |
| 24 | <li>Attention</li> |
| 25 | </ul> |
| 26 | </p> |
| 27 | |
| 28 | <a name="androidLightsBuildingDriver"></a><h2>Building a Lights Library</h2> |
| 29 | <p> To implement a Lights driver, create a shared library that implements the interface defined in <code>lights.h</code>. You must name your shared library |
| 30 | <code>liblights.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. |
| 31 | </p |
| 32 | |
| 33 | |
| 34 | <a name="androidLightsInterface"></a><h2>Interface</h2> |
| 35 | |
| 36 | |
| 37 | |
| 38 | <p><span class="lh2"><a name="androidDoxygenNote"></a></span> |
| 39 | |
| 40 | <p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="lights.html">click here</a>.</p> |
| 41 | |
| 42 | |
| 43 | <iframe onLoad="resizeDoxFrameHeight();" src="lights_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" |
| 44 | frameborder="0" style="width:100%;"></iframe> |