⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a2d_8h-source.html

📁 avr应用测试程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
00076 <span class="comment"></span>// these channels supported only in ATmega12800077 <span class="comment">// differential with gain</span>00078 <span class="preprocessor">#define ADC_CH_0_0_DIFF10X      0x08</span>00079 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_1_0_DIFF10X      0x09</span>00080 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_0_0_DIFF200X     0x0A</span>00081 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_1_0_DIFF200X     0x0B</span>00082 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_2_2_DIFF10X      0x0C</span>00083 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_3_2_DIFF10X      0x0D</span>00084 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_2_2_DIFF200X     0x0E</span>00085 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_3_2_DIFF200X     0x0F</span>00086 <span class="preprocessor"></span><span class="comment">// differential</span>00087 <span class="preprocessor">#define ADC_CH_0_1_DIFF1X       0x10</span>00088 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_1_1_DIFF1X       0x11</span>00089 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_2_1_DIFF1X       0x12</span>00090 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_3_1_DIFF1X       0x13</span>00091 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_4_1_DIFF1X       0x14</span>00092 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_5_1_DIFF1X       0x15</span>00093 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_6_1_DIFF1X       0x16</span>00094 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_7_1_DIFF1X       0x17</span>00095 <span class="preprocessor"></span>00096 <span class="preprocessor">#define ADC_CH_0_2_DIFF1X       0x18</span>00097 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_1_2_DIFF1X       0x19</span>00098 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_2_2_DIFF1X       0x1A</span>00099 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_3_2_DIFF1X       0x1B</span>00100 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_4_2_DIFF1X       0x1C</span>00101 <span class="preprocessor"></span><span class="preprocessor">#define ADC_CH_5_2_DIFF1X       0x1D</span>00102 <span class="preprocessor"></span>00103 <span class="comment">// compatibility for new Mega processors</span>00104 <span class="comment">// ADCSR hack apparently no longer necessary in new AVR-GCC</span>00105 <span class="preprocessor">#ifdef ADCSRA</span>00106 <span class="preprocessor"></span><span class="preprocessor">#ifndef ADCSR</span>00107 <span class="preprocessor"></span><span class="preprocessor">    #define ADCSR   ADCSRA</span>00108 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00109 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00110 <span class="preprocessor"></span><span class="preprocessor">#ifdef ADATE</span>00111 <span class="preprocessor"></span><span class="preprocessor">    #define ADFR    ADATE</span>00112 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00113 <span class="preprocessor"></span>00114 <span class="comment">// function prototypes</span>00115 <span class="comment"></span>00116 <span class="comment">//! Initializes the A/D converter.</span>00117 <span class="comment">/// Turns ADC on and prepares it for use.</span>00118 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga0">a2dInit</a>(<span class="keywordtype">void</span>);00119 <span class="comment"></span>00120 <span class="comment">//! Turn off A/D converter</span>00121 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga1">a2dOff</a>(<span class="keywordtype">void</span>);00122 <span class="comment"></span>00123 <span class="comment">//! Sets the division ratio of the A/D converter clock.</span>00124 <span class="comment">/// This function is automatically called from a2dInit()</span>00125 <span class="comment">/// with a default value.</span>00126 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga2">a2dSetPrescaler</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> prescale);00127 <span class="comment"></span>00128 <span class="comment">//! Configures which voltage reference the A/D converter uses.</span>00129 <span class="comment">/// This function is automatically called from a2dInit()</span>00130 <span class="comment">/// with a default value.</span>00131 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga3">a2dSetReference</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ref);00132 <span class="comment"></span>00133 <span class="comment">//! sets the a2d input channel</span>00134 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga4">a2dSetChannel</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch);00135 <span class="comment"></span>00136 <span class="comment">//! start a conversion on the current a2d input channel</span>00137 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__a2d.html#ga5">a2dStartConvert</a>(<span class="keywordtype">void</span>);00138 <span class="comment"></span>00139 <span class="comment">//! return TRUE if conversion is complete</span>00140 <span class="comment"></span>u08 <a class="code" href="group__a2d.html#ga6">a2dIsComplete</a>(<span class="keywordtype">void</span>);00141 <span class="comment"></span>00142 <span class="comment">//! Starts a conversion on A/D channel# ch,</span>00143 <span class="comment">/// returns the 10-bit value of the conversion when it is finished.</span>00144 <span class="comment"></span><span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="group__a2d.html#ga7">a2dConvert10bit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch);00145 <span class="comment"></span>00146 <span class="comment">//! Starts a conversion on A/D channel# ch,</span>00147 <span class="comment">/// returns the 8-bit value of the conversion when it is finished.</span>00148 <span class="comment"></span><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="group__a2d.html#ga8">a2dConvert8bit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch);00149 00150 <span class="preprocessor">#endif</span>00151 <span class="preprocessor"></span><span class="comment">//@}</span></span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:06 2006 for Procyon AVRlib by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -