This repository has been archived on 2024-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
Solar-Panel/html/tmr2_8c.html

330 lines
17 KiB
HTML
Raw Normal View History

2023-03-15 11:55:57 +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" 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: mcc_generated_files/tmr2.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 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&amp;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&amp;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&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('tmr2_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">
<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> </div>
<div class="headertitle"><div class="title">tmr2.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;xc.h&gt;</code><br />
<code>#include &quot;<a class="el" href="tmr2_8h_source.html">tmr2.h</a>&quot;</code><br />
</div>
<p><a href="tmr2_8c_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:a46c13c9255379e99c10240229a145d37"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#a46c13c9255379e99c10240229a145d37">TMR2_Initialize</a> (void)</td></tr>
<tr class="separator:a46c13c9255379e99c10240229a145d37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb37b846db811f973b4009215d59f91a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#afb37b846db811f973b4009215d59f91a">TMR2_StartTimer</a> (void)</td></tr>
<tr class="separator:afb37b846db811f973b4009215d59f91a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36d7e6eab8b279863c83a32fb41adb02"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#a36d7e6eab8b279863c83a32fb41adb02">TMR2_StopTimer</a> (void)</td></tr>
<tr class="separator:a36d7e6eab8b279863c83a32fb41adb02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4acc1f7c8c2dbd46424dad273cdb9cb1"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#a4acc1f7c8c2dbd46424dad273cdb9cb1">TMR2_ReadTimer</a> (void)</td></tr>
<tr class="separator:a4acc1f7c8c2dbd46424dad273cdb9cb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb2fbe8254fcc8c01b9784b028a7eac6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#acb2fbe8254fcc8c01b9784b028a7eac6">TMR2_WriteTimer</a> (uint8_t timerVal)</td></tr>
<tr class="separator:acb2fbe8254fcc8c01b9784b028a7eac6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5490961ba3ba77d10896e320ab840a74"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#a5490961ba3ba77d10896e320ab840a74">TMR2_LoadPeriodRegister</a> (uint8_t periodVal)</td></tr>
<tr class="separator:a5490961ba3ba77d10896e320ab840a74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0b9dbd90bacc904f311d71fbcccd038"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tmr2_8c.html#ab0b9dbd90bacc904f311d71fbcccd038">TMR2_HasOverflowOccured</a> (void)</td></tr>
<tr class="separator:ab0b9dbd90bacc904f311d71fbcccd038"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ab0b9dbd90bacc904f311d71fbcccd038" name="ab0b9dbd90bacc904f311d71fbcccd038"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab0b9dbd90bacc904f311d71fbcccd038">&#9670;&#160;</a></span>TMR2_HasOverflowOccured()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool TMR2_HasOverflowOccured </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary Boolean routine to poll or to check for the match flag on the fly.</p>
<p>@Description This function is called to check for the timer match flag. This function is used in timer polling method.</p>
<p>@Preconditions Initialize the TMR2 module before calling this routine.</p>
<p>@Param None</p>
<p>@Returns true - timer match has occurred. false - timer match has not occurred.</p>
<p>@Example <code> while(1) { check the match flag if(TMR2_HasOverflowOccured()) { Do something else...</code></p>
<p><code>Reload the TMR2 value TMR2_Reload(); } } </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00111">111</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="a46c13c9255379e99c10240229a145d37" name="a46c13c9255379e99c10240229a145d37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46c13c9255379e99c10240229a145d37">&#9670;&#160;</a></span>TMR2_Initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TMR2_Initialize </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>TMR2 Generated Driver File</p>
<p>@Company Microchip Technology Inc.</p>
<p>@File Name <a class="el" href="tmr2_8c.html">tmr2.c</a></p>
<p>@Summary This is the generated driver implementation file for the TMR2 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs</p>
<p>@Description This source file provides APIs for TMR2. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 Device : PIC18F97J60 Driver Version : 2.01 The generated drivers are tested against the following: Compiler : XC8 2.36 and above MPLAB : MPLAB X 6.00 Section: Included Files Section: Global Variables Definitions Section: TMR2 APIs </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00062">62</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="a5490961ba3ba77d10896e320ab840a74" name="a5490961ba3ba77d10896e320ab840a74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5490961ba3ba77d10896e320ab840a74">&#9670;&#160;</a></span>TMR2_LoadPeriodRegister()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TMR2_LoadPeriodRegister </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>periodVal</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary Load value to Period Register.</p>
<p>@Description This function writes the value to PR2 register. This function must be called after the initialization of TMR2.</p>
<p>@Preconditions Initialize the TMR2 before calling this function.</p>
<p>@Param periodVal - Value to load into TMR2 register.</p>
<p>@Returns None</p>
<p>@Example <code> #define PERIOD1 0x80 #define PERIOD2 0x40 #define ZERO 0x00</code></p>
<p><code> while(1) { Read the TMR2 register if(ZERO == <a class="el" href="tmr2_8h.html#a4acc1f7c8c2dbd46424dad273cdb9cb1">TMR2_ReadTimer()</a>) { Do something else... </p><pre class="fragment"> if(flag)
{
flag = 0;
</pre><p> Load Period 1 value TMR2_LoadPeriodRegister(PERIOD1); } else { flag = 1;</code></p>
<p><code>Load Period 2 value TMR2_LoadPeriodRegister(PERIOD2); } }</code></p>
<p><code>Do something else... } </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00106">106</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="a4acc1f7c8c2dbd46424dad273cdb9cb1" name="a4acc1f7c8c2dbd46424dad273cdb9cb1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4acc1f7c8c2dbd46424dad273cdb9cb1">&#9670;&#160;</a></span>TMR2_ReadTimer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t TMR2_ReadTimer </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary Reads the TMR2 register.</p>
<p>@Description This function reads the TMR2 register value and return it.</p>
<p>@Preconditions Initialize the TMR2 before calling this function.</p>
<p>@Param None</p>
<p>@Returns This function returns the current value of TMR2 register.</p>
<p>@Example <code> Initialize TMR2 module</code></p>
<p><code>Start TMR2 <a class="el" href="tmr2_8h.html#afb37b846db811f973b4009215d59f91a">TMR2_StartTimer()</a>;</code></p>
<p><code>Read the current value of TMR2 if(0 == <a class="el" href="tmr2_8h.html#a4acc1f7c8c2dbd46424dad273cdb9cb1">TMR2_ReadTimer()</a>) { Do something else...</code></p>
<p><code>Reload the TMR value TMR2_Reload(); } </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00091">91</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="afb37b846db811f973b4009215d59f91a" name="afb37b846db811f973b4009215d59f91a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb37b846db811f973b4009215d59f91a">&#9670;&#160;</a></span>TMR2_StartTimer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TMR2_StartTimer </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary This function starts the TMR2.</p>
<p>@Description This function starts the TMR2 operation. This function must be called after the initialization of TMR2.</p>
<p>@Preconditions Initialize the TMR2 before calling this function.</p>
<p>@Param None</p>
<p>@Returns None</p>
<p>@Example <code> Initialize TMR2 module</code></p>
<p><code>Start TMR2 <a class="el" href="tmr2_8h.html#afb37b846db811f973b4009215d59f91a">TMR2_StartTimer()</a>;</code></p>
<p><code>Do something else... </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00079">79</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="a36d7e6eab8b279863c83a32fb41adb02" name="a36d7e6eab8b279863c83a32fb41adb02"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36d7e6eab8b279863c83a32fb41adb02">&#9670;&#160;</a></span>TMR2_StopTimer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TMR2_StopTimer </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary This function stops the TMR2.</p>
<p>@Description This function stops the TMR2 operation. This function must be called after the start of TMR2.</p>
<p>@Preconditions Initialize the TMR2 before calling this function.</p>
<p>@Param None</p>
<p>@Returns None</p>
<p>@Example <code> Initialize TMR2 module</code></p>
<p><code>Start TMR2 <a class="el" href="tmr2_8h.html#afb37b846db811f973b4009215d59f91a">TMR2_StartTimer()</a>;</code></p>
<p><code>Do something else...</code></p>
<p><code>Stop TMR2; <a class="el" href="tmr2_8h.html#a36d7e6eab8b279863c83a32fb41adb02">TMR2_StopTimer()</a>; </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00085">85</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.c</a>.</p>
</div>
</div>
<a id="acb2fbe8254fcc8c01b9784b028a7eac6" name="acb2fbe8254fcc8c01b9784b028a7eac6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb2fbe8254fcc8c01b9784b028a7eac6">&#9670;&#160;</a></span>TMR2_WriteTimer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void TMR2_WriteTimer </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>timerVal</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>@Summary Writes the TMR2 register.</p>
<p>@Description This function writes the TMR2 register. This function must be called after the initialization of TMR2.</p>
<p>@Preconditions Initialize the TMR2 before calling this function.</p>
<p>@Param timerVal - Value to write into TMR2 register.</p>
<p>@Returns None</p>
<p>@Example <code> #define PERIOD 0x80 #define ZERO 0x00</code></p>
<p><code> while(1) { Read the TMR2 register if(ZERO == <a class="el" href="tmr2_8h.html#a4acc1f7c8c2dbd46424dad273cdb9cb1">TMR2_ReadTimer()</a>) { Do something else...</code></p>
<p><code>Write the TMR2 register TMR2_WriteTimer(PERIOD); }</code></p>
<p><code>Do something else... } </code> </p>
<p class="definition">Definition at line <a class="el" href="tmr2_8c_source.html#l00100">100</a> of file <a class="el" href="tmr2_8c_source.html">tmr2.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="dir_0ad8aa10ae8c15a00cc43e117933779f.html">mcc_generated_files</a></li><li class="navelem"><a class="el" href="tmr2_8c.html">tmr2.c</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>