device_h_pg.html 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <title>Device Header File &lt;device.h&gt;</title>
  7. <title>CMSIS-Core (Cortex-M): Device Header File &lt;device.h&gt;</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <link href="cmsis.css" rel="stylesheet" type="text/css" />
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <script type="text/javascript" src="printComponentTabs.js"></script>
  13. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  14. <script type="text/javascript" src="resize.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. $(document).ready(initResizable);
  18. $(window).load(resizeHeight);
  19. </script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/search.js"></script>
  22. <script type="text/javascript">
  23. $(document).ready(function() { searchBox.OnSelectItem(0); });
  24. </script>
  25. </head>
  26. <body>
  27. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  28. <div id="titlearea">
  29. <table cellspacing="0" cellpadding="0">
  30. <tbody>
  31. <tr style="height: 46px;">
  32. <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  33. <td style="padding-left: 0.5em;">
  34. <div id="projectname">CMSIS-Core (Cortex-M)
  35. &#160;<span id="projectnumber">Version 5.2.0</span>
  36. </div>
  37. <div id="projectbrief">CMSIS-Core support for Cortex-M processor-based devices</div>
  38. </td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. <!-- end header part -->
  44. <div id="CMSISnav" class="tabs1">
  45. <ul class="tablist">
  46. <script type="text/javascript">
  47. <!--
  48. writeComponentTabs.call(this);
  49. //-->
  50. </script>
  51. </ul>
  52. </div>
  53. <!-- Generated by Doxygen 1.8.6 -->
  54. <script type="text/javascript">
  55. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  56. </script>
  57. <div id="navrow1" class="tabs">
  58. <ul class="tablist">
  59. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  60. <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
  61. <li><a href="modules.html"><span>Reference</span></a></li>
  62. <li>
  63. <div id="MSearchBox" class="MSearchBoxInactive">
  64. <span class="left">
  65. <img id="MSearchSelect" src="search/mag_sel.png"
  66. onmouseover="return searchBox.OnSearchSelectShow()"
  67. onmouseout="return searchBox.OnSearchSelectHide()"
  68. alt=""/>
  69. <input type="text" id="MSearchField" value="Search" accesskey="S"
  70. onfocus="searchBox.OnSearchFieldFocus(true)"
  71. onblur="searchBox.OnSearchFieldFocus(false)"
  72. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  73. </span><span class="right">
  74. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  75. </span>
  76. </div>
  77. </li>
  78. </ul>
  79. </div>
  80. </div><!-- top -->
  81. <div id="side-nav" class="ui-resizable side-nav-resizable">
  82. <div id="nav-tree">
  83. <div id="nav-tree-contents">
  84. <div id="nav-sync" class="sync"></div>
  85. </div>
  86. </div>
  87. <div id="splitbar" style="-moz-user-select:none;"
  88. class="ui-resizable-handle">
  89. </div>
  90. </div>
  91. <script type="text/javascript">
  92. $(document).ready(function(){initNavTree('device_h_pg.html','');});
  93. </script>
  94. <div id="doc-content">
  95. <!-- window showing the filter options -->
  96. <div id="MSearchSelectWindow"
  97. onmouseover="return searchBox.OnSearchSelectShow()"
  98. onmouseout="return searchBox.OnSearchSelectHide()"
  99. onkeydown="return searchBox.OnSearchSelectKey(event)">
  100. <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>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>
  101. <!-- iframe showing the search results (closed by default) -->
  102. <div id="MSearchResultsWindow">
  103. <iframe src="javascript:void(0)" frameborder="0"
  104. name="MSearchResults" id="MSearchResults">
  105. </iframe>
  106. </div>
  107. <div class="header">
  108. <div class="headertitle">
  109. <div class="title">Device Header File &lt;device.h&gt; </div> </div>
  110. </div><!--header-->
  111. <div class="contents">
  112. <div class="textblock"><p>The <a class="el" href="device_h_pg.html">Device Header File &lt;device.h&gt;</a> contains the following sections that are device specific:</p>
  113. <ul>
  114. <li><a class="el" href="device_h_pg.html#interrupt_number_sec">Interrupt Number Definition</a> provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.</li>
  115. <li><a class="el" href="device_h_pg.html#core_config_sect">Configuration of the Processor and Core Peripherals</a> reflect the features of the device.</li>
  116. <li><a class="el" href="device_h_pg.html#device_access">Device Peripheral Access Layer</a> provides 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>
  117. <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>
  118. </ul>
  119. <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 &lt;device.h&gt;</a> in detail.</p>
  120. <h1><a class="anchor" id="interrupt_number_sec"></a>
  121. Interrupt Number Definition</h1>
  122. <p><a class="el" href="device_h_pg.html">Device Header File &lt;device.h&gt;</a> contains the enumeration <a class="el" href="group__NVIC__gr.html#ga7e1129cd8a196f4284d41db3e82ad5c8">IRQn_Type</a> that defines all exceptions and interrupts of the device.</p>
  123. <ul>
  124. <li>Negative IRQn values represent processor core exceptions (internal interrupts).</li>
  125. <li>Positive IRQn values represent device-specific exceptions (external interrupts). The first device-specific interrupt has the IRQn value 0. The IRQn values needs extension to reflect the device-specific interrupt vector table in the <a class="el" href="startup_s_pg.html">Startup File startup_&lt;device&gt;.s</a>.</li>
  126. </ul>
  127. <p><b>Example:</b> </p>
  128. <p>The following example shows the extension of the interrupt vector table for the LPC1100 device family.</p>
  129. <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">enum</span> IRQn</div>
  130. <div class="line">{</div>
  131. <div class="line"><span class="comment">/****** Cortex-M0 Processor Exceptions Numbers ***************************************************/</span></div>
  132. <div class="line"> <a class="code" href="group__NVIC__gr.html#gga7e1129cd8a196f4284d41db3e82ad5c8ade177d9c70c89e084093024b932a4e30">NonMaskableInt_IRQn</a> = -14, </div>
  133. <div class="line"> <a class="code" href="group__NVIC__gr.html#gga7e1129cd8a196f4284d41db3e82ad5c8ab1a222a34a32f0ef5ac65e714efc1f85">HardFault_IRQn</a> = -13, </div>
  134. <div class="line"> <a class="code" href="group__NVIC__gr.html#gga7e1129cd8a196f4284d41db3e82ad5c8a4ce820b3cc6cf3a796b41aadc0cf1237">SVCall_IRQn</a> = -5, </div>
  135. <div class="line"> <a class="code" href="group__NVIC__gr.html#gga7e1129cd8a196f4284d41db3e82ad5c8a03c3cc89984928816d81793fc7bce4a2">PendSV_IRQn</a> = -2, </div>
  136. <div class="line"> <a class="code" href="group__NVIC__gr.html#gga7e1129cd8a196f4284d41db3e82ad5c8a6dbff8f8543325f3474cbae2446776e7">SysTick_IRQn</a> = -1, </div>
  137. <div class="line"><span class="comment">/****** LPC11xx/LPC11Cxx Specific Interrupt Numbers **********************************************/</span></div>
  138. <div class="line"> WAKEUP0_IRQn = 0, </div>
  139. <div class="line"> WAKEUP1_IRQn = 1, </div>
  140. <div class="line"> WAKEUP2_IRQn = 2,</div>
  141. <div class="line"> : :</div>
  142. <div class="line"> : :</div>
  143. <div class="line"> EINT1_IRQn = 30, </div>
  144. <div class="line"> EINT0_IRQn = 31, </div>
  145. <div class="line">} <a class="code" href="group__NVIC__gr.html#ga7e1129cd8a196f4284d41db3e82ad5c8">IRQn_Type</a>;</div>
  146. </div><!-- fragment --><h1><a class="anchor" id="core_config_sect"></a>
  147. Configuration of the Processor and Core Peripherals</h1>
  148. <p>The <a class="el" href="device_h_pg.html">Device Header File &lt;device.h&gt;</a> configures the Cortex-M or SecurCore processor and the core peripherals with <em>#defines</em> that are set prior to including the file <b>core_&lt;cpu&gt;.h</b>.</p>
  149. <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>
  150. <p><b>core_cm0.h</b> </p>
  151. <table class="cmtable">
  152. <tr>
  153. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  154. <tr>
  155. <td>__CM0_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  156. <tr>
  157. <td>__NVIC_PRIO_BITS </td><td>2 </td><td>2 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  158. <tr>
  159. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  160. </table>
  161. <p><b>core_cm0plus.h</b> </p>
  162. <table class="cmtable">
  163. <tr>
  164. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  165. <tr>
  166. <td>__CM0PLUS_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  167. <tr>
  168. <td>__NVIC_PRIO_BITS </td><td>2 </td><td>2 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  169. <tr>
  170. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  171. </table>
  172. <p><b>core_cm3.h</b> </p>
  173. <table class="cmtable">
  174. <tr>
  175. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  176. <tr>
  177. <td>__CM3_REV </td><td>0x0101 | 0x0200 </td><td>0x0200 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  178. <tr>
  179. <td>__NVIC_PRIO_BITS </td><td>2 .. 8 </td><td>4 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  180. <tr>
  181. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  182. <tr>
  183. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  184. </table>
  185. <p><b>core_cm4.h</b> </p>
  186. <table class="cmtable">
  187. <tr>
  188. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  189. <tr>
  190. <td>__CM4_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  191. <tr>
  192. <td>__NVIC_PRIO_BITS </td><td>2 .. 8 </td><td>4 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  193. <tr>
  194. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  195. <tr>
  196. <td>__FPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a FPU is present or not </td></tr>
  197. <tr>
  198. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  199. </table>
  200. <p><b>core_cm7.h</b> </p>
  201. <table class="cmtable">
  202. <tr>
  203. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  204. <tr>
  205. <td>__CM7_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  206. <tr>
  207. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  208. <tr>
  209. <td>__NVIC_PRIO_BITS </td><td>2 .. 8 </td><td>4 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  210. <tr>
  211. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  212. <tr>
  213. <td>__FPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a FPU is present or not. See <b>__FPU_DP</b> description below. </td></tr>
  214. <tr>
  215. <td>__FPU_DP </td><td>0 .. 1 </td><td>0 </td><td>The combination of the defines <b>__FPU_PRESENT</b> and <b>__FPU_DP</b> determine the whether the FPU is with single or double precision as shown in the table below. <br/>
  216. <br/>
  217. <table class="cmtable">
  218. <tr bgcolor="cyan">
  219. <td><b>__FPU_PRESENT</b> </td><td><b>__FPU_DP</b> </td><td><b>Description</b> </td></tr>
  220. <tr>
  221. <td align="center">0 </td><td align="center"><em>ignored</em> </td><td>Processor has no FPU. The value set for <b>__FPU_DP</b> has no influence. </td></tr>
  222. <tr>
  223. <td align="center">1 </td><td align="center">0 </td><td>Processor with FPU with single precision. The file <b>ARMCM7_SP.h</b> has preconfigured settings for this combination. </td></tr>
  224. <tr>
  225. <td align="center">1 </td><td align="center">1 </td><td>Processor with FPU with double precision. The file <b>ARMCM7_DP.h</b> has preconfigured settings for this combination. </td></tr>
  226. </table>
  227. </td></tr>
  228. <tr>
  229. <td>__ICACHE_PRESENT </td><td>0 .. 1 </td><td>1 </td><td>Instruction Chache present or not </td></tr>
  230. <tr>
  231. <td>__DCACHE_PRESENT </td><td>0 .. 1 </td><td>1 </td><td>Data Chache present or not </td></tr>
  232. <tr>
  233. <td>__DTCM_PRESENT </td><td>0 .. 1 </td><td>1 </td><td>Data Tightly Coupled Memory is present or not </td></tr>
  234. </table>
  235. <p><b>core_sc000.h</b> </p>
  236. <table class="cmtable">
  237. <tr>
  238. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  239. <tr>
  240. <td>__SC000_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  241. <tr>
  242. <td>__NVIC_PRIO_BITS </td><td>2 </td><td>2 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  243. <tr>
  244. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  245. <tr>
  246. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  247. </table>
  248. <p><b>core_sc300.h</b> </p>
  249. <table class="cmtable">
  250. <tr>
  251. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  252. <tr>
  253. <td>__SC300_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  254. <tr>
  255. <td>__NVIC_PRIO_BITS </td><td>2 .. 8 </td><td>4 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  256. <tr>
  257. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  258. <tr>
  259. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  260. </table>
  261. <p><b>core_CM23.h</b> or <b>core_ARMv8MBL.h</b> </p>
  262. <table class="cmtable">
  263. <tr>
  264. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  265. <tr>
  266. <td>__ARMv8MBL_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  267. <tr>
  268. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  269. <tr>
  270. <td>__SAUREGION_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if SAU regions are present or not </td></tr>
  271. <tr>
  272. <td>__VTOR_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a VTOR register is present or not </td></tr>
  273. <tr>
  274. <td>__NVIC_PRIO_BITS </td><td>2 </td><td>2 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  275. <tr>
  276. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  277. </table>
  278. <p><b>core_CM33.h</b> or <b>core_cm35p.h</b> or <b>core_ARMv8MML.h</b> </p>
  279. <table class="cmtable">
  280. <tr>
  281. <th>#define </th><th>Value Range </th><th>Default </th><th>Description </th></tr>
  282. <tr>
  283. <td>__ARMv8MML_REV </td><td>0x0000 </td><td>0x0000 </td><td>Core revision number ([15:8] revision number, [7:0] patch number) </td></tr>
  284. <tr>
  285. <td>__MPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a MPU is present or not </td></tr>
  286. <tr>
  287. <td>__SAUREGION_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if SAU regions are present or not </td></tr>
  288. <tr>
  289. <td>__FPU_PRESENT </td><td>0 .. 1 </td><td>0 </td><td>Defines if a FPU is present or not </td></tr>
  290. <tr>
  291. <td>__NVIC_PRIO_BITS </td><td>2 .. 8 </td><td>3 </td><td>Number of priority bits implemented in the NVIC (device specific) </td></tr>
  292. <tr>
  293. <td>__Vendor_SysTickConfig </td><td>0 .. 1 </td><td>0 </td><td>If this define is set to 1, then the default <b>SysTick_Config</b> function is excluded. In this case, the file <em><b>device.h</b></em> must contain a vendor specific implementation of this function. </td></tr>
  294. </table>
  295. <p><b>Example</b> </p>
  296. <p>The following code exemplifies the configuration of the Cortex-M4 Processor and Core Peripherals.</p>
  297. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM4_REV 0x0001 </span><span class="comment">/* Core revision r0p1 */</span><span class="preprocessor"></span></div>
  298. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __MPU_PRESENT 1 </span><span class="comment">/* MPU present or not */</span><span class="preprocessor"></span></div>
  299. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NVIC_PRIO_BITS 3 </span><span class="comment">/* Number of Bits used for Priority Levels */</span><span class="preprocessor"></span></div>
  300. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __Vendor_SysTickConfig 0 </span><span class="comment">/* Set to 1 if different SysTick Config is used */</span><span class="preprocessor"></span></div>
  301. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __FPU_PRESENT 1 </span><span class="comment">/* FPU present or not */</span><span class="preprocessor"></span></div>
  302. <div class="line"><span class="preprocessor"></span>.</div>
  303. <div class="line">.</div>
  304. <div class="line"><span class="preprocessor">#include &lt;core_cm4.h&gt;</span> <span class="comment">/* Cortex-M4 processor and core peripherals */</span></div>
  305. </div><!-- fragment --><h1><a class="anchor" id="core_version_sect"></a>
  306. CMSIS Version and Processor Information</h1>
  307. <p>Defines in the core_<em>cpu</em>.h file identify the version of the CMSIS-Core (Cortex-M) 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 &lt;device.h&gt;</a> to verify a minimum version or ensure that the right processor core is used.</p>
  308. <p><b>core_cm0.h</b> </p>
  309. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM0_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  310. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM0_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  311. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  312. <div class="line"><span class="preprocessor"> __CM0_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  313. <div class="line"><span class="preprocessor"></span> </div>
  314. <div class="line"><span class="preprocessor">#define __CORTEX_M (0U) </span><span class="comment">/* Cortex-M Core */</span><span class="preprocessor"></span></div>
  315. </div><!-- fragment --><p><b>core_cm0plus.h</b> </p>
  316. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM0PLUS_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  317. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM0PLUS_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  318. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM0PLUS_CMSIS_VERSION ((__CM0P_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  319. <div class="line"><span class="preprocessor"> __CM0P_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  320. <div class="line"><span class="preprocessor"></span> </div>
  321. <div class="line"><span class="preprocessor">#define __CORTEX_M (0U) </span><span class="comment">/* Cortex-M Core */</span><span class="preprocessor"></span></div>
  322. </div><!-- fragment --><p><b>core_cm1.h</b> </p>
  323. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM1_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) </span></div>
  324. <div class="line"><span class="preprocessor">#define __CM1_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) </span></div>
  325. <div class="line"><span class="preprocessor">#define __CM1_CMSIS_VERSION ((__CM1_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  326. <div class="line"><span class="preprocessor"> __CM1_CMSIS_VERSION_SUB ) </span></div>
  327. <div class="line"><span class="preprocessor">#define __CORTEX_M (1U) </span></div>
  328. </div><!-- fragment --><p><b>core_cm3.h</b> </p>
  329. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM3_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  330. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM3_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  331. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  332. <div class="line"><span class="preprocessor"> __CM3_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  333. <div class="line"><span class="preprocessor"></span> </div>
  334. <div class="line"><span class="preprocessor">#define __CORTEX_M (3U) </span><span class="comment">/* Cortex-M Core */</span><span class="preprocessor"></span></div>
  335. </div><!-- fragment --><p><b>core_cm4.h</b> </p>
  336. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM4_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  337. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM4_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  338. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  339. <div class="line"><span class="preprocessor"> __CM4_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  340. <div class="line"><span class="preprocessor"></span> </div>
  341. <div class="line"><span class="preprocessor">#define __CORTEX_M (4U) </span><span class="comment">/* Cortex-M Core */</span><span class="preprocessor"></span></div>
  342. </div><!-- fragment --><p><b>core_cm7.h</b> </p>
  343. <div class="fragment"><div class="line"><span class="preprocessor">#define __CM7_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  344. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM7_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  345. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  346. <div class="line"><span class="preprocessor"> __CM7_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  347. <div class="line"><span class="preprocessor"></span> </div>
  348. <div class="line"><span class="preprocessor">#define __CORTEX_M (7U) </span><span class="comment">/* Cortex-M Core */</span><span class="preprocessor"></span></div>
  349. </div><!-- fragment --><p><b>core_sc000.h</b> </p>
  350. <div class="fragment"><div class="line"><span class="preprocessor">#define __SC000_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  351. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __SC000_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  352. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  353. <div class="line"><span class="preprocessor"> __SC000_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  354. <div class="line"><span class="preprocessor"></span></div>
  355. <div class="line"><span class="preprocessor">#define __CORTEX_SC (0U) </span><span class="comment">/* Cortex secure core */</span><span class="preprocessor"></span></div>
  356. </div><!-- fragment --><p><b>core_sc300.h</b> </p>
  357. <div class="fragment"><div class="line"><span class="preprocessor">#define __SC300_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  358. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __SC300_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  359. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  360. <div class="line"><span class="preprocessor"> __SC300_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  361. <div class="line"><span class="preprocessor"></span></div>
  362. <div class="line"><span class="preprocessor">#define __CORTEX_SC (300U) </span><span class="comment">/* Cortex secure core */</span><span class="preprocessor"></span></div>
  363. </div><!-- fragment --><p><b>core_ARMv8MBL.h</b> </p>
  364. <div class="fragment"><div class="line"><span class="preprocessor">#define __ARMv8MBL_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  365. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __ARMv8MBL_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  366. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __ARMv8MBL_CMSIS_VERSION ((__ARMv8MBL_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  367. <div class="line"><span class="preprocessor"> __ARMv8MBL_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  368. <div class="line"><span class="preprocessor"></span> </div>
  369. <div class="line"><span class="preprocessor">#define __CORTEX_M (tbd) </span><span class="comment">/* Cortex secure core */</span><span class="preprocessor"></span></div>
  370. </div><!-- fragment --><p><b>core_ARMv8MML.h</b> </p>
  371. <div class="fragment"><div class="line"><span class="preprocessor">#define __ARMv8MML_CMSIS_VERSION_MAIN (5U) </span><span class="comment">/* [31:16] CMSIS HAL main version */</span><span class="preprocessor"></span></div>
  372. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __ARMv8MML_CMSIS_VERSION_SUB (0U) </span><span class="comment">/* [15:0] CMSIS HAL sub version */</span><span class="preprocessor"></span></div>
  373. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __ARMv8MML_CMSIS_VERSION ((__ARMv8MML_CMSIS_VERSION_MAIN &lt;&lt; 16U) | \</span></div>
  374. <div class="line"><span class="preprocessor"> __ARMv8MML_CMSIS_VERSION_SUB ) </span><span class="comment">/* CMSIS HAL version number */</span><span class="preprocessor"></span></div>
  375. <div class="line"><span class="preprocessor"></span> </div>
  376. <div class="line"><span class="preprocessor">#define __CORTEX_M (tbd) </span><span class="comment">/* Cortex secure core */</span><span class="preprocessor"></span></div>
  377. </div><!-- fragment --><h1><a class="anchor" id="device_access"></a>
  378. Device Peripheral Access Layer</h1>
  379. <p>The <a class="el" href="device_h_pg.html">Device Header File &lt;device.h&gt;</a> contains for each peripheral:</p>
  380. <ul>
  381. <li>Register Layout Typedef</li>
  382. <li>Base Address</li>
  383. <li>Access Definitions</li>
  384. </ul>
  385. <p>The section <a class="el" href="group__peripheral__gr.html">Peripheral Access</a> shows examples for peripheral definitions.</p>
  386. <h1><a class="anchor" id="device_h_sec"></a>
  387. Device.h Template File</h1>
  388. <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 &lt;device.h&gt;</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>
  389. <pre class="fragment">/**************************************************************************//**
  390. * @file &lt;Device&gt;.h
  391. * @brief CMSIS Cortex-M# Core Peripheral Access Layer Header File for
  392. * Device &lt;Device&gt;
  393. * @version V5.00
  394. * @date 10. January 2018
  395. ******************************************************************************/
  396. /*
  397. * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  398. *
  399. * SPDX-License-Identifier: Apache-2.0
  400. *
  401. * Licensed under the Apache License, Version 2.0 (the License); you may
  402. * not use this file except in compliance with the License.
  403. * You may obtain a copy of the License at
  404. *
  405. * www.apache.org/licenses/LICENSE-2.0
  406. *
  407. * Unless required by applicable law or agreed to in writing, software
  408. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  409. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  410. * See the License for the specific language governing permissions and
  411. * limitations under the License.
  412. */
  413. #ifndef &lt;Device&gt;_H /* ToDo: replace '&lt;Device&gt;' with your device name */
  414. #define &lt;Device&gt;_H
  415. #ifdef __cplusplus
  416. extern "C" {
  417. #endif
  418. /* ToDo: replace '&lt;Vendor&gt;' with vendor name; add your doxyGen comment */
  419. /** @addtogroup &lt;Vendor&gt;
  420. * @{
  421. */
  422. /* ToDo: replace '&lt;Device&gt;' with device name; add your doxyGen comment */
  423. /** @addtogroup &lt;Device&gt;
  424. * @{
  425. */
  426. /** @addtogroup Configuration_of_CMSIS
  427. * @{
  428. */
  429. /* =========================================================================================================================== */
  430. /* ================ Interrupt Number Definition ================ */
  431. /* =========================================================================================================================== */
  432. typedef enum IRQn
  433. {
  434. /* ======================================= ARM Cortex-M# Specific Interrupt Numbers ======================================== */
  435. /* ToDo: use this Cortex interrupt numbers if your device is a Cortex-M0 / Cortex-M0+ device */
  436. Reset_IRQn = -15, /*!&lt; -15 Reset Vector, invoked on Power up and warm reset */
  437. NonMaskableInt_IRQn = -14, /*!&lt; -14 Non maskable Interrupt, cannot be stopped or preempted */
  438. HardFault_IRQn = -13, /*!&lt; -13 Hard Fault, all classes of Fault */
  439. SVCall_IRQn = -5, /*!&lt; -5 System Service Call via SVC instruction */
  440. PendSV_IRQn = -2, /*!&lt; -2 Pendable request for system service */
  441. SysTick_IRQn = -1, /*!&lt; -1 System Tick Timer */
  442. /* ToDo: use this Cortex interrupt numbers if your device is a Cortex-M3 / Cortex-M4 / Cortex-M7 device */
  443. Reset_IRQn = -15, /*!&lt; -15 Reset Vector, invoked on Power up and warm reset */
  444. NonMaskableInt_IRQn = -14, /*!&lt; -14 Non maskable Interrupt, cannot be stopped or preempted */
  445. HardFault_IRQn = -13, /*!&lt; -13 Hard Fault, all classes of Fault */
  446. MemoryManagement_IRQn = -12, /*!&lt; -12 Memory Management, MPU mismatch, including Access Violation
  447. and No Match */
  448. BusFault_IRQn = -11, /*!&lt; -11 Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory
  449. related Fault */
  450. UsageFault_IRQn = -10, /*!&lt; -10 Usage Fault, i.e. Undef Instruction, Illegal State Transition */
  451. SVCall_IRQn = -5, /*!&lt; -5 System Service Call via SVC instruction */
  452. DebugMonitor_IRQn = -4, /*!&lt; -4 Debug Monitor */
  453. PendSV_IRQn = -2, /*!&lt; -2 Pendable request for system service */
  454. SysTick_IRQn = -1, /*!&lt; -1 System Tick Timer */
  455. /* =========================================== &lt;Device&gt; Specific Interrupt Numbers ========================================= */
  456. /* ToDo: add here your device specific external interrupt numbers
  457. according the interrupt handlers defined in startup_Device.s
  458. eg.: Interrupt for Timer#1 TIM1_IRQHandler -&gt; TIM1_IRQn */
  459. &lt;DeviceInterrupt&gt;_IRQn = 0, /*!&lt; Device Interrupt */
  460. } IRQn_Type;
  461. /* =========================================================================================================================== */
  462. /* ================ Processor and Core Peripheral Section ================ */
  463. /* =========================================================================================================================== */
  464. /* =========================== Configuration of the Arm Cortex-M4 Processor and Core Peripherals =========================== */
  465. /* ToDo: set the defines according your Device */
  466. /* ToDo: define the correct core revision
  467. __CM0_REV if your device is a Cortex-M0 device
  468. __CM3_REV if your device is a Cortex-M3 device
  469. __CM4_REV if your device is a Cortex-M4 device
  470. __CM7_REV if your device is a Cortex-M7 device */
  471. #define __CM#_REV 0x0201 /*!&lt; Core Revision r2p1 */
  472. /* ToDo: define the correct core features for the &lt;Device&gt; */
  473. #define __MPU_PRESENT 1 /*!&lt; Set to 1 if MPU is present */
  474. #define __VTOR_PRESENT 1 /*!&lt; Set to 1 if VTOR is present */
  475. #define __NVIC_PRIO_BITS 3 /*!&lt; Number of Bits used for Priority Levels */
  476. #define __Vendor_SysTickConfig 0 /*!&lt; Set to 1 if different SysTick Config is used */
  477. #define __FPU_PRESENT 0 /*!&lt; Set to 1 if FPU is present */
  478. #define __FPU_DP 0 /*!&lt; Set to 1 if FPU is double precision FPU (default is single precision FPU) */
  479. #define __ICACHE_PRESENT 0 /*!&lt; Set to 1 if I-Cache is present */
  480. #define __DCACHE_PRESENT 0 /*!&lt; Set to 1 if D-Cache is present */
  481. #define __DTCM_PRESENT 0 /*!&lt; Set to 1 if DTCM is present */
  482. /** @} */ /* End of group Configuration_of_CMSIS */
  483. /* ToDo: include the correct core_cm#.h file
  484. core_cm0.h if your device is a CORTEX-M0 device
  485. core_cm3.h if your device is a CORTEX-M3 device
  486. core_cm4.h if your device is a CORTEX-M4 device
  487. core_cm7.h if your device is a CORTEX-M4 device */
  488. #include &lt;core_cm#.h&gt; /*!&lt; Arm Cortex-M# processor and core peripherals */
  489. /* ToDo: include your system_&lt;Device&gt;.h file
  490. replace '&lt;Device&gt;' with your device name */
  491. #include "system_&lt;Device&gt;.h" /*!&lt; &lt;Device&gt; System */
  492. /* ======================================== Start of section using anonymous unions ======================================== */
  493. #if defined (__CC_ARM)
  494. #pragma push
  495. #pragma anon_unions
  496. #elif defined (__ICCARM__)
  497. #pragma language=extended
  498. #elif defined(__ARMCC_VERSION) &amp;&amp; (__ARMCC_VERSION &gt;= 6010050)
  499. #pragma clang diagnostic push
  500. #pragma clang diagnostic ignored "-Wc11-extensions"
  501. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  502. #elif defined (__GNUC__)
  503. /* anonymous unions are enabled by default */
  504. #elif defined (__TMS470__)
  505. /* anonymous unions are enabled by default */
  506. #elif defined (__TASKING__)
  507. #pragma warning 586
  508. #elif defined (__CSMC__)
  509. /* anonymous unions are enabled by default */
  510. #else
  511. #warning Not supported compiler type
  512. #endif
  513. /* =========================================================================================================================== */
  514. /* ================ Device Specific Peripheral Section ================ */
  515. /* =========================================================================================================================== */
  516. /** @addtogroup Device_Peripheral_peripherals
  517. * @{
  518. */
  519. /* ToDo: add here your device specific peripheral access structure typedefs
  520. following is an example for a timer */
  521. /* =========================================================================================================================== */
  522. /* ================ TMR ================ */
  523. /* =========================================================================================================================== */
  524. /**
  525. * @brief Timer (TMR)
  526. */
  527. typedef struct
  528. { /*!&lt; (@ 0x40000000) TIM Structure */
  529. __IOM uint32_t TimerLoad; /*!&lt; (@ 0x00000004) Timer Load */
  530. __IM uint32_t TimerValue; /*!&lt; (@ 0x00000008) Timer Counter Current Value */
  531. __IOM uint32_t TimerControl; /*!&lt; (@ 0x0000000C) Timer Control */
  532. __OM uint32_t TimerIntClr; /*!&lt; (@ 0x00000010) Timer Interrupt Clear */
  533. __IM uint32_t TimerRIS; /*!&lt; (@ 0x00000014) Timer Raw Interrupt Status */
  534. __IM uint32_t TimerMIS; /*!&lt; (@ 0x00000018) Timer Masked Interrupt Status */
  535. __IM uint32_t RESERVED[1];
  536. __IOM uint32_t TimerBGLoad; /*!&lt; (@ 0x00000020) Background Load Register */
  537. } &lt;DeviceAbbreviation&gt;_TMR_TypeDef;
  538. /*@}*/ /* end of group &lt;Device&gt;_Peripherals */
  539. /* ========================================= End of section using anonymous unions ========================================= */
  540. #if defined (__CC_ARM)
  541. #pragma pop
  542. #elif defined (__ICCARM__)
  543. /* leave anonymous unions enabled */
  544. #elif (__ARMCC_VERSION &gt;= 6010050)
  545. #pragma clang diagnostic pop
  546. #elif defined (__GNUC__)
  547. /* anonymous unions are enabled by default */
  548. #elif defined (__TMS470__)
  549. /* anonymous unions are enabled by default */
  550. #elif defined (__TASKING__)
  551. #pragma warning restore
  552. #elif defined (__CSMC__)
  553. /* anonymous unions are enabled by default */
  554. #else
  555. #warning Not supported compiler type
  556. #endif
  557. /* =========================================================================================================================== */
  558. /* ================ Device Specific Peripheral Address Map ================ */
  559. /* =========================================================================================================================== */
  560. /* ToDo: add here your device peripherals base addresses
  561. following is an example for timer */
  562. /** @addtogroup Device_Peripheral_peripheralAddr
  563. * @{
  564. */
  565. /* Peripheral and SRAM base address */
  566. #define &lt;DeviceAbbreviation&gt;_FLASH_BASE (0x00000000UL) /*!&lt; (FLASH ) Base Address */
  567. #define &lt;DeviceAbbreviation&gt;_SRAM_BASE (0x20000000UL) /*!&lt; (SRAM ) Base Address */
  568. #define &lt;DeviceAbbreviation&gt;_PERIPH_BASE (0x40000000UL) /*!&lt; (Peripheral) Base Address */
  569. /* Peripheral memory map */
  570. #define &lt;DeviceAbbreviation&gt;TIM0_BASE (&lt;DeviceAbbreviation&gt;_PERIPH_BASE) /*!&lt; (Timer0 ) Base Address */
  571. #define &lt;DeviceAbbreviation&gt;TIM1_BASE (&lt;DeviceAbbreviation&gt;_PERIPH_BASE + 0x0800) /*!&lt; (Timer1 ) Base Address */
  572. #define &lt;DeviceAbbreviation&gt;TIM2_BASE (&lt;DeviceAbbreviation&gt;_PERIPH_BASE + 0x1000) /*!&lt; (Timer2 ) Base Address */
  573. /** @} */ /* End of group Device_Peripheral_peripheralAddr */
  574. /* =========================================================================================================================== */
  575. /* ================ Peripheral declaration ================ */
  576. /* =========================================================================================================================== */
  577. /* ToDo: add here your device peripherals pointer definitions
  578. following is an example for timer */
  579. /** @addtogroup Device_Peripheral_declaration
  580. * @{
  581. */
  582. #define &lt;DeviceAbbreviation&gt;_TIM0 ((&lt;DeviceAbbreviation&gt;_TMR_TypeDef *) &lt;DeviceAbbreviation&gt;TIM0_BASE)
  583. #define &lt;DeviceAbbreviation&gt;_TIM1 ((&lt;DeviceAbbreviation&gt;_TMR_TypeDef *) &lt;DeviceAbbreviation&gt;TIM0_BASE)
  584. #define &lt;DeviceAbbreviation&gt;_TIM2 ((&lt;DeviceAbbreviation&gt;_TMR_TypeDef *) &lt;DeviceAbbreviation&gt;TIM0_BASE)
  585. /** @} */ /* End of group &lt;Device&gt; */
  586. /** @} */ /* End of group &lt;Vendor&gt; */
  587. #ifdef __cplusplus
  588. }
  589. #endif
  590. #endif /* &lt;Device&gt;_H */
  591. </pre> </div></div><!-- contents -->
  592. </div><!-- doc-content -->
  593. <!-- start footer part -->
  594. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  595. <ul>
  596. <li class="navelem"><a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a></li>
  597. <li class="footer">Generated on Mon Mar 18 2019 16:05:26 for CMSIS-Core (Cortex-M) by Arm Ltd. All rights reserved.
  598. <!--
  599. <a href="http://www.doxygen.org/index.html">
  600. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
  601. -->
  602. </li>
  603. </ul>
  604. </div>
  605. </body>
  606. </html>