1 <!-- HTML header for doxygen 1.9.6-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>CMSIS-Core (Cortex-A): Device Header File <device.h></title>
9 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
12 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
13 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="jquery.js"></script>
15 <script type="text/javascript" src="dynsections.js"></script>
16 <script type="text/javascript" src="printComponentTabs.js"></script>
17 <script type="text/javascript" src="footer.js"></script>
18 <script type="text/javascript" src="navtree.js"></script>
19 <link href="navtree.css" rel="stylesheet" type="text/css"/>
20 <script type="text/javascript" src="resize.js"></script>
21 <script type="text/javascript" src="navtreedata.js"></script>
22 <script type="text/javascript" src="navtree.js"></script>
23 <link href="search/search.css" rel="stylesheet" type="text/css"/>
24 <script type="text/javascript" src="search/searchdata.js"></script>
25 <script type="text/javascript" src="search/search.js"></script>
26 <script type="text/javascript">
27 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
28 $(document).ready(function() { init_search(); });
31 <script type="text/javascript" src="darkmode_toggle.js"></script>
32 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
33 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
34 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
35 <link href="version.css" rel="stylesheet" type="text/css" />
36 <script type="text/javascript" src="../../version.js"></script>
39 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
41 <table cellspacing="0" cellpadding="0">
43 <tr style="height: 55px;">
44 <td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
45 <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
46 <div id="projectname">CMSIS-Core (Cortex-A)
47  <span id="projectnumber"><script type="text/javascript">
49 writeHeader.call(this);
50 writeVersionDropdown.call(this, "CMSIS-Core (Cortex-A)");
55 <div id="projectbrief">CMSIS-Core support for Cortex-A processor-based devices</div>
57 <td> <div id="MSearchBox" class="MSearchBoxInactive">
59 <span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
60 <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
61 onfocus="searchBox.OnSearchFieldFocus(true)"
62 onblur="searchBox.OnSearchFieldFocus(false)"
63 onkeyup="searchBox.OnSearchFieldChange(event)"/>
64 </span><span class="right">
65 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
69 <!--END !PROJECT_NAME-->
74 <!-- end header part -->
75 <div id="CMSISnav" class="tabs1">
77 <script type="text/javascript">
78 writeComponentTabs.call(this);
82 <script type="text/javascript">
83 writeSubComponentTabs.call(this);
85 <!-- Generated by Doxygen 1.9.6 -->
86 <script type="text/javascript">
87 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
88 var searchBox = new SearchBox("searchBox", "search/",'.html');
92 <div id="side-nav" class="ui-resizable side-nav-resizable">
94 <div id="nav-tree-contents">
95 <div id="nav-sync" class="sync"></div>
98 <div id="splitbar" style="-moz-user-select:none;"
99 class="ui-resizable-handle">
102 <script type="text/javascript">
103 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
104 $(document).ready(function(){initNavTree('device_h_pg.html',''); initResizable(); });
107 <div id="doc-content">
108 <!-- window showing the filter options -->
109 <div id="MSearchSelectWindow"
110 onmouseover="return searchBox.OnSearchSelectShow()"
111 onmouseout="return searchBox.OnSearchSelectHide()"
112 onkeydown="return searchBox.OnSearchSelectKey(event)">
115 <!-- iframe showing the search results (closed by default) -->
116 <div id="MSearchResultsWindow">
117 <div id="MSearchResults">
120 <div id="SRResults"></div>
121 <div class="SRStatus" id="Loading">Loading...</div>
122 <div class="SRStatus" id="Searching">Searching...</div>
123 <div class="SRStatus" id="NoMatches">No Matches</div>
129 <div><div class="header">
130 <div class="headertitle"><div class="title">Device Header File <device.h> </div></div>
132 <div class="contents">
133 <div class="textblock"><p>The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> contains the following sections that are device specific:</p><ul>
134 <li><a class="el" href="device_h_pg.html#irqn_defs">Interrupt Number Definition</a> provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.</li>
135 <li><a class="el" href="device_h_pg.html#config_perifs">Configuration of the Processor and Core Peripherals</a> reflect the features of the device.</li>
136 <li><a class="el" href="device_h_pg.html#access_perifs">Device Peripheral Access Layer</a> definitions for the <a class="el" href="group__peripheral__gr.html">Peripheral Access</a> to all device peripherals. It contains all data structures and the address mapping for device-specific peripherals.</li>
137 <li><b>Access Functions for Peripherals (optioal)</b> provide additional helper functions for peripherals that are useful for programming of these peripherals. Access Functions may be provided as inline functions or can be extern references to a device-specific library provided by the silicon vendor.</li>
139 <h1><a class="anchor" id="irqn_defs"></a>
140 Interrupt Number Definition</h1>
141 <h1><a class="anchor" id="config_perifs"></a>
142 Configuration of the Processor and Core Peripherals</h1>
143 <h1><a class="anchor" id="access_perifs"></a>
144 Device Peripheral Access Layer</h1>
145 <p>The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> contains the following sections that are device specific:</p><ul>
146 <li><a class="el" href="device_h_pg.html#irqn_defs">Interrupt Number Definition</a> provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.</li>
147 <li><a class="el" href="device_h_pg.html#config_perifs">Configuration of the Processor and Core Peripherals</a> reflect the features of the device.</li>
148 <li><a class="el" href="device_h_pg.html#access_perifs">Device Peripheral Access Layer</a> definitions for the <a class="el" href="group__peripheral__gr.html">Peripheral Access</a> to all device peripherals. It contains all data structures and the address mapping for device-specific peripherals.</li>
149 <li><b>Access Functions for Peripherals (optional)</b> provide additional helper functions for peripherals that are useful for programming of these peripherals. Access Functions may be provided as inline functions or can be extern references to a device-specific library provided by the silicon vendor.</li>
151 <p><a href="modules.html"><b>Reference</b> </a> describes the standard features and functions of the <a class="el" href="device_h_pg.html">Device Header File <device.h></a> in detail.</p>
152 <h1><a class="anchor" id="interrupt_number_sec"></a>
153 Interrupt Number Definition</h1>
154 <p><a class="el" href="device_h_pg.html">Device Header File <device.h></a> contains the enumeration IRQn_Type that defines all exceptions and interrupts of the device. For devices implementing an Arm GIC these are defined as:</p><ul>
155 <li>IRQn 0-15 represents software generated interrupts (SGI), local to each processor core.</li>
156 <li>IRQn 16-31 represents private peripheral interrupts (PPI), local to each processor core.</li>
157 <li>IRQn 32-1019 represents shared peripheral interrupts (SPI), routable to all processor cores.</li>
158 <li>IRQn 1020-1023 represents special interrupts, refer to the GIC Architecture Specification.</li>
160 <p><b>Example:</b> </p>
161 <p>The following example shows the extension of the interrupt vector table for Cortex-A9 class device.</p>
162 <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">enum</span> IRQn</div>
163 <div class="line">{</div>
164 <div class="line"><span class="comment">/****** SGI Interrupts Numbers ****************************************/</span></div>
165 <div class="line"> SGI0_IRQn = 0, </div>
166 <div class="line"> SGI1_IRQn = 1,</div>
167 <div class="line"> SGI2_IRQn = 2,</div>
168 <div class="line"> : :</div>
169 <div class="line"> SGI15_IRQn = 15,</div>
170 <div class="line"> </div>
171 <div class="line"><span class="comment">/****** Cortex-A9 Processor Exceptions Numbers ****************************************/</span></div>
172 <div class="line"> GlobalTimer_IRQn = 27, </div>
173 <div class="line"> PrivTimer_IRQn = 29, </div>
174 <div class="line"> PrivWatchdog_IRQn = 30, </div>
175 <div class="line"><span class="comment">/****** Platform Exceptions Numbers ***************************************************/</span></div>
176 <div class="line"> Watchdog_IRQn = 32, </div>
177 <div class="line"> Timer0_IRQn = 34, </div>
178 <div class="line"> Timer1_IRQn = 35, </div>
179 <div class="line"> RTClock_IRQn = 36, </div>
180 <div class="line"> UART0_IRQn = 37, </div>
181 <div class="line"> : :</div>
182 <div class="line"> : :</div>
183 <div class="line">} IRQn_Type;</div>
184 </div><!-- fragment --><h1><a class="anchor" id="core_config_sect"></a>
185 Configuration of the Processor and Core Peripherals</h1>
186 <p>The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> configures the Cortex-A processor and the core peripherals with <em>#defines</em> that are set prior to including the file <b>core_<cpu>.h</b>.</p>
187 <p>The following tables list the <em>#defines</em> along with the possible values for each processor core. If these <em>#defines</em> are missing default values are used.</p>
188 <table class="cmtable">
190 <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
192 <td>__CM0_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
194 <td>__CORTEX_A </td><td>5, 7, 9 </td><td>(n/a) </td><td>Core type number </td></tr>
196 <td>__FPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if an FPU is present or not </td></tr>
198 <td>__GIC_PRESENT </td><td>0 ..1 </td><td>Defines if an GIC is present or not </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
200 <td>__TIM_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a private timer is present or not </td></tr>
202 <td>__L2C_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a level 2 cache controller is present or not </td></tr>
204 <p><b>Example</b> </p>
205 <p>The following code exemplifies the configuration of the Cortex-A9 Processor and Core Peripherals.</p>
206 <div class="fragment"><div class="line"><span class="preprocessor">#define __CA_REV 0x0000U </span></div>
207 <div class="line"><span class="preprocessor">#define __CORTEX_A 9U </span></div>
208 <div class="line"><span class="preprocessor">#define __FPU_PRESENT 1U </span></div>
209 <div class="line"><span class="preprocessor">#define __GIC_PRESENT 1U </span></div>
210 <div class="line"><span class="preprocessor">#define __TIM_PRESENT 0U </span></div>
211 <div class="line"><span class="preprocessor">#define __L2C_PRESENT 0U </span></div>
212 <div class="line">:</div>
213 <div class="line">:</div>
214 <div class="line"><span class="preprocessor">#include "<a class="code" href="core__ca_8h.html">core_ca.h</a>"</span> <span class="comment">/* Cortex-A processor and core peripherals */</span></div>
215 <div class="ttc" id="acore__ca_8h_html"><div class="ttname"><a href="core__ca_8h.html">core_ca.h</a></div><div class="ttdoc">CMSIS Cortex-A Core Peripheral Access Layer Header File.</div></div>
216 </div><!-- fragment --><h1><a class="anchor" id="core_version_sect"></a>
217 CMSIS Version and Processor Information</h1>
218 <p>Defines in the core_<em>cpu</em>.h file identify the version of the CMSIS-Core-A and the processor used. The following shows the defines in the various core_<em>cpu</em>.h files that may be used in the <a class="el" href="device_h_pg.html">Device Header File <device.h></a> to verify a minimum version or ensure that the right processor core is used.</p>
219 <div class="fragment"><div class="line"><span class="preprocessor">#define __CA_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS Core main version */</span><span class="preprocessor"></span></div>
220 <div class="line"><span class="preprocessor">#define __CA_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS Core sub version */</span><span class="preprocessor"></span></div>
221 <div class="line"><span class="preprocessor">#define __CA_CMSIS_VERSION ((__CA_CMSIS_VERSION_MAIN << 16U) | \</span></div>
222 <div class="line"><span class="preprocessor"> __CA_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS Core version number */</span><span class="preprocessor"></span></div>
223 </div><!-- fragment --><h1><a class="anchor" id="device_access"></a>
224 Device Peripheral Access Layer</h1>
225 <p>The <a class="el" href="device_h_pg.html">Device Header File <device.h></a> contains for each peripheral:</p><ul>
226 <li>Register Layout Typedef</li>
227 <li>Base Address</li>
228 <li>Access Definitions</li>
230 <p>The section <a class="el" href="group__peripheral__gr.html">Peripheral Access</a> shows examples for peripheral definitions.</p>
231 <h1><a class="anchor" id="device_h_sec"></a>
232 Device.h Template File</h1>
233 <p>The silicon vendor needs to extend the Device.h template file with the CMSIS features described above. In addition the <a class="el" href="device_h_pg.html">Device Header File <device.h></a> may contain functions to access device-specific peripherals. The <a class="el" href="system_c_pg.html#system_Device_h_sec">system_Device.h Template File</a> which is provided as part of the CMSIS specification is shown below.</p>
234 <pre class="fragment"></pre> </div></div><!-- contents -->
235 </div><!-- PageDoc -->
236 </div><!-- doc-content -->
237 <!-- start footer part -->
238 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
241 <script type="text/javascript">
243 writeFooter.call(this);