Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

438 linhas
18KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.10"/>
  7. <title>SdFat: DigitalPin&lt; PinNumber &gt; Class Template Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectalign" style="padding-left: 0.5em;">
  26. <div id="projectname">SdFat
  27. </div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. <!-- end header part -->
  34. <!-- Generated by Doxygen 1.8.10 -->
  35. <script type="text/javascript">
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. </script>
  38. <div id="navrow1" class="tabs">
  39. <ul class="tablist">
  40. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  41. <li><a href="modules.html"><span>Modules</span></a></li>
  42. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  43. <li><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. <div id="navrow2" class="tabs2">
  63. <ul class="tablist">
  64. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  65. <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
  66. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  67. </ul>
  68. </div>
  69. <!-- window showing the filter options -->
  70. <div id="MSearchSelectWindow"
  71. onmouseover="return searchBox.OnSearchSelectShow()"
  72. onmouseout="return searchBox.OnSearchSelectHide()"
  73. onkeydown="return searchBox.OnSearchSelectKey(event)">
  74. </div>
  75. <!-- iframe showing the search results (closed by default) -->
  76. <div id="MSearchResultsWindow">
  77. <iframe src="javascript:void(0)" frameborder="0"
  78. name="MSearchResults" id="MSearchResults">
  79. </iframe>
  80. </div>
  81. </div><!-- top -->
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-methods">Public Member Functions</a> &#124;
  85. <a href="class_digital_pin-members.html">List of all members</a> </div>
  86. <div class="headertitle">
  87. <div class="title">DigitalPin&lt; PinNumber &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__digital_pin.html">Fast Pin I/O</a></div></div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <p>Fast digital port I/O.
  91. <a href="class_digital_pin.html#details">More...</a></p>
  92. <p><code>#include &lt;DigitalPin.h&gt;</code></p>
  93. <table class="memberdecls">
  94. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  95. Public Member Functions</h2></td></tr>
  96. <tr class="memitem:aa6e07eea6e152d47c6f0d232bed9c45e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#aa6e07eea6e152d47c6f0d232bed9c45e">config</a> (uint8_t <a class="el" href="class_digital_pin.html#afe1550df47980934061d5578ec1fd644">mode</a>, bool level)</td></tr>
  97. <tr class="separator:aa6e07eea6e152d47c6f0d232bed9c45e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  98. <tr class="memitem:ab68480b09df5c4794c95cdf2230d4c55"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#ab68480b09df5c4794c95cdf2230d4c55">DigitalPin</a> ()</td></tr>
  99. <tr class="separator:ab68480b09df5c4794c95cdf2230d4c55"><td class="memSeparator" colspan="2">&#160;</td></tr>
  100. <tr class="memitem:add1677ecf4c7dc3c12effd39c1db34ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#add1677ecf4c7dc3c12effd39c1db34ed">high</a> ()</td></tr>
  101. <tr class="separator:add1677ecf4c7dc3c12effd39c1db34ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:aeb6a3f66fb3f9fb9ec8233bdb18aa6eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#aeb6a3f66fb3f9fb9ec8233bdb18aa6eb">low</a> ()</td></tr>
  103. <tr class="separator:aeb6a3f66fb3f9fb9ec8233bdb18aa6eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:afe1550df47980934061d5578ec1fd644"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#afe1550df47980934061d5578ec1fd644">mode</a> (uint8_t mode)</td></tr>
  105. <tr class="separator:afe1550df47980934061d5578ec1fd644"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. <tr class="memitem:ab609c911b4a672e4d382260fc1fdd266"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#ab609c911b4a672e4d382260fc1fdd266">operator bool</a> () const </td></tr>
  107. <tr class="separator:ab609c911b4a672e4d382260fc1fdd266"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:adbc9c84602246497a1dbe011e9339cc0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_digital_pin.html">DigitalPin</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#adbc9c84602246497a1dbe011e9339cc0">operator=</a> (bool value)</td></tr>
  109. <tr class="separator:adbc9c84602246497a1dbe011e9339cc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a55e344551ca86f8acd489aac277c9961"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#a55e344551ca86f8acd489aac277c9961">read</a> () const </td></tr>
  111. <tr class="separator:a55e344551ca86f8acd489aac277c9961"><td class="memSeparator" colspan="2">&#160;</td></tr>
  112. <tr class="memitem:ab2109c522836448cd6dfd576c1b5a5a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#ab2109c522836448cd6dfd576c1b5a5a0">toggle</a> ()</td></tr>
  113. <tr class="separator:ab2109c522836448cd6dfd576c1b5a5a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:a08b7eee5165c5055bd0bbbda491bdfff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_digital_pin.html#a08b7eee5165c5055bd0bbbda491bdfff">write</a> (bool value)</td></tr>
  115. <tr class="separator:a08b7eee5165c5055bd0bbbda491bdfff"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. </table>
  117. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  118. <div class="textblock"><h3>template&lt;uint8_t PinNumber&gt;<br />
  119. class DigitalPin&lt; PinNumber &gt;</h3>
  120. <p>Fast digital port I/O. </p>
  121. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  122. <a class="anchor" id="ab68480b09df5c4794c95cdf2230d4c55"></a>
  123. <div class="memitem">
  124. <div class="memproto">
  125. <div class="memtemplate">
  126. template&lt;uint8_t PinNumber&gt; </div>
  127. <table class="mlabels">
  128. <tr>
  129. <td class="mlabels-left">
  130. <table class="memname">
  131. <tr>
  132. <td class="memname"><a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::<a class="el" href="class_digital_pin.html">DigitalPin</a> </td>
  133. <td>(</td>
  134. <td class="paramname"></td><td>)</td>
  135. <td></td>
  136. </tr>
  137. </table>
  138. </td>
  139. <td class="mlabels-right">
  140. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  141. </tr>
  142. </table>
  143. </div><div class="memdoc">
  144. <p>Constructor </p>
  145. </div>
  146. </div>
  147. <h2 class="groupheader">Member Function Documentation</h2>
  148. <a class="anchor" id="aa6e07eea6e152d47c6f0d232bed9c45e"></a>
  149. <div class="memitem">
  150. <div class="memproto">
  151. <div class="memtemplate">
  152. template&lt;uint8_t PinNumber&gt; </div>
  153. <table class="mlabels">
  154. <tr>
  155. <td class="mlabels-left">
  156. <table class="memname">
  157. <tr>
  158. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::config </td>
  159. <td>(</td>
  160. <td class="paramtype">uint8_t&#160;</td>
  161. <td class="paramname"><em>mode</em>, </td>
  162. </tr>
  163. <tr>
  164. <td class="paramkey"></td>
  165. <td></td>
  166. <td class="paramtype">bool&#160;</td>
  167. <td class="paramname"><em>level</em>&#160;</td>
  168. </tr>
  169. <tr>
  170. <td></td>
  171. <td>)</td>
  172. <td></td><td></td>
  173. </tr>
  174. </table>
  175. </td>
  176. <td class="mlabels-right">
  177. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  178. </tr>
  179. </table>
  180. </div><div class="memdoc">
  181. <p>Set pin configuration. </p><dl class="params"><dt>Parameters</dt><dd>
  182. <table class="params">
  183. <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>INPUT or OUTPUT. </td></tr>
  184. <tr><td class="paramdir">[in]</td><td class="paramname">level</td><td>If mode is OUTPUT, set level high/low. If mode is INPUT, enable or disable the pin's 20K pullup. </td></tr>
  185. </table>
  186. </dd>
  187. </dl>
  188. </div>
  189. </div>
  190. <a class="anchor" id="add1677ecf4c7dc3c12effd39c1db34ed"></a>
  191. <div class="memitem">
  192. <div class="memproto">
  193. <div class="memtemplate">
  194. template&lt;uint8_t PinNumber&gt; </div>
  195. <table class="mlabels">
  196. <tr>
  197. <td class="mlabels-left">
  198. <table class="memname">
  199. <tr>
  200. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::high </td>
  201. <td>(</td>
  202. <td class="paramname"></td><td>)</td>
  203. <td></td>
  204. </tr>
  205. </table>
  206. </td>
  207. <td class="mlabels-right">
  208. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  209. </tr>
  210. </table>
  211. </div><div class="memdoc">
  212. <p>Set pin level high if output mode or enable 20K pullup if input mode. </p>
  213. </div>
  214. </div>
  215. <a class="anchor" id="aeb6a3f66fb3f9fb9ec8233bdb18aa6eb"></a>
  216. <div class="memitem">
  217. <div class="memproto">
  218. <div class="memtemplate">
  219. template&lt;uint8_t PinNumber&gt; </div>
  220. <table class="mlabels">
  221. <tr>
  222. <td class="mlabels-left">
  223. <table class="memname">
  224. <tr>
  225. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::low </td>
  226. <td>(</td>
  227. <td class="paramname"></td><td>)</td>
  228. <td></td>
  229. </tr>
  230. </table>
  231. </td>
  232. <td class="mlabels-right">
  233. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  234. </tr>
  235. </table>
  236. </div><div class="memdoc">
  237. <p>Set pin level low if output mode or disable 20K pullup if input mode. </p>
  238. </div>
  239. </div>
  240. <a class="anchor" id="afe1550df47980934061d5578ec1fd644"></a>
  241. <div class="memitem">
  242. <div class="memproto">
  243. <div class="memtemplate">
  244. template&lt;uint8_t PinNumber&gt; </div>
  245. <table class="mlabels">
  246. <tr>
  247. <td class="mlabels-left">
  248. <table class="memname">
  249. <tr>
  250. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::mode </td>
  251. <td>(</td>
  252. <td class="paramtype">uint8_t&#160;</td>
  253. <td class="paramname"><em>mode</em></td><td>)</td>
  254. <td></td>
  255. </tr>
  256. </table>
  257. </td>
  258. <td class="mlabels-right">
  259. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  260. </tr>
  261. </table>
  262. </div><div class="memdoc">
  263. <p>Set pin mode. </p><dl class="params"><dt>Parameters</dt><dd>
  264. <table class="params">
  265. <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>INPUT, OUTPUT, or INPUT_PULLUP.</td></tr>
  266. </table>
  267. </dd>
  268. </dl>
  269. <p>The internal pullup resistors will be enabled if mode is INPUT_PULLUP and disabled if the mode is INPUT. </p>
  270. </div>
  271. </div>
  272. <a class="anchor" id="ab609c911b4a672e4d382260fc1fdd266"></a>
  273. <div class="memitem">
  274. <div class="memproto">
  275. <div class="memtemplate">
  276. template&lt;uint8_t PinNumber&gt; </div>
  277. <table class="mlabels">
  278. <tr>
  279. <td class="mlabels-left">
  280. <table class="memname">
  281. <tr>
  282. <td class="memname"><a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::operator bool </td>
  283. <td>(</td>
  284. <td class="paramname"></td><td>)</td>
  285. <td> const</td>
  286. </tr>
  287. </table>
  288. </td>
  289. <td class="mlabels-right">
  290. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  291. </tr>
  292. </table>
  293. </div><div class="memdoc">
  294. <p>Parenthesis operator. </p><dl class="section return"><dt>Returns</dt><dd>Pin's level </dd></dl>
  295. </div>
  296. </div>
  297. <a class="anchor" id="adbc9c84602246497a1dbe011e9339cc0"></a>
  298. <div class="memitem">
  299. <div class="memproto">
  300. <div class="memtemplate">
  301. template&lt;uint8_t PinNumber&gt; </div>
  302. <table class="mlabels">
  303. <tr>
  304. <td class="mlabels-left">
  305. <table class="memname">
  306. <tr>
  307. <td class="memname"><a class="el" href="class_digital_pin.html">DigitalPin</a>&amp; <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::operator= </td>
  308. <td>(</td>
  309. <td class="paramtype">bool&#160;</td>
  310. <td class="paramname"><em>value</em></td><td>)</td>
  311. <td></td>
  312. </tr>
  313. </table>
  314. </td>
  315. <td class="mlabels-right">
  316. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  317. </tr>
  318. </table>
  319. </div><div class="memdoc">
  320. <p>Asignment operator. </p><dl class="params"><dt>Parameters</dt><dd>
  321. <table class="params">
  322. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>If true set the pin's level high else set the pin's level low.</td></tr>
  323. </table>
  324. </dd>
  325. </dl>
  326. <dl class="section return"><dt>Returns</dt><dd>This <a class="el" href="class_digital_pin.html" title="Fast digital port I/O. ">DigitalPin</a> instance. </dd></dl>
  327. </div>
  328. </div>
  329. <a class="anchor" id="a55e344551ca86f8acd489aac277c9961"></a>
  330. <div class="memitem">
  331. <div class="memproto">
  332. <div class="memtemplate">
  333. template&lt;uint8_t PinNumber&gt; </div>
  334. <table class="mlabels">
  335. <tr>
  336. <td class="mlabels-left">
  337. <table class="memname">
  338. <tr>
  339. <td class="memname">bool <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::read </td>
  340. <td>(</td>
  341. <td class="paramname"></td><td>)</td>
  342. <td> const</td>
  343. </tr>
  344. </table>
  345. </td>
  346. <td class="mlabels-right">
  347. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  348. </tr>
  349. </table>
  350. </div><div class="memdoc">
  351. <dl class="section return"><dt>Returns</dt><dd>Pin's level. </dd></dl>
  352. </div>
  353. </div>
  354. <a class="anchor" id="ab2109c522836448cd6dfd576c1b5a5a0"></a>
  355. <div class="memitem">
  356. <div class="memproto">
  357. <div class="memtemplate">
  358. template&lt;uint8_t PinNumber&gt; </div>
  359. <table class="mlabels">
  360. <tr>
  361. <td class="mlabels-left">
  362. <table class="memname">
  363. <tr>
  364. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::toggle </td>
  365. <td>(</td>
  366. <td class="paramname"></td><td>)</td>
  367. <td></td>
  368. </tr>
  369. </table>
  370. </td>
  371. <td class="mlabels-right">
  372. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  373. </tr>
  374. </table>
  375. </div><div class="memdoc">
  376. <p>Toggle a pin.</p>
  377. <p>If the pin is in output mode toggle the pin's level. If the pin is in input mode toggle the state of the 20K pullup. </p>
  378. </div>
  379. </div>
  380. <a class="anchor" id="a08b7eee5165c5055bd0bbbda491bdfff"></a>
  381. <div class="memitem">
  382. <div class="memproto">
  383. <div class="memtemplate">
  384. template&lt;uint8_t PinNumber&gt; </div>
  385. <table class="mlabels">
  386. <tr>
  387. <td class="mlabels-left">
  388. <table class="memname">
  389. <tr>
  390. <td class="memname">void <a class="el" href="class_digital_pin.html">DigitalPin</a>&lt; PinNumber &gt;::write </td>
  391. <td>(</td>
  392. <td class="paramtype">bool&#160;</td>
  393. <td class="paramname"><em>value</em></td><td>)</td>
  394. <td></td>
  395. </tr>
  396. </table>
  397. </td>
  398. <td class="mlabels-right">
  399. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  400. </tr>
  401. </table>
  402. </div><div class="memdoc">
  403. <p>Write the pin's level. </p><dl class="params"><dt>Parameters</dt><dd>
  404. <table class="params">
  405. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>If true set the pin's level high else set the pin's level low. </td></tr>
  406. </table>
  407. </dd>
  408. </dl>
  409. </div>
  410. </div>
  411. <hr/>The documentation for this class was generated from the following file:<ul>
  412. <li>Arduino/libraries/SdFat/src/SdSpiCard/<a class="el" href="_digital_pin_8h.html">DigitalPin.h</a></li>
  413. </ul>
  414. </div><!-- contents -->
  415. <!-- start footer part -->
  416. <hr class="footer"/><address class="footer"><small>
  417. Generated on Sat Jan 23 2016 13:44:27 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  418. <img class="footer" src="doxygen.png" alt="doxygen"/>
  419. </a> 1.8.10
  420. </small></address>
  421. </body>
  422. </html>