Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IoT-MBBR (masterthesis): firmware/EFM32HG222F64_iot-mbbr/dbprint/dbprint_documentation.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="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>
<script type="text/javascript">
$(document).ready(initResizable);
</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">IoT-MBBR (masterthesis)
</div>
<div id="projectbrief">Masterthesis upgrading a Moving Bed BioReactor with extra sensors and cloud connectivity.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</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">
$(document).ready(function(){initNavTree('dbprint__documentation_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">dbprint_documentation.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This file contains useful documentation closely related to dbprint.
<a href="#details">More...</a></p>
<p><a href="dbprint__documentation_8h_source.html">Go to the source code of this file.</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This file contains useful documentation closely related to dbprint. </p>
<dl class="section version"><dt>Version</dt><dd>7.0 </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Brecht Van Eeckhoudt</dd></dl>
<hr/>
<h1><a class="anchor" id="DeBugPrint"></a>
DeBugPrint</h1>
<p>DeBugPrint is a homebrew minimal low-level println/printf replacement. It can be used to to print text/values to uart without a lot of external libraries. The end goal was to use no external libraries (with methods like <code>itoa</code>) apart from the ones specific to the microcontroller.</p>
<hr/>
<h1><a class="anchor" id="Doxygen"></a>
Doxygen</h1>
<p>These files have been made with <a href="www.doxygen.org"><b>Doxygen</b></a> comments above all methods to generate documentation. A combination of <b>Doxygen-specific tags</b> (preceded with an <code>@</code> symbol) and <b>markdown syntax</b> are supported to generate, for example, HTML-files.</p>
<hr/>
<h1><a class="anchor" id="ENABLE"></a>
Enable/disable dbprint using definition in `debug_dbprint.h`</h1>
<p>In the file <code><a class="el" href="debug__dbprint_8h.html" title="Enable or disable printing to UART with dbprint. ">debug_dbprint.h</a></code> <b>dbprint UART functionality can be enabled/disabled</b> with the definition <code>#define DEBUG_DBPRINT</code>. If it's value is <code>0</code>, all dbprint functionality is disabled.</p>
<dl class="section warning"><dt>Warning</dt><dd>This means that the <b>only header file to include in your projects</b> for dbprint to work is<br />
<code>#include <a class="el" href="debug__dbprint_8h.html" title="Enable or disable printing to UART with dbprint. ">debug_dbprint.h</a></code></dd></dl>
<dl class="section note"><dt>Note</dt><dd>If you also want to use this definition to enable/disable dbprint statements in your code, please use the following convention:<br />
<code>#if DEBUG_DBPRINT == 1 // DEBUG_DBPRINT</code><br />
<code><your source code dbprint statements go here></code><br />
<code>#endif // DEBUG_DBPRINT</code></dd></dl>
<hr/>
<h1><a class="anchor" id="DBPRINT"></a>
More info about dbprint (and VCOM)</h1>
<dl class="section note"><dt>Note</dt><dd>When using <code>dbprint</code> functionality, the following settings are used and can't be changed without editing the source code:<br />
<ul>
<li>Baudrate = 115200</li>
<li>8 databits</li>
<li>1 stopbit</li>
<li>No parity</li>
</ul>
</dd></dl>
<p>VCOM is an on-board (SLSTK3400A) UART to USB converter alongside the Segger J-Link debugger, connected with microcontroller pins <code>PA0</code> (RX) and <code>PF2</code> (TX). This converter can then be used with Putty or another serial port program.</p>
<dl class="section note"><dt>Note</dt><dd>When you want to debug using VCOM with interrupt functionality disabled, you can use the following initialization settings:<br />
<code>dbprint_INIT(USART1, 4, true, false);</code></dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Setting the third argument to <code>true</code> indicates to the code that <code>PA9</code> (<code>EFM_BC_EN</code>) should be set high to enable the isolation switch on the PCB of the Happy Gecko to link <code>PA0</code> (RX) and <code>PF2</code> (TX) to the debugger. Don't use this pin yourself if you want to make use of the on-board UART to USB converter!</dd></dl>
<hr/>
<h1><a class="anchor" id="ENERGY"></a>
Energy profiler and dbprint</h1>
<p>The Energy profiler in Simplicity Studio seems to use VCOM somehow, change to using an external UART adapter if both the energy profiler and UART debugging are necessary at the same time!</p>
<p>If the energy profiler was used and the code functionality was switched, physically re-plug the board to make sure VCOM UART starts working again!</p>
<hr/>
<h1><a class="anchor" id="UART"></a>
Alternate UART Functionality Pinout</h1>
<table class="doxtable">
<tr>
<th>Location </th><th><code>#0</code> </th><th><code>#1</code> </th><th><code>#2</code> </th><th><code>#3</code> </th><th><code>#4</code> </th><th><code>#5</code> </th><th><code>#6</code> </th></tr>
<tr>
<td><code>US0_RX</code> </td><td><code>PE11</code> </td><td></td><td><code>PC10</code> </td><td><code>PE12</code> </td><td><code>PB08</code> </td><td><code>PC01</code> </td><td><code>PC01</code> </td></tr>
<tr>
<td><code>US0_TX</code> </td><td><code>PE10</code> </td><td></td><td></td><td><code>PE13</code> </td><td><code>PB07</code> </td><td><code>PC00</code> </td><td><code>PC00</code> </td></tr>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
<tr>
<td><code>US1_RX</code> </td><td><code>PC01</code> </td><td></td><td><code>PD06</code> </td><td><code>PD06</code> </td><td><code>PA00</code> </td><td><code>PC02</code> </td><td></td></tr>
<tr>
<td><code>US1_TX</code> </td><td><code>PC00</code> </td><td></td><td><code>PD07</code> </td><td><code>PD07</code> </td><td><code>PF02</code> </td><td><code>PC01</code> </td><td></td></tr>
</table>
<p>VCOM:</p><ul>
<li>USART1 #4 (USART0 can't be used)</li>
<li>RX - <code>PA0</code></li>
<li>TX - <code>PF2</code></li>
<li>Isolation switch - <code>PA9</code> (<code>EFM_BC_EN</code>) (don't use this pin yourself when using the on-board UART to USB converter)</li>
</ul>
<hr/>
<h1><a class="anchor" id="Keywords"></a>
Keywords</h1>
<h2><a class="anchor" id="Volatile"></a>
Volatile</h2>
<p>The <code>volatile</code> type indicates to the compiler that the data is not normal memory, and could change at unexpected times. Hardware registers are often volatile, and so are variables which get changed in interrupts.<br />
Volatile variables are stored in <em>RAM</em>.</p>
<h2><a class="anchor" id="Static"></a>
Static</h2>
<h3><a class="anchor" id="VARIABLE"></a>
Static variable</h3>
<p>During compile time (this is why we can't use variable length array's) memory gets reserved for this variable. The data itself gets put in the <em>data</em> segment of the memory (regular variables are put in the <em>stack</em> segment).<br />
It's best to keep the use of <code>static</code> variables to a minimum. One should ask himself the question if it's necessary to keep the variable constantly in the memory. If the answer is yes, a <code>static</code> variable is acceptable.<br />
A <b>static variable inside a function</b> keeps its value between invocations.</p>
<h3><a class="anchor" id="FUNCTION"></a>
Static global function</h3>
<p>The function is only "seen" in the file it's declared in. This means <code>static</code> can be used for methods the same way <code>private</code> is used for certain methods in C++.</p>
<hr/>
<h1><a class="anchor" id="DATA"></a>
Bits, bytes, nibbles and unsigned/signed integer value ranges</h1>
<ul>
<li>1 nibble = 4 bits (<code>0b1111</code> = <code>0xF</code> )</li>
<li>1 byte = 8 bits (<code>0b1111 1111</code> = <code>0xFF</code>)</li>
</ul>
<table class="doxtable">
<tr>
<th>Type </th><th>Alias </th><th>Size </th><th>Minimum value </th><th>Maximum value </th></tr>
<tr>
<td><code>uint8_t</code> </td><td><code>unsigned char</code> </td><td>1 byte </td><td>0 </td><td>255 (<code>0xFF</code>) </td></tr>
<tr>
<td><code>uint16_t</code> </td><td><code>unsigned short</code> </td><td>2 bytes </td><td>0 </td><td>65 535 (<code>0xFFFF</code>) </td></tr>
<tr>
<td><code>uint32_t</code> </td><td><code>unsigned int</code> </td><td>4 bytes </td><td>0 </td><td>4 294 967 295 (<code>0xFFFF FFFF</code>) </td></tr>
<tr>
<td></td><td></td><td></td><td></td><td></td></tr>
<tr>
<td><code>int8_t</code> </td><td><code>signed char</code> </td><td>1 byte </td><td>-128 </td><td>127 </td></tr>
<tr>
<td><code>int16_t</code> </td><td><code>signed short</code> </td><td>2 bytes </td><td>-32 768 </td><td>32 767 </td></tr>
<tr>
<td><code>int32_t</code> </td><td><code>signed int</code> </td><td>4 bytes </td><td>-2 147 483 648 </td><td>2 147 483 647 </td></tr>
</table>
<ul>
<li><code>-128</code> = <code>0x80</code> = <code>0b1000 0000</code> (If the left most bit is one, the sign of the number is negative)</li>
<li><code>127</code> = <code>0x7F</code> = <code>0b0111 1111</code> </li>
</ul>
<p class="definition">Definition in file <a class="el" href="dbprint__documentation_8h_source.html">dbprint_documentation.h</a>.</p>
</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_d9edf6c004b4a7ff14fe9ae7a92214ee.html">firmware</a></li><li class="navelem"><a class="el" href="dir_9a5a365c58dea0dc152d55f461feaba5.html">EFM32HG222F64_iot-mbbr</a></li><li class="navelem"><a class="el" href="dir_94278571b66272a106537e099057d77d.html">dbprint</a></li><li class="navelem"><a class="el" href="dbprint__documentation_8h.html">dbprint_documentation.h</a></li>
<li class="footer">Generated on Thu Sep 3 2020 04:44:25 for IoT-MBBR (masterthesis) by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>
48241ad08This file is pinned to the selected release. Download the original to open it in your design tool.