📄 periphery_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Sample MSP430-4619LCD Project: periphery.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.1 --><div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul></div><h1>periphery.h File Reference</h1>Keyboard and joystick handler function headers. <a href="#_details">More...</a><p><code>#include "<a class="el" href="common_8h-source.html">common.h</a>"</code><br><p>Include dependency graph for periphery.h:<p><center><img src="periphery_8h__incl.png" border="0" usemap="#periphery.h_map" alt=""></center><map name="periphery.h_map"><area href="common_8h.html" shape="rect" coords="152,6,245,30" alt=""><area href="integer_8h-source.html" shape="rect" coords="293,6,376,30" alt=""></map><p>This graph shows which files directly or indirectly include this file:<p><center><img src="periphery_8h__dep__incl.png" border="0" usemap="#periphery.hdep_map" alt=""></center><map name="periphery.hdep_map"><area href="main_8c.html" shape="rect" coords="301,8,368,32" alt=""><area href="menu_8h.html" shape="rect" coords="165,56,237,80" alt=""><area href="mma_8c.html" shape="rect" coords="168,104,235,128" alt=""><area href="periphery_8c.html" shape="rect" coords="153,152,249,176" alt=""><area href="menu_8c.html" shape="rect" coords="299,56,371,80" alt=""></map><p><a href="periphery_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Typedefs</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">typedef enum <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3">KBD_buttonPressed_T</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#ee61ae8f1c2cb6699241b9779166205f">KBD_buttonPressed_t</a></td></tr><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#3a41aabdad9b51b22a22a5258eb85550">JOY_pos_T</a> </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3">KBD_buttonPressed_T</a> { <br> <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce339290f25fe0f22e829936fb3eaf69dc6">KBD_LEFT</a> = JOY_POS_LEFT, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce379a6c46eb777cd89428ac4bec665bdeb">KBD_RIGHT</a> = JOY_POS_RIGHT, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3c5ec33c9246d8b46361b85b3fce36f2c">KBD_UP</a> = JOY_POS_UP, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce35220502aac775bdbbb2fbd8578336186">KBD_DOWN</a> = JOY_POS_DOWN, <br> <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce31b7f56901e09ea55d650643f2a1193b3">KBD_CENTER</a> = JOY_POS_CENTER, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce38aa3e27b2e075b24bf225d7aaa89ae1d">KBD_B1</a> = 0x20, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce33ab3e16ccfb2dd3794bd9e36441f679c">KBD_B2</a> = 0x40, <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce37e7f58f2dfc495230247864c3c42c181">KBD_OK</a> = KBD_B1, <br> <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3d64ccc54e9ccb336174d4ef9df161fdd">KBD_QUIT</a> = KBD_B2<br> }</td></tr><tr><td colspan="2"><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#477b8611b60e8470d77f072cf7c9d0b7">KBD_init</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#2a649e701ffa69773fb450e89db89698">KBD_getB1</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#d16bb4f020abd6db5093cccc2fdede88">KBD_getB2</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#b28c3e1b3cf39437be09919fb78a364c">JOY_init</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">JOY_pos_t </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#3ef001533f2bf00e62e27f2a1e5172ed">JOY_getPosition</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="63c0677a7650d8b00aabded94d64693c"></a><!-- doxytag: member="periphery.h::KBD_getButtonPressed" ref="63c0677a7650d8b00aabded94d64693c" args="()" --><a class="el" href="periphery_8h.html#ee61ae8f1c2cb6699241b9779166205f">KBD_buttonPressed_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#63c0677a7650d8b00aabded94d64693c">KBD_getButtonPressed</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#75690af9e89afd801dc40b20b5c813f1">GPIO_init</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#d773088e6129cd48c3d19dc2d2bd9a94">ADC12_init</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#231a7acdc6e3232732bedba92e905288">ADC12_get</a> (uint16_t mctl)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#e026819d3f4002ec6a094cb0a9254bed">ADC12_getOS</a> (uint16_t mctl)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#d4968c9198afd4c51e5ce6a8f8feebff">ADC12_getVCC</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#bdf0a3bb022e0beb710bcfd588afd99e">ADC12_getTempCelsius</a> ()</td></tr><tr><td colspan="2"><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="091d014581a2dd236ee7eb29ea220219"></a><!-- doxytag: member="periphery.h::KBD_b1Pressed" ref="091d014581a2dd236ee7eb29ea220219" args="" -->volatile <a class="el" href="common_8h.html#449976458a084f880dc8e3d29e7eb6f5">bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#091d014581a2dd236ee7eb29ea220219">KBD_b1Pressed</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="073df23545e437a9157e7e7bd906821f"></a><!-- doxytag: member="periphery.h::KBD_b2Pressed" ref="073df23545e437a9157e7e7bd906821f" args="" -->volatile <a class="el" href="common_8h.html#449976458a084f880dc8e3d29e7eb6f5">bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8h.html#073df23545e437a9157e7e7bd906821f">KBD_b2Pressed</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Keyboard and joystick handler function headers. <p><dl class="author" compact><dt><b>Author:</b></dt><dd>Peter Ivanov, Olimex Ltd. </dd></dl><p>Definition in file <a class="el" href="periphery_8h-source.html">periphery.h</a>.<hr><h2>Typedef Documentation</h2><a class="anchor" name="ee61ae8f1c2cb6699241b9779166205f"></a><!-- doxytag: member="periphery.h::KBD_buttonPressed_t" ref="ee61ae8f1c2cb6699241b9779166205f" args="" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef enum <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3">KBD_buttonPressed_T</a> <a class="el" href="periphery_8h.html#ee61ae8f1c2cb6699241b9779166205f">KBD_buttonPressed_t</a> </td> </tr> </table></div><div class="memdoc"><p>This enum is used to detect which button has been pressed. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="periphery_8c.html#63c0677a7650d8b00aabded94d64693c">KBD_getButtonPressed()</a> </dd></dl></div></div><p><hr><h2>Enumeration Type Documentation</h2><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce3"></a><!-- doxytag: member="periphery.h::KBD_buttonPressed_T" ref="14dc48ed135ccdd9551d8ac9195adce3" args="" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="periphery_8h.html#14dc48ed135ccdd9551d8ac9195adce3">KBD_buttonPressed_T</a> </td> </tr> </table></div><div class="memdoc"><p>This enum is used to detect which button has been pressed. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="periphery_8c.html#63c0677a7650d8b00aabded94d64693c">KBD_getButtonPressed()</a> </dd></dl><dl compact><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce339290f25fe0f22e829936fb3eaf69dc6"></a><!-- doxytag: member="KBD_LEFT" ref="14dc48ed135ccdd9551d8ac9195adce339290f25fe0f22e829936fb3eaf69dc6" args="" -->KBD_LEFT</em> </td><td>Joystick pushed to left. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce379a6c46eb777cd89428ac4bec665bdeb"></a><!-- doxytag: member="KBD_RIGHT" ref="14dc48ed135ccdd9551d8ac9195adce379a6c46eb777cd89428ac4bec665bdeb" args="" -->KBD_RIGHT</em> </td><td>Joystick pushed to right. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce3c5ec33c9246d8b46361b85b3fce36f2c"></a><!-- doxytag: member="KBD_UP" ref="14dc48ed135ccdd9551d8ac9195adce3c5ec33c9246d8b46361b85b3fce36f2c" args="" -->KBD_UP</em> </td><td>Joystick pushed to up. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce35220502aac775bdbbb2fbd8578336186"></a><!-- doxytag: member="KBD_DOWN" ref="14dc48ed135ccdd9551d8ac9195adce35220502aac775bdbbb2fbd8578336186" args="" -->KBD_DOWN</em> </td><td>Joystick pushed to down. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce31b7f56901e09ea55d650643f2a1193b3"></a><!-- doxytag: member="KBD_CENTER" ref="14dc48ed135ccdd9551d8ac9195adce31b7f56901e09ea55d650643f2a1193b3" args="" -->KBD_CENTER</em> </td><td>The center of joystick pushed. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce38aa3e27b2e075b24bf225d7aaa89ae1d"></a><!-- doxytag: member="KBD_B1" ref="14dc48ed135ccdd9551d8ac9195adce38aa3e27b2e075b24bf225d7aaa89ae1d" args="" -->KBD_B1</em> </td><td>Button 1 (OK) pressed. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce33ab3e16ccfb2dd3794bd9e36441f679c"></a><!-- doxytag: member="KBD_B2" ref="14dc48ed135ccdd9551d8ac9195adce33ab3e16ccfb2dd3794bd9e36441f679c" args="" -->KBD_B2</em> </td><td>Button 2 (Quit) pressed. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce37e7f58f2dfc495230247864c3c42c181"></a><!-- doxytag: member="KBD_OK" ref="14dc48ed135ccdd9551d8ac9195adce37e7f58f2dfc495230247864c3c42c181" args="" -->KBD_OK</em> </td><td>Button 1 (OK) pressed. </td></tr><tr><td valign="top"><em><a class="anchor" name="14dc48ed135ccdd9551d8ac9195adce3d64ccc54e9ccb336174d4ef9df161fdd"></a><!-- doxytag: member="KBD_QUIT" ref="14dc48ed135ccdd9551d8ac9195adce3d64ccc54e9ccb336174d4ef9df161fdd" args="" -->KBD_QUIT</em> </td><td>Button 2 (Quit) pressed. </td></tr></table></dl><p>Definition at line <a class="el" href="periphery_8h-source.html#l00036">36</a> of file <a class="el" href="periphery_8h-source.html">periphery.h</a>.</div></div><p><hr><h2>Function Documentation</h2><a class="anchor" name="231a7acdc6e3232732bedba92e905288"></a><!-- doxytag: member="periphery.h::ADC12_get" ref="231a7acdc6e3232732bedba92e905288" args="(uint16_t mctl)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int ADC12_get </td> <td>(</td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>mctl</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Get value form an ADC12 channel.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>mctl</em> </td><td>ADC12 channel number (INCH_0 .. INCH_12) and other parameters. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Maesured value: 0..4095 (12 bit). </dd></dl><p>Definition at line <a class="el" href="periphery_8c-source.html#l00300">300</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><a class="anchor" name="e026819d3f4002ec6a094cb0a9254bed"></a><!-- doxytag: member="periphery.h::ADC12_getOS" ref="e026819d3f4002ec6a094cb0a9254bed" args="(uint16_t mctl)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">uint16_t ADC12_getOS </td> <td>(</td> <td class="paramtype">uint16_t </td> <td class="paramname"> <em>mctl</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Get value form an ADC12 channel. Eight times oversampling is used to get more precise value. Before calling this function you should switch on the reference voltage and wait. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="periphery_8c.html#d4968c9198afd4c51e5ce6a8f8feebff">ADC12_getVCC()</a>, <a class="el" href="periphery_8c.html#bdf0a3bb022e0beb710bcfd588afd99e">ADC12_getTempCelsius()</a></dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>mctl</em> </td><td>ADC12 channel number (INCH_0 .. INCH_12) and other parameters. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Maesured value: 0..4095 (12 bit). </dd></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -