1 <!-- HTML header for doxygen 1.8.20-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.9.4"/>
8 <meta name="viewport" content="width=device-width, initial-scale=1"/>
9 <title>Raspberry Pi Pico SDK: pico_stdio_usb</title>
10 <!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <link href="search/search.css" rel="stylesheet" type="text/css"/>
18 <script type="text/javascript" src="search/searchdata.js"></script>
19 <script type="text/javascript" src="search/search.js"></script>
20 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
21 <link href="doxygen.css" rel="stylesheet" type="text/css" />
22 <link href="normalise.css" rel="stylesheet" type="text/css"/>
23 <link href="main.css" rel="stylesheet" type="text/css"/>
24 <link href="styles.css" rel="stylesheet" type="text/css"/>
27 <div class="navigation-mobile">
28 <div class="logo--mobile">
29 <a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
31 <div class="navigation-toggle">
32 <span class="line-1"></span>
36 <span class="line-3"></span>
39 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
41 <a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
42 <span style="display: inline-block; margin-top: 10px;">
46 <div class="navigation-footer">
47 <img src="logo-mobile.svg" alt="Raspberry Pi">
48 <a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
50 <!-- <div class="search">
52 <input type="search" name="search" id="search" placeholder="Search">
53 <input type="submit" value="Search">
56 <!-- Generated by Doxygen 1.9.4 -->
57 <script type="text/javascript">
58 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
59 var searchBox = new SearchBox("searchBox", "search",'Search','.html');
62 <script type="text/javascript" src="menudata.js"></script>
63 <script type="text/javascript" src="menu.js"></script>
64 <script type="text/javascript">
65 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
67 initMenu('',true,false,'search.php','Search');
68 $(document).ready(function() { init_search(); });
72 <div id="main-nav"></div>
74 <div id="side-nav" class="ui-resizable side-nav-resizable">
76 <div id="nav-tree-contents">
77 <div id="nav-sync" class="sync"></div>
80 <div id="splitbar" style="-moz-user-select:none;"
81 class="ui-resizable-handle">
84 <script type="text/javascript">
85 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
86 $(document).ready(function(){initNavTree('group__pico__stdio__usb.html',''); initResizable(); });
89 <div id="doc-content">
90 <!-- window showing the filter options -->
91 <div id="MSearchSelectWindow"
92 onmouseover="return searchBox.OnSearchSelectShow()"
93 onmouseout="return searchBox.OnSearchSelectHide()"
94 onkeydown="return searchBox.OnSearchSelectKey(event)">
97 <!-- iframe showing the search results (closed by default) -->
98 <div id="MSearchResultsWindow">
99 <iframe src="javascript:void(0)" frameborder="0"
100 name="MSearchResults" id="MSearchResults">
105 <div class="summary">
106 <a href="#func-members">Functions</a> </div>
107 <div class="headertitle"><div class="title">pico_stdio_usb<div class="ingroups"><a class="el" href="group__runtime.html">Runtime Infrastructure</a> » <a class="el" href="group__pico__stdio.html">pico_stdio</a></div></div></div>
109 <div class="contents">
111 <p>Support for stdin/stdout over USB serial (CDC)
112 <a href="#details">More...</a></p>
113 <table class="memberdecls">
114 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
115 Functions</h2></td></tr>
116 <tr class="memitem:gab87bcfa3f24e5a3fe92a944f9eecc460"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__stdio__usb.html#gab87bcfa3f24e5a3fe92a944f9eecc460">stdio_usb_init</a> (void)</td></tr>
117 <tr class="memdesc:gab87bcfa3f24e5a3fe92a944f9eecc460"><td class="mdescLeft"> </td><td class="mdescRight">Explicitly initialize USB stdio and add it to the current set of stdin drivers. <a href="group__pico__stdio__usb.html#gab87bcfa3f24e5a3fe92a944f9eecc460">More...</a><br /></td></tr>
118 <tr class="separator:gab87bcfa3f24e5a3fe92a944f9eecc460"><td class="memSeparator" colspan="2"> </td></tr>
119 <tr class="memitem:ga86edc8e3a477bb388ae73d92a3e87824"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__stdio__usb.html#ga86edc8e3a477bb388ae73d92a3e87824">stdio_usb_connected</a> (void)</td></tr>
120 <tr class="memdesc:ga86edc8e3a477bb388ae73d92a3e87824"><td class="mdescLeft"> </td><td class="mdescRight">Check if there is an active stdio CDC connection to a host. <a href="group__pico__stdio__usb.html#ga86edc8e3a477bb388ae73d92a3e87824">More...</a><br /></td></tr>
121 <tr class="separator:ga86edc8e3a477bb388ae73d92a3e87824"><td class="memSeparator" colspan="2"> </td></tr>
123 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
124 <p >Support for stdin/stdout over USB serial (CDC) </p>
125 <p >Linking this library or calling <code>pico_enable_stdio_usb(TARGET ENABLED)</code> in the CMake (which achieves the same thing) will add USB CDC to the drivers used for standard input/output</p>
126 <p >Note this library is a developer convenience. It is not applicable in all cases; for one it takes full control of the USB device precluding your use of the USB in device or host mode. For this reason, this library will automatically disengage if you try to using it alongside <a class="el" href="group__tinyusb__device.html">tinyusb_device</a> or <a class="el" href="group__tinyusb__host.html">tinyusb_host</a>. It also takes control of a lower level IRQ and sets up a periodic background task.</p>
127 <p >This library also includes (by default) functionality to enable the RP2040 to be reset over the USB interface. </p>
128 <h2 class="groupheader">Function Documentation</h2>
129 <a id="ga86edc8e3a477bb388ae73d92a3e87824" name="ga86edc8e3a477bb388ae73d92a3e87824"></a>
130 <h2 class="memtitle"><span class="permalink"><a href="#ga86edc8e3a477bb388ae73d92a3e87824">◆ </a></span>stdio_usb_connected()</h2>
132 <div class="memitem">
133 <div class="memproto">
134 <table class="memname">
136 <td class="memname">bool stdio_usb_connected </td>
138 <td class="paramtype">void </td>
139 <td class="paramname"></td><td>)</td>
143 </div><div class="memdoc">
145 <p>Check if there is an active stdio CDC connection to a host. </p>
146 <dl class="section return"><dt>Returns</dt><dd>true if stdio is connected over CDC </dd></dl>
150 <a id="gab87bcfa3f24e5a3fe92a944f9eecc460" name="gab87bcfa3f24e5a3fe92a944f9eecc460"></a>
151 <h2 class="memtitle"><span class="permalink"><a href="#gab87bcfa3f24e5a3fe92a944f9eecc460">◆ </a></span>stdio_usb_init()</h2>
153 <div class="memitem">
154 <div class="memproto">
155 <table class="memname">
157 <td class="memname">bool stdio_usb_init </td>
159 <td class="paramtype">void </td>
160 <td class="paramname"></td><td>)</td>
164 </div><div class="memdoc">
166 <p>Explicitly initialize USB stdio and add it to the current set of stdin drivers. </p>
167 <p >PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS can be set to cause this method to wait for a CDC connection from the host before returning, which is useful if you don't want any initial stdout output to be discarded before the connection is established.</p>
168 <dl class="section return"><dt>Returns</dt><dd>true if the USB CDC was initialized, false if an error occurred</dd></dl>
169 <p>Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</p>
170 <p >SPDX-License-Identifier: BSD-3-Clause </p>
174 </div><!-- contents -->
175 </div><!-- doc-content -->
177 <script src="main.js"></script>