2020-07-25 23:50:03 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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" / >
2020-11-21 21:08:44 +00:00
< meta name = "generator" content = "Doxygen 1.8.20" / >
2020-07-25 23:50:03 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > MyOS Kernel: kernel/cpu/i386/serial.c 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 = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "resize.js" > < / script >
< script type = "text/javascript" src = "navtreedata.js" > < / script >
< script type = "text/javascript" src = "navtree.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 >
< 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" > MyOS Kernel
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2020-11-21 21:08:44 +00:00
<!-- Generated by Doxygen 1.8.20 -->
2020-07-25 23:50:03 +00:00
< 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');
/* @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 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */< / script >
< div id = "main-nav" > < / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('serial_8c.html',''); initResizable(); });
/* @license-end */
< / script >
< div id = "doc-content" >
<!-- 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 = "summary" >
< a href = "#define-members" > Macros< / a > |
< a href = "#func-members" > Functions< / a > |
< a href = "#var-members" > Variables< / a > < / div >
< div class = "headertitle" >
< div class = "title" > serial.c File Reference< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< div class = "textblock" > < code > #include < cpu/ports.h> < / code > < br / >
< / div > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "define-members" > < / a >
Macros< / h2 > < / td > < / tr >
< tr class = "memitem:a773d88e6be98081f856bb18700c1e968" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a773d88e6be98081f856bb18700c1e968" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a69c0742ded515a83d1cbc516056c887c" > data_ports< / a > [com])< / td > < / tr >
< tr class = "memdesc:a773d88e6be98081f856bb18700c1e968" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the data port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a773d88e6be98081f856bb18700c1e968" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a630b8d5ff9c330d75ab2813c475187dc" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a630b8d5ff9c330d75ab2813c475187dc" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a630b8d5ff9c330d75ab2813c475187dc" > INT_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+1)< / td > < / tr >
< tr class = "memdesc:a630b8d5ff9c330d75ab2813c475187dc" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the interrupt config port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a630b8d5ff9c330d75ab2813c475187dc" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a5c2915e689d550707e4bf431e19c0316" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a5c2915e689d550707e4bf431e19c0316" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a5c2915e689d550707e4bf431e19c0316" > FIFO_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+2)< / td > < / tr >
< tr class = "memdesc:a5c2915e689d550707e4bf431e19c0316" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the fifo config port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a5c2915e689d550707e4bf431e19c0316" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a920ba50e8ec6a18ef2fbfb370d455188" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a920ba50e8ec6a18ef2fbfb370d455188" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a920ba50e8ec6a18ef2fbfb370d455188" > LINE_CMD_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+3)< / td > < / tr >
< tr class = "memdesc:a920ba50e8ec6a18ef2fbfb370d455188" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the line cmd port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a920ba50e8ec6a18ef2fbfb370d455188" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ac82e8d558a9c66a32295fefde9f515c7" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "ac82e8d558a9c66a32295fefde9f515c7" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#ac82e8d558a9c66a32295fefde9f515c7" > MODEM_CMD_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+4)< / td > < / tr >
< tr class = "memdesc:ac82e8d558a9c66a32295fefde9f515c7" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the modem cmd port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:ac82e8d558a9c66a32295fefde9f515c7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a3fb743f3450ea68cadc461aad6d52579" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a3fb743f3450ea68cadc461aad6d52579" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a3fb743f3450ea68cadc461aad6d52579" > LINE_STAT_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+5)< / td > < / tr >
< tr class = "memdesc:a3fb743f3450ea68cadc461aad6d52579" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the line status port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a3fb743f3450ea68cadc461aad6d52579" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a33869476648347ff4dbf5ea3c5eb32a0" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a33869476648347ff4dbf5ea3c5eb32a0" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a33869476648347ff4dbf5ea3c5eb32a0" > SCRATCH_PORT< / a > (com)      (< a class = "el" href = "serial_8c.html#a773d88e6be98081f856bb18700c1e968" > DATA_PORT< / a > (com)+7)< / td > < / tr >
< tr class = "memdesc:a33869476648347ff4dbf5ea3c5eb32a0" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns the scratch port of a serial port. < br / > < / td > < / tr >
< tr class = "separator:a33869476648347ff4dbf5ea3c5eb32a0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:afbc9214be5b2a129335389f750aa63b5" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "afbc9214be5b2a129335389f750aa63b5" > < / a >
#define  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#afbc9214be5b2a129335389f750aa63b5" > IS_TRANSMIT_FIFO_EMPTY< / a > (com)      (port_byte_in(< a class = "el" href = "serial_8c.html#a3fb743f3450ea68cadc461aad6d52579" > LINE_STAT_PORT< / a > (com))& 0x20)< / td > < / tr >
< tr class = "memdesc:afbc9214be5b2a129335389f750aa63b5" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns whether the trasmit FIFO is empty. < br / > < / td > < / tr >
< tr class = "separator:afbc9214be5b2a129335389f750aa63b5" > < 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 >
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:af048fb49b855f8c5b78534b90cde6ffb" > < td class = "memItemLeft" align = "right" valign = "top" > static void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#af048fb49b855f8c5b78534b90cde6ffb" > configure< / a > (int com, int rate)< / td > < / tr >
< tr class = "separator:af048fb49b855f8c5b78534b90cde6ffb" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a8b17b137d175d09afe7cb07684f82e5d" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a8b17b137d175d09afe7cb07684f82e5d" > serial_init< / a > ()< / td > < / tr >
< tr class = "separator:a8b17b137d175d09afe7cb07684f82e5d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a9c751f48f189bdf68240e476f01ea070" > < td class = "memItemLeft" align = "right" valign = "top" > void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a9c751f48f189bdf68240e476f01ea070" > serial_putc< / a > (char c)< / td > < / tr >
< tr class = "separator:a9c751f48f189bdf68240e476f01ea070" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "var-members" > < / a >
Variables< / h2 > < / td > < / tr >
< tr class = "memitem:a17305d9bc2b84f3812f054da9f17a858" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a17305d9bc2b84f3812f054da9f17a858" > < / a >
static char  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a17305d9bc2b84f3812f054da9f17a858" > configured< / a > [] ={0,0,0,0}< / td > < / tr >
< tr class = "memdesc:a17305d9bc2b84f3812f054da9f17a858" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > What serial ports have been detected and configured. < br / > < / td > < / tr >
< tr class = "separator:a17305d9bc2b84f3812f054da9f17a858" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a69c0742ded515a83d1cbc516056c887c" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "a69c0742ded515a83d1cbc516056c887c" > < / a >
static int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "serial_8c.html#a69c0742ded515a83d1cbc516056c887c" > data_ports< / a > [4] ={0x3f8,0x2f8,0x3e8,0x2e8}< / td > < / tr >
< tr class = "memdesc:a69c0742ded515a83d1cbc516056c887c" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > List of the data ports for all the potential serial ports. < br / > < / td > < / tr >
< tr class = "separator:a69c0742ded515a83d1cbc516056c887c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< h2 class = "groupheader" > Function Documentation< / h2 >
< a id = "af048fb49b855f8c5b78534b90cde6ffb" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#af048fb49b855f8c5b78534b90cde6ffb" > ◆ < / a > < / span > configure()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > static void configure < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > com< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > rate< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > static< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Configure a serial port with a specified baud rate. < / p > < dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > com< / td > < td > The number of the serial port to configure < / td > < / tr >
< tr > < td class = "paramname" > rate< / td > < td > The baud rate to set the serial port to. < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
< a id = "a8b17b137d175d09afe7cb07684f82e5d" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a8b17b137d175d09afe7cb07684f82e5d" > ◆ < / a > < / span > serial_init()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void serial_init < / td >
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Initialize the serial driver < / p >
< / div >
< / div >
< a id = "a9c751f48f189bdf68240e476f01ea070" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a9c751f48f189bdf68240e476f01ea070" > ◆ < / a > < / span > serial_putc()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > void serial_putc < / td >
< td > (< / td >
< td class = "paramtype" > char  < / td >
< td class = "paramname" > < em > c< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Write a character to the serial port < / p > < dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > c< / td > < td > The character to write < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "navelem" > < a class = "el" href = "dir_dc43877d82dd332f9fb2071fcca799d6.html" > kernel< / a > < / li > < li class = "navelem" > < a class = "el" href = "dir_de6efc35b99b831d558bda0d93c38d37.html" > cpu< / a > < / li > < li class = "navelem" > < a class = "el" href = "dir_4f1b1f9de0a2e79802f54c784fb69b12.html" > i386< / a > < / li > < li class = "navelem" > < a class = "el" href = "serial_8c.html" > serial.c< / a > < / li >
2020-11-21 21:08:44 +00:00
< li class = "footer" > Generated by < a href = "http://www.doxygen.org/index.html" > < img class = "footer" src = "doxygen.svg" width = "104" height = "31" alt = "doxygen" / > < / a > 1.8.20 < / li >
2020-07-25 23:50:03 +00:00
< / ul >
< / div >
< / body >
< / html >