825 lines
54 KiB
HTML
825 lines
54 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"/>
|
|
<meta name="generator" content="Doxygen 1.8.6"/>
|
|
<title>Kinetis SDK v.2.0 API Reference Manual: Notification Framework</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="navtree.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(initResizable);
|
|
$(window).load(resizeHeight);
|
|
</script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="customdoxygen.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="projectlogo"><img alt="Logo" src="fs_logo.gif"/></td>
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">Kinetis SDK v.2.0 API Reference Manual
|
|
 <span id="projectnumber">Rev. 0</span>
|
|
</div>
|
|
<div id="projectbrief">Freescale Semiconductor, Inc.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.6 -->
|
|
<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 Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>API Reference</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><!-- 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('group__notifier.html','');});
|
|
</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)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Pages</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>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Data Structures</a> |
|
|
<a href="#typedef-members">Typedefs</a> |
|
|
<a href="#enum-members">Enumerations</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Notification Framework</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
|
|
<p>This section describes the programming interface of the Notifier driver.</p>
|
|
<h1><a class="anchor" id="NotifierOv"></a>
|
|
Notifier Overview</h1>
|
|
<p>The Notifier provides a configuration dynamic change service. Based on this service, applications can switch between pre-defined configurations. The Notifier enables drivers and applications to register callback functions to this framework. Each time that the configuration is changed, drivers and applications receive a notification and change their settings. To simplify, the Notifier only supports the static callback registration. This means that, for applications, all callback functions are collected into a static table and passed to the Notifier.</p>
|
|
<p>The configuration transition includes 3 steps:</p>
|
|
<ol type="1">
|
|
<li>Before configuration transition, the Notifier sends a "BEFORE" message to the callback table. When this message is received, IP drivers should check whether any current processes can be stopped and stop them. If the processes cannot be stopped, the callback function returns an error.</li>
|
|
</ol>
|
|
<p>The Notifier supports two types of transition policies, a graceful policy and a forceful policy. When the graceful policy is used, if some callbacks return an error while sending "BEFORE" message, the configuration transition stops and the Notifier sends a "RECOVER" message to all drivers that have stopped. Then, these drivers can recover the previous status and continue to work. When the forceful policy is used, drivers are stopped forcefully.</p>
|
|
<ol type="1">
|
|
<li>After the "BEFORE" message is processed successfully, the system changes to the new configuration.</li>
|
|
<li>After the configuration changes, the Notifier sends an "AFTER" message to the callback table to notify drivers that the configuration transition is finished.</li>
|
|
</ol>
|
|
<h2>This is an example to use the Notifier in the Power Manager application: </h2>
|
|
<p>~~~~~{.c} </p>
|
|
<pre class="fragment">#include "fsl_notifier.h"
|
|
|
|
/* Definition of the Power Manager callback
|
|
status_t callback0(notifier_notification_block_t *notify, void *data)
|
|
{
|
|
|
|
status_t ret = kStatus_Success;
|
|
|
|
...
|
|
...
|
|
...
|
|
|
|
return ret;
|
|
}
|
|
/* Definition of the Power Manager user function
|
|
status_t APP_PowerModeSwitch(notifier_user_config_t *targetConfig, void *userData)
|
|
{
|
|
...
|
|
...
|
|
...
|
|
}
|
|
...
|
|
...
|
|
...
|
|
...
|
|
...
|
|
/* Main function
|
|
int main(void)
|
|
{
|
|
/* Define a notifier handle
|
|
notifier_handle_t powerModeHandle;
|
|
|
|
/* Callback configuration
|
|
user_callback_data_t callbackData0;
|
|
|
|
notifier_callback_config_t callbackCfg0 = {callback0,
|
|
kNOTIFIER_CallbackBeforeAfter,
|
|
(void *)&callbackData0};
|
|
|
|
notifier_callback_config_t callbacks[] = {callbackCfg0};
|
|
|
|
/* Power mode configurations
|
|
power_user_config_t vlprConfig;
|
|
power_user_config_t stopConfig;
|
|
|
|
notifier_user_config_t *powerConfigs[] = {&vlprConfig, &stopConfig};
|
|
|
|
/* Definition of a transition to and out the power modes
|
|
vlprConfig.mode = kAPP_PowerModeVlpr;
|
|
vlprConfig.enableLowPowerWakeUpOnInterrupt = false;
|
|
|
|
stopConfig = vlprConfig;
|
|
stopConfig.mode = kAPP_PowerModeStop;
|
|
|
|
/* Create Notifier handle
|
|
NOTIFIER_CreateHandle(&powerModeHandle, powerConfigs, 2U, callbacks, 1U, APP_PowerModeSwitch, NULL);
|
|
...
|
|
...
|
|
/* Power mode switch
|
|
NOTIFIER_switchConfig(&powerModeHandle, targetConfigIndex, kNOTIFIER_PolicyAgreement);
|
|
}
|
|
</pre><p> ~~~~~{.c} </p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:structnotifier__notification__block__t"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#structnotifier__notification__block__t">notifier_notification_block_t</a></td></tr>
|
|
<tr class="memdesc:structnotifier__notification__block__t"><td class="mdescLeft"> </td><td class="mdescRight">notification block passed to the registered callback function. <a href="group__notifier.html#structnotifier__notification__block__t">More...</a><br/></td></tr>
|
|
<tr class="separator:structnotifier__notification__block__t"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:structnotifier__callback__config__t"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#structnotifier__callback__config__t">notifier_callback_config_t</a></td></tr>
|
|
<tr class="memdesc:structnotifier__callback__config__t"><td class="mdescLeft"> </td><td class="mdescRight">callback configuration structure <a href="group__notifier.html#structnotifier__callback__config__t">More...</a><br/></td></tr>
|
|
<tr class="separator:structnotifier__callback__config__t"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:structnotifier__handle__t"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a></td></tr>
|
|
<tr class="memdesc:structnotifier__handle__t"><td class="mdescLeft"> </td><td class="mdescRight">Notifier handle structure. <a href="group__notifier.html#structnotifier__handle__t">More...</a><br/></td></tr>
|
|
<tr class="separator:structnotifier__handle__t"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
|
|
Typedefs</h2></td></tr>
|
|
<tr class="memitem:gad0b6e919f3ff69992b36a2734a650ec7"><td class="memItemLeft" align="right" valign="top">typedef void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a></td></tr>
|
|
<tr class="memdesc:gad0b6e919f3ff69992b36a2734a650ec7"><td class="mdescLeft"> </td><td class="mdescRight">notifier user configuration type. <a href="#gad0b6e919f3ff69992b36a2734a650ec7">More...</a><br/></td></tr>
|
|
<tr class="separator:gad0b6e919f3ff69992b36a2734a650ec7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gacb6a6d6f99e6ddfbb96dae53382949b2"><td class="memItemLeft" align="right" valign="top">typedef status_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gacb6a6d6f99e6ddfbb96dae53382949b2">notifier_user_function_t</a> )(<a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> *targetConfig, void *userData)</td></tr>
|
|
<tr class="memdesc:gacb6a6d6f99e6ddfbb96dae53382949b2"><td class="mdescLeft"> </td><td class="mdescRight">notifier user function prototype User can use this function to execute specific operations in configuration switch. <a href="#gacb6a6d6f99e6ddfbb96dae53382949b2">More...</a><br/></td></tr>
|
|
<tr class="separator:gacb6a6d6f99e6ddfbb96dae53382949b2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gafd1d8cc01c496de8b4cd3990ff85415c"><td class="memItemLeft" align="right" valign="top">typedef status_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gafd1d8cc01c496de8b4cd3990ff85415c">notifier_callback_t</a> )(<a class="el" href="group__notifier.html#structnotifier__notification__block__t">notifier_notification_block_t</a> *notify, void *data)</td></tr>
|
|
<tr class="memdesc:gafd1d8cc01c496de8b4cd3990ff85415c"><td class="mdescLeft"> </td><td class="mdescRight">Callback prototype. <a href="#gafd1d8cc01c496de8b4cd3990ff85415c">More...</a><br/></td></tr>
|
|
<tr class="separator:gafd1d8cc01c496de8b4cd3990ff85415c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
|
|
Enumerations</h2></td></tr>
|
|
<tr class="memitem:gacac871f1b98f53906b07b2663943c784"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gacac871f1b98f53906b07b2663943c784">_notifier_status</a> { <br/>
|
|
  <a class="el" href="group__notifier.html#ggacac871f1b98f53906b07b2663943c784a23344b22d4d82fea2f17f4979d515c5c">kStatus_NOTIFIER_ErrorNotificationBefore</a>,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#ggacac871f1b98f53906b07b2663943c784a7b48bf0cf849b07c6131a0abb65d2d58">kStatus_NOTIFIER_ErrorNotificationAfter</a>
|
|
<br/>
|
|
}</td></tr>
|
|
<tr class="memdesc:gacac871f1b98f53906b07b2663943c784"><td class="mdescLeft"> </td><td class="mdescRight">Notifier error codes. <a href="group__notifier.html#gacac871f1b98f53906b07b2663943c784">More...</a><br/></td></tr>
|
|
<tr class="separator:gacac871f1b98f53906b07b2663943c784"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga62e961564dc31b8155d128a3f6566409"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a> { <br/>
|
|
  <a class="el" href="group__notifier.html#gga62e961564dc31b8155d128a3f6566409a4513243b3cacd0aec289531dfb53e964">kNOTIFIER_PolicyAgreement</a>,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#gga62e961564dc31b8155d128a3f6566409a97a2587e9e4c523dc028778ba1f72dc8">kNOTIFIER_PolicyForcible</a>
|
|
<br/>
|
|
}</td></tr>
|
|
<tr class="memdesc:ga62e961564dc31b8155d128a3f6566409"><td class="mdescLeft"> </td><td class="mdescRight">Notifier policies. <a href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">More...</a><br/></td></tr>
|
|
<tr class="separator:ga62e961564dc31b8155d128a3f6566409"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga5ee4314c2a52ee0af61985e7163a1be9"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#ga5ee4314c2a52ee0af61985e7163a1be9">notifier_notification_type_t</a> { <br/>
|
|
  <a class="el" href="group__notifier.html#gga5ee4314c2a52ee0af61985e7163a1be9a49e6ad28b9d351a051035c8065de5d94">kNOTIFIER_NotifyRecover</a> = 0x00U,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#gga5ee4314c2a52ee0af61985e7163a1be9a91707ed2be51db6da2a9d6cc6eaee39c">kNOTIFIER_NotifyBefore</a> = 0x01U,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#gga5ee4314c2a52ee0af61985e7163a1be9a6e89a377b2890077646fc6af6b5c2e00">kNOTIFIER_NotifyAfter</a> = 0x02U
|
|
<br/>
|
|
}</td></tr>
|
|
<tr class="memdesc:ga5ee4314c2a52ee0af61985e7163a1be9"><td class="mdescLeft"> </td><td class="mdescRight">Notification type. <a href="group__notifier.html#ga5ee4314c2a52ee0af61985e7163a1be9">More...</a><br/></td></tr>
|
|
<tr class="separator:ga5ee4314c2a52ee0af61985e7163a1be9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaad75237e3cea51f8315cf6577b35db91"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gaad75237e3cea51f8315cf6577b35db91">notifier_callback_type_t</a> { <br/>
|
|
  <a class="el" href="group__notifier.html#ggaad75237e3cea51f8315cf6577b35db91ab9c117f1eccd38f914d0e4d05015d6a1">kNOTIFIER_CallbackBefore</a> = 0x01U,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#ggaad75237e3cea51f8315cf6577b35db91a8d5832eddd0d8cf976413aea02f3bfdc">kNOTIFIER_CallbackAfter</a> = 0x02U,
|
|
<br/>
|
|
  <a class="el" href="group__notifier.html#ggaad75237e3cea51f8315cf6577b35db91ada6451efe227571a1442e70ddf36e005">kNOTIFIER_CallbackBeforeAfter</a> = 0x03U
|
|
<br/>
|
|
}</td></tr>
|
|
<tr class="memdesc:gaad75237e3cea51f8315cf6577b35db91"><td class="mdescLeft"> </td><td class="mdescRight">The callback type, indicates what kinds of notification the callback handles. <a href="group__notifier.html#gaad75237e3cea51f8315cf6577b35db91">More...</a><br/></td></tr>
|
|
<tr class="separator:gaad75237e3cea51f8315cf6577b35db91"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:gaa2dfe33b4724d9c1025acdde1b1b3c31"><td class="memItemLeft" align="right" valign="top">status_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#gaa2dfe33b4724d9c1025acdde1b1b3c31">NOTIFIER_CreateHandle</a> (<a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> *notifierHandle, <a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> **configs, uint8_t configsNumber, <a class="el" href="group__notifier.html#structnotifier__callback__config__t">notifier_callback_config_t</a> *callbacks, uint8_t callbacksNumber, <a class="el" href="group__notifier.html#gacb6a6d6f99e6ddfbb96dae53382949b2">notifier_user_function_t</a> userFunction, void *userData)</td></tr>
|
|
<tr class="memdesc:gaa2dfe33b4724d9c1025acdde1b1b3c31"><td class="mdescLeft"> </td><td class="mdescRight">Create Notifier handle. <a href="#gaa2dfe33b4724d9c1025acdde1b1b3c31">More...</a><br/></td></tr>
|
|
<tr class="separator:gaa2dfe33b4724d9c1025acdde1b1b3c31"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9ca08c8f6fa9a7bafa9ecbe08603cd97"><td class="memItemLeft" align="right" valign="top">status_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97">NOTIFIER_SwitchConfig</a> (<a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> *notifierHandle, uint8_t configIndex, <a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a> policy)</td></tr>
|
|
<tr class="memdesc:ga9ca08c8f6fa9a7bafa9ecbe08603cd97"><td class="mdescLeft"> </td><td class="mdescRight">Switch configuration according to a pre-defined structure. <a href="#ga9ca08c8f6fa9a7bafa9ecbe08603cd97">More...</a><br/></td></tr>
|
|
<tr class="separator:ga9ca08c8f6fa9a7bafa9ecbe08603cd97"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9736632c3beca486ec3f8dab504b839c"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#ga9736632c3beca486ec3f8dab504b839c">NOTIFIER_GetErrorCallbackIndex</a> (<a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> *notifierHandle)</td></tr>
|
|
<tr class="memdesc:ga9736632c3beca486ec3f8dab504b839c"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the last failed notification callback. <a href="#ga9736632c3beca486ec3f8dab504b839c">More...</a><br/></td></tr>
|
|
<tr class="separator:ga9736632c3beca486ec3f8dab504b839c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
|
|
<a name="structnotifier__notification__block__t" id="structnotifier__notification__block__t"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct notifier_notification_block_t</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<div class="textblock"></div><table class="memberdecls">
|
|
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
|
|
<tr class="memitem:a2e0b1d4d7e3ebf8f454b55af953e3ffa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a2e0b1d4d7e3ebf8f454b55af953e3ffa">targetConfig</a></td></tr>
|
|
<tr class="memdesc:a2e0b1d4d7e3ebf8f454b55af953e3ffa"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to target configuration. <a href="#a2e0b1d4d7e3ebf8f454b55af953e3ffa">More...</a><br/></td></tr>
|
|
<tr class="separator:a2e0b1d4d7e3ebf8f454b55af953e3ffa"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a26aef2519eb2f9990e04f2ce961dfc9b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a26aef2519eb2f9990e04f2ce961dfc9b">policy</a></td></tr>
|
|
<tr class="memdesc:a26aef2519eb2f9990e04f2ce961dfc9b"><td class="mdescLeft"> </td><td class="mdescRight">Configure transition policy. <a href="#a26aef2519eb2f9990e04f2ce961dfc9b">More...</a><br/></td></tr>
|
|
<tr class="separator:a26aef2519eb2f9990e04f2ce961dfc9b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2ca3b1a52e315e072a8ab48fcc1dd62a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#ga5ee4314c2a52ee0af61985e7163a1be9">notifier_notification_type_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a2ca3b1a52e315e072a8ab48fcc1dd62a">notifyType</a></td></tr>
|
|
<tr class="memdesc:a2ca3b1a52e315e072a8ab48fcc1dd62a"><td class="mdescLeft"> </td><td class="mdescRight">Configure notification type. <a href="#a2ca3b1a52e315e072a8ab48fcc1dd62a">More...</a><br/></td></tr>
|
|
<tr class="separator:a2ca3b1a52e315e072a8ab48fcc1dd62a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h4 class="groupheader">Field Documentation</h4>
|
|
<a class="anchor" id="a2e0b1d4d7e3ebf8f454b55af953e3ffa"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a>* notifier_notification_block_t::targetConfig</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a26aef2519eb2f9990e04f2ce961dfc9b"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a> notifier_notification_block_t::policy</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a2ca3b1a52e315e072a8ab48fcc1dd62a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#ga5ee4314c2a52ee0af61985e7163a1be9">notifier_notification_type_t</a> notifier_notification_block_t::notifyType</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a name="structnotifier__callback__config__t" id="structnotifier__callback__config__t"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct notifier_callback_config_t</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<div class="textblock"><p>This structure holds configuration of callbacks. Callbacks of this type are expected to be statically allocated. This structure contains following application-defined data: callback - pointer to the callback function callbackType - specifies when the callback is called callbackData - pointer to the data passed to the callback. </p>
|
|
</div><table class="memberdecls">
|
|
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
|
|
<tr class="memitem:a116c9dd621ffc21178e769edbd9192e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#gafd1d8cc01c496de8b4cd3990ff85415c">notifier_callback_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a116c9dd621ffc21178e769edbd9192e4">callback</a></td></tr>
|
|
<tr class="memdesc:a116c9dd621ffc21178e769edbd9192e4"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to the callback function. <a href="#a116c9dd621ffc21178e769edbd9192e4">More...</a><br/></td></tr>
|
|
<tr class="separator:a116c9dd621ffc21178e769edbd9192e4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad9e6ec8e23a48ef8d97b2f6d16fb68ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#gaad75237e3cea51f8315cf6577b35db91">notifier_callback_type_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#ad9e6ec8e23a48ef8d97b2f6d16fb68ec">callbackType</a></td></tr>
|
|
<tr class="memdesc:ad9e6ec8e23a48ef8d97b2f6d16fb68ec"><td class="mdescLeft"> </td><td class="mdescRight">Callback type. <a href="#ad9e6ec8e23a48ef8d97b2f6d16fb68ec">More...</a><br/></td></tr>
|
|
<tr class="separator:ad9e6ec8e23a48ef8d97b2f6d16fb68ec"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4e7db701bbf36647da1e6d0f0efe2ebf"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a4e7db701bbf36647da1e6d0f0efe2ebf">callbackData</a></td></tr>
|
|
<tr class="memdesc:a4e7db701bbf36647da1e6d0f0efe2ebf"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to the data passed to the callback. <a href="#a4e7db701bbf36647da1e6d0f0efe2ebf">More...</a><br/></td></tr>
|
|
<tr class="separator:a4e7db701bbf36647da1e6d0f0efe2ebf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h4 class="groupheader">Field Documentation</h4>
|
|
<a class="anchor" id="a116c9dd621ffc21178e769edbd9192e4"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#gafd1d8cc01c496de8b4cd3990ff85415c">notifier_callback_t</a> notifier_callback_config_t::callback</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad9e6ec8e23a48ef8d97b2f6d16fb68ec"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#gaad75237e3cea51f8315cf6577b35db91">notifier_callback_type_t</a> notifier_callback_config_t::callbackType</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a4e7db701bbf36647da1e6d0f0efe2ebf"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void* notifier_callback_config_t::callbackData</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a name="structnotifier__handle__t" id="structnotifier__handle__t"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct notifier_handle_t</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<div class="textblock"><p>Notifier handle structure. Contains data necessary for Notifier proper function. Stores references to registered configurations, callbacks, information about their numbers, user function, user data and other internal data. <a class="el" href="group__notifier.html#gaa2dfe33b4724d9c1025acdde1b1b3c31" title="Create Notifier handle. ">NOTIFIER_CreateHandle()</a> must be called to intialize this handle. </p>
|
|
</div><table class="memberdecls">
|
|
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
|
|
<tr class="memitem:a8fd95d668f17b8a7705e2a4ff49f2e16"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a8fd95d668f17b8a7705e2a4ff49f2e16">configsTable</a></td></tr>
|
|
<tr class="memdesc:a8fd95d668f17b8a7705e2a4ff49f2e16"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to configure table. <a href="#a8fd95d668f17b8a7705e2a4ff49f2e16">More...</a><br/></td></tr>
|
|
<tr class="separator:a8fd95d668f17b8a7705e2a4ff49f2e16"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a59bdd44c33254cfd4626f5906d3c0a7a"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a59bdd44c33254cfd4626f5906d3c0a7a">configsNumber</a></td></tr>
|
|
<tr class="memdesc:a59bdd44c33254cfd4626f5906d3c0a7a"><td class="mdescLeft"> </td><td class="mdescRight">Number of configurations. <a href="#a59bdd44c33254cfd4626f5906d3c0a7a">More...</a><br/></td></tr>
|
|
<tr class="separator:a59bdd44c33254cfd4626f5906d3c0a7a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a423480d080ea2580628222dc6c492735"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#structnotifier__callback__config__t">notifier_callback_config_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a423480d080ea2580628222dc6c492735">callbacksTable</a></td></tr>
|
|
<tr class="memdesc:a423480d080ea2580628222dc6c492735"><td class="mdescLeft"> </td><td class="mdescRight">Pointer to callback table. <a href="#a423480d080ea2580628222dc6c492735">More...</a><br/></td></tr>
|
|
<tr class="separator:a423480d080ea2580628222dc6c492735"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:acd4e9338f2cd47c46fc0c02886daafbb"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#acd4e9338f2cd47c46fc0c02886daafbb">callbacksNumber</a></td></tr>
|
|
<tr class="memdesc:acd4e9338f2cd47c46fc0c02886daafbb"><td class="mdescLeft"> </td><td class="mdescRight">Maximum number of callback configurations. <a href="#acd4e9338f2cd47c46fc0c02886daafbb">More...</a><br/></td></tr>
|
|
<tr class="separator:acd4e9338f2cd47c46fc0c02886daafbb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6a8447a4b6045219363883663f40d300"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a6a8447a4b6045219363883663f40d300">errorCallbackIndex</a></td></tr>
|
|
<tr class="memdesc:a6a8447a4b6045219363883663f40d300"><td class="mdescLeft"> </td><td class="mdescRight">Index of callback returns error. <a href="#a6a8447a4b6045219363883663f40d300">More...</a><br/></td></tr>
|
|
<tr class="separator:a6a8447a4b6045219363883663f40d300"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aae9d6d2cc9c47485863c098c0284a021"><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#aae9d6d2cc9c47485863c098c0284a021">currentConfigIndex</a></td></tr>
|
|
<tr class="memdesc:aae9d6d2cc9c47485863c098c0284a021"><td class="mdescLeft"> </td><td class="mdescRight">Index of current configuration. <a href="#aae9d6d2cc9c47485863c098c0284a021">More...</a><br/></td></tr>
|
|
<tr class="separator:aae9d6d2cc9c47485863c098c0284a021"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4f6589fa386e93c40c52ed292da4f47f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__notifier.html#gacb6a6d6f99e6ddfbb96dae53382949b2">notifier_user_function_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a4f6589fa386e93c40c52ed292da4f47f">userFunction</a></td></tr>
|
|
<tr class="memdesc:a4f6589fa386e93c40c52ed292da4f47f"><td class="mdescLeft"> </td><td class="mdescRight">user function. <a href="#a4f6589fa386e93c40c52ed292da4f47f">More...</a><br/></td></tr>
|
|
<tr class="separator:a4f6589fa386e93c40c52ed292da4f47f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5e90e1dafbe97f2ea5187530ee04af0a"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__notifier.html#a5e90e1dafbe97f2ea5187530ee04af0a">userData</a></td></tr>
|
|
<tr class="memdesc:a5e90e1dafbe97f2ea5187530ee04af0a"><td class="mdescLeft"> </td><td class="mdescRight">user data passed to user function. <a href="#a5e90e1dafbe97f2ea5187530ee04af0a">More...</a><br/></td></tr>
|
|
<tr class="separator:a5e90e1dafbe97f2ea5187530ee04af0a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h4 class="groupheader">Field Documentation</h4>
|
|
<a class="anchor" id="a8fd95d668f17b8a7705e2a4ff49f2e16"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a>** notifier_handle_t::configsTable</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a59bdd44c33254cfd4626f5906d3c0a7a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t notifier_handle_t::configsNumber</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a423480d080ea2580628222dc6c492735"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#structnotifier__callback__config__t">notifier_callback_config_t</a>* notifier_handle_t::callbacksTable</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="acd4e9338f2cd47c46fc0c02886daafbb"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t notifier_handle_t::callbacksNumber</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a6a8447a4b6045219363883663f40d300"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t notifier_handle_t::errorCallbackIndex</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="aae9d6d2cc9c47485863c098c0284a021"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t notifier_handle_t::currentConfigIndex</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a4f6589fa386e93c40c52ed292da4f47f"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__notifier.html#gacb6a6d6f99e6ddfbb96dae53382949b2">notifier_user_function_t</a> notifier_handle_t::userFunction</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a5e90e1dafbe97f2ea5187530ee04af0a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void* notifier_handle_t::userData</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Typedef Documentation</h2>
|
|
<a class="anchor" id="gad0b6e919f3ff69992b36a2734a650ec7"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef void <a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Reference of user defined configuration is stored in an array, notifer switch between these configurations based on this array. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacb6a6d6f99e6ddfbb96dae53382949b2"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef status_t(* notifier_user_function_t)(<a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> *targetConfig, void *userData)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Before and after this function execution, different notification will be sent to registered callbacks. If this function returns any error code, <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> will exit.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">targetConfig</td><td>target Configuration. </td></tr>
|
|
<tr><td class="paramname">userData</td><td>Refers to other specific data passed to user function. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An error code or kStatus_Success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gafd1d8cc01c496de8b4cd3990ff85415c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef status_t(* notifier_callback_t)(<a class="el" href="group__notifier.html#structnotifier__notification__block__t">notifier_notification_block_t</a> *notify, void *data)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Declaration of callback. It is common for registered callbacks. Reference to function of this type is part of <a class="el" href="group__notifier.html#structnotifier__callback__config__t" title="callback configuration structure ">notifier_callback_config_t</a> callback configuration structure. Depending on callback type, function of this prototype is called (see <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a>) before configuration switch, after it or in both cases to notify about the switch progress (see notifier_callback_type_t). When called, type of the notification is passed as parameter along with reference to the target configuration structure (see <a class="el" href="group__notifier.html#structnotifier__notification__block__t" title="notification block passed to the registered callback function. ">notifier_notification_block_t</a>) and any data passed during the callback registration. When notified before configuration switch, depending on the configuration switch policy (see notifier_policy_t) the callback may deny the execution of user function by returning any error code different from kStatus_Success (see <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a>).</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">notify</td><td>Notification block. </td></tr>
|
|
<tr><td class="paramname">data</td><td>Callback data. Refers to the data passed during callback registration. Intended to pass any driver or application data such as internal state information. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An error code or kStatus_Success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Enumeration Type Documentation</h2>
|
|
<a class="anchor" id="gacac871f1b98f53906b07b2663943c784"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__notifier.html#gacac871f1b98f53906b07b2663943c784">_notifier_status</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Used as return value of Notifier functions. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ggacac871f1b98f53906b07b2663943c784a23344b22d4d82fea2f17f4979d515c5c"></a>kStatus_NOTIFIER_ErrorNotificationBefore</em> </td><td class="fielddoc">
|
|
<p>Error occurs during send "BEFORE" notification. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="ggacac871f1b98f53906b07b2663943c784a7b48bf0cf849b07c6131a0abb65d2d58"></a>kStatus_NOTIFIER_ErrorNotificationAfter</em> </td><td class="fielddoc">
|
|
<p>Error occurs during send "AFTER" notification. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga62e961564dc31b8155d128a3f6566409"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Defines whether user function execution is forced or not. For kNOTIFIER_PolicyForcible, the user function is executed regardless of the callback results, while kNOTIFIER_PolicyAgreement policy is used to exit <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> when any of the callbacks returns error code. See also <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> description. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga62e961564dc31b8155d128a3f6566409a4513243b3cacd0aec289531dfb53e964"></a>kNOTIFIER_PolicyAgreement</em> </td><td class="fielddoc">
|
|
<p><a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> method is exited when any of the callbacks returns error code. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="gga62e961564dc31b8155d128a3f6566409a97a2587e9e4c523dc028778ba1f72dc8"></a>kNOTIFIER_PolicyForcible</em> </td><td class="fielddoc">
|
|
<p>user function is executed regardless of the results. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga5ee4314c2a52ee0af61985e7163a1be9"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__notifier.html#ga5ee4314c2a52ee0af61985e7163a1be9">notifier_notification_type_t</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Used to notify registered callbacks </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga5ee4314c2a52ee0af61985e7163a1be9a49e6ad28b9d351a051035c8065de5d94"></a>kNOTIFIER_NotifyRecover</em> </td><td class="fielddoc">
|
|
<p>Notify IP to recover to previous work state. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="gga5ee4314c2a52ee0af61985e7163a1be9a91707ed2be51db6da2a9d6cc6eaee39c"></a>kNOTIFIER_NotifyBefore</em> </td><td class="fielddoc">
|
|
<p>Notify IP that configuration setting is going to change. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="gga5ee4314c2a52ee0af61985e7163a1be9a6e89a377b2890077646fc6af6b5c2e00"></a>kNOTIFIER_NotifyAfter</em> </td><td class="fielddoc">
|
|
<p>Notify IP that configuration setting has been changed. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaad75237e3cea51f8315cf6577b35db91"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__notifier.html#gaad75237e3cea51f8315cf6577b35db91">notifier_callback_type_t</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Used in the callback configuration structure (<a class="el" href="group__notifier.html#structnotifier__callback__config__t" title="callback configuration structure ">notifier_callback_config_t</a>) to specify when the registered callback is called during configuration switch initiated by <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a>. Callback can be invoked in following situations:</p>
|
|
<ul>
|
|
<li>before the configuration switch (Callback return value can affect <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> execution. Refer to the <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> and notifier_policy_t documentation).</li>
|
|
<li>after unsuccessful attempt to switch configuration</li>
|
|
<li>after sucecessful configuration switch </li>
|
|
</ul>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ggaad75237e3cea51f8315cf6577b35db91ab9c117f1eccd38f914d0e4d05015d6a1"></a>kNOTIFIER_CallbackBefore</em> </td><td class="fielddoc">
|
|
<p>Callback handles BEFORE notification. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="ggaad75237e3cea51f8315cf6577b35db91a8d5832eddd0d8cf976413aea02f3bfdc"></a>kNOTIFIER_CallbackAfter</em> </td><td class="fielddoc">
|
|
<p>Callback handles AFTER notification. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><em><a class="anchor" id="ggaad75237e3cea51f8315cf6577b35db91ada6451efe227571a1442e70ddf36e005"></a>kNOTIFIER_CallbackBeforeAfter</em> </td><td class="fielddoc">
|
|
<p>Callback handles BEFORE and AFTER notification. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a class="anchor" id="gaa2dfe33b4724d9c1025acdde1b1b3c31"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">status_t NOTIFIER_CreateHandle </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> * </td>
|
|
<td class="paramname"><em>notifierHandle</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#gad0b6e919f3ff69992b36a2734a650ec7">notifier_user_config_t</a> ** </td>
|
|
<td class="paramname"><em>configs</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>configsNumber</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#structnotifier__callback__config__t">notifier_callback_config_t</a> * </td>
|
|
<td class="paramname"><em>callbacks</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>callbacksNumber</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#gacb6a6d6f99e6ddfbb96dae53382949b2">notifier_user_function_t</a> </td>
|
|
<td class="paramname"><em>userFunction</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"><em>userData</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">notifierHandle</td><td>A pointer to notifier handle </td></tr>
|
|
<tr><td class="paramname">configs</td><td>A pointer to an array with references to all configurations which is handled by the Notifier. </td></tr>
|
|
<tr><td class="paramname">configsNumber</td><td>Number of configurations. Size of configs array. </td></tr>
|
|
<tr><td class="paramname">callbacks</td><td>A pointer to an array of callback configurations. If there are no callbacks to register during Notifier initialization, use NULL value. </td></tr>
|
|
<tr><td class="paramname">callbacksNumber</td><td>Number of registered callbacks. Size of callbacks array. </td></tr>
|
|
<tr><td class="paramname">userFunction</td><td>user function. </td></tr>
|
|
<tr><td class="paramname">userData</td><td>user data passed to user function. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An error code or kStatus_Success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga9ca08c8f6fa9a7bafa9ecbe08603cd97"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">status_t NOTIFIER_SwitchConfig </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> * </td>
|
|
<td class="paramname"><em>notifierHandle</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>configIndex</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#ga62e961564dc31b8155d128a3f6566409">notifier_policy_t</a> </td>
|
|
<td class="paramname"><em>policy</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>This function sets the system to the target configuration. Before transition, the Notifier sends notifications to all callbacks registered to the callback table. Callbacks are invoked in the following order: All registered callbacks are notified ordered by index in the callbacks array. The same order is used for before and after switch notifications. The notifications before the configuration switch can be used to obtain confirmation about the change from registered callbacks. If any registered callback denies the configuration change, further execution of this function depends on the notifier policy: the configuration change is either forced (kNOTIFIER_PolicyForcible) or exited (kNOTIFIER_PolicyAgreement). When configuration change is forced, the result of the before switch notifications are ignored. If agreement is required, if any callback returns an error code then further notifications before switch notifications are cancelled and all already notified callbacks are re-invoked The index of the callback which returned error code during pre-switch notifications is stored (any error codes during callbacks re-invocation are ignored) and NOTIFIER_GetErrorCallback() can be used to get it. Regardless of the policies, if any callback returned an error code, an error code denoting in which phase the error occurred is returned when <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> exits. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">notifierHandle</td><td>pointer to notifier handle </td></tr>
|
|
<tr><td class="paramname">configIndex</td><td>Index of the target configuration. </td></tr>
|
|
<tr><td class="paramname">policy</td><td>Transaction policy, kNOTIFIER_PolicyAgreement or kNOTIFIER_PolicyForcible.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An error code or kStatus_Success. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga9736632c3beca486ec3f8dab504b839c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint8_t NOTIFIER_GetErrorCallbackIndex </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__notifier.html#structnotifier__handle__t">notifier_handle_t</a> * </td>
|
|
<td class="paramname"><em>notifierHandle</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>This function returns index of the last callback that failed during the configuration switch while the last <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> was called. If the last <a class="el" href="group__notifier.html#ga9ca08c8f6fa9a7bafa9ecbe08603cd97" title="Switch configuration according to a pre-defined structure. ">NOTIFIER_SwitchConfig()</a> call ended successfully value equal to callbacks number is returned. Returned value represents index in the array of static call-backs.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">notifierHandle</td><td>pointer to notifier handle </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Callback index of last failed callback or value equal to callbacks count. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.5-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul class="foot">
|
|
<li class="footer">© 2016 NXP Semiconductors. All rights reserved.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|