348 lines
15 KiB
HTML
348 lines
15 KiB
HTML
<!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" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.6"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Solar panel: modbus.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>
|
|
<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 id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Solar panel
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.6 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('modbus_8h.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">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#func-members">Functions</a> |
|
|
<a href="#var-members">Variables</a> </div>
|
|
<div class="headertitle"><div class="title">modbus.h File Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Modbus serial library.
|
|
<a href="#details">More...</a></p>
|
|
<div class="textblock"><code>#include <stdint.h></code><br />
|
|
</div>
|
|
<p><a href="modbus_8h_source.html">Go to the source code of this file.</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:a67d9839b8e221bcb53bbbb2ba59ff618"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#a67d9839b8e221bcb53bbbb2ba59ff618">modbus_init</a> (uint8_t address)</td></tr>
|
|
<tr class="separator:a67d9839b8e221bcb53bbbb2ba59ff618"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6ae3279c3dcad4aa532eb07689f242e1"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#a6ae3279c3dcad4aa532eb07689f242e1">modbus_analyse_and_answer</a> (void)</td></tr>
|
|
<tr class="separator:a6ae3279c3dcad4aa532eb07689f242e1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af1b0553ef81d80e21233e23c3253ae61"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#af1b0553ef81d80e21233e23c3253ae61">modbus_send</a> (uint8_t length)</td></tr>
|
|
<tr class="separator:af1b0553ef81d80e21233e23c3253ae61"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aacb32a5aea357fae4e7fde574f95bfb9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#aacb32a5aea357fae4e7fde574f95bfb9">modbus_char_recvd</a> (void)</td></tr>
|
|
<tr class="separator:aacb32a5aea357fae4e7fde574f95bfb9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:add3e4a272cc65130d4e9f9c53caa61db"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#add3e4a272cc65130d4e9f9c53caa61db">modbus_timer</a> (void)</td></tr>
|
|
<tr class="separator:add3e4a272cc65130d4e9f9c53caa61db"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
|
|
Variables</h2></td></tr>
|
|
<tr class="memitem:a32ee4d57aa4ff7f7fce07fbe100dc0c2"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#a32ee4d57aa4ff7f7fce07fbe100dc0c2">modbusAddress</a></td></tr>
|
|
<tr class="separator:a32ee4d57aa4ff7f7fce07fbe100dc0c2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af231936e7cd39b49156a2a178f3d54eb"><td class="memItemLeft" align="right" valign="top">uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#af231936e7cd39b49156a2a178f3d54eb">input_registers</a> [2]</td></tr>
|
|
<tr class="separator:af231936e7cd39b49156a2a178f3d54eb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2aac17f17a0fbffad12e7ca46ed8ae0f"><td class="memItemLeft" align="right" valign="top">uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="modbus_8h.html#a2aac17f17a0fbffad12e7ca46ed8ae0f">holding_registers</a> [2]</td></tr>
|
|
<tr class="separator:a2aac17f17a0fbffad12e7ca46ed8ae0f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Modbus serial library. </p>
|
|
|
|
<p class="definition">Definition in file <a class="el" href="modbus_8h_source.html">modbus.h</a>.</p>
|
|
</div><h2 class="groupheader">Function Documentation</h2>
|
|
<a id="a6ae3279c3dcad4aa532eb07689f242e1" name="a6ae3279c3dcad4aa532eb07689f242e1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6ae3279c3dcad4aa532eb07689f242e1">◆ </a></span>modbus_analyse_and_answer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t modbus_analyse_and_answer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Analyses the received frame and answer to server</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>an error code if frame not valid </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00040">40</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aacb32a5aea357fae4e7fde574f95bfb9" name="aacb32a5aea357fae4e7fde574f95bfb9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aacb32a5aea357fae4e7fde574f95bfb9">◆ </a></span>modbus_char_recvd()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void modbus_char_recvd </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>This function will be called every time a character has been received on the Modbus serial port. It is called from the interrupt hander.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">c</td><td>: the received char // removed ! </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd>interrupts.c. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00085">85</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a67d9839b8e221bcb53bbbb2ba59ff618" name="a67d9839b8e221bcb53bbbb2ba59ff618"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a67d9839b8e221bcb53bbbb2ba59ff618">◆ </a></span>modbus_init()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void modbus_init </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>address</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Initializes this Modbus library.</p>
|
|
<p>Initialize pins, timer, serial port and variables. Interrupts MUST be initialized for the timer and the serial port.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">address</td><td>: the Modbus address of this device</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="modbus_8h.html#aacb32a5aea357fae4e7fde574f95bfb9">modbus_char_recvd</a> </dd>
|
|
<dd>
|
|
<a class="el" href="modbus_8h.html#add3e4a272cc65130d4e9f9c53caa61db">modbus_timer</a> </dd>
|
|
<dd>
|
|
interrupts.c </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00108">108</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af1b0553ef81d80e21233e23c3253ae61" name="af1b0553ef81d80e21233e23c3253ae61"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af1b0553ef81d80e21233e23c3253ae61">◆ </a></span>modbus_send()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void modbus_send </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>length</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Send the Modbus frame on tx_buf with CRC added</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">length</td><td>: length of the frame without the CRC </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00092">92</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="add3e4a272cc65130d4e9f9c53caa61db" name="add3e4a272cc65130d4e9f9c53caa61db"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#add3e4a272cc65130d4e9f9c53caa61db">◆ </a></span>modbus_timer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void modbus_timer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Modbus timer finished. This function is called by the interrupt handler when a MODBUS frame is finished. It must analyse the received packet and reply if required.</p>
|
|
<dl class="section see"><dt>See also</dt><dd>interrupts.c </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00033">33</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Variable Documentation</h2>
|
|
<a id="a2aac17f17a0fbffad12e7ca46ed8ae0f" name="a2aac17f17a0fbffad12e7ca46ed8ae0f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2aac17f17a0fbffad12e7ca46ed8ae0f">◆ </a></span>holding_registers</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint16_t holding_registers[2]</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00014">14</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af231936e7cd39b49156a2a178f3d54eb" name="af231936e7cd39b49156a2a178f3d54eb"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af231936e7cd39b49156a2a178f3d54eb">◆ </a></span>input_registers</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint16_t input_registers[2]</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00013">13</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a32ee4d57aa4ff7f7fce07fbe100dc0c2" name="a32ee4d57aa4ff7f7fce07fbe100dc0c2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a32ee4d57aa4ff7f7fce07fbe100dc0c2">◆ </a></span>modbusAddress</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t modbusAddress</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p class="definition">Definition at line <a class="el" href="modbus_8c_source.html#l00012">12</a> of file <a class="el" href="modbus_8c_source.html">modbus.c</a>.</p>
|
|
|
|
</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="modbus_8h.html">modbus.h</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|