uofw/group__SystemTimer.html
2016-08-03 00:15:35 +00:00

445 lines
20 KiB
HTML

<!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"/>
<title>uOFW: System Timer Module</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">uOFW
</div>
<div id="projectbrief">Reverse engineered PSP kernel 6.60.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">System Timer Module</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef s32(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#ga05489df07ffa9efb9d4a0b0ede12260f">SceSysTimerCb</a> )(s32 timerId, s32 count, void *common, s32 unk)</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gaf3cfe953fef7b49b17a07a4472bf7eb6">sceSTimerAlloc</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gad21aa3eb40d988f11271189048c28658">sceSTimerFree</a> (s32 timerId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gaeb5efad503c2ee6857338a10f2abb089">sceSTimerStartCount</a> (s32 timerId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gacfeced72bc885c9f996af057cd445c5a">sceSTimerGetCount</a> (s32 timerId, s32 *count)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#ga5f9a1d68ec79da1cc0d722f9bbe3b84e">sceSTimerResetCount</a> (s32 timerId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gabb0746e92a8802b01dc7df46ed54242b">sceSTimerStopCount</a> (s32 timerId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#ga4d845f8370853f09b616caca5689ca94">sceSTimerSetPrscl</a> (s32 timerId, s32 numerator, s32 denominator)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#ga0915d3a75aea194789ad651f954a7114">sceSTimerSetHandler</a> (s32 timerId, s32 compareValue, <a class="el" href="group__SystemTimer.html#ga05489df07ffa9efb9d4a0b0ede12260f">SceSysTimerCb</a> timeUpHandler, void *common)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__SystemTimer.html#gafe4d49a86307eae9334c3e476bddae65">sceSTimerSetTMCY</a> (s32 timerId, s32 arg1)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Hardware timer management. </p>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga05489df07ffa9efb9d4a0b0ede12260f"></a><!-- doxytag: member="systimer.h::SceSysTimerCb" ref="ga05489df07ffa9efb9d4a0b0ede12260f" args=")(s32 timerId, s32 count, void *common, s32 unk)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef s32(* <a class="el" href="group__SystemTimer.html#ga05489df07ffa9efb9d4a0b0ede12260f">SceSysTimerCb</a>)(s32 timerId, s32 count, void *common, s32 unk)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The time-up handler used by <a class="el" href="group__SystemTimer.html#ga0915d3a75aea194789ad651f954a7114">sceSTimerSetHandler()</a>. <br/>
When the hardware timer counter register matches the comparison value that was set by <a class="el" href="group__SystemTimer.html#ga0915d3a75aea194789ad651f954a7114">sceSTimerSetHandler()</a>, the time-up handler is called.</p>
<p>When the value returned by the time-up handler is not equal to -1, timer <br/>
counting is stopped and the timer is set to "not in use".</p>
<p>The following arguments don't need to be used in the time-up routine.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerID</td><td>The ID of the timer this time-up handler belongs to. </td></tr>
<tr><td class="paramname">count</td><td>Counter value. </td></tr>
<tr><td class="paramname">common</td><td>Pass the common argument specified in <a class="el" href="group__SystemTimer.html#ga0915d3a75aea194789ad651f954a7114">sceSTimerSetHandler()</a>. </td></tr>
<tr><td class="paramname">unk</td><td>Unknown.</td></tr>
</table>
</dd>
</dl>
<p>Typically returns -1. </p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf3cfe953fef7b49b17a07a4472bf7eb6"></a><!-- doxytag: member="systimer.h::sceSTimerAlloc" ref="gaf3cfe953fef7b49b17a07a4472bf7eb6" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gaf3cfe953fef7b49b17a07a4472bf7eb6">sceSTimerAlloc</a> </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Obtain a hardware timer. Cannot be called from an interrupt handler.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The timer id (greater than or equal to 0) on success. </dd></dl>
</div>
</div>
<a class="anchor" id="gad21aa3eb40d988f11271189048c28658"></a><!-- doxytag: member="systimer.h::sceSTimerFree" ref="gad21aa3eb40d988f11271189048c28658" args="(s32 timerId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gad21aa3eb40d988f11271189048c28658">sceSTimerFree</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the hardware timer that was obtained by <a class="el" href="group__SystemTimer.html#gaf3cfe953fef7b49b17a07a4472bf7eb6">sceSTimerAlloc()</a>.<br/>
Cannot be called from an interrupt handler.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to return.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="gaeb5efad503c2ee6857338a10f2abb089"></a><!-- doxytag: member="systimer.h::sceSTimerStartCount" ref="gaeb5efad503c2ee6857338a10f2abb089" args="(s32 timerId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gaeb5efad503c2ee6857338a10f2abb089">sceSTimerStartCount</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Start hardware timer counting. The timer is set to "in use" state.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to start counting.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="gacfeced72bc885c9f996af057cd445c5a"></a><!-- doxytag: member="systimer.h::sceSTimerGetCount" ref="gacfeced72bc885c9f996af057cd445c5a" args="(s32 timerId, s32 *count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gacfeced72bc885c9f996af057cd445c5a">sceSTimerGetCount</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s32 *&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Read the current value of hardware timer's counter register.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to obtain the timer counter value from. </td></tr>
<tr><td class="paramname">count</td><td>A pointer where the obtained counter value will be stored into.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="ga5f9a1d68ec79da1cc0d722f9bbe3b84e"></a><!-- doxytag: member="systimer.h::sceSTimerResetCount" ref="ga5f9a1d68ec79da1cc0d722f9bbe3b84e" args="(s32 timerId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#ga5f9a1d68ec79da1cc0d722f9bbe3b84e">sceSTimerResetCount</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reset the hardware timer's counter register to 0.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to reset its counter.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="gabb0746e92a8802b01dc7df46ed54242b"></a><!-- doxytag: member="systimer.h::sceSTimerStopCount" ref="gabb0746e92a8802b01dc7df46ed54242b" args="(s32 timerId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gabb0746e92a8802b01dc7df46ed54242b">sceSTimerStopCount</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Stop the hardware timer counting and set the timer's state to "not in use".</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to stop its counting.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="ga4d845f8370853f09b616caca5689ca94"></a><!-- doxytag: member="systimer.h::sceSTimerSetPrscl" ref="ga4d845f8370853f09b616caca5689ca94" args="(s32 timerId, s32 numerator, s32 denominator)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#ga4d845f8370853f09b616caca5689ca94">sceSTimerSetPrscl</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>numerator</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>denominator</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the prescale of a hardware timer. It can be only set on timers which are in the "not in use" state.<br/>
The input signal is divided into the resulting ratio. The ratio has to be less than 1/11.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to set the prescale. </td></tr>
<tr><td class="paramname">numerator</td><td>The numerator of the prescale. Must not be 0. </td></tr>
<tr><td class="paramname">denominator</td><td>The denominator of the prescale. Must not be 0.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="ga0915d3a75aea194789ad651f954a7114"></a><!-- doxytag: member="systimer.h::sceSTimerSetHandler" ref="ga0915d3a75aea194789ad651f954a7114" args="(s32 timerId, s32 compareValue, SceSysTimerCb timeUpHandler, void *common)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#ga0915d3a75aea194789ad651f954a7114">sceSTimerSetHandler</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>compareValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__SystemTimer.html#ga05489df07ffa9efb9d4a0b0ede12260f">SceSysTimerCb</a>&#160;</td>
<td class="paramname"><em>timeUpHandler</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>common</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the comparison value and the time-up handler of the hardware timer counter register.<br/>
The hardware timer counter register begins counting up from zero. If the counter register matches <br/>
the comparison value, an interrupt occurs, the counter register is returned to zero, and counting <br/>
continues. The time-up handler is called via this interrupt.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer to set the compare value and time-up handler. </td></tr>
<tr><td class="paramname">compareValue</td><td>The count comparison value. Should not be greater 4194303 (~1/10 seconds) and less than 0. </td></tr>
<tr><td class="paramname">timeUpHandler</td><td>Specify the time-up handler that is called when count matches the comparison value.<br/>
Pass null to delete a registered time-up handler. This will also stop the hardware timer <br/>
counting. </td></tr>
<tr><td class="paramname">common</td><td>Pointer to memory common between time-up handler and general routines.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
<a class="anchor" id="gafe4d49a86307eae9334c3e476bddae65"></a><!-- doxytag: member="systimer.h::sceSTimerSetTMCY" ref="gafe4d49a86307eae9334c3e476bddae65" args="(s32 timerId, s32 arg1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">s32 <a class="el" href="group__SystemTimer.html#gafe4d49a86307eae9334c3e476bddae65">sceSTimerSetTMCY</a> </td>
<td>(</td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>timerId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">s32&#160;</td>
<td class="paramname"><em>arg1</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unknown purpose.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">timerId</td><td>The ID of the timer. </td></tr>
<tr><td class="paramname">arg1</td><td>Unknown. Should not be less than 0 and greater 4194304.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>SCE_ERROR_OK on success. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></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>
<hr class="footer"/><address class="footer"><small>
Generated on Wed Aug 3 2016 00:15:35 for uOFW by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>