diff options
Diffstat (limited to 'group__adc.html')
-rw-r--r-- | group__adc.html | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/group__adc.html b/group__adc.html index 7c24bf66..453b046c 100644 --- a/group__adc.html +++ b/group__adc.html @@ -2,8 +2,8 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<meta http-equiv="X-UA-Compatible" content="IE=9"/> -<meta name="generator" content="Doxygen 1.9.1"/> +<meta http-equiv="X-UA-Compatible" content="IE=11"/> +<meta name="generator" content="Doxygen 1.9.3"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Sensor Watch: Analog Input</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> @@ -19,10 +19,9 @@ <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> - <tr style="height: 56px;"> - <td id="projectalign" style="padding-left: 0.5em;"> - <div id="projectname">Sensor Watch -  <span id="projectnumber">0.0.0</span> + <tr id="projectrow"> + <td id="projectalign"> + <div id="projectname">Sensor Watch<span id="projectnumber"> 0.0.0</span> </div> <div id="projectbrief">A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.</div> </td> @@ -31,21 +30,22 @@ </table> </div> <!-- end header part --> -<!-- Generated by Doxygen 1.9.1 --> +<!-- Generated by Doxygen 1.9.3 --> <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); +/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ +var searchBox = new SearchBox("searchBox", "search",'Search','.html'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); -/* @license-end */</script> +/* @license-end */ +</script> <div id="main-nav"></div> </div><!-- top --> <!-- window showing the filter options --> @@ -66,27 +66,26 @@ $(function() { <div class="summary"> <a href="#enum-members">Enumerations</a> | <a href="#func-members">Functions</a> </div> - <div class="headertitle"> -<div class="title">Analog Input</div> </div> + <div class="headertitle"><div class="title">Analog Input</div></div> </div><!--header--> <div class="contents"> <p>This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector. <a href="#details">More...</a></p> <table class="memberdecls"> -<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a> Enumerations</h2></td></tr> -<tr class="memitem:ga844283c184c3510635199e50c64304c8"><td class="memItemLeft" align="right" valign="top"><a id="ga844283c184c3510635199e50c64304c8"></a>enum  </td><td class="memItemRight" valign="bottom"><b>watch_adc_reference_voltage</b> { <b>ADC_REFERENCE_INTREF</b> = 0 +<tr class="memitem:ga844283c184c3510635199e50c64304c8"><td class="memItemLeft" align="right" valign="top"><a id="ga844283c184c3510635199e50c64304c8" name="ga844283c184c3510635199e50c64304c8"></a>enum  </td><td class="memItemRight" valign="bottom"><b>watch_adc_reference_voltage</b> { <b>ADC_REFERENCE_INTREF</b> = 0 , <b>ADC_REFERENCE_VCC_DIV1POINT6</b> , <b>ADC_REFERENCE_VCC_DIV2</b> , <b>ADC_REFERENCE_VCC</b> }</td></tr> <tr class="separator:ga844283c184c3510635199e50c64304c8"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> -<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:ga908b5334af677309b03d7679d77aaa02"><td class="memItemLeft" align="right" valign="top"><a id="ga908b5334af677309b03d7679d77aaa02"></a> -void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__adc.html#ga908b5334af677309b03d7679d77aaa02">watch_enable_adc</a> (void)</td></tr> +<tr class="memitem:ga908b5334af677309b03d7679d77aaa02"><td class="memItemLeft" align="right" valign="top"><a id="ga908b5334af677309b03d7679d77aaa02" name="ga908b5334af677309b03d7679d77aaa02"></a> +void </td><td class="memItemRight" valign="bottom"><b>watch_enable_adc</b> (void)</td></tr> <tr class="memdesc:ga908b5334af677309b03d7679d77aaa02"><td class="mdescLeft"> </td><td class="mdescRight">Enables the ADC peripheral. You must call this before attempting to read a value from an analog pin. <br /></td></tr> <tr class="separator:ga908b5334af677309b03d7679d77aaa02"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga30a491e9cab049a2812f75862a613aa8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__adc.html#ga30a491e9cab049a2812f75862a613aa8">watch_enable_analog_input</a> (const uint8_t pin)</td></tr> @@ -115,9 +114,9 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou <tr class="separator:gaf443c79008bec5ceecbd21ad401d52cb"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> -<p>This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector. </p> +<p >This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector. </p> <h2 class="groupheader">Function Documentation</h2> -<a id="gaf443c79008bec5ceecbd21ad401d52cb"></a> +<a id="gaf443c79008bec5ceecbd21ad401d52cb" name="gaf443c79008bec5ceecbd21ad401d52cb"></a> <h2 class="memtitle"><span class="permalink"><a href="#gaf443c79008bec5ceecbd21ad401d52cb">◆ </a></span>watch_disable_adc()</h2> <div class="memitem"> @@ -138,7 +137,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div> </div> -<a id="gae38e15840bc5f3eca16ccb782dbb1c31"></a> +<a id="gae38e15840bc5f3eca16ccb782dbb1c31" name="gae38e15840bc5f3eca16ccb782dbb1c31"></a> <h2 class="memtitle"><span class="permalink"><a href="#gae38e15840bc5f3eca16ccb782dbb1c31">◆ </a></span>watch_disable_analog_input()</h2> <div class="memitem"> @@ -164,7 +163,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div> </div> -<a id="ga30a491e9cab049a2812f75862a613aa8"></a> +<a id="ga30a491e9cab049a2812f75862a613aa8" name="ga30a491e9cab049a2812f75862a613aa8"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga30a491e9cab049a2812f75862a613aa8">◆ </a></span>watch_enable_analog_input()</h2> <div class="memitem"> @@ -190,7 +189,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div> </div> -<a id="ga2064244f68cff87a1df08f6b07183069"></a> +<a id="ga2064244f68cff87a1df08f6b07183069" name="ga2064244f68cff87a1df08f6b07183069"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga2064244f68cff87a1df08f6b07183069">◆ </a></span>watch_get_analog_pin_level()</h2> <div class="memitem"> @@ -218,7 +217,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div> </div> -<a id="ga465fcb058492d350d29fe4403df85b14"></a> +<a id="ga465fcb058492d350d29fe4403df85b14" name="ga465fcb058492d350d29fe4403df85b14"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga465fcb058492d350d29fe4403df85b14">◆ </a></span>watch_get_vcc_voltage()</h2> <div class="memitem"> @@ -235,11 +234,11 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div><div class="memdoc"> <p>Returns the voltage of the VCC supply in millivolts (i.e. 3000 mV == 3.0 V). If running on a coin cell, this will be the battery voltage. </p> -<p>Unlike other ADC functions, this function does not return a raw value from the ADC, but rather scales it to an actual number of millivolts. This is because the ADC doesn't let us measure VCC per se; it instead lets us measure VCC / 4, and we choose to measure it against the internal reference voltage of 1.024 V. In short, the ADC gives us a number that's complicated to deal with, so we just turn it into a useful number for you :) </p><dl class="section note"><dt>Note</dt><dd>This function depends on INTREF being 1.024V. If you have changed it by poking at the supply controller's VREF.SEL bits, this function will return inaccurate values. </dd></dl> +<p >Unlike other ADC functions, this function does not return a raw value from the ADC, but rather scales it to an actual number of millivolts. This is because the ADC doesn't let us measure VCC per se; it instead lets us measure VCC / 4, and we choose to measure it against the internal reference voltage of 1.024 V. In short, the ADC gives us a number that's complicated to deal with, so we just turn it into a useful number for you :) </p><dl class="section note"><dt>Note</dt><dd>This function depends on INTREF being 1.024V. If you have changed it by poking at the supply controller's VREF.SEL bits, this function will return inaccurate values. </dd></dl> </div> </div> -<a id="ga90bac58a3fa935d8fd640f4b58c8037d"></a> +<a id="ga90bac58a3fa935d8fd640f4b58c8037d" name="ga90bac58a3fa935d8fd640f4b58c8037d"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga90bac58a3fa935d8fd640f4b58c8037d">◆ </a></span>watch_set_analog_num_samples()</h2> <div class="memitem"> @@ -272,7 +271,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div> </div> -<a id="ga9ea7b8aef4573f02ff3adafcf891cd93"></a> +<a id="ga9ea7b8aef4573f02ff3adafcf891cd93" name="ga9ea7b8aef4573f02ff3adafcf891cd93"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga9ea7b8aef4573f02ff3adafcf891cd93">◆ </a></span>watch_set_analog_reference_voltage()</h2> <div class="memitem"> @@ -296,12 +295,12 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </dd> </dl> <p>In order to turn an analog voltage into a 16-bit integer, the ADC needs to compare the measured voltage to a reference point. For example, if you were powering the watch with VCC == 3.0V and you had two 10K resistors connected in series from 3V to GND, you could expect to get 3 volts when you measure the top of the voltage divider, 0 volts at the bottom, and 1.5 volts in the middle. If you read these values uising a reference voltage of ADC_REFERENCE_VCC, the top value would be about 65535, the bottom about 0, and the middle about 32768. However! If we used ADC_REFERENCE_VCC_DIV2 as our reference, we would expect to get 65535 both at the top and the middle, because the largest value the ADC can measure in this configutation is 1.5V (VCC / 2).</p> -<p>By changing the reference voltage from ADC_REFERENCE_VCC to ADC_REFERENCE_VCC_DIV1POINT6 or ADC_REFERENCE_VCC_DIV2, you can get more resolution when measuring small voltages (i.e. a phototransistor circuit in low light).</p> -<p>There is also a special reference voltage called ADC_REFERENCE_INTREF. The SAM L22's Supply Controller provides a selectable voltage reference (by default, 1.024 V) that you can select as a reference voltage for ADC conversions. Unlike the three references we talked about in the last paragraph, this reference voltage does not depend on VCC, which makes it very useful for measuring the battery voltage (since you can't really compare VCC to itself). You can change the INTREF voltage to 2.048 or 4.096 V by poking at the supply controller's VREF register, but the watch library does not support this use case. </p> +<p >By changing the reference voltage from ADC_REFERENCE_VCC to ADC_REFERENCE_VCC_DIV1POINT6 or ADC_REFERENCE_VCC_DIV2, you can get more resolution when measuring small voltages (i.e. a phototransistor circuit in low light).</p> +<p >There is also a special reference voltage called ADC_REFERENCE_INTREF. The SAM L22's Supply Controller provides a selectable voltage reference (by default, 1.024 V) that you can select as a reference voltage for ADC conversions. Unlike the three references we talked about in the last paragraph, this reference voltage does not depend on VCC, which makes it very useful for measuring the battery voltage (since you can't really compare VCC to itself). You can change the INTREF voltage to 2.048 or 4.096 V by poking at the supply controller's VREF register, but the watch library does not support this use case. </p> </div> </div> -<a id="gae9f9ed34e8752e211c1692af473a88dc"></a> +<a id="gae9f9ed34e8752e211c1692af473a88dc" name="gae9f9ed34e8752e211c1692af473a88dc"></a> <h2 class="memtitle"><span class="permalink"><a href="#gae9f9ed34e8752e211c1692af473a88dc">◆ </a></span>watch_set_analog_sampling_length()</h2> <div class="memitem"> @@ -332,7 +331,7 @@ void </td><td class="memItemRight" valign="bottom"><a class="el" href="grou </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> -Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 +Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </small></address> </body> </html> |