📄 periphery_8c.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.c 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.c File Reference</h1>Keyboard and joystick handler functions. <a href="#_details">More...</a><p><code>#include <msp430xG461x.h></code><br><code>#include <signal.h></code><br><code>#include "<a class="el" href="periphery_8h-source.html">periphery.h</a>"</code><br><code>#include "<a class="el" href="lcd_8h-source.html">lcd.h</a>"</code><br><code>#include "<a class="el" href="time_8h-source.html">time.h</a>"</code><br><p>Include dependency graph for periphery.c:<p><center><img src="periphery_8c__incl.png" border="0" usemap="#periphery.c_map" alt=""></center><map name="periphery.c_map"><area href="periphery_8h.html" shape="rect" coords="175,102,273,126" alt=""><area href="lcd_8h.html" shape="rect" coords="197,150,251,174" alt=""><area href="time_8h.html" shape="rect" coords="192,198,256,222" alt=""><area href="common_8h.html" shape="rect" coords="344,102,437,126" alt=""><area href="integer_8h-source.html" shape="rect" coords="485,102,568,126" alt=""></map><p><a href="periphery_8c-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>Defines</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8c.html#3cb24f09004f92185b77e9e7bac6ea61">TEMP_OFFSET</a> 0</td></tr><tr><td colspan="2"><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8c.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_8c.html#d16bb4f020abd6db5093cccc2fdede88">KBD_getB2</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8c.html#aef39e368becfc8ede2d7e992660ded8">interrupt</a> (PORT1_VECTOR)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="periphery_8c.html#477b8611b60e8470d77f072cf7c9d0b7">KBD_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_8c.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_8c.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.c::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_8c.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_8c.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_8c.html#d773088e6129cd48c3d19dc2d2bd9a94">ADC12_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_8c.html#9ec8d0362cf611d557888c89d4482f87">ADC12_set1V5RefOn</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_8c.html#2163612531b2c18f22bb68f2c83b1da6">ADC12_set1V5RefOff</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_8c.html#9464a8c7650e23ac0832306e8e606349">ADC12_set2V5RefOn</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_8c.html#7289b206e53bd7792ee3d68b41d9e276">ADC12_set2V5RefOff</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_8c.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_8c.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_8c.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_8c.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.c::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_8c.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.c::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_8c.html#073df23545e437a9157e7e7bd906821f">KBD_b2Pressed</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Keyboard and joystick handler functions. <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_8c-source.html">periphery.c</a>.<hr><h2>Define Documentation</h2><a class="anchor" name="3cb24f09004f92185b77e9e7bac6ea61"></a><!-- doxytag: member="periphery.c::TEMP_OFFSET" ref="3cb24f09004f92185b77e9e7bac6ea61" args="" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">#define TEMP_OFFSET 0 </td> </tr> </table></div><div class="memdoc"><p>Temperature offset in Celsius. This value is for my MSP430-449STK2 board!<p>My calibration: A/D: 2799 -> 7.1 Celsius A/D: 2965 -> 25.0 Celsius <p>Definition at line <a class="el" href="periphery_8c-source.html#l00426">426</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><hr><h2>Function Documentation</h2><a class="anchor" name="231a7acdc6e3232732bedba92e905288"></a><!-- doxytag: member="periphery.c::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.c::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><p>Definition at line <a class="el" href="periphery_8c-source.html#l00349">349</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><a class="anchor" name="bdf0a3bb022e0beb710bcfd588afd99e"></a><!-- doxytag: member="periphery.c::ADC12_getTempCelsius" ref="bdf0a3bb022e0beb710bcfd588afd99e" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">float ADC12_getTempCelsius </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Calculates internal temperature of MSP430. You should calibrate the value! Change the TEMP_OFFSET define!<p><dl class="author" compact><dt><b>Author:</b></dt><dd>Peter Ivanov</dd></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Temperature in Celsius-degrees. </dd></dl><p>Definition at line <a class="el" href="periphery_8c-source.html#l00436">436</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><a class="anchor" name="d4968c9198afd4c51e5ce6a8f8feebff"></a><!-- doxytag: member="periphery.c::ADC12_getVCC" ref="d4968c9198afd4c51e5ce6a8f8feebff" args="(void)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">float ADC12_getVCC </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Get value form ADC12 chanel A11 (measure VCC) <dl class="return" compact><dt><b>Returns:</b></dt><dd>Voltage of power supply (VCC) in volts. </dd></dl><p>Definition at line <a class="el" href="periphery_8c-source.html#l00395">395</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><a class="anchor" name="d773088e6129cd48c3d19dc2d2bd9a94"></a><!-- doxytag: member="periphery.c::ADC12_init" ref="d773088e6129cd48c3d19dc2d2bd9a94" args="(void)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void ADC12_init </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Initialize ADC12 module <p>Definition at line <a class="el" href="periphery_8c-source.html#l00228">228</a> of file <a class="el" href="periphery_8c-source.html">periphery.c</a>.</div></div><p><a class="anchor" name="2163612531b2c18f22bb68f2c83b1da6"></a><!-- doxytag: member="periphery.c::ADC12_set1V5RefOff" ref="2163612531b2c18f22bb68f2c83b1da6" args="(void)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void ADC12_set1V5RefOff </td> <td>(</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -