sdk-ameba-v4.0b_without_nda.../doc/api_doc/group__analog__out.html

258 lines
11 KiB
HTML
Raw Normal View History

2017-10-15 06:36:37 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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.8.11"/>
<title>SDK4.0: ANALOG_OUT</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SDK4.0
</div>
<div id="projectbrief">This document shows Ameba SDK 4.0 APIs</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ANALOG_OUT<div class="ingroups"><a class="el" href="group__sdk.html">Ameba SDK</a> &raquo; <a class="el" href="group__hal.html">HAL</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>analog_out functions
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Ameba1 Only</h2></td></tr>
<tr class="memitem:ga125c25ad6ab46870e3c0a3310cae2a2e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga125c25ad6ab46870e3c0a3310cae2a2e"></a>
typedef struct dac_s&#160;</td><td class="memItemRight" valign="bottom"><b>dac_t</b></td></tr>
<tr class="separator:ga125c25ad6ab46870e3c0a3310cae2a2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga03af2eab754bf06b4a38b8ad180fb07e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog__out.html#ga03af2eab754bf06b4a38b8ad180fb07e">analogout_init</a> (dac_t *obj, PinName pin)</td></tr>
<tr class="memdesc:ga03af2eab754bf06b4a38b8ad180fb07e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize DAC. <a href="#ga03af2eab754bf06b4a38b8ad180fb07e">More...</a><br /></td></tr>
<tr class="separator:ga03af2eab754bf06b4a38b8ad180fb07e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7b24b593e30c6faf73652906bd23005f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog__out.html#ga7b24b593e30c6faf73652906bd23005f">analogout_free</a> (dac_t *obj)</td></tr>
<tr class="memdesc:ga7b24b593e30c6faf73652906bd23005f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free DAC. <a href="#ga7b24b593e30c6faf73652906bd23005f">More...</a><br /></td></tr>
<tr class="separator:ga7b24b593e30c6faf73652906bd23005f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01920ea7cfe3b59980600977e8454f10"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog__out.html#ga01920ea7cfe3b59980600977e8454f10">analogout_write</a> (dac_t *obj, float value)</td></tr>
<tr class="memdesc:ga01920ea7cfe3b59980600977e8454f10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute analog output obj: dac object define in application software. value: analog ratio value, should be transfered to register value. <a href="#ga01920ea7cfe3b59980600977e8454f10">More...</a><br /></td></tr>
<tr class="separator:ga01920ea7cfe3b59980600977e8454f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga62b4e5baeb451bf9e110c22231a5921e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__analog__out.html#ga62b4e5baeb451bf9e110c22231a5921e">analogout_write_u16</a> (dac_t *obj, uint16_t value)</td></tr>
<tr class="memdesc:ga62b4e5baeb451bf9e110c22231a5921e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute analog output 16bit obj: dac object define in application software. value: analog ratio value, should be transfered to register value. <a href="#ga62b4e5baeb451bf9e110c22231a5921e">More...</a><br /></td></tr>
<tr class="separator:ga62b4e5baeb451bf9e110c22231a5921e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>analog_out functions </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga7b24b593e30c6faf73652906bd23005f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void analogout_free </td>
<td>(</td>
<td class="paramtype">dac_t *&#160;</td>
<td class="paramname"><em>obj</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Free DAC. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>dac object define in application software. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga03af2eab754bf06b4a38b8ad180fb07e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void analogout_init </td>
<td>(</td>
<td class="paramtype">dac_t *&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PinName&#160;</td>
<td class="paramname"><em>pin</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize DAC. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">obj</td><td>dac object define in application software. </td></tr>
<tr><td class="paramname">pin</td><td>dac PinName according to pinmux spec. </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga01920ea7cfe3b59980600977e8454f10"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void analogout_write </td>
<td>(</td>
<td class="paramtype">dac_t *&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Execute analog output obj: dac object define in application software. value: analog ratio value, should be transfered to register value. </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function is mainly to execute analog output and the value is a ratio. The upper/lower bound of DAC register input value is defined by DAC_XXXXX_FULL_SCALE. The parameter "value" of this function should be transfered to register value. </dd></dl>
</div>
</div>
<a class="anchor" id="ga62b4e5baeb451bf9e110c22231a5921e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void analogout_write_u16 </td>
<td>(</td>
<td class="paramtype">dac_t *&#160;</td>
<td class="paramname"><em>obj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Execute analog output 16bit obj: dac object define in application software. value: analog ratio value, should be transfered to register value. </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The register value of DAC input is a format of 2's complement. The most maximum value of positive value drives DAC to output a voltage about 3.3V. The most mimimum value of negative value drives DAC to output a voltage about 0. And the middle value of 0x000 will drive DAC to output a voltage of half of max voltage. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>