xmclib/CMSIS/Documentation/SVD/html/elem_special.html

303 lines
20 KiB
HTML
Raw Normal View History

2024-10-17 17:09:59 +02:00
<!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>Special Elements</title>
<title>CMSIS-SVD: Special Elements</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-SVD
&#160;<span id="projectnumber">Version 1.3.3</span>
</div>
<div id="projectbrief">CMSIS System View Description</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 class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</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('elem_special.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>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="headertitle">
<div class="title">Special Elements </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This section describes elements that occur on various levels and specifies the general rules. Specific requirements are mentioned in the place where these elements occur.</p>
<ul>
<li><a class="el" href="elem_special.html#dimElementGroup_gr">dimElementGroup</a> - Elements that can be used to define arrays and lists in the code.</li>
<li><a class="el" href="elem_special.html#registerPropertiesGroup_gr">registerPropertiesGroup</a> - Register properties. Higher level definitions use as default values for lower level descriptions.</li>
</ul>
<p>&#160;</p>
<hr/>
<h1><a class="anchor" id="dimElementGroup_gr"></a>
dimElementGroup</h1>
<p>The elements below appear on various levels and can be used to define arrays and lists in the code. Single descriptions get duplicated automatically into an array or a list. The subsequent is true for all elements of type <em>dimableIdentifierType</em>.</p>
<ul>
<li>To create arrays, use the placeholder <em>[%s]</em> at the end of a <em>&lt;name&gt;</em> and <em>&lt;displayName&gt;</em>. <span style="color:red">Do not define <em>&lt;dimIndex&gt;</em> in this case!</span></li>
<li>To create lists, use the placeholder <em>%s</em> anywhere within or at the end of a <em>&lt;name&gt;</em> and <em>&lt;displayName&gt;</em>.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>Some of the <em>&lt;name&gt;</em> and <em>&lt;displayName&gt;</em> elements can use both placeholders (<em>[%s]</em>, <em>%s</em>), others just one. Refer to <a class="el" href="elem_peripherals.html#elem_peripheral">peripheral</a>, <a class="el" href="elem_registers.html#elem_register">register</a>, <a class="el" href="elem_registers.html#elem_cluster">cluster</a>, and <a class="el" href="elem_registers.html#elem_field">field</a> for details.</dd></dl>
<table class="cmtable" summary="dimElementGroup Description">
<tr>
<th style="white-space:nowrap">Parent Element </th><th colspan="3">Element Chain </th></tr>
<tr>
<td><a class="el" href="elem_peripherals.html#elem_peripheral">peripheral</a> </td><td colspan="3"><a class="el" href="elem_peripherals.html#elem_peripheral">/device/peripherals/peripheral element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_register">register</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_register">/device/peripherals/peripheral/registers/.../register element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_cluster">cluster</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_cluster">/device/pripherals/peripheral/registers/.../cluster element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_field">field</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_field">/device/peripherals/peripheral/registers/.../fields/field element</a> </td></tr>
<tr>
<th style="white-space:nowrap">Grouped Elements </th><th>Description </th><th>Type </th><th>Occurrence </th></tr>
<tr>
<td>dim </td><td>Defines the number of elements in an array or list. </td><td>scaledNonNegativeInteger </td><td>1..1 </td></tr>
<tr>
<td>dimIncrement </td><td>Specify the address increment between two neighboring array or list members in the address map. </td><td>scaledNonNegativeInteger </td><td>1..1 </td></tr>
<tr>
<td>dimIndex </td><td>Specify the strings that substitue the placeholder <em>%s</em> within <em>&lt;name&gt;</em> and <em>&lt;displayName&gt;</em>. By default, <em>&lt;dimIndex&gt;</em> is a value starting with <span class="XML-Token">0</span>. <br/>
<b>Remark:</b> Do not define <em>&lt;dimIndex&gt;</em> when using the placeholder <em>[%s]</em> in <em>&lt;name&gt;</em> or <em>&lt;displayName&gt;</em>. </td><td>dimIndexType </td><td>0..1 </td></tr>
<tr>
<td>dimName </td><td>Specify the name of the C-type structure. If not defined, then the entry in the <em>&lt;name&gt;</em> element is used. </td><td>identifierType </td><td>0..1 </td></tr>
<tr>
<td><a class="el" href="elem_special.html#elem_dimArrayIndex">dimArrayIndex</a> </td><td>Grouping element to create enumerations in the header file. </td><td>dimArrayIndexType </td><td>0..1 </td></tr>
</table>
<p><b>Example:</b> The examples creates definitions for registers.</p>
<div class="fragment"><div class="line">...</div>
<div class="line">&lt;<span class="keyword">register</span>&gt;</div>
<div class="line"> &lt;dim&gt;6&lt;/dim&gt; </div>
<div class="line"> &lt;dimIncrement&gt;4&lt;/dimIncrement&gt; </div>
<div class="line"> &lt;dimIndex&gt;A,B,C,D,E,Z&lt;/dimIndex&gt; </div>
<div class="line"> &lt;name&gt;GPIO_%s_CTRL&lt;/name&gt; </div>
<div class="line">...</div>
<div class="line">&lt;/<span class="keyword">register</span>&gt;</div>
</div><!-- fragment --><p>The code above generates the list: =&gt; GPIO_A_CTRL, GPIO_B_CTRL, GPIO_C_CTRL, GPIO_D_CTRL, GPIO_E_CTRL, GPIO_Z_CTRL</p>
<div class="fragment"><div class="line">...</div>
<div class="line">&lt;<span class="keyword">register</span>&gt;</div>
<div class="line"> &lt;dim&gt;4&lt;/dim&gt; </div>
<div class="line"> &lt;dimIncrement&gt;4&lt;/dimIncrement&gt; </div>
<div class="line"> &lt;dimIndex&gt;3-6&lt;/dimIndex&gt; </div>
<div class="line"> &lt;name&gt;IRQ%s&lt;/name&gt; </div>
<div class="line">...</div>
<div class="line">&lt;/<span class="keyword">register</span>&gt;</div>
</div><!-- fragment --><p>The example above generates the list: =&gt; IRQ3, IRQ4, IRQ5, IRQ6</p>
<div class="fragment"><div class="line">...</div>
<div class="line">&lt;<span class="keyword">register</span>&gt;</div>
<div class="line"> &lt;dim&gt;4&lt;/dim&gt; </div>
<div class="line"> &lt;dimIncrement&gt;4&lt;/dimIncrement&gt; </div>
<div class="line"> &lt;name&gt;MyArr[%s]&lt;/name&gt; </div>
<div class="line">...</div>
<div class="line">&lt;/<span class="keyword">register</span>&gt;</div>
</div><!-- fragment --><p>The example above generates the array: =&gt; MyArr[4]</p>
<p>&#160;</p>
<hr/>
<h2><a class="anchor" id="elem_dimArrayIndex"></a>
/device/peripherals/peripheral/.../dimArrayIndex element</h2>
<p>This information is used for generating an <em>enum</em> in the device header file. The debugger may use this information to display the identifier string as well as the description. Just like symbolic constants making source code more readable, the system view in the debugger becomes more instructive.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">...</div>
<div class="line">&lt;dimArrayIndex&gt;</div>
<div class="line"> &lt;headerEnumName&gt;FSMC_EnumArray&lt;/headerEnumName&gt;</div>
<div class="line"> &lt;enumeratedValue&gt;</div>
<div class="line"> &lt;name&gt;UART0&lt;/name&gt;</div>
<div class="line"> &lt;description&gt;UART0 Peripheral&lt;/description&gt;</div>
<div class="line"> &lt;value&gt;0&lt;/value&gt;</div>
<div class="line"> &lt;/enumeratedValue&gt;</div>
<div class="line"> &lt;enumeratedValue&gt;</div>
<div class="line"> &lt;name&gt;TIMER0&lt;/name&gt;</div>
<div class="line"> &lt;description&gt;TIMER0 Peripheral&lt;/description&gt;</div>
<div class="line"> &lt;value&gt;1&lt;/value&gt;</div>
<div class="line"> &lt;/enumeratedValue&gt;</div>
<div class="line">&lt;/dimArrayIndex&gt;</div>
<div class="line">...</div>
</div><!-- fragment --><p><a class="anchor" id="elem_dimArrayIndex_sc"></a><b>/device/peripherals/peripheral/.../dimArrayIndex</b> </p>
<table class="cmtable" summary="dimArrayIndex Table">
<tr>
<th style="white-space:nowrap">Parent Element </th><th colspan="3">Element Chain </th></tr>
<tr>
<td><a class="el" href="elem_peripherals.html#elem_peripheral">peripheral</a> </td><td colspan="3"><a class="el" href="elem_peripherals.html#elem_peripheral">/device/peripherals/peripheral element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_register">register</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_register">/device/peripherals/peripheral/registers/.../register element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_cluster">cluster</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_cluster">/device/pripherals/peripheral/registers/.../cluster element</a> </td></tr>
<tr>
<th style="white-space:nowrap">Child Elements </th><th>Description </th><th>Type </th><th>Occurrence </th></tr>
<tr>
<td>headerEnumName </td><td><p class="starttd">Specify the base name of enumerations. Overwrites the hierarchical enumeration type in the device header file. User is responsible for uniqueness across description. The headerfile generator uses the name of a peripheral or cluster as the base name for enumeration types. If <em>&lt;headerEnumName&gt;</em> element is specfied, then this string is used.</p>
<p class="endtd"></p>
</td><td>identifierType </td><td>0..1 </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_enumeratedValue">enumeratedValue</a> </td><td>Specify the values contained in the enumeration. </td><td>enumeratedValueType </td><td>1..* </td></tr>
</table>
<p>&#160;</p>
<hr/>
<h1><a class="anchor" id="registerPropertiesGroup_gr"></a>
registerPropertiesGroup</h1>
<p>The following elements are available on various levels. Element values defined on a lower level overwrite element values defined on a more general level. For example, <em>&lt;register&gt;</em>.<em>&lt;size&gt;</em> overwrites <em>&lt;peripheral&gt;</em>.<em>&lt;size&gt;</em>. Elements not defined on a more general level, must be defined at <em>&lt;register&gt;</em> level at the latest.</p>
<p>Special requirements are described on the level where the element occurs. Click on the parent element in the table below for details.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line">&lt;device schemaVersion=<span class="stringliteral">&quot;1.3&quot;</span> xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> xs:noNamespaceSchemaLocation=<span class="stringliteral">&quot;CMSIS-SVD.xsd&quot;</span>&gt;</div>
<div class="line"> &lt;name&gt;ARM_Cortex_M3&lt;/name&gt;</div>
<div class="line"> &lt;version&gt;0.1&lt;/version&gt;</div>
<div class="line"> &lt;description&gt;ARM Cortex-M3 based Microcontroller demonstration device&lt;/description&gt;</div>
<div class="line"> &lt;addressUnitBits&gt;8&lt;/addressUnitBits&gt;</div>
<div class="line"> &lt;width&gt;32&lt;/width&gt;</div>
<div class="line"> &lt;size&gt;32&lt;/size&gt;</div>
<div class="line"> &lt;access&gt;read-write&lt;/access&gt;</div>
<div class="line"> &lt;protection&gt;s&lt;/protection&gt;</div>
<div class="line"> ...</div>
<div class="line"> &lt;peripherals&gt;</div>
<div class="line"> ...</div>
<div class="line"> &lt;/peripherals&gt;</div>
<div class="line">&lt;/device&gt;</div>
</div><!-- fragment --><p>Default settings have been defined for <em>&lt;width&gt;</em>, <em>&lt;size&gt;</em>, <em>&lt;access&gt;</em>, and <em>&lt;protection&gt;</em> on device level. These settings can be refined on subsequent levels.</p>
<p><a class="anchor" id="elem_register_sc"></a><b>Register Properties</b> </p>
<table class="cmtable" summary="Register Properties Group Elements">
<tr>
<th style="white-space:nowrap">Parent Element </th><th colspan="3">Element Chain </th></tr>
<tr>
<td><a class="el" href="elem_device.html">device</a> </td><td colspan="3"><a class="el" href="elem_device.html">/device element</a> </td></tr>
<tr>
<td><a class="el" href="elem_peripherals.html#elem_peripheral">peripheral</a> </td><td colspan="3"><a class="el" href="elem_peripherals.html#elem_peripheral">/device/peripherals/peripheral element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_register">register</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_register">/device/peripherals/peripheral/registers/.../register element</a> </td></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_cluster">cluster</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_cluster">/device/pripherals/peripheral/registers/.../cluster element</a> </td></tr>
<tr>
<th>&#160; </th><th colspan="3"><span class="XML-Token">Below: Parent elements that have a reference to a single element of this block</span> </th></tr>
<tr>
<td><a class="el" href="elem_registers.html#elem_field">field</a> </td><td colspan="3"><a class="el" href="elem_registers.html#elem_field">/device/peripherals/peripheral/registers/.../fields/field element</a> (only for element <em>&lt;access&gt;</em>) </td></tr>
<tr>
<td><a class="el" href="elem_cpu.html#elem_sauRegionsConfig">sauRegionsConfig</a> </td><td colspan="3"><a class="el" href="elem_cpu.html#elem_sauRegionsConfig">/device/cpu/sauRegionsConfig element</a> (element <em>&lt;protection&gt;</em> for attribute <em>&lt;protectionWhenDisabled&gt;</em>) </td></tr>
<tr>
<td><a class="el" href="elem_peripherals.html#elem_addressBlock">addressBlock</a> </td><td colspan="3"><a class="el" href="elem_peripherals.html#elem_addressBlock">/device/peripherals/peripheral/addressBlock element</a> (only for element <em>&lt;protection&gt;</em>) </td></tr>
<tr>
<th style="white-space:nowrap">Elements </th><th>Description </th><th>Type </th><th>Occurrence </th></tr>
<tr>
<td>size </td><td>Define the default bit-width of any device register (implicit inheritance). The value can be redefined on any lower level using the <em>&lt;size&gt;</em> element there. </td><td>scaledNonNegativeInteger </td><td>0..1 </td></tr>
<tr>
<td><a class="anchor" id="elem_access"></a>access </td><td>Define access rights. Access rights can be redefined at any lower level. Use one of the following predefined values:<ul>
<li><span class="XML-Token">read-only</span>: Read access is permitted. Write operations have an undefined result.</li>
<li><span class="XML-Token">write-only</span>: Read operations have an undefined result. Write access is permitted.</li>
<li><span class="XML-Token">read-write</span>: Read and write accesses are permitted. Writes affect the state of the register and reads return the register value.</li>
<li><span class="XML-Token">writeOnce</span>: Read operations have an undefined results. Only the first write after reset has an effect.</li>
<li><span class="XML-Token">read-writeOnce</span>: Read access is always permitted. Only the first write access after a reset will have an effect on the content. Other write operations have an undefined result. </li>
</ul>
</td><td>accessType </td><td>0..1 </td></tr>
<tr>
<td><a class="anchor" id="elem_protection"></a>protection </td><td>Specify the security privilege to access an address region. This information is relevant for the programmer as well as the debugger when no universal access permissions have been granted. If no specific information is provided, an address region is accessible in any mode. The following values can be used to protect accesses by the programmer or debugger:<ul>
<li><span class="XML-Token">"s"</span> - secure permission required for access</li>
<li><span class="XML-Token">"n"</span> - non-secure or secure permission required for access</li>
<li><span class="XML-Token">"p"</span> - privileged permission required for access </li>
</ul>
</td><td>protectionStringType </td><td>0..1 </td></tr>
<tr>
<td>resetValue </td><td>Define the default value for all registers at RESET. The value can be redefined on any lower level using the <em>&lt;resetValue&gt;</em> element there. The actual reset value is calculated from the <em>&lt;resetValue&gt;</em> and the <em>&lt;resetMask&gt;</em>. The mask is used to specify bits with an undefined reset value. </td><td>scaledNonNegativeInteger </td><td>0..1 </td></tr>
<tr>
<td>resetMask </td><td>Identify register bits that have a defined reset value. These bit positions are set to <span class="XML-Token">1</span>. Bit positions with an undefined reset value are set to <span class="XML-Token">0</span>. </td><td>scaledNonNegativeInteger </td><td>0..1 </td></tr>
</table>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="svd_Format_pg.html">SVD Description (*.svd) Format</a></li>
<li class="footer">Generated on Wed Feb 8 2017 10:21:05 for CMSIS-SVD by ARM Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
-->
</li>
</ul>
</div>
</body>
</html>