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

193 lines
20 KiB
HTML
Raw Permalink 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: serial_api.h File Reference</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><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><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 id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_59865070466a2d887ccae359ce349522.html">sdk-ameba</a></li><li class="navelem"><a class="el" href="dir_bb17c7c1f6b5d4e42018e46e245402cf.html">project</a></li><li class="navelem"><a class="el" href="dir_4d8a5561b87cbdbe66a2580ebcb931d0.html">realtek_8195a_gen_project</a></li><li class="navelem"><a class="el" href="dir_d55a6639c0ef2e769c54f3d73fdcd6ae.html">rtl8195a</a></li><li class="navelem"><a class="el" href="dir_218701c72f38a637f56ccea9eb201b28.html">sw</a></li><li class="navelem"><a class="el" href="dir_467016183711ec67a0924a03f0be9cbd.html">lib</a></li><li class="navelem"><a class="el" href="dir_91cf82b8388ba308ddfe17c7b1476a41.html">sw_lib</a></li><li class="navelem"><a class="el" href="dir_d752387d37b25b2ddfb0bd02d399f93a.html">mbed</a></li><li class="navelem"><a class="el" href="dir_0ab723912218eac66c7f4e14b04376cf.html">hal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">serial_api.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This file provides mbed API for UART.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;device.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Ameba Common</h2></td></tr>
<tr class="memitem:ga2c48912c12fd98a4f4faffbc7f20a9f6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga2c48912c12fd98a4f4faffbc7f20a9f6">SerialParity</a> { <br />
&#160;&#160;<a class="el" href="group__uart.html#gga2c48912c12fd98a4f4faffbc7f20a9f6acc1b5f7583b642d0565d0b5c564ba353">ParityNone</a> = 0,
<a class="el" href="group__uart.html#gga2c48912c12fd98a4f4faffbc7f20a9f6aafeb42f20ebe23268f54485545776eb9">ParityOdd</a> = 1,
<a class="el" href="group__uart.html#gga2c48912c12fd98a4f4faffbc7f20a9f6a4a03b07aec589fbf62d4cc09aea5ef10">ParityEven</a> = 2,
<a class="el" href="group__uart.html#gga2c48912c12fd98a4f4faffbc7f20a9f6a686de860a468d952d60d30eaf12ff8f6">ParityForced1</a> = 3,
<br />
&#160;&#160;<a class="el" href="group__uart.html#gga2c48912c12fd98a4f4faffbc7f20a9f6ab95dcc23f911b83096e072255041f98f">ParityForced0</a> = 4
<br />
}<tr class="memdesc:ga2c48912c12fd98a4f4faffbc7f20a9f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART Parity mode used by serial_format. <a href="group__uart.html#ga2c48912c12fd98a4f4faffbc7f20a9f6">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga2c48912c12fd98a4f4faffbc7f20a9f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8dbaa98202e6883fc0398bcc14f582b7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga8dbaa98202e6883fc0398bcc14f582b7">SerialIrq</a> { <a class="el" href="group__uart.html#gga8dbaa98202e6883fc0398bcc14f582b7ada2693bfed74737c8d61d4818bc6171f">RxIrq</a>,
<a class="el" href="group__uart.html#gga8dbaa98202e6883fc0398bcc14f582b7aa4066880713ec11ad8d574f89336aed0">TxIrq</a>
}<tr class="memdesc:ga8dbaa98202e6883fc0398bcc14f582b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART Interrupt enable/disable used by serial_irq_set. <a href="group__uart.html#ga8dbaa98202e6883fc0398bcc14f582b7">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga8dbaa98202e6883fc0398bcc14f582b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae88006c219f95bae663fe0f2a2561dd7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gae88006c219f95bae663fe0f2a2561dd7">FlowControl</a> { <a class="el" href="group__uart.html#ggae88006c219f95bae663fe0f2a2561dd7a2f840702ab35486ee6fb2a9c47cda1ce">FlowControlNone</a>,
<a class="el" href="group__uart.html#ggae88006c219f95bae663fe0f2a2561dd7a147f23a0288db0a3d93da040ef80247c">FlowControlRTS</a>,
<a class="el" href="group__uart.html#ggae88006c219f95bae663fe0f2a2561dd7a658dc07c550efee6dd57ded2c190dbcf">FlowControlCTS</a>,
<a class="el" href="group__uart.html#ggae88006c219f95bae663fe0f2a2561dd7a07762176ebd2a742b8691e25b7eb627e">FlowControlRTSCTS</a>
}<tr class="memdesc:gae88006c219f95bae663fe0f2a2561dd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART FlowControl mode used by serial_set_flow_control. <a href="group__uart.html#gae88006c219f95bae663fe0f2a2561dd7">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gae88006c219f95bae663fe0f2a2561dd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafdf9fed473dc0148434ae42cc6a8a64e"><td class="memItemLeft" align="right" valign="top">
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>uart_irq_handler</b>) (uint32_t id, <a class="el" href="group__uart.html#ga8dbaa98202e6883fc0398bcc14f582b7">SerialIrq</a> event)</td></tr>
<tr class="separator:gafdf9fed473dc0148434ae42cc6a8a64e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8f14cde53cf29b42e3a46f0f3e347cd"><td class="memItemLeft" align="right" valign="top">
typedef struct serial_s&#160;</td><td class="memItemRight" valign="bottom"><b>serial_t</b></td></tr>
<tr class="separator:gaf8f14cde53cf29b42e3a46f0f3e347cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3096f72c7bb6c02936a2b5753ffe7157"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga3096f72c7bb6c02936a2b5753ffe7157">serial_init</a> (serial_t *obj, PinName tx, PinName rx)</td></tr>
<tr class="memdesc:ga3096f72c7bb6c02936a2b5753ffe7157"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the UART device, include clock/function/interrupt/UART registers. <a href="group__uart.html#ga3096f72c7bb6c02936a2b5753ffe7157">More...</a><br /></td></tr>
<tr class="separator:ga3096f72c7bb6c02936a2b5753ffe7157"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29829ef7c866e140b2fb738195be3020"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga29829ef7c866e140b2fb738195be3020">serial_free</a> (serial_t *obj)</td></tr>
<tr class="memdesc:ga29829ef7c866e140b2fb738195be3020"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitializes the UART device, include clock/function/interrupt/UART registers. <a href="group__uart.html#ga29829ef7c866e140b2fb738195be3020">More...</a><br /></td></tr>
<tr class="separator:ga29829ef7c866e140b2fb738195be3020"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33a5f814c050396d17bde80505c93188"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga33a5f814c050396d17bde80505c93188">serial_baud</a> (serial_t *obj, int baudrate)</td></tr>
<tr class="memdesc:ga33a5f814c050396d17bde80505c93188"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART device baudrate. <a href="group__uart.html#ga33a5f814c050396d17bde80505c93188">More...</a><br /></td></tr>
<tr class="separator:ga33a5f814c050396d17bde80505c93188"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd3983278709908656d97258002466e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gadd3983278709908656d97258002466e7">serial_format</a> (serial_t *obj, int data_bits, <a class="el" href="group__uart.html#ga2c48912c12fd98a4f4faffbc7f20a9f6">SerialParity</a> parity, int stop_bits)</td></tr>
<tr class="memdesc:gadd3983278709908656d97258002466e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART format. <a href="group__uart.html#gadd3983278709908656d97258002466e7">More...</a><br /></td></tr>
<tr class="separator:gadd3983278709908656d97258002466e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f22516de1ec2fca735606495ab1f869"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga7f22516de1ec2fca735606495ab1f869">serial_irq_handler</a> (serial_t *obj, uart_irq_handler handler, uint32_t id)</td></tr>
<tr class="memdesc:ga7f22516de1ec2fca735606495ab1f869"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART interrupt hander if needed. <a href="group__uart.html#ga7f22516de1ec2fca735606495ab1f869">More...</a><br /></td></tr>
<tr class="separator:ga7f22516de1ec2fca735606495ab1f869"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafefbd52507666563e36924676db7652e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gafefbd52507666563e36924676db7652e">serial_irq_set</a> (serial_t *obj, <a class="el" href="group__uart.html#ga8dbaa98202e6883fc0398bcc14f582b7">SerialIrq</a> irq, uint32_t enable)</td></tr>
<tr class="memdesc:gafefbd52507666563e36924676db7652e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/Disable UART interrupt. <a href="group__uart.html#gafefbd52507666563e36924676db7652e">More...</a><br /></td></tr>
<tr class="separator:gafefbd52507666563e36924676db7652e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d3f8740a64b01ffc0ce607a638ece92"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga6d3f8740a64b01ffc0ce607a638ece92">serial_getc</a> (serial_t *obj)</td></tr>
<tr class="memdesc:ga6d3f8740a64b01ffc0ce607a638ece92"><td class="mdescLeft">&#160;</td><td class="mdescRight">get one byte from UART. <a href="group__uart.html#ga6d3f8740a64b01ffc0ce607a638ece92">More...</a><br /></td></tr>
<tr class="separator:ga6d3f8740a64b01ffc0ce607a638ece92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25f76e4c233aa5298856d99ea3f4058e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga25f76e4c233aa5298856d99ea3f4058e">serial_putc</a> (serial_t *obj, int c)</td></tr>
<tr class="memdesc:ga25f76e4c233aa5298856d99ea3f4058e"><td class="mdescLeft">&#160;</td><td class="mdescRight">send one byte use UART. <a href="group__uart.html#ga25f76e4c233aa5298856d99ea3f4058e">More...</a><br /></td></tr>
<tr class="separator:ga25f76e4c233aa5298856d99ea3f4058e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c9040624bb759fd5cd2bc10a60831bd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga0c9040624bb759fd5cd2bc10a60831bd">serial_readable</a> (serial_t *obj)</td></tr>
<tr class="memdesc:ga0c9040624bb759fd5cd2bc10a60831bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">check if there is data in rx fifo. <a href="group__uart.html#ga0c9040624bb759fd5cd2bc10a60831bd">More...</a><br /></td></tr>
<tr class="separator:ga0c9040624bb759fd5cd2bc10a60831bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadbfe8af954c543d045e9ca7b553578c8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gadbfe8af954c543d045e9ca7b553578c8">serial_writable</a> (serial_t *obj)</td></tr>
<tr class="memdesc:gadbfe8af954c543d045e9ca7b553578c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">check if write data to tx fifo is permitted. <a href="group__uart.html#gadbfe8af954c543d045e9ca7b553578c8">More...</a><br /></td></tr>
<tr class="separator:gadbfe8af954c543d045e9ca7b553578c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga390a75da4b756c213661502dc71a0234"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga390a75da4b756c213661502dc71a0234">serial_clear</a> (serial_t *obj)</td></tr>
<tr class="memdesc:ga390a75da4b756c213661502dc71a0234"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear Rx fifo. <a href="group__uart.html#ga390a75da4b756c213661502dc71a0234">More...</a><br /></td></tr>
<tr class="separator:ga390a75da4b756c213661502dc71a0234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4e24d07fc05f2ce0cf59c61da149e01"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gaf4e24d07fc05f2ce0cf59c61da149e01">serial_break_set</a> (serial_t *obj)</td></tr>
<tr class="memdesc:gaf4e24d07fc05f2ce0cf59c61da149e01"><td class="mdescLeft">&#160;</td><td class="mdescRight">enable UART break contol function. <a href="group__uart.html#gaf4e24d07fc05f2ce0cf59c61da149e01">More...</a><br /></td></tr>
<tr class="separator:gaf4e24d07fc05f2ce0cf59c61da149e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5348986db46756483d94b5040ab9a0a9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga5348986db46756483d94b5040ab9a0a9">serial_break_clear</a> (serial_t *obj)</td></tr>
<tr class="memdesc:ga5348986db46756483d94b5040ab9a0a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">disable UART break contol function. <a href="group__uart.html#ga5348986db46756483d94b5040ab9a0a9">More...</a><br /></td></tr>
<tr class="separator:ga5348986db46756483d94b5040ab9a0a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8be980153743b25bcbcff4c5855dbf3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#gaf8be980153743b25bcbcff4c5855dbf3">serial_pinout_tx</a> (PinName tx)</td></tr>
<tr class="memdesc:gaf8be980153743b25bcbcff4c5855dbf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">set tx pinmux. <a href="group__uart.html#gaf8be980153743b25bcbcff4c5855dbf3">More...</a><br /></td></tr>
<tr class="separator:gaf8be980153743b25bcbcff4c5855dbf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga17cb0ba1a2c4bdae299120e4d7557f4b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__uart.html#ga17cb0ba1a2c4bdae299120e4d7557f4b">serial_set_flow_control</a> (serial_t *obj, <a class="el" href="group__uart.html#gae88006c219f95bae663fe0f2a2561dd7">FlowControl</a> type, PinName rxflow, PinName txflow)</td></tr>
<tr class="memdesc:ga17cb0ba1a2c4bdae299120e4d7557f4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">uart autoflow contol setting. <a href="group__uart.html#ga17cb0ba1a2c4bdae299120e4d7557f4b">More...</a><br /></td></tr>
<tr class="separator:ga17cb0ba1a2c4bdae299120e4d7557f4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This file provides mbed API for UART. </p>
<p>mbed Microcontroller Library</p>
<dl class="section author"><dt>Author</dt><dd></dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.0.0 </dd></dl>
<dl class="section attention"><dt>Attention</dt><dd></dd></dl>
<p>Copyright (c) 2006-2013 ARM Limited</p>
<p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at </p><pre class="fragment">http://www.apache.org/licenses/LICENSE-2.0
</pre><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </p>
</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>