blob: 797138c93116512510dee44830bf3b1023cb1320 [file] [log] [blame]
<!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>CAN Interface</title>
<title>CMSIS-Driver: CAN Interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.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>
</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: 46px;">
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-Driver
&#160;<span id="projectnumber">Version 2.7.1</span>
</div>
<div id="projectbrief">Peripheral Interface for Middleware and Application Code</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<script type="text/javascript">
<!--
writeComponentTabs.call(this);
//-->
</script>
</ul>
</div>
<!-- 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&#160;Page</span></a></li>
<li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
<li><a href="modules.html"><span>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__can__interface__gr.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">&#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>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</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="#groups">Content</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">CAN Interface</div> </div>
</div><!--header-->
<div class="contents">
<p>Driver API for CAN Bus Peripheral (Driver_CAN.h)
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Content</h2></td></tr>
<tr class="memitem:group__can__status__code__ctrls"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__status__code__ctrls.html">Status Error Codes</a></td></tr>
<tr class="memdesc:group__can__status__code__ctrls"><td class="mdescLeft">&#160;</td><td class="mdescRight">Status codes of the CAN driver. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__CAN__unit__events"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CAN__unit__events.html">CAN Unit Events</a></td></tr>
<tr class="memdesc:group__CAN__unit__events"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback unit events notified via <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a>. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__CAN__events"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CAN__events.html">CAN Object Events</a></td></tr>
<tr class="memdesc:group__CAN__events"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback objects events notified via <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a>. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__can__control"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__control.html">CAN Control Codes</a></td></tr>
<tr class="memdesc:group__can__control"><td class="mdescLeft">&#160;</td><td class="mdescRight">Codes to configure the CAN driver. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><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:structARM__DRIVER__CAN"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a></td></tr>
<tr class="memdesc:structARM__DRIVER__CAN"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access structure of the CAN Driver. <a href="group__can__interface__gr.html#structARM__DRIVER__CAN">More...</a><br/></td></tr>
<tr class="separator:structARM__DRIVER__CAN"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__CAN__CAPABILITIES"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a></td></tr>
<tr class="memdesc:structARM__CAN__CAPABILITIES"><td class="mdescLeft">&#160;</td><td class="mdescRight">CAN Device Driver Capabilities. <a href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">More...</a><br/></td></tr>
<tr class="separator:structARM__CAN__CAPABILITIES"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__CAN__STATUS"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#structARM__CAN__STATUS">ARM_CAN_STATUS</a></td></tr>
<tr class="memdesc:structARM__CAN__STATUS"><td class="mdescLeft">&#160;</td><td class="mdescRight">CAN Status. <a href="group__can__interface__gr.html#structARM__CAN__STATUS">More...</a><br/></td></tr>
<tr class="separator:structARM__CAN__STATUS"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__CAN__MSG__INFO"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a></td></tr>
<tr class="memdesc:structARM__CAN__MSG__INFO"><td class="mdescLeft">&#160;</td><td class="mdescRight">CAN Message Information. <a href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">More...</a><br/></td></tr>
<tr class="separator:structARM__CAN__MSG__INFO"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__CAN__OBJ__CAPABILITIES"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a></td></tr>
<tr class="memdesc:structARM__CAN__OBJ__CAPABILITIES"><td class="mdescLeft">&#160;</td><td class="mdescRight">CAN Object Capabilities. <a href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">More...</a><br/></td></tr>
<tr class="separator:structARM__CAN__OBJ__CAPABILITIES"><td class="memSeparator" colspan="2">&#160;</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:gaac07b9fdf614bf439414f5417aaa376e"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#gaac07b9fdf614bf439414f5417aaa376e">ARM_CAN_SignalUnitEvent_t</a> )(uint32_t event)</td></tr>
<tr class="memdesc:gaac07b9fdf614bf439414f5417aaa376e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> : Signal CAN Unit Event. <a href="#gaac07b9fdf614bf439414f5417aaa376e">More...</a><br/></td></tr>
<tr class="separator:gaac07b9fdf614bf439414f5417aaa376e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ceceac3e9aa0981c5cacfab88efb4eb"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga7ceceac3e9aa0981c5cacfab88efb4eb">ARM_CAN_SignalObjectEvent_t</a> )(uint32_t obj_idx, uint32_t event)</td></tr>
<tr class="memdesc:ga7ceceac3e9aa0981c5cacfab88efb4eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> : Signal CAN Object Event. <a href="#ga7ceceac3e9aa0981c5cacfab88efb4eb">More...</a><br/></td></tr>
<tr class="separator:ga7ceceac3e9aa0981c5cacfab88efb4eb"><td class="memSeparator" colspan="2">&#160;</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:ga4256d5b23ffcb27759a05f8e6b854f13"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga4256d5b23ffcb27759a05f8e6b854f13">ARM_CAN_GetVersion</a> (void)</td></tr>
<tr class="memdesc:ga4256d5b23ffcb27759a05f8e6b854f13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get driver version. <a href="#ga4256d5b23ffcb27759a05f8e6b854f13">More...</a><br/></td></tr>
<tr class="separator:ga4256d5b23ffcb27759a05f8e6b854f13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35f21cabe1637b1be964024a8f77721c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a> (void)</td></tr>
<tr class="memdesc:ga35f21cabe1637b1be964024a8f77721c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get driver capabilities. <a href="#ga35f21cabe1637b1be964024a8f77721c">More...</a><br/></td></tr>
<tr class="separator:ga35f21cabe1637b1be964024a8f77721c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa72ceb25ba67e279d7432404632deb44"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a> (<a class="el" href="group__can__interface__gr.html#gaac07b9fdf614bf439414f5417aaa376e">ARM_CAN_SignalUnitEvent_t</a> cb_unit_event, <a class="el" href="group__can__interface__gr.html#ga7ceceac3e9aa0981c5cacfab88efb4eb">ARM_CAN_SignalObjectEvent_t</a> cb_object_event)</td></tr>
<tr class="memdesc:gaa72ceb25ba67e279d7432404632deb44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize CAN interface and register signal (callback) functions. <a href="#gaa72ceb25ba67e279d7432404632deb44">More...</a><br/></td></tr>
<tr class="separator:gaa72ceb25ba67e279d7432404632deb44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e3e364b64f2ab277399e3279cce5ef8"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga1e3e364b64f2ab277399e3279cce5ef8">ARM_CAN_Uninitialize</a> (void)</td></tr>
<tr class="memdesc:ga1e3e364b64f2ab277399e3279cce5ef8"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initialize CAN interface. <a href="#ga1e3e364b64f2ab277399e3279cce5ef8">More...</a><br/></td></tr>
<tr class="separator:ga1e3e364b64f2ab277399e3279cce5ef8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f634f126ac97daef2f3115aa7bfed7c"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga6f634f126ac97daef2f3115aa7bfed7c">ARM_CAN_PowerControl</a> (<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td></tr>
<tr class="memdesc:ga6f634f126ac97daef2f3115aa7bfed7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Control CAN interface power. <a href="#ga6f634f126ac97daef2f3115aa7bfed7c">More...</a><br/></td></tr>
<tr class="separator:ga6f634f126ac97daef2f3115aa7bfed7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1fe6cc207415de604975ae251e269361"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga1fe6cc207415de604975ae251e269361">ARM_CAN_GetClock</a> (void)</td></tr>
<tr class="memdesc:ga1fe6cc207415de604975ae251e269361"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve CAN base clock frequency. <a href="#ga1fe6cc207415de604975ae251e269361">More...</a><br/></td></tr>
<tr class="separator:ga1fe6cc207415de604975ae251e269361"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga88bb27a8525503a250cca7a2c4a5d07a"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga88bb27a8525503a250cca7a2c4a5d07a">ARM_CAN_SetBitrate</a> (<a class="el" href="group__can__timeseg__ctrls.html#ga11c12020b81a63a73a8b53e96a7e3dea">ARM_CAN_BITRATE_SELECT</a> select, uint32_t bitrate, uint32_t bit_segments)</td></tr>
<tr class="memdesc:ga88bb27a8525503a250cca7a2c4a5d07a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set bitrate for CAN interface. <a href="#ga88bb27a8525503a250cca7a2c4a5d07a">More...</a><br/></td></tr>
<tr class="separator:ga88bb27a8525503a250cca7a2c4a5d07a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga28226a6e223f9b95b4dafb7c2f48a855"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a> (<a class="el" href="group__can__bus__mode__ctrls.html#gabbca99c46d478bcf822eee71cdf75dcd">ARM_CAN_MODE</a> mode)</td></tr>
<tr class="memdesc:ga28226a6e223f9b95b4dafb7c2f48a855"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set operating mode for CAN interface. <a href="#ga28226a6e223f9b95b4dafb7c2f48a855">More...</a><br/></td></tr>
<tr class="separator:ga28226a6e223f9b95b4dafb7c2f48a855"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45ab314f5121cf5a1b32d9adc600e0f7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> (uint32_t obj_idx)</td></tr>
<tr class="memdesc:ga45ab314f5121cf5a1b32d9adc600e0f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve capabilities of an object. <a href="#ga45ab314f5121cf5a1b32d9adc600e0f7">More...</a><br/></td></tr>
<tr class="separator:ga45ab314f5121cf5a1b32d9adc600e0f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f9bc7088704483388e14872c9d5385d"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> (uint32_t obj_idx, <a class="el" href="group__can__filter__operation__ctrls.html#gacb04d0f8b3969ee69362ff2b62941d75">ARM_CAN_FILTER_OPERATION</a> operation, uint32_t id, uint32_t arg)</td></tr>
<tr class="memdesc:ga4f9bc7088704483388e14872c9d5385d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add or remove filter for message reception. <a href="#ga4f9bc7088704483388e14872c9d5385d">More...</a><br/></td></tr>
<tr class="separator:ga4f9bc7088704483388e14872c9d5385d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00ec0715f6755a49dae5b60dca182630"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> (uint32_t obj_idx, <a class="el" href="group__can__obj__config__ctrls.html#gaa9488554de0575bc821c9f65213c4cd0">ARM_CAN_OBJ_CONFIG</a> obj_cfg)</td></tr>
<tr class="memdesc:ga00ec0715f6755a49dae5b60dca182630"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure object. <a href="#ga00ec0715f6755a49dae5b60dca182630">More...</a><br/></td></tr>
<tr class="separator:ga00ec0715f6755a49dae5b60dca182630"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0dcffd362b4093043442a030eaebbcfe"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> (uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, const uint8_t *data, uint8_t size)</td></tr>
<tr class="memdesc:ga0dcffd362b4093043442a030eaebbcfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send message on CAN bus. <a href="#ga0dcffd362b4093043442a030eaebbcfe">More...</a><br/></td></tr>
<tr class="separator:ga0dcffd362b4093043442a030eaebbcfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafc37084df5eab32f593c2744d35cf647"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a> (uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, uint8_t *data, uint8_t size)</td></tr>
<tr class="memdesc:gafc37084df5eab32f593c2744d35cf647"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read message received on CAN bus. <a href="#gafc37084df5eab32f593c2744d35cf647">More...</a><br/></td></tr>
<tr class="separator:gafc37084df5eab32f593c2744d35cf647"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8d9f0c5f03a8a81ab062b5aa57e5dea4"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a> (uint32_t control, uint32_t arg)</td></tr>
<tr class="memdesc:ga8d9f0c5f03a8a81ab062b5aa57e5dea4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Control CAN interface. <a href="#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">More...</a><br/></td></tr>
<tr class="separator:ga8d9f0c5f03a8a81ab062b5aa57e5dea4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga676d6b567fc4ab3d44f5d7a50ec9419c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__STATUS">ARM_CAN_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga676d6b567fc4ab3d44f5d7a50ec9419c">ARM_CAN_GetStatus</a> (void)</td></tr>
<tr class="memdesc:ga676d6b567fc4ab3d44f5d7a50ec9419c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get CAN status. <a href="#ga676d6b567fc4ab3d44f5d7a50ec9419c">More...</a><br/></td></tr>
<tr class="separator:ga676d6b567fc4ab3d44f5d7a50ec9419c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga38795d1ed135ce3bd87f31ef1596bccf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> (uint32_t event)</td></tr>
<tr class="memdesc:ga38795d1ed135ce3bd87f31ef1596bccf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal CAN unit event. <a href="#ga38795d1ed135ce3bd87f31ef1596bccf">More...</a><br/></td></tr>
<tr class="separator:ga38795d1ed135ce3bd87f31ef1596bccf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabfcaeac9e2ca25936ba5a29f2d594e7e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> (uint32_t obj_idx, uint32_t event)</td></tr>
<tr class="memdesc:gabfcaeac9e2ca25936ba5a29f2d594e7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal CAN object event. <a href="#gabfcaeac9e2ca25936ba5a29f2d594e7e">More...</a><br/></td></tr>
<tr class="separator:gabfcaeac9e2ca25936ba5a29f2d594e7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<p>Driver API for CAN Bus Peripheral (Driver_CAN.h) </p>
<p>The <b>Controller Area Network</b> Interface Bus (CAN) implements a multi-master serial bus for connecting microcontrollers and devices, also known as nodes, to communicate with each other in applications without a host computer. CAN is a message-based protocol, designed originally for automotive applications, but meanwhile used also in many other surroundings. The complexity of the node can range from a simple I/O device up to an embedded computer with a CAN interface and sophisticated software. The node may also be a gateway allowing a standard computer to communicate over a USB or Ethernet port to the devices on a CAN network. Devices are connected to the bus through a host processor, a CAN controller, and a CAN transceiver.</p>
<p>The CAN Driver API allows to implement CAN Interfaces that conform to the <a href="http://www.bosch-semiconductors.com/" target="_blank">CAN specifications available from BOSCH</a>:</p>
<ul>
<li>CAN 2.0B: CAN Specification 2.0B (released Sep. 1991) which is now superseded by ISO 11898-1.</li>
<li>CAN FD: CAN with Flexible Data Rate introduced in 2012 (released April 17th, 2012).</li>
</ul>
<p>Wikipedia offers more information about the <a href="http://en.wikipedia.org/wiki/CAN_bus" target="_blank"><b>CAN Bus</b></a>.</p>
<p>CAN 2.0B** Every CAN CMSIS-Driver supports the CAN 2.0B standard</p>
<p>CAN 2.0B supports:</p>
<ul>
<li>message can contain up to 8 data bytes</li>
<li>bitrates of up to 1Mbits/s</li>
<li><a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> requests</li>
</ul>
<p><a class="anchor" id="CAN_FD"></a><b>CAN FD</b></p>
<p>Support for CAN FD depends on the hardware. A CMSIS-Driver that supports CAN FD has the capability <a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> data field <b>fd_mode</b> = <span class="XML-Token">1</span>, which can be retrieved with the function <a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a>.</p>
<p>CAN FD supports:</p>
<ul>
<li>message can contain up to 64 data bytes</li>
<li>faster data transfers with faster bitrate used during the data phase</li>
</ul>
<p>CAN FD does not support <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> requests.</p>
<p><b>Block Diagram</b></p>
<p>The CAN Driver API defines a <b>CAN</b> interface for middleware components. The CAN Driver supports multiple nodes, which are able to send and receive messages, but not simultaneously.</p>
<div class="image">
<img src="CAN_Node.png" alt="CAN_Node.png"/>
<div class="caption">
CAN Node Schematic</div></div>
<h2>CAN API </h2>
<p>The following header files define the Application Programming Interface (API) for the CAN interface:</p>
<ul>
<li><b>Driver_CAN.h</b> : Driver API for CAN Bus Peripheral</li>
</ul>
<p>The driver implementation is a typical part of the Device Family Pack (DFP) that supports the peripherals of the microcontroller family.</p>
<p><b>Driver Functions</b></p>
<p>The driver functions are published in the access struct as explained in <a class="el" href="theoryOperation.html#DriverFunctions">Common Driver Functions</a></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> : access struct for CAN driver functions</li>
</ul>
<p><b>Example Code</b></p>
<p>The following example code shows the usage of the CAN interface.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &quot;cmsis_os.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Driver__CAN_8h.html">Driver_CAN.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// CAN Driver Controller selector</span></div>
<div class="line"><span class="preprocessor">#define CAN_CONTROLLER 1 // CAN Controller number</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#define _CAN_Driver_(n) Driver_CAN##n</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define CAN_Driver_(n) _CAN_Driver_(n)</span></div>
<div class="line"><span class="preprocessor"></span><span class="keyword">extern</span> <a class="code" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> CAN_Driver_(CAN_CONTROLLER);</div>
<div class="line"><span class="preprocessor">#define ptrCAN (&amp;CAN_Driver_(CAN_CONTROLLER))</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line">uint32_t rx_obj_idx = 0xFFFFFFFFU;</div>
<div class="line">uint8_t rx_data[8];</div>
<div class="line"><a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> rx_msg_info;</div>
<div class="line">uint32_t tx_obj_idx = 0xFFFFFFFFU;</div>
<div class="line">uint8_t tx_data[8];</div>
<div class="line"><a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> tx_msg_info;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> Error_Handler (<span class="keywordtype">void</span>) { <span class="keywordflow">while</span> (1); }</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> CAN_SignalUnitEvent (uint32_t event) {}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> CAN_SignalObjectEvent (uint32_t obj_idx, uint32_t event) {</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (obj_idx == rx_obj_idx) { <span class="comment">// If receive object event</span></div>
<div class="line"> <span class="keywordflow">if</span> (event == <a class="code" href="group__CAN__events.html#ga2c1082561eeae3b2b8132e81fc241e47">ARM_CAN_EVENT_RECEIVE</a>) { <span class="comment">// If message was received successfully</span></div>
<div class="line"> <span class="keywordflow">if</span> (ptrCAN-&gt;MessageRead(rx_obj_idx, &amp;rx_msg_info, rx_data, 8U) &gt; 0U) {</div>
<div class="line"> <span class="comment">// Read received message</span></div>
<div class="line"> <span class="comment">// process received message ...</span></div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (obj_idx == tx_obj_idx) { <span class="comment">// If transmit object event</span></div>
<div class="line"> <span class="keywordflow">if</span> (event == <a class="code" href="group__CAN__events.html#ga486f0f35ebc7e3b5931ee68b56703503">ARM_CAN_EVENT_SEND_COMPLETE</a>) { <span class="comment">// If message was sent successfully</span></div>
<div class="line"> <span class="comment">// acknowledge sent message ...</span></div>
<div class="line"> }</div>
<div class="line"> }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) {</div>
<div class="line"> <a class="code" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> can_cap;</div>
<div class="line"> <a class="code" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> can_obj_cap;</div>
<div class="line"> int32_t status;</div>
<div class="line"> uint32_t i, num_objects;</div>
<div class="line"> </div>
<div class="line"> can_cap = ptrCAN-&gt;GetCapabilities (); <span class="comment">// Get CAN driver capabilities</span></div>
<div class="line"> num_objects = can_cap.<a class="code" href="group__can__interface__gr.html#a69bd1a164443cf6f501489f4d31f4681">num_objects</a>; <span class="comment">// Number of receive/transmit objects</span></div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;Initialize (CAN_SignalUnitEvent, CAN_SignalObjectEvent); <span class="comment">// Initialize CAN driver</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;PowerControl (<a class="code" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>); <span class="comment">// Power-up CAN controller</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;SetMode (<a class="code" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda9967a5ebaa045afe54d75e5629676ddc">ARM_CAN_MODE_INITIALIZATION</a>); <span class="comment">// Activate initialization mode</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;SetBitrate (<a class="code" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a>, <span class="comment">// Set nominal bitrate</span></div>
<div class="line"> 100000U, <span class="comment">// Set bitrate to 100 kbit/s</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga01183319a5a899eafea9ffe7af73d5ea">ARM_CAN_BIT_PROP_SEG</a>(5U) | <span class="comment">// Set propagation segment to 5 time quanta</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga03f1921ee97a7ebf5d767b6cacf40792">ARM_CAN_BIT_PHASE_SEG1</a>(1U) | <span class="comment">// Set phase segment 1 to 1 time quantum (sample point at 87.5% of bit time)</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga76de056d56803cb7a0d01978ee981e80">ARM_CAN_BIT_PHASE_SEG2</a>(1U) | <span class="comment">// Set phase segment 2 to 1 time quantum (total bit is 8 time quanta long)</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#gab32e97fa4edf497c111dd3f0d8779269">ARM_CAN_BIT_SJW</a>(1U)); <span class="comment">// Resynchronization jump width is same as phase segment 2</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">for</span> (i = 0U; i &lt; num_objects; i++) { <span class="comment">// Find first available object for receive and transmit</span></div>
<div class="line"> can_obj_cap = ptrCAN-&gt;ObjectGetCapabilities (i); <span class="comment">// Get object capabilities</span></div>
<div class="line"> <span class="keywordflow">if</span> ((rx_obj_idx == 0xFFFFFFFFU) &amp;&amp; (can_obj_cap.<a class="code" href="group__can__interface__gr.html#a895532773c3204e1538191f155c7bac8">rx</a> == 1U)) { rx_obj_idx = i; }</div>
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((tx_obj_idx == 0xFFFFFFFFU) &amp;&amp; (can_obj_cap.<a class="code" href="group__can__interface__gr.html#a9706173b2ed538efeb5ee4a952e2272f">tx</a> == 1U)) { tx_obj_idx = i; <span class="keywordflow">break</span>; }</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> ((rx_obj_idx == 0xFFFFFFFFU) || (tx_obj_idx == 0xFFFFFFFFU)) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Set filter to receive messages with extended ID 0x12345678 to receive object</span></div>
<div class="line"> status = ptrCAN-&gt;ObjectSetFilter(rx_obj_idx, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U), 0U);</div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;ObjectConfigure(tx_obj_idx, <a class="code" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a3e20952f92855298cd0a39a7f47b3f3c">ARM_CAN_OBJ_TX</a>); <span class="comment">// Configure transmit object</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;ObjectConfigure(rx_obj_idx, <a class="code" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a14780ac7274831ee94f427cbbf67c003">ARM_CAN_OBJ_RX</a>); <span class="comment">// Configure receive object</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> status = ptrCAN-&gt;SetMode (<a class="code" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcdaa3190344bdf3452462e5c0518ac3cdc4">ARM_CAN_MODE_NORMAL</a>); <span class="comment">// Activate normal operation mode</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"> </div>
<div class="line"> memset(&amp;tx_msg_info, 0U, <span class="keyword">sizeof</span>(<a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a>)); <span class="comment">// Clear message info structure</span></div>
<div class="line"> tx_msg_info.<a class="code" href="group__can__interface__gr.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U); <span class="comment">// Set extended ID for transmit message</span></div>
<div class="line"> tx_data[0] = 0xFFU; <span class="comment">// Initialize transmit data</span></div>
<div class="line"> <span class="keywordflow">while</span> (1) {</div>
<div class="line"> tx_data[0]++; <span class="comment">// Increment transmit data</span></div>
<div class="line"> status = ptrCAN-&gt;MessageSend(tx_obj_idx, &amp;tx_msg_info, tx_data, 1U); <span class="comment">// Send data message with 1 data byte</span></div>
<div class="line"> <span class="keywordflow">if</span> (status != 1U) { Error_Handler(); }</div>
<div class="line"> <span class="keywordflow">for</span> (i = 0U; i &lt; 1000000U; i++) { __nop(); } <span class="comment">// Wait a little while</span></div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="can_objects"></a>
CAN Message Objects</h1>
<p>The CMSIS-Driver for the CAN interface provides multiple CAN message objects, which can be seen as individual communication channels. The number of available CAN message objects depends on the CAN peripheral. The function <a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a> returns the maximum number of available CAN message objects. The number is encoded in the structure <a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> in the data field <em>num_objects</em>. CAN message objects are addressed with the functions listed below, whereby the parameter <em>obj_idx</em> addresses an individual object. The valid range for <em>obj_idx</em> is <span class="XML-Token">[0 .. (<em>num_objects</em> - 1)]</span>.</p>
<table class="doxtable">
<tr>
<th align="left">Function </th><th align="left">Description </th></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> </td><td align="left">Retrieves message object capabilities such as receive, transmit, <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> automatic handling and <a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a>. </td></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> </td><td align="left">Allows to set-up CAN ID filtering for the message object. </td></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> </td><td align="left">Allows to configure the message object for receive, transmit or <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> automatic handling. </td></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a> </td><td align="left">Read received message from the message object. </td></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> </td><td align="left">Send CAN message or send <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> or set CAN message to be sent automatically on reception of matching <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> on the message object. </td></tr>
<tr>
<td align="left"><a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> </td><td align="left">Callback function that signals a message transfer or a received message overrun. </td></tr>
</table>
<p>Each CAN message object may have different capabilities. Before using a CAN message object, call the function <a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> to verify the available features.</p>
<h1><a class="anchor" id="can_filtering"></a>
CAN Message Filtering</h1>
<p>The CMSIS-Driver for the CAN interface supports ID filtering for the receiving message objects. The receiving CAN node examines the identifier to decide if it was relevant. This filtering is done by the CAN peripheral according the settings configured with the function <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a>.</p>
<p>The function <a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> retrieves the filter capabilities of the CAN message objects stored in <a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a>.</p>
<table class="doxtable">
<tr>
<th align="left">Data Fields </th><th align="left">CAN Messages Object can be filtered with ... </th></tr>
<tr>
<td align="left"><em>exact_filtering</em> </td><td align="left">an exact ID value set by using the function <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> with <em>control</em> = <a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>. </td></tr>
<tr>
<td align="left"><em>range_filtering</em> </td><td align="left">a range ID value set by using the function <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> with <em>control</em> = <a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a22123bef8e773844fce604c553bf2ed5">ARM_CAN_FILTER_ID_RANGE_ADD</a>. </td></tr>
<tr>
<td align="left"><em>mask_filtering</em> </td><td align="left">a mask ID value set by as using the function <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> with <em>control</em> = <a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a>. </td></tr>
<tr>
<td align="left"><em>multiple_filters</em> </td><td align="left">... several filters to capture multiple ID values, or ID value ranges. </td></tr>
</table>
<p><b>CAN message filtering using an exact ID</b></p>
<p>Example: accept in message object #1 only frames with extended ID = 0x1567. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (1, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x1567), 0);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><p>Example: accept in message object #2 frames with extended ID = 0x3167 and extended ID = 0x42123. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (2, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x3167), 0);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
<div class="line">status = ptrCAN-&gt;ObjectSetFilter (2, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x42123), 0);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><p><b>CAN message filtering using a range ID</b></p>
<p>Example: accept in message object #3 only frames with extended ID &gt;= 0x1567 and extended ID &lt;= 0x1577. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (3, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a22123bef8e773844fce604c553bf2ed5">ARM_CAN_FILTER_ID_RANGE_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x1567), <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x1577));</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><p><b>CAN message filtering using a mask ID</b></p>
<p>Using the function <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> with <em>control</em> = <a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a> allows to specify with <em>arg</em> a mask value.</p>
<ul>
<li>if a mask bit is <span class="XML-Token">0</span>, the corresponding <em>ID</em> bit will be accepted, regardless of the value.</li>
<li>if a mask bit is <span class="XML-Token">1</span>, the corresponding <em>ID</em> bit will be compared with the value of the ID filter bit; if they match the message will be accepted otherwise the frame is rejected.</li>
</ul>
<p>Example: accept in message object #0 only frames with extended IDs 0x1560 to 0x156F. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (0, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x1560), 0x1FFFFFF0);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><p>Example: accept in message object #2 only frames with extended IDs 0x35603, 0x35613, 0x35623, and 0x35633. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (2, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x35603), 0x1FFFFFCF);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><p>Example: accept any message in object #4 regardless of the ID. </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter (4, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0), 0);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
</div><!-- fragment --><h1><a class="anchor" id="Remote_Frame"></a>
Remote Frame</h1>
<p>In general, data transmission is performed on an autonomous basis with the data source node sending out Data Frames.</p>
<p>However, sending a <b>Remote Frame</b> allows a destination node to request the data from the source node. The examples below shows the data exchange using a <b>Remote Transmission Request (RTR)</b>.</p>
<p><b>Example for automatic Data Message response on RTR</b></p>
<p>For automatic data message response on an RTR, the object is configured with the function <a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> <em>obj_cfg</em> = <a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0ac5d28d180ea9e4328974ffcb8b928a0c">ARM_CAN_OBJ_RX_RTR_TX_DATA</a>.</p>
<p>In this case, the function <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> sets a data message that is transmitted when an RTR with a matching CAN ID is received. If <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> was not called before the RTR is received, the response is hardware dependent (either last data message is repeated or no data message is sent until <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> is called).</p>
<p>After data transmission is completed, the driver calls a callback function <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> with <em>event</em> = <a class="el" href="group__CAN__events.html#ga486f0f35ebc7e3b5931ee68b56703503">ARM_CAN_EVENT_SEND_COMPLETE</a> and the related <em>obj_idx</em>.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter(0, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U), 0U);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
<div class="line">status = trCAN-&gt;ObjectConfigure(0, <a class="code" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0ac5d28d180ea9e4328974ffcb8b928a0c">ARM_CAN_OBJ_RX_RTR_TX_DATA</a>);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
<div class="line"></div>
<div class="line">memset(&amp;tx_msg_info, 0, <span class="keyword">sizeof</span>(<a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a>)); <span class="comment">// Clear transmit message structure</span></div>
<div class="line">tx_msg_info.<a class="code" href="group__can__interface__gr.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U); <span class="comment">// Set ID of message</span></div>
<div class="line">data_buf[0] = <span class="charliteral">&#39;1&#39;</span>; data_buf[1] = <span class="charliteral">&#39;2&#39;</span>; <span class="comment">// Prepare data to transmit</span></div>
<div class="line">data_buf[2] = <span class="charliteral">&#39;3&#39;</span>; data_buf[3] = <span class="charliteral">&#39;4&#39;</span>;</div>
<div class="line">data_buf[4] = <span class="charliteral">&#39;5&#39;</span>; data_buf[5] = <span class="charliteral">&#39;6&#39;</span>;</div>
<div class="line">data_buf[6] = <span class="charliteral">&#39;7&#39;</span>; data_buf[7] = <span class="charliteral">&#39;8&#39;</span>;</div>
<div class="line">ptrCAN-&gt;MessageSend(0, &amp;tx_msg_info, data_buf, 8); <span class="comment">// Start send message that will be triggered on RTR reception</span></div>
</div><!-- fragment --><p><b>Example for automatic Data Message reception using RTR</b></p>
<p>For automatic data message reception on an RTR, the object is configured with the function <a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> <em>obj_cfg</em> = <a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a396d7a6cd2353e1a2936405ace6417f5">ARM_CAN_OBJ_TX_RTR_RX_DATA</a>.</p>
<p>The receiver or consumer requests data with transmission of an RTR with the <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a>. This RTR requests from the transmitter or producer to send the data message. Once the data message is received, the driver calls a callback function <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> with <em>event</em> = <a class="el" href="group__CAN__events.html#ga2c1082561eeae3b2b8132e81fc241e47">ARM_CAN_EVENT_RECEIVE</a> and the related <em>obj_idx</em>. The received data message can then be read with the function <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a>.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectSetFilter(0, <a class="code" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a>, <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U), 0U);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
<div class="line">status = ptrCAN-&gt;ObjectConfigure(0, <a class="code" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a396d7a6cd2353e1a2936405ace6417f5">ARM_CAN_OBJ_TX_RTR_RX_DATA</a>);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) ... <span class="comment">// error handling</span></div>
<div class="line">memset(&amp;tx_msg_info, 0, <span class="keyword">sizeof</span>(<a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a>)); <span class="comment">// Clear transmit message structure</span></div>
<div class="line">tx_msg_info.<a class="code" href="group__can__interface__gr.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U); <span class="comment">// Set ID of message</span></div>
<div class="line">tx_msg_info.<a class="code" href="group__can__interface__gr.html#a1f32fc9e5d3b33babf5905140e7a53af">rtr</a> = 1; <span class="comment">// Set RTR flag of message to send RTR</span></div>
<div class="line">tx_msg_info.<a class="code" href="group__can__interface__gr.html#a811fbb0cb2c2263b1a7440a7e9d78239">dlc</a> = 1; <span class="comment">// Set data length code of message to 1 to request 1 data byte</span></div>
<div class="line">ptrCAN-&gt;MesageSend(0, &amp;tx_msg_info, 0, 0); <span class="comment">// Send RTR</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Wait for ARM_CAN_EVENT_RECEIVE</span></div>
<div class="line">ptrCAN-&gt;MessageRead(0, &amp;rx_msg_info, data_buf, 8); <span class="comment">// Read received message</span></div>
</div><!-- fragment --> <hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structARM__DRIVER__CAN" id="structARM__DRIVER__CAN"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ARM_DRIVER_CAN</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>Access structure of the CAN Driver. </p>
<p>The functions of the CAN are accessed by function pointers exposed by this structure. Refer to <a class="el" href="theoryOperation.html#DriverFunctions">Common Driver Functions</a> for overview information.</p>
<p>Each instance of a CAN provides such an access structure. The instance is identified by a postfix number in the symbol name of the access structure, for example:</p>
<ul>
<li><b>Driver_CAN0</b> is the name of the access struct of the first instance (no. 0).</li>
<li><b>Driver_CAN1</b> is the name of the access struct of the second instance (no. 1).</li>
</ul>
<p>A configuration setting in the middleware allows you to connect the middleware to a specific driver instance <b>Driver_CAN<em>n</em></b>. </p>
</div><table class="memberdecls">
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
<tr class="memitem:a8834b281da48583845c044a81566c1b3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a8834b281da48583845c044a81566c1b3">GetVersion</a> )(void)</td></tr>
<tr class="memdesc:a8834b281da48583845c044a81566c1b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga4256d5b23ffcb27759a05f8e6b854f13">ARM_CAN_GetVersion</a> : Get driver version. <a href="#a8834b281da48583845c044a81566c1b3">More...</a><br/></td></tr>
<tr class="separator:a8834b281da48583845c044a81566c1b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62c0c62c2bf482c000b1b2a2c817a96f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a62c0c62c2bf482c000b1b2a2c817a96f">GetCapabilities</a> )(void)</td></tr>
<tr class="memdesc:a62c0c62c2bf482c000b1b2a2c817a96f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a> : Get driver capabilities. <a href="#a62c0c62c2bf482c000b1b2a2c817a96f">More...</a><br/></td></tr>
<tr class="separator:a62c0c62c2bf482c000b1b2a2c817a96f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a322b44b8e757887616b75035a8fd7027"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a322b44b8e757887616b75035a8fd7027">Initialize</a> )(<a class="el" href="group__can__interface__gr.html#gaac07b9fdf614bf439414f5417aaa376e">ARM_CAN_SignalUnitEvent_t</a> cb_unit_event, <a class="el" href="group__can__interface__gr.html#ga7ceceac3e9aa0981c5cacfab88efb4eb">ARM_CAN_SignalObjectEvent_t</a> cb_object_event)</td></tr>
<tr class="memdesc:a322b44b8e757887616b75035a8fd7027"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a> : Initialize CAN interface. <a href="#a322b44b8e757887616b75035a8fd7027">More...</a><br/></td></tr>
<tr class="separator:a322b44b8e757887616b75035a8fd7027"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcf20681a1402869ecb5c6447fada17b"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#adcf20681a1402869ecb5c6447fada17b">Uninitialize</a> )(void)</td></tr>
<tr class="memdesc:adcf20681a1402869ecb5c6447fada17b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga1e3e364b64f2ab277399e3279cce5ef8">ARM_CAN_Uninitialize</a> : De-initialize CAN interface. <a href="#adcf20681a1402869ecb5c6447fada17b">More...</a><br/></td></tr>
<tr class="separator:adcf20681a1402869ecb5c6447fada17b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba8f1c8019af95ffe19c32403e3240ef"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef">PowerControl</a> )(<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td></tr>
<tr class="memdesc:aba8f1c8019af95ffe19c32403e3240ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga6f634f126ac97daef2f3115aa7bfed7c">ARM_CAN_PowerControl</a> : Control CAN interface power. <a href="#aba8f1c8019af95ffe19c32403e3240ef">More...</a><br/></td></tr>
<tr class="separator:aba8f1c8019af95ffe19c32403e3240ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21063f38e762cf29dfd3f5991ee936e2"><td class="memItemLeft" align="right" valign="top">uint32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a21063f38e762cf29dfd3f5991ee936e2">GetClock</a> )(void)</td></tr>
<tr class="memdesc:a21063f38e762cf29dfd3f5991ee936e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga1fe6cc207415de604975ae251e269361">ARM_CAN_GetClock</a> : Retrieve CAN base clock frequency. <a href="#a21063f38e762cf29dfd3f5991ee936e2">More...</a><br/></td></tr>
<tr class="separator:a21063f38e762cf29dfd3f5991ee936e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a360a314665607fc2d866c24e1608fd06"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a360a314665607fc2d866c24e1608fd06">SetBitrate</a> )(<a class="el" href="group__can__timeseg__ctrls.html#ga11c12020b81a63a73a8b53e96a7e3dea">ARM_CAN_BITRATE_SELECT</a> select, uint32_t bitrate, uint32_t bit_segments)</td></tr>
<tr class="memdesc:a360a314665607fc2d866c24e1608fd06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga88bb27a8525503a250cca7a2c4a5d07a">ARM_CAN_SetBitrate</a> : Set bitrate for CAN interface. <a href="#a360a314665607fc2d866c24e1608fd06">More...</a><br/></td></tr>
<tr class="separator:a360a314665607fc2d866c24e1608fd06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fa2edbde052011604addec816782b4e"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a0fa2edbde052011604addec816782b4e">SetMode</a> )(<a class="el" href="group__can__bus__mode__ctrls.html#gabbca99c46d478bcf822eee71cdf75dcd">ARM_CAN_MODE</a> mode)</td></tr>
<tr class="memdesc:a0fa2edbde052011604addec816782b4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a> : Set operating mode for CAN interface. <a href="#a0fa2edbde052011604addec816782b4e">More...</a><br/></td></tr>
<tr class="separator:a0fa2edbde052011604addec816782b4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7239c03265659edcaf69dc9ea5e29ce3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a7239c03265659edcaf69dc9ea5e29ce3">ObjectGetCapabilities</a> )(uint32_t obj_idx)</td></tr>
<tr class="memdesc:a7239c03265659edcaf69dc9ea5e29ce3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> : Retrieve capabilities of an object. <a href="#a7239c03265659edcaf69dc9ea5e29ce3">More...</a><br/></td></tr>
<tr class="separator:a7239c03265659edcaf69dc9ea5e29ce3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bfa264f66c84606ebf9f9e8dc45b907"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a2bfa264f66c84606ebf9f9e8dc45b907">ObjectSetFilter</a> )(uint32_t obj_idx, <a class="el" href="group__can__filter__operation__ctrls.html#gacb04d0f8b3969ee69362ff2b62941d75">ARM_CAN_FILTER_OPERATION</a> operation, uint32_t id, uint32_t arg)</td></tr>
<tr class="memdesc:a2bfa264f66c84606ebf9f9e8dc45b907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> : Add or remove filter for message reception. <a href="#a2bfa264f66c84606ebf9f9e8dc45b907">More...</a><br/></td></tr>
<tr class="separator:a2bfa264f66c84606ebf9f9e8dc45b907"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24cfe29d7f6a29dfbac3c7011fc5b652"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a24cfe29d7f6a29dfbac3c7011fc5b652">ObjectConfigure</a> )(uint32_t obj_idx, <a class="el" href="group__can__obj__config__ctrls.html#gaa9488554de0575bc821c9f65213c4cd0">ARM_CAN_OBJ_CONFIG</a> obj_cfg)</td></tr>
<tr class="memdesc:a24cfe29d7f6a29dfbac3c7011fc5b652"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> : Configure object. <a href="#a24cfe29d7f6a29dfbac3c7011fc5b652">More...</a><br/></td></tr>
<tr class="separator:a24cfe29d7f6a29dfbac3c7011fc5b652"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e6eb8bae2b7f8af99a3ca3cbbacce22"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a3e6eb8bae2b7f8af99a3ca3cbbacce22">MessageSend</a> )(uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, const uint8_t *data, uint8_t size)</td></tr>
<tr class="memdesc:a3e6eb8bae2b7f8af99a3ca3cbbacce22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> : Send message on CAN bus. <a href="#a3e6eb8bae2b7f8af99a3ca3cbbacce22">More...</a><br/></td></tr>
<tr class="separator:a3e6eb8bae2b7f8af99a3ca3cbbacce22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace17a0046cf2c6cdbcb0fd3202e460a0"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ace17a0046cf2c6cdbcb0fd3202e460a0">MessageRead</a> )(uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, uint8_t *data, uint8_t size)</td></tr>
<tr class="memdesc:ace17a0046cf2c6cdbcb0fd3202e460a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a> : Read message received on CAN bus. <a href="#ace17a0046cf2c6cdbcb0fd3202e460a0">More...</a><br/></td></tr>
<tr class="separator:ace17a0046cf2c6cdbcb0fd3202e460a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e0f47a92f626a971c5197fca6545505"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#a6e0f47a92f626a971c5197fca6545505">Control</a> )(uint32_t control, uint32_t arg)</td></tr>
<tr class="memdesc:a6e0f47a92f626a971c5197fca6545505"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a> : Control CAN interface. <a href="#a6e0f47a92f626a971c5197fca6545505">More...</a><br/></td></tr>
<tr class="separator:a6e0f47a92f626a971c5197fca6545505"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad60ff24982cdb3ce38b8c17e0b4f0acc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__can__interface__gr.html#structARM__CAN__STATUS">ARM_CAN_STATUS</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__can__interface__gr.html#ad60ff24982cdb3ce38b8c17e0b4f0acc">GetStatus</a> )(void)</td></tr>
<tr class="memdesc:ad60ff24982cdb3ce38b8c17e0b4f0acc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__can__interface__gr.html#ga676d6b567fc4ab3d44f5d7a50ec9419c">ARM_CAN_GetStatus</a> : Get CAN status. <a href="#ad60ff24982cdb3ce38b8c17e0b4f0acc">More...</a><br/></td></tr>
<tr class="separator:ad60ff24982cdb3ce38b8c17e0b4f0acc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h4 class="groupheader">Field Documentation</h4>
<a class="anchor" id="a8834b281da48583845c044a81566c1b3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>(* GetVersion)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga4256d5b23ffcb27759a05f8e6b854f13">ARM_CAN_GetVersion</a> : Get driver version. </p>
</div>
</div>
<a class="anchor" id="a62c0c62c2bf482c000b1b2a2c817a96f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a>(* GetCapabilities)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a> : Get driver capabilities. </p>
</div>
</div>
<a class="anchor" id="a322b44b8e757887616b75035a8fd7027"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* Initialize)(<a class="el" href="group__can__interface__gr.html#gaac07b9fdf614bf439414f5417aaa376e">ARM_CAN_SignalUnitEvent_t</a> cb_unit_event, <a class="el" href="group__can__interface__gr.html#ga7ceceac3e9aa0981c5cacfab88efb4eb">ARM_CAN_SignalObjectEvent_t</a> cb_object_event)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a> : Initialize CAN interface. </p>
</div>
</div>
<a class="anchor" id="adcf20681a1402869ecb5c6447fada17b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* Uninitialize)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga1e3e364b64f2ab277399e3279cce5ef8">ARM_CAN_Uninitialize</a> : De-initialize CAN interface. </p>
</div>
</div>
<a class="anchor" id="aba8f1c8019af95ffe19c32403e3240ef"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* PowerControl)(<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga6f634f126ac97daef2f3115aa7bfed7c">ARM_CAN_PowerControl</a> : Control CAN interface power. </p>
</div>
</div>
<a class="anchor" id="a21063f38e762cf29dfd3f5991ee936e2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t(* GetClock)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga1fe6cc207415de604975ae251e269361">ARM_CAN_GetClock</a> : Retrieve CAN base clock frequency. </p>
</div>
</div>
<a class="anchor" id="a360a314665607fc2d866c24e1608fd06"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* SetBitrate)(<a class="el" href="group__can__timeseg__ctrls.html#ga11c12020b81a63a73a8b53e96a7e3dea">ARM_CAN_BITRATE_SELECT</a> select, uint32_t bitrate, uint32_t bit_segments)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga88bb27a8525503a250cca7a2c4a5d07a">ARM_CAN_SetBitrate</a> : Set bitrate for CAN interface. </p>
</div>
</div>
<a class="anchor" id="a0fa2edbde052011604addec816782b4e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* SetMode)(<a class="el" href="group__can__bus__mode__ctrls.html#gabbca99c46d478bcf822eee71cdf75dcd">ARM_CAN_MODE</a> mode)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a> : Set operating mode for CAN interface. </p>
</div>
</div>
<a class="anchor" id="a7239c03265659edcaf69dc9ea5e29ce3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a>(* ObjectGetCapabilities)(uint32_t obj_idx)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a> : Retrieve capabilities of an object. </p>
</div>
</div>
<a class="anchor" id="a2bfa264f66c84606ebf9f9e8dc45b907"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* ObjectSetFilter)(uint32_t obj_idx, <a class="el" href="group__can__filter__operation__ctrls.html#gacb04d0f8b3969ee69362ff2b62941d75">ARM_CAN_FILTER_OPERATION</a> operation, uint32_t id, uint32_t arg)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d">ARM_CAN_ObjectSetFilter</a> : Add or remove filter for message reception. </p>
</div>
</div>
<a class="anchor" id="a24cfe29d7f6a29dfbac3c7011fc5b652"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* ObjectConfigure)(uint32_t obj_idx, <a class="el" href="group__can__obj__config__ctrls.html#gaa9488554de0575bc821c9f65213c4cd0">ARM_CAN_OBJ_CONFIG</a> obj_cfg)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> : Configure object. </p>
</div>
</div>
<a class="anchor" id="a3e6eb8bae2b7f8af99a3ca3cbbacce22"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* MessageSend)(uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, const uint8_t *data, uint8_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> : Send message on CAN bus. </p>
</div>
</div>
<a class="anchor" id="ace17a0046cf2c6cdbcb0fd3202e460a0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* MessageRead)(uint32_t obj_idx, <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *msg_info, uint8_t *data, uint8_t size)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a> : Read message received on CAN bus. </p>
</div>
</div>
<a class="anchor" id="a6e0f47a92f626a971c5197fca6545505"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* Control)(uint32_t control, uint32_t arg)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a> : Control CAN interface. </p>
</div>
</div>
<a class="anchor" id="ad60ff24982cdb3ce38b8c17e0b4f0acc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__can__interface__gr.html#structARM__CAN__STATUS">ARM_CAN_STATUS</a>(* GetStatus)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga676d6b567fc4ab3d44f5d7a50ec9419c">ARM_CAN_GetStatus</a> : Get CAN status. </p>
</div>
</div>
</div>
</div>
<a name="structARM__CAN__CAPABILITIES" id="structARM__CAN__CAPABILITIES"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ARM_CAN_CAPABILITIES</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>CAN Device Driver Capabilities. </p>
<p>A CAN driver can be implemented with different capabilities encoded in the data fields of this structure.</p>
<p><b>Returned by:</b></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#ga35f21cabe1637b1be964024a8f77721c">ARM_CAN_GetCapabilities</a></li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> for information about CAN objects. </dd></dl>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a69bd1a164443cf6f501489f4d31f4681"></a>uint32_t</td>
<td class="fieldname">
num_objects: 8</td>
<td class="fielddoc">
Number of <a class="el" href="group__can__interface__gr.html#can_objects">CAN Message Objects</a> available. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ae0514834750c7452431717a881471e2b"></a>uint32_t</td>
<td class="fieldname">
reentrant_operation: 1</td>
<td class="fielddoc">
Support for reentrant calls to <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a>, <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a>, <a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> and abort message sending used by <a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a>. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a15d22d5906d419ed1a7ca0968be00a04"></a>uint32_t</td>
<td class="fieldname">
fd_mode: 1</td>
<td class="fielddoc">
Support for CAN with flexible data-rate mode (CAN_FD) (set by <a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a>) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a93008ac105806db484e78e0582ca118c"></a>uint32_t</td>
<td class="fieldname">
restricted_mode: 1</td>
<td class="fielddoc">
Support for restricted operation mode (set by <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a>) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a176f42e68d9cba86b3594c40044b86c6"></a>uint32_t</td>
<td class="fieldname">
monitor_mode: 1</td>
<td class="fielddoc">
Support for bus monitoring mode (set by <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a>) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af19cdbb26d3496ed7dd63a59a7c7711f"></a>uint32_t</td>
<td class="fieldname">
internal_loopback: 1</td>
<td class="fielddoc">
Support for internal loopback mode (set by <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a>) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2b76df7e4bfbdd9866cc906415e626c9"></a>uint32_t</td>
<td class="fieldname">
external_loopback: 1</td>
<td class="fielddoc">
Support for external loopback mode (set by <a class="el" href="group__can__interface__gr.html#ga28226a6e223f9b95b4dafb7c2f48a855">ARM_CAN_SetMode</a>) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 18</td>
<td class="fielddoc">
Reserved (must be zero) </td></tr>
</table>
</div>
</div>
<a name="structARM__CAN__STATUS" id="structARM__CAN__STATUS"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ARM_CAN_STATUS</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>CAN Status. </p>
<p>Structure with information about the status of the CAN unit state and errors. The data fields encode the unit bus state, last error code, transmitter error count, and receiver error count.</p>
<p><b>Returned by:</b></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#ga676d6b567fc4ab3d44f5d7a50ec9419c">ARM_CAN_GetStatus</a> </li>
</ul>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a96ec94acab56690b3801e3c5fbd09fa2"></a>uint32_t</td>
<td class="fieldname">
unit_state: 4</td>
<td class="fielddoc">
Unit bus state. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2171ea8dff5e4b54e84728aa134854b6"></a>uint32_t</td>
<td class="fieldname">
last_error_code: 4</td>
<td class="fielddoc">
Last error code. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8941505f6f3ebd69825c4382184c580f"></a>uint32_t</td>
<td class="fieldname">
tx_error_count: 8</td>
<td class="fielddoc">
Transmitter error count. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab7e8b863b379b786ad1af935aa3ef2e8"></a>uint32_t</td>
<td class="fieldname">
rx_error_count: 8</td>
<td class="fielddoc">
Receiver error count. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 8</td>
<td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a name="structARM__CAN__MSG__INFO" id="structARM__CAN__MSG__INFO"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ARM_CAN_MSG_INFO</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>CAN Message Information. </p>
<p>Structure with information about the CAN message.</p>
<p>In CAN mode, the following <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> data fields are ignored: <em>edl</em>, <em>brs</em>, <em>esi</em>. <br/>
In CAN FD mode, the following <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> data field is ignored: <em>rtr</em>.</p>
<p><b>Parameter for:</b></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a></li>
<li><a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a></li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> </dd></dl>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abaabdc509cdaba7df9f56c6c76f3ae19"></a>uint32_t</td>
<td class="fieldname">
id</td>
<td class="fielddoc">
CAN identifier with frame format specifier (bit 31) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1f32fc9e5d3b33babf5905140e7a53af"></a>uint32_t</td>
<td class="fieldname">
rtr: 1</td>
<td class="fielddoc">
Remote transmission request frame. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab6883964c9d4bdf60616684e8d2459df"></a>uint32_t</td>
<td class="fieldname">
edl: 1</td>
<td class="fielddoc">
Flexible data-rate format extended data length. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a3539c043c5868c59f76c736fe2bcadf4"></a>uint32_t</td>
<td class="fieldname">
brs: 1</td>
<td class="fielddoc">
Flexible data-rate format with bitrate switch. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ada78e3124de6adf5a5d212f9ebc4bbe0"></a>uint32_t</td>
<td class="fieldname">
esi: 1</td>
<td class="fielddoc">
Flexible data-rate format error state indicator. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a811fbb0cb2c2263b1a7440a7e9d78239"></a>uint32_t</td>
<td class="fieldname">
dlc: 4</td>
<td class="fielddoc">
Data length code. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 24</td>
<td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a name="structARM__CAN__OBJ__CAPABILITIES" id="structARM__CAN__OBJ__CAPABILITIES"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct ARM_CAN_OBJ_CAPABILITIES</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>CAN Object Capabilities. </p>
<p>A CAN object can be implemented with different capabilities encoded in the data fields of this structure.</p>
<p><b>Returned by</b>:</p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#ga45ab314f5121cf5a1b32d9adc600e0f7">ARM_CAN_ObjectGetCapabilities</a></li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630">ARM_CAN_ObjectConfigure</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a> </dd></dl>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a9706173b2ed538efeb5ee4a952e2272f"></a>uint32_t</td>
<td class="fieldname">
tx: 1</td>
<td class="fielddoc">
Object supports transmission. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a895532773c3204e1538191f155c7bac8"></a>uint32_t</td>
<td class="fieldname">
rx: 1</td>
<td class="fielddoc">
Object supports reception. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8a41139926d7c032247458d055071fda"></a>uint32_t</td>
<td class="fieldname">
rx_rtr_tx_data: 1</td>
<td class="fielddoc">
Object supports RTR reception and automatic Data Frame transmission. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1debac19545140bdfe3c5fa8d53f1863"></a>uint32_t</td>
<td class="fieldname">
tx_rtr_rx_data: 1</td>
<td class="fielddoc">
Object supports RTR transmission and automatic Data Frame reception. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a3662fb9a8fb81212043cadd90da704af"></a>uint32_t</td>
<td class="fieldname">
multiple_filters: 1</td>
<td class="fielddoc">
Object allows assignment of multiple filters to it. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a886337af58da4f995529eba228fb9b7a"></a>uint32_t</td>
<td class="fieldname">
exact_filtering: 1</td>
<td class="fielddoc">
Object supports exact identifier filtering. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a96dcf869f4adc9cec686630082c7c60a"></a>uint32_t</td>
<td class="fieldname">
range_filtering: 1</td>
<td class="fielddoc">
Object supports range identifier filtering. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2aa0e772d6cb8c30bb76ce1324423464"></a>uint32_t</td>
<td class="fieldname">
mask_filtering: 1</td>
<td class="fielddoc">
Object supports mask identifier filtering. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a5a782fc223b0ea5034c6676eaec6f2d4"></a>uint32_t</td>
<td class="fieldname">
message_depth: 8</td>
<td class="fielddoc">
Number of messages buffers (FIFO) for that object. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 16</td>
<td class="fielddoc">
Reserved (must be zero) </td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gaac07b9fdf614bf439414f5417aaa376e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ARM_CAN_SignalUnitEvent_t</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> : Signal CAN Unit Event. </p>
<p>Provides the typedef for the callback function <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a>.</p>
<p><b>Parameter for:</b></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a> </li>
</ul>
</div>
</div>
<a class="anchor" id="ga7ceceac3e9aa0981c5cacfab88efb4eb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ARM_CAN_SignalObjectEvent_t</td>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> : Signal CAN Object Event. </p>
<p>Provides the typedef for the callback function <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a>.</p>
<p><b>Parameter for:</b></p>
<ul>
<li><a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a> </li>
</ul>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga4256d5b23ffcb27759a05f8e6b854f13"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a> ARM_CAN_GetVersion </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 driver version. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a></dd></dl>
<p>The function <b>ARM_CAN_GetVersion</b> returns version information of the driver implementation in <a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a></p>
<ul>
<li>API version is the version of the CMSIS-Driver specification used to implement this driver.</li>
<li>Driver version is source code version of the actual driver implementation.</li>
</ul>
<p>Example: </p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <a class="code" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> Driver_CAN0;</div>
<div class="line"><a class="code" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> *drv_info;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> setup_can (<span class="keywordtype">void</span>) {</div>
<div class="line"> <a class="code" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a> version;</div>
<div class="line"></div>
<div class="line"> drv_info = &amp;Driver_CAN0;</div>
<div class="line"> version = drv_info-&gt;<a class="code" href="group__can__interface__gr.html#a8834b281da48583845c044a81566c1b3">GetVersion</a> ();</div>
<div class="line"> <span class="keywordflow">if</span> (version.<a class="code" href="group__common__drv__gr.html#ad180da20fbde1d3dafc074af87c19540">api</a> &lt; 0x10A) { <span class="comment">// requires at minimum API version 1.10 or higher</span></div>
<div class="line"> <span class="comment">// error handling</span></div>
<div class="line"> <span class="keywordflow">return</span>;</div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ga35f21cabe1637b1be964024a8f77721c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> ARM_CAN_GetCapabilities </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 driver capabilities. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a></dd></dl>
<p>The function <b>ARM_CAN_GetCapabilities</b> returns information about the capabilities in this driver implementation. The data fields of the structure <a class="el" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> encode various capabilities.</p>
<p>Example: </p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <a class="code" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> Driver_CAN0;</div>
<div class="line"><a class="code" href="group__can__interface__gr.html#structARM__DRIVER__CAN">ARM_DRIVER_CAN</a> *drv_info;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> read_capabilities (<span class="keywordtype">void</span>) {</div>
<div class="line"> <a class="code" href="group__can__interface__gr.html#structARM__CAN__CAPABILITIES">ARM_CAN_CAPABILITIES</a> drv_capabilities;</div>
<div class="line"></div>
<div class="line"> drv_info = &amp;Driver_CAN0;</div>
<div class="line"> drv_capabilities = drv_info-&gt;<a class="code" href="group__can__interface__gr.html#a62c0c62c2bf482c000b1b2a2c817a96f">GetCapabilities</a> ();</div>
<div class="line"> <span class="comment">// interrogate capabilities</span></div>
<div class="line"></div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="gaa72ceb25ba67e279d7432404632deb44"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_Initialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__can__interface__gr.html#gaac07b9fdf614bf439414f5417aaa376e">ARM_CAN_SignalUnitEvent_t</a>&#160;</td>
<td class="paramname"><em>cb_unit_event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__can__interface__gr.html#ga7ceceac3e9aa0981c5cacfab88efb4eb">ARM_CAN_SignalObjectEvent_t</a>&#160;</td>
<td class="paramname"><em>cb_object_event</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize CAN interface and register signal (callback) functions. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">cb_unit_event</td><td>Pointer to <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> callback function </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cb_object_event</td><td>Pointer to <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> callback function </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>initializes</b> the CAN interface.</p>
<p>The function performs the following operations:</p>
<ul>
<li>Initializes the resources needed for the CAN interface, for example dynamic memory allocation, RTOS object allocation, and possibly hardware pin configuration.</li>
<li>Registers the <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> callback function.</li>
<li>Registers the <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> callback function.</li>
</ul>
<p>The parameter <em>cb_unit_event</em> is a pointer to the <a class="el" href="group__can__interface__gr.html#ga38795d1ed135ce3bd87f31ef1596bccf">ARM_CAN_SignalUnitEvent</a> callback function; use a NULL pointer when no callback signals are required.</p>
<p>The parameter <em>cb_object_event</em> is a pointer to the <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> callback function; use a NULL pointer when no callback signals are required.</p>
<p><b>Example:</b> </p>
<ul>
<li>see <a class="el" href="group__can__interface__gr.html">CAN Interface</a> </li>
</ul>
</div>
</div>
<a class="anchor" id="ga1e3e364b64f2ab277399e3279cce5ef8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_Uninitialize </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>De-initialize CAN interface. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_Uninitialize</b> de-initializes the resources of the CAN interface. It is called to release the software resources used by the interface such as deallocate any RTOS objects, dynamic memory and pin de-configuration. </p>
</div>
</div>
<a class="anchor" id="ga6f634f126ac97daef2f3115aa7bfed7c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_PowerControl </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a>&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Control CAN interface power. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>Power state<ul>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a> : power off: no operation possible</li>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5a9ef9e57cbcc948d0e22314e73dc8c434">ARM_POWER_LOW</a> : low power mode: retain state, detect and signal wake-up events</li>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a> : power on: full operation at maximum performance </li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_PowerControl</b> controls the power modes of the CAN interface.</p>
<p>The parameter <em>state</em> can be:</p>
<ul>
<li>ARM_POWER_FULL: Activate clocks and driver functionality as if peripheral was reset.</li>
<li>ARM_POWER_OFF: Unconditionally put peripheral into non-functional (reset) state.</li>
<li>ARM_POWER_LOW: Put peripheral into low power consumption state ready to wake up on bus event. </li>
</ul>
</div>
</div>
<a class="anchor" id="ga1fe6cc207415de604975ae251e269361"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t ARM_CAN_GetClock </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieve CAN base clock frequency. </p>
<dl class="section return"><dt>Returns</dt><dd>base clock frequency</dd></dl>
<p>The function <b>ARM_CAN_GetClock</b> returns the CAN base clock frequency in <span class="XML-Token">[Hz]</span>. This value may be used to validate the <em>bitrate</em> for the function <a class="el" href="group__can__interface__gr.html#ga88bb27a8525503a250cca7a2c4a5d07a">ARM_CAN_SetBitrate</a>.</p>
<p><b>Example</b>: </p>
<div class="fragment"><div class="line">CAN_clock = <a class="code" href="group__can__interface__gr.html#ga1fe6cc207415de604975ae251e269361">ARM_CAN_GetClock</a>(); <span class="comment">// CAN base clock frequency</span></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ga88bb27a8525503a250cca7a2c4a5d07a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_SetBitrate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__can__timeseg__ctrls.html#ga11c12020b81a63a73a8b53e96a7e3dea">ARM_CAN_BITRATE_SELECT</a>&#160;</td>
<td class="paramname"><em>select</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>bitrate</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>bit_segments</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set bitrate for CAN interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">select</td><td>Bitrate selection<ul>
<li><a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a> : nominal (flexible data-rate arbitration) bitrate</li>
<li><a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaaa6c9996de0cdf42da5c02086cd8f16dc">ARM_CAN_BITRATE_FD_DATA</a> : flexible data-rate data bitrate </li>
</ul>
</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bitrate</td><td>Bitrate </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bit_segments</td><td>Bit segments settings<ul>
<li><a class="el" href="group__can__timeseg__ctrls.html#ga01183319a5a899eafea9ffe7af73d5ea">ARM_CAN_BIT_PROP_SEG(x)</a> : number of time quanta for propagation time segment</li>
<li><a class="el" href="group__can__timeseg__ctrls.html#ga03f1921ee97a7ebf5d767b6cacf40792">ARM_CAN_BIT_PHASE_SEG1(x)</a> : number of time quanta for phase buffer segment 1</li>
<li><a class="el" href="group__can__timeseg__ctrls.html#ga76de056d56803cb7a0d01978ee981e80">ARM_CAN_BIT_PHASE_SEG2(x)</a> : number of time quanta for phase buffer Segment 2</li>
<li><a class="el" href="group__can__timeseg__ctrls.html#gab32e97fa4edf497c111dd3f0d8779269">ARM_CAN_BIT_SJW(x)</a> : number of time quanta for (re-)synchronization jump width </li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_SetBitrate</b> sets the CAN communication bit rate.</p>
<p>The parameter <em>select</em> selects the bit rate affected by function call as defined in <a class="el" href="group__can__timeseg__ctrls.html#ga11c12020b81a63a73a8b53e96a7e3dea">ARM_CAN_BITRATE_SELECT</a> and listed in the table below.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>select</em> </th><th align="left">CAN Mode Bit Rate </th></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a> </td><td align="left">Select nominal (flexible data-rate arbitration) bitrate (CAN 2.0B) </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaaa6c9996de0cdf42da5c02086cd8f16dc">ARM_CAN_BITRATE_FD_DATA</a> </td><td align="left">Select flexible data-rate data bitrate (<a class="el" href="group__can__interface__gr.html#CAN_FD">CAN_FD</a>) </td></tr>
</table>
<p>The parameter <em>bitrate</em> is the bit rate for the selected CAN mode.</p>
<p>The parameter <em>bit_segments</em> is used to setup the time quanta for sampling (see picture below). The values listed in the table below are ORed and specify the various sampling segments. The CAN controller samples each bit on the bus at the <em>Sample Point</em>.</p>
<table class="cmtable">
<tr>
<th>Parameter <em>bit_segments</em> </th><th>Bit </th><th>for <em>select</em> = <a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a> <br/>
(CAN specification) </th><th>for <em>select</em> = <a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a> <br/>
(CAN FD specification) </th><th>for <em>select</em> = <a class="el" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaaa6c9996de0cdf42da5c02086cd8f16dc">ARM_CAN_BITRATE_FD_DATA</a> <br/>
(CAN FD specification) </th></tr>
<tr>
<td><a class="el" href="group__can__timeseg__ctrls.html#ga01183319a5a899eafea9ffe7af73d5ea">ARM_CAN_BIT_PROP_SEG</a>(<em>x</em>) <br/>
Propagation Time Segment <br/>
(PROP_SEG) </td><td>0..7 </td><td><em>x</em> = <span class="XML-Token">[1..8]</span> </td><td><em>x</em> = <span class="XML-Token">[1..32] or more</span> </td><td><em>x</em> = <span class="XML-Token">[0..8]</span> </td></tr>
<tr>
<td><a class="el" href="group__can__timeseg__ctrls.html#ga03f1921ee97a7ebf5d767b6cacf40792">ARM_CAN_BIT_PHASE_SEG1</a>(<em>x</em>) <br/>
Phase Buffer Segment 1 <br/>
(PHASE_SEG1) </td><td>8..15 </td><td><em>x</em> = <span class="XML-Token">[1..8]</span> </td><td><em>x</em> = <span class="XML-Token">[1..32] or more</span> </td><td><em>x</em> = <span class="XML-Token">[1..8]</span> </td></tr>
<tr>
<td rowspan="2"><a class="el" href="group__can__timeseg__ctrls.html#ga76de056d56803cb7a0d01978ee981e80">ARM_CAN_BIT_PHASE_SEG2</a>(<em>x</em>) <br/>
Phase Buffer Segment 2 <br/>
(PHASE_SEG2) </td><td rowspan="2">16..23 </td><td><em>x</em> = <span class="XML-Token">[1..8]</span> </td><td><em>x</em> = <span class="XML-Token">[1..32] or more</span> </td><td><em>x</em> = <span class="XML-Token">[1..8]</span> </td></tr>
<tr>
<td colspan="3">The maximum allowed value is <span class="XML-Token">x = MAX (PHASE_SEG1, IPT)</span>. IPT = Information Processing Time. Usually, IPT = <span class="XML-Token">2</span>. Exceptions apply. Read the specifications of your CAN controller. </td></tr>
<tr>
<td rowspan="2"><a class="el" href="group__can__timeseg__ctrls.html#gab32e97fa4edf497c111dd3f0d8779269">ARM_CAN_BIT_SJW</a>(<em>x</em>) <br/>
(Re-)Synchronization Jump Width <br/>
(SJW). </td><td rowspan="2">24..31 </td><td><em>x</em> = <span class="XML-Token">[1..4]</span> </td><td><em>x</em> = <span class="XML-Token">[1..4]</span> </td><td><em>x</em> = <span class="XML-Token">[1..4]</span> </td></tr>
<tr>
<td colspan="3">The maximum allowed value is <span class="XML-Token">x = MIN (MIN (PHASE_SEG1, PHASE_SEG2), 4)</span>. SJW is not allowed to be greater than either PHASE segment. </td></tr>
</table>
<p>The picture shows a Nominal Bit Time with 10 time quanta. </p>
<div class="image">
<img src="CAN_Bit_Timing.png" alt="CAN_Bit_Timing.png"/>
<div class="caption">
CAN Bit Timing</div></div>
<p>The time quanta (N) per bit is: </p>
<div class="fragment"><div class="line">N = 1 + PROP_SEG + PHASE_SEG1 + PHASE_SEG2; <span class="comment">// note SYNC_SEG is always 1</span></div>
</div><!-- fragment --><p>The driver uses this value and the CAN clock to calculate a suitable prescaler value (P). If the driver cannot achieve the requested <em>bitrate</em> it returns with <a class="el" href="Driver__CAN_8h.html#a90b9d9323a6049fb4fcd1efe7c892294">ARM_CAN_INVALID_BITRATE</a>. The formula for the <em>bitrate</em> is: </p>
<div class="fragment"><div class="line">bitrate = (CAN_Clock / P) / N;</div>
</div><!-- fragment --><p><b>Example</b>: </p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;SetBitrate (<a class="code" href="Driver__CAN_8h.html#ga11c12020b81a63a73a8b53e96a7e3deaa3b6d191c99f1eba4f01bcc5fbfaf67f3">ARM_CAN_BITRATE_NOMINAL</a>, <span class="comment">// Set nominal bitrate</span></div>
<div class="line"> 125000U, <span class="comment">// Set bitrate to 125 kbit/s</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga01183319a5a899eafea9ffe7af73d5ea">ARM_CAN_BIT_PROP_SEG</a>(5U) | <span class="comment">// Set propagation segment to 5 time quanta</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga03f1921ee97a7ebf5d767b6cacf40792">ARM_CAN_BIT_PHASE_SEG1</a>(1U) | <span class="comment">// Set phase segment 1 to 1 time quantum (sample point at 87.5% of bit time)</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#ga76de056d56803cb7a0d01978ee981e80">ARM_CAN_BIT_PHASE_SEG2</a>(1U) | <span class="comment">// Set phase segment 2 to 1 time quantum (total bit is 8 time quanta long)</span></div>
<div class="line"> <a class="code" href="group__can__timeseg__ctrls.html#gab32e97fa4edf497c111dd3f0d8779269">ARM_CAN_BIT_SJW</a>(1U)); <span class="comment">// Resynchronization jump width is same as phase segment 2</span></div>
</div><!-- fragment --><p>In this example, N = 8 and with a CAN_Clock = 8MHz the prescaler (P) is calculated by the driver to 8. </p>
</div>
</div>
<a class="anchor" id="ga28226a6e223f9b95b4dafb7c2f48a855"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_SetMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__can__bus__mode__ctrls.html#gabbca99c46d478bcf822eee71cdf75dcd">ARM_CAN_MODE</a>&#160;</td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set operating mode for CAN interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>Operating mode<ul>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda9967a5ebaa045afe54d75e5629676ddc">ARM_CAN_MODE_INITIALIZATION</a> : initialization mode</li>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcdaa3190344bdf3452462e5c0518ac3cdc4">ARM_CAN_MODE_NORMAL</a> : normal operation mode</li>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda22a9bb26e68c2a04f641d466040d755d">ARM_CAN_MODE_RESTRICTED</a> : restricted operation mode</li>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda904f68f08c84c4b85c763f5d98c574ab">ARM_CAN_MODE_MONITOR</a> : bus monitoring mode</li>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda8579315576baa43860a398a30fd527d8">ARM_CAN_MODE_LOOPBACK_INTERNAL</a> : loopback internal mode</li>
<li><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda5ee1ba60abcf39d575e7cb309e641b9b">ARM_CAN_MODE_LOOPBACK_EXTERNAL</a> : loopback external mode </li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_SetMode</b> sets the CAN bus communication mode using the parameter <em>mode</em>.</p>
<p>The table lists the values for <em>mode</em>.</p>
<table class="cmtable">
<tr>
<th>Parameter <em>mode</em> </th><th>Bus Communication Mode </th><th>supported when <a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> data field </th></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda9967a5ebaa045afe54d75e5629676ddc">ARM_CAN_MODE_INITIALIZATION</a> </td><td>Initialization mode; Used to setup communication parameters for the reception objects and global filtering, while peripheral is not active on the bus. Refer to <a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a> for details. </td><td><em>always supported</em> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcdaa3190344bdf3452462e5c0518ac3cdc4">ARM_CAN_MODE_NORMAL</a> </td><td>Normal operation mode. Used when peripheral is in active mode to receive, transmit, and acknowledge messages on the bus. Depending on the current unit state, it can generate error or overload messages. Verify the unit state with <a class="el" href="group__can__interface__gr.html#ga676d6b567fc4ab3d44f5d7a50ec9419c">ARM_CAN_GetStatus</a>. </td><td><em>always supported</em> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda22a9bb26e68c2a04f641d466040d755d">ARM_CAN_MODE_RESTRICTED</a> </td><td>Restricted operation mode. Used for monitoring the bus communication non-intrusively without transmitting. </td><td><em>restricted_mode</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda904f68f08c84c4b85c763f5d98c574ab">ARM_CAN_MODE_MONITOR</a> </td><td>Bus monitoring mode. </td><td><em>monitor_mode</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda8579315576baa43860a398a30fd527d8">ARM_CAN_MODE_LOOPBACK_INTERNAL</a> </td><td>Test mode; loopback of CAN transmission to its receiver. No transmission visible on CAN bus. </td><td><em>internal_loopback</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gabbca99c46d478bcf822eee71cdf75dcda5ee1ba60abcf39d575e7cb309e641b9b">ARM_CAN_MODE_LOOPBACK_EXTERNAL</a> </td><td>Test mode; loopback of CAN transmission to its receiver. Transmission is visible on CAN bus. </td><td><em>external_loopback</em> = <span class="XML-Token">1</span> </td></tr>
</table>
</div>
</div>
<a class="anchor" id="ga45ab314f5121cf5a1b32d9adc600e0f7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> ARM_CAN_ObjectGetCapabilities </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>obj_idx</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieve capabilities of an object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">obj_idx</td><td>Object index </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a></dd></dl>
<p>The function <b>ARM_CAN_ObjectGetCapabilities</b> retrieves the capabilities of a CAN object. The structure <a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> stores the values.</p>
<p>The parameter <em>obj_idx</em> is the message object index.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630" title="Configure object. ">ARM_CAN_ObjectConfigure</a> </dd>
<dd>
<a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d" title="Add or remove filter for message reception. ">ARM_CAN_ObjectSetFilter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga4f9bc7088704483388e14872c9d5385d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_ObjectSetFilter </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>obj_idx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__can__filter__operation__ctrls.html#gacb04d0f8b3969ee69362ff2b62941d75">ARM_CAN_FILTER_OPERATION</a>&#160;</td>
<td class="paramname"><em>operation</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>arg</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add or remove filter for message reception. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">obj_idx</td><td>Object index of object that filter should be or is assigned to </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">operation</td><td>Operation on filter<ul>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a> : add exact id filter</li>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a6fdaecf3fa244ef1e4d1069d9c6c95f8">ARM_CAN_FILTER_ID_EXACT_REMOVE</a> : remove exact id filter</li>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a22123bef8e773844fce604c553bf2ed5">ARM_CAN_FILTER_ID_RANGE_ADD</a> : add range id filter</li>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a17fea7d388dc702bb3318ecae911f50d">ARM_CAN_FILTER_ID_RANGE_REMOVE</a> : remove range id filter</li>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a> : add maskable id filter</li>
<li><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ad9573d5d0e112aece7abc0bc24aa92fb">ARM_CAN_FILTER_ID_MASKABLE_REMOVE</a> : remove maskable id filter </li>
</ul>
</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>ID or start of ID range (depending on filter type) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>Mask or end of ID range (depending on filter type) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_ObjectSetFilter</b> sets or removes the filter for message reception. Refer to <a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a> for details on filtering.</p>
<p>The parameter <em>obj_idx</em> is the message object index. <br/>
The parameter <em>operation</em> is the operation on the filter as listed in the table below and which are defined in the structure <a class="el" href="group__can__filter__operation__ctrls.html#gacb04d0f8b3969ee69362ff2b62941d75">ARM_CAN_FILTER_OPERATION</a>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>operation</em> </th><th align="left">Operation on Filter </th><th align="left">supported when <a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> data field </th></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75aa734058b50573de3b0cc49311997806b">ARM_CAN_FILTER_ID_EXACT_ADD</a> </td><td align="left">Add exact ID filter </td><td align="left"><em>exact_filtering</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a6fdaecf3fa244ef1e4d1069d9c6c95f8">ARM_CAN_FILTER_ID_EXACT_REMOVE</a> </td><td align="left">Remove exact ID filter </td><td align="left"><em>exact_filtering</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a22123bef8e773844fce604c553bf2ed5">ARM_CAN_FILTER_ID_RANGE_ADD</a> </td><td align="left">Add range ID filter </td><td align="left"><em>range_filtering</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75a17fea7d388dc702bb3318ecae911f50d">ARM_CAN_FILTER_ID_RANGE_REMOVE</a> </td><td align="left">Remove range ID filter </td><td align="left"><em>range_filtering</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ac4ad302fa9b762c1d14964141e234ba9">ARM_CAN_FILTER_ID_MASKABLE_ADD</a> </td><td align="left">Add maskable ID filter </td><td align="left"><em>mask_filtering</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="Driver__CAN_8h.html#gacb04d0f8b3969ee69362ff2b62941d75ad9573d5d0e112aece7abc0bc24aa92fb">ARM_CAN_FILTER_ID_MASKABLE_REMOVE</a> </td><td align="left">Remove maskable ID filter </td><td align="left"><em>mask_filtering</em> = <span class="XML-Token">1</span> </td></tr>
</table>
<p>The parameter <em>id</em> is the identifier of the filter or defines the start of the filter range (depends on the filter operation). <br/>
The parameter <em>arg</em> is the mask of the filter or defines the end of the filter range (depends on the filter operation).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#ga00ec0715f6755a49dae5b60dca182630" title="Configure object. ">ARM_CAN_ObjectConfigure</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga00ec0715f6755a49dae5b60dca182630"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_ObjectConfigure </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>obj_idx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__can__obj__config__ctrls.html#gaa9488554de0575bc821c9f65213c4cd0">ARM_CAN_OBJ_CONFIG</a>&#160;</td>
<td class="paramname"><em>obj_cfg</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Configure object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">obj_idx</td><td>Object index </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">obj_cfg</td><td>Object configuration state<ul>
<li><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0aebbd0da59658805af30203be66d80249">ARM_CAN_OBJ_INACTIVE</a> : deactivate object</li>
<li><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a14780ac7274831ee94f427cbbf67c003">ARM_CAN_OBJ_RX</a> : configure object for reception</li>
<li><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a3e20952f92855298cd0a39a7f47b3f3c">ARM_CAN_OBJ_TX</a> : configure object for transmission</li>
<li><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0ac5d28d180ea9e4328974ffcb8b928a0c">ARM_CAN_OBJ_RX_RTR_TX_DATA</a> : configure object that on RTR reception automatically transmits Data Frame</li>
<li><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a396d7a6cd2353e1a2936405ace6417f5">ARM_CAN_OBJ_TX_RTR_RX_DATA</a> : configure object that transmits RTR and automatically receives Data Frame </li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_ObjectConfigure</b> configures the message object, which can be a mailbox or FIFO. Refer to <a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a> for details.</p>
<p>The parameter <em>obj_idx</em> specifies the message object index. <br/>
The parameter <em>obj_cfg</em> configures the <b>object</b> with values as shown in the following table.</p>
<table class="cmtable">
<tr>
<th>Parameter <em>obj_cfg</em> </th><th>Object Configuration </th><th>supported when <a class="el" href="group__can__interface__gr.html#structARM__CAN__OBJ__CAPABILITIES">ARM_CAN_OBJ_CAPABILITIES</a> data field </th></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0aebbd0da59658805af30203be66d80249">ARM_CAN_OBJ_INACTIVE</a> </td><td>Deactivate object (default after <a class="el" href="group__can__interface__gr.html#gaa72ceb25ba67e279d7432404632deb44">ARM_CAN_Initialize</a>) </td><td><em>always supported</em> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a14780ac7274831ee94f427cbbf67c003">ARM_CAN_OBJ_RX</a> </td><td>Receive object; read received message with <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a>. </td><td><em>rx</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a3e20952f92855298cd0a39a7f47b3f3c">ARM_CAN_OBJ_TX</a> </td><td>Transmit object; send message with <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a>. </td><td><em>tx</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0ac5d28d180ea9e4328974ffcb8b928a0c">ARM_CAN_OBJ_RX_RTR_TX_DATA</a> </td><td><a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> Receive; when <b>RTR</b> is received data message is transmitted; set data message with <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a>. </td><td><em>rx_rtr_tx_data</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td><a class="el" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a396d7a6cd2353e1a2936405ace6417f5">ARM_CAN_OBJ_TX_RTR_RX_DATA</a> </td><td><a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> Transmit; a <b>RTR</b> is sent with <a class="el" href="group__can__interface__gr.html#ga0dcffd362b4093043442a030eaebbcfe">ARM_CAN_MessageSend</a> to trigger object reception; read received data message with <a class="el" href="group__can__interface__gr.html#gafc37084df5eab32f593c2744d35cf647">ARM_CAN_MessageRead</a>. </td><td><em>tx_rtr_rx_data</em> = <span class="XML-Token">1</span> </td></tr>
</table>
<p>When the <b>object</b> is deactivated, it is not used for data communication.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#ga4f9bc7088704483388e14872c9d5385d" title="Add or remove filter for message reception. ">ARM_CAN_ObjectSetFilter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga0dcffd362b4093043442a030eaebbcfe"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_MessageSend </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>obj_idx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a> *&#160;</td>
<td class="paramname"><em>msg_info</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint8_t *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send message on CAN bus. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">obj_idx</td><td>Object index </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">msg_info</td><td>Pointer to CAN message information </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to data buffer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of data bytes to send </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>value &gt;= 0 number of data bytes accepted to send </dd>
<dd>
value &lt; 0 <a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_CAN_MessageSend</b> sends a CAN message on the CAN bus, or sets data message that will be automatically returned upon RTR reception with matching CAN ID.</p>
<p>Only one message can be sent with a call to this function (for CAN up to <span class="XML-Token">8</span> bytes; for CAN FD up to <span class="XML-Token">64</span> bytes of data). A message transmission can be terminated with a call to the function <a class="el" href="group__can__interface__gr.html#ga8d9f0c5f03a8a81ab062b5aa57e5dea4">ARM_CAN_Control</a> with <em>control</em> = <a class="el" href="group__can__mode__ctrls.html#gae051a548bf785104a934908360529438">ARM_CAN_ABORT_MESSAGE_SEND</a>.</p>
<p>The parameter <em>obj_idx</em> specifies the message object index.</p>
<p>The parameter <em>msg_info</em> is a pointer to the structure <a class="el" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a>, which contains the following relevant data fields for sending message:</p>
<ul>
<li><em>id:</em> Identifier of the message; bit <span class="XML-Token">31</span> specifies if this is an <span class="XML-Token">11-bit</span> or <span class="XML-Token">29-bit</span> identifier.</li>
<li><em>rtr:</em> Specifies if Remote Transmission Request should be sent (<em>dlc</em> is used for number of requested bytes), otherwise the data message will be sent. Refer to <a class="el" href="group__can__interface__gr.html#Remote_Frame">Remote Frame</a> for details.</li>
<li><em>edl:</em> Specifies if Extended Data Length is used; for CAN FD, message can contain up to <span class="XML-Token">64</span> data bytes.</li>
<li><em>brs:</em> Specifies if Bit Rate Switching is to be used; for CAN FD, the bit rate can be increased during data phase.</li>
<li><em>dlc:</em> Data Length Code of requested data bytes when sending Remote Transmission Request.</li>
</ul>
<p>The parameter <em>data</em> is a pointer to the data buffer.<br/>
The parameter <em>size</em> is the number of data bytes to send.<br/>
The function returns the number of bytes accepted to be sent or <a class="el" href="group__execution__status.html#ga13c1123319c7b9a4735d63447f35116b">ARM_DRIVER_ERROR_BUSY</a> if the hardware is not ready to accept a new message for transmission.</p>
<p>When the message is sent, the callback function <a class="el" href="group__can__interface__gr.html#gabfcaeac9e2ca25936ba5a29f2d594e7e">ARM_CAN_SignalObjectEvent</a> is called signalling <a class="el" href="group__CAN__events.html#ga486f0f35ebc7e3b5931ee68b56703503">ARM_CAN_EVENT_SEND_COMPLETE</a> on specified object.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__can__interface__gr.html#can_filtering">CAN Message Filtering</a></dd></dl>
<p><b>Example:</b></p>
<div class="fragment"><div class="line">status = ptrCAN-&gt;ObjectConfigure(0, <a class="code" href="Driver__CAN_8h.html#gaa9488554de0575bc821c9f65213c4cd0a3e20952f92855298cd0a39a7f47b3f3c">ARM_CAN_OBJ_TX</a>);</div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
<div class="line"></div>
<div class="line">memset(&amp;tx_msg_info, 0, <span class="keyword">sizeof</span>(<a class="code" href="group__can__interface__gr.html#structARM__CAN__MSG__INFO">ARM_CAN_MSG_INFO</a>)); <span class="comment">// Clear transmit message structure</span></div>
<div class="line">tx_msg_info.<a class="code" href="group__can__interface__gr.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a> = <a class="code" href="group__can__identifer__ctrls.html#gae7d4efb6fb49e1ec47c2b12e22f37cae">ARM_CAN_EXTENDED_ID</a>(0x12345678U); <span class="comment">// Set ID of message</span></div>
<div class="line">data_buf[0] = <span class="charliteral">&#39;1&#39;</span>; data_buf[1] = <span class="charliteral">&#39;2&#39;</span>; <span class="comment">// Prepare data to transmit</span></div>
<div class="line">data_buf[2] = <span class="charliteral">&#39;3&#39;</span>; data_buf[3] = <span class="charliteral">&#39;4&#39;</span>;</div>
<div class="line">data_buf[4] = <span class="charliteral">&#39;5&#39;</span>; data_buf[5] = <span class="charliteral">&#39;6&#39;</span>;</div>
<div class="line">data_buf[6] = <span class="charliteral">&#39;7&#39;</span>; data_buf[7] = <span class="charliteral">&#39;8&#39;</span>;</div>
<div class="line">status = ptrCAN-&gt;MesageSend(0, &amp;tx_msg_info, data_buf, 8); <span class="comment">// Send message</span></div>
<div class="line"><span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a> ) { Error_Handler(); }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="gafc37084df5eab32f593c2744d35cf647"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t ARM_CAN_MessageRead </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>obj_idx</em>, </td>
</