Files
6CAR/doc/Doxygen/html/sdrv__semag_8h.html
2026-04-18 09:16:58 +08:00

379 lines
20 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">
<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.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SemiDrive SSDK Appication Program Interface: Z:/01-Code/06-SSDK-DEV-Firewall/ssdk/drivers/include/sdrv_semag.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="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">SemiDrive SSDK Appication Program Interface<span id="projectnumber">&#160;PTG3.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'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>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_14bc92f4b96c8519b376567118ac28b3.html">drivers</a></li><li class="navelem"><a class="el" href="dir_ee023d43c33bfccc31aa50a48a76892b.html">include</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">sdrv_semag.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="sdrv__common_8h_source.html">sdrv_common.h</a>&gt;</code><br />
<code>#include &lt;types.h&gt;</code><br />
</div>
<p><a href="sdrv__semag_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:a0e9b98ee41a4aeef9675f6a3d47a80cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#a0e9b98ee41a4aeef9675f6a3d47a80cd">sdrv_semag_trylock</a> (uint32_t gate_idx)</td></tr>
<tr class="separator:a0e9b98ee41a4aeef9675f6a3d47a80cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6b11497cf799fca41cb32a71ef278d8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#aa6b11497cf799fca41cb32a71ef278d8">sdrv_semag_lock</a> (uint32_t gate_idx)</td></tr>
<tr class="separator:aa6b11497cf799fca41cb32a71ef278d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1474de31ac32cf189cba0bd44091f71"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#ae1474de31ac32cf189cba0bd44091f71">sdrv_semag_unlock</a> (uint32_t gate_idx)</td></tr>
<tr class="separator:ae1474de31ac32cf189cba0bd44091f71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf60568741259794ef70f5922b2db1a3"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#abf60568741259794ef70f5922b2db1a3">sdrv_semag_get_lock_proc</a> (uint32_t gate_idx)</td></tr>
<tr class="separator:abf60568741259794ef70f5922b2db1a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a519a4d03ed6b09251826b417822c5e44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#a519a4d03ed6b09251826b417822c5e44">sdrv_semag_reset_all_gate</a> (void)</td></tr>
<tr class="separator:a519a4d03ed6b09251826b417822c5e44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5f07b50e50df6b617e4f8450b6e15db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#ae5f07b50e50df6b617e4f8450b6e15db">sdrv_semag_enable_gate_notify_interrupt</a> (uint32_t mask)</td></tr>
<tr class="separator:ae5f07b50e50df6b617e4f8450b6e15db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2772683a344c4a3070d98a71bab32cdf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#a2772683a344c4a3070d98a71bab32cdf">sdrv_semag_disable_gate_notify_interrupt</a> (uint32_t mask)</td></tr>
<tr class="separator:a2772683a344c4a3070d98a71bab32cdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22140fa13f5c8baabe5982440d671f83"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#a22140fa13f5c8baabe5982440d671f83">sdrv_semag_get_notify_status</a> (void)</td></tr>
<tr class="separator:a22140fa13f5c8baabe5982440d671f83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bd3298a847a5d0101eedb6ae0409934"><td class="memItemLeft" align="right" valign="top"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sdrv__semag_8h.html#a1bd3298a847a5d0101eedb6ae0409934">sdrv_semag_clear_notify_status</a> (uint32_t mask)</td></tr>
<tr class="separator:a1bd3298a847a5d0101eedb6ae0409934"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >User should initialize mbox module before using semag driver.</p>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2022 Semidrive Semiconductor. All rights reserved. </dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a41d9e164413a3329cc7debc241e667c6" name="a41d9e164413a3329cc7debc241e667c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41d9e164413a3329cc7debc241e667c6">&#9670;&nbsp;</a></span>SDRV_SEMAG_NUM</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SDRV_SEMAG_NUM&#160;&#160;&#160;(32UL)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a955df89c459274a72555062ffc8c291e" name="a955df89c459274a72555062ffc8c291e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a955df89c459274a72555062ffc8c291e">&#9670;&nbsp;</a></span>SDRV_SEMAG_PROCESSOR_NUM</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SDRV_SEMAG_PROCESSOR_NUM&#160;&#160;&#160;(8UL)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1bd3298a847a5d0101eedb6ae0409934" name="a1bd3298a847a5d0101eedb6ae0409934"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bd3298a847a5d0101eedb6ae0409934">&#9670;&nbsp;</a></span>sdrv_semag_clear_notify_status()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_clear_notify_status </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>mask</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Clear the gate notification interrupt status. </p>
<p >This function clear SEMAG gate IRQ notifications.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Mask of the gate index, for example: (1&lt;&lt;0U) | (1&lt;&lt;1U) means gate 0 and gate 1. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_OK Clear the notify interrupt status of the semag gate successfully. </dd></dl>
</div>
</div>
<a id="a2772683a344c4a3070d98a71bab32cdf" name="a2772683a344c4a3070d98a71bab32cdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2772683a344c4a3070d98a71bab32cdf">&#9670;&nbsp;</a></span>sdrv_semag_disable_gate_notify_interrupt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_disable_gate_notify_interrupt </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>mask</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Disable the gate notification interrupt. </p>
<p >Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Mask of the gate index, for example: (1&lt;&lt;0U) | (1&lt;&lt;1U) means gate 0 and gate 1. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_OK Disable the notify interrupt of the semag gate successfully. </dd></dl>
</div>
</div>
<a id="ae5f07b50e50df6b617e4f8450b6e15db" name="ae5f07b50e50df6b617e4f8450b6e15db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5f07b50e50df6b617e4f8450b6e15db">&#9670;&nbsp;</a></span>sdrv_semag_enable_gate_notify_interrupt()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_enable_gate_notify_interrupt </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>mask</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enable the gate notification interrupt. </p>
<p >Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Mask of the gate index, for example: (1&lt;&lt;0U) | (1&lt;&lt;1U) means gate 0 and gate 1. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_OK Enable the notify interrupt of the semag gate successfully. </dd></dl>
</div>
</div>
<a id="abf60568741259794ef70f5922b2db1a3" name="abf60568741259794ef70f5922b2db1a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf60568741259794ef70f5922b2db1a3">&#9670;&nbsp;</a></span>sdrv_semag_get_lock_proc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t sdrv_semag_get_lock_proc </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>gate_idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the status of the SEMAG gate. </p>
<p >This function checks the lock status of a specific SEMAG gate.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">gate_idx</td><td>Gate number to check lock status. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Return -1 if the gate is unlocked, otherwise return the processor number which has locked the gate. </dd></dl>
</div>
</div>
<a id="a22140fa13f5c8baabe5982440d671f83" name="a22140fa13f5c8baabe5982440d671f83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22140fa13f5c8baabe5982440d671f83">&#9670;&nbsp;</a></span>sdrv_semag_get_notify_status()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t sdrv_semag_get_notify_status </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the gate notification flags. </p>
<p >Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.</p>
<dl class="section return"><dt>Returns</dt><dd>Mask of the gate index, for example: (1&lt;&lt;0U) | (1&lt;&lt;1U) means gate 0 and gate 1 flags are pending. </dd></dl>
</div>
</div>
<a id="aa6b11497cf799fca41cb32a71ef278d8" name="aa6b11497cf799fca41cb32a71ef278d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6b11497cf799fca41cb32a71ef278d8">&#9670;&nbsp;</a></span>sdrv_semag_lock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_lock </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>gate_idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Locks the SEMAG gate. </p>
<p >This function locks the specific SEMAG gate. If the gate has been locked by other processors, this function waits until it is unlocked and then lock it.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">gate_idx</td><td>Gate number to lock. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_INVALID_PARAM The gate id is unvalid. SDRV_STATUS_OK Lock the semag gate successfully. </dd></dl>
</div>
</div>
<a id="a519a4d03ed6b09251826b417822c5e44" name="a519a4d03ed6b09251826b417822c5e44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a519a4d03ed6b09251826b417822c5e44">&#9670;&nbsp;</a></span>sdrv_semag_reset_all_gate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_reset_all_gate </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Resets all SEMAG gates to an unlocked status. </p>
<p >This function resets all SEMAG gate to an unlocked status, it will only unlock gates which locked by itself, can't reset gates which locked by other processors. </p><dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_OK Reset all semag gates successfully. </dd></dl>
</div>
</div>
<a id="a0e9b98ee41a4aeef9675f6a3d47a80cd" name="a0e9b98ee41a4aeef9675f6a3d47a80cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e9b98ee41a4aeef9675f6a3d47a80cd">&#9670;&nbsp;</a></span>sdrv_semag_trylock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_trylock </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>gate_idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to lock the SEMAG gate. </p>
<p >This function tries to lock the specific SEMAG gate. If the gate has been locked by another processor, this function returns an error code.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">gate_idx</td><td>Gate number to lock. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_INVALID_PARAM The gate id is unvalid. SDRV_STATUS_FAIL Semag gate has been locked by another processor. SDRV_STATUS_OK Lock the semag gate successfully. </dd></dl>
</div>
</div>
<a id="ae1474de31ac32cf189cba0bd44091f71" name="ae1474de31ac32cf189cba0bd44091f71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1474de31ac32cf189cba0bd44091f71">&#9670;&nbsp;</a></span>sdrv_semag_unlock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="sdrv__common_8h.html#aaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> sdrv_semag_unlock </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>gate_idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Unlocks the SEMAG gate. </p>
<p >This function unlocks the specific SEMAG gate. It only writes unlock value to the SEMAG gate register. However, it does not check whether the SEMAG gate is locked by the current processor or not. As a result, if the SEMAG gate is not locked by the current processor, this function has no effect.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">gate_idx</td><td>Gate number to unlock. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>SDRV_STATUS_OK Unlock the semag gate successfully. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>