]> begriffs open source - cmsis/blob - main/Core_A/group__peripheral__gr.html
Update documentation for branch main
[cmsis] / main / Core_A / group__peripheral__gr.html
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">
4 <head>
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): Peripheral Access</title>
9 <link href="doxygen.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="tabs.js"></script>
13 <script type="text/javascript" src="footer.js"></script>
14 <script type="text/javascript" src="navtree.js"></script>
15 <link href="navtree.css" rel="stylesheet" type="text/css"/>
16 <script type="text/javascript" src="resize.js"></script>
17 <script type="text/javascript" src="navtreedata.js"></script>
18 <script type="text/javascript" src="navtree.js"></script>
19 <link href="search/search.css" rel="stylesheet" type="text/css"/>
20 <script type="text/javascript" src="search/searchdata.js"></script>
21 <script type="text/javascript" src="search/search.js"></script>
22 <script type="text/javascript">
23 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
24   $(document).ready(function() { init_search(); });
25 /* @license-end */
26 </script>
27 <script type="text/javascript" src="darkmode_toggle.js"></script>
28 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
29 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
30 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
31 <link href="extra_tabs.css" rel="stylesheet" type="text/css"/>
32 <link href="version.css" rel="stylesheet" type="text/css"/>
33 <script type="text/javascript" src="../../version.js"></script>
34 </head>
35 <body>
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
37 <div id="titlearea">
38 <table cellspacing="0" cellpadding="0">
39  <tbody>
40  <tr style="height: 55px;">
41   <td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
42   <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
43    <div id="projectname">CMSIS-Core (Cortex-A)
44    &#160;<span id="projectnumber"><script type="text/javascript">
45      <!--
46      writeHeader.call(this);
47      writeVersionDropdown.call(this, "CMSIS-Core (Cortex-A)");
48      //-->
49     </script>
50    </span>
51    </div>
52    <div id="projectbrief">CMSIS-Core support for Cortex-A processor-based devices</div>
53   </td>
54    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
55         <span class="left">
56           <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
57           <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
58                onfocus="searchBox.OnSearchFieldFocus(true)" 
59                onblur="searchBox.OnSearchFieldFocus(false)" 
60                onkeyup="searchBox.OnSearchFieldChange(event)"/>
61           </span><span class="right">
62             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
63           </span>
64         </div>
65 </td>
66   <!--END !PROJECT_NAME-->
67  </tr>
68  </tbody>
69 </table>
70 </div>
71 <!-- end header part -->
72 <div id="CMSISnav" class="tabs1">
73   <ul class="tablist">
74     <script type="text/javascript">
75       writeComponentTabs.call(this);
76     </script>
77   </ul>
78 </div>
79 <script type="text/javascript">
80   writeSubComponentTabs.call(this);
81 </script>
82 <!-- Generated by Doxygen 1.9.6 -->
83 <script type="text/javascript">
84 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
85 var searchBox = new SearchBox("searchBox", "search/",'.html');
86 /* @license-end */
87 </script>
88 </div><!-- top -->
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
90   <div id="nav-tree">
91     <div id="nav-tree-contents">
92       <div id="nav-sync" class="sync"></div>
93     </div>
94   </div>
95   <div id="splitbar" style="-moz-user-select:none;" 
96        class="ui-resizable-handle">
97   </div>
98 </div>
99 <script type="text/javascript">
100 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
101 $(document).ready(function(){initNavTree('group__peripheral__gr.html',''); initResizable(); });
102 /* @license-end */
103 </script>
104 <div id="doc-content">
105 <!-- window showing the filter options -->
106 <div id="MSearchSelectWindow"
107      onmouseover="return searchBox.OnSearchSelectShow()"
108      onmouseout="return searchBox.OnSearchSelectHide()"
109      onkeydown="return searchBox.OnSearchSelectKey(event)">
110 </div>
111
112 <!-- iframe showing the search results (closed by default) -->
113 <div id="MSearchResultsWindow">
114 <div id="MSearchResults">
115 <div class="SRPage">
116 <div id="SRIndex">
117 <div id="SRResults"></div>
118 <div class="SRStatus" id="Loading">Loading...</div>
119 <div class="SRStatus" id="Searching">Searching...</div>
120 <div class="SRStatus" id="NoMatches">No Matches</div>
121 </div>
122 </div>
123 </div>
124 </div>
125
126 <div class="header">
127   <div class="summary">
128 <a href="#define-members">Macros</a>  </div>
129   <div class="headertitle"><div class="title">Peripheral Access</div></div>
130 </div><!--header-->
131 <div class="contents">
132
133 <p>Naming conventions and optional features for accessing peripherals.  
134 <a href="#details">More...</a></p>
135 <table class="memberdecls">
136 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
137 Macros</h2></td></tr>
138 <tr class="memitem:ga286e3b913dbd236c7f48ea70c8821f4e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__peripheral__gr.html#ga286e3b913dbd236c7f48ea70c8821f4e">_VAL2FLD</a>(field,  value)</td></tr>
139 <tr class="memdesc:ga286e3b913dbd236c7f48ea70c8821f4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mask and shift a bit field value for assigning the result to a peripheral register.  <br /></td></tr>
140 <tr class="separator:ga286e3b913dbd236c7f48ea70c8821f4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
141 <tr class="memitem:ga139b6e261c981f014f386927ca4a8444"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__peripheral__gr.html#ga139b6e261c981f014f386927ca4a8444">_FLD2VAL</a>(field,  value)</td></tr>
142 <tr class="memdesc:ga139b6e261c981f014f386927ca4a8444"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract from a peripheral register value the a bit field value.  <br /></td></tr>
143 <tr class="separator:ga139b6e261c981f014f386927ca4a8444"><td class="memSeparator" colspan="2">&#160;</td></tr>
144 </table>
145 <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
146 <p>Naming conventions and optional features for accessing peripherals. </p>
147 <p>The section below describes the naming conventions, requirements, and optional features for accessing device specific peripherals. Most of the rules also apply to the core peripherals. The <a class="el" href="device_h_pg.html">Device Header File &lt;device.h&gt;</a> contains typically these definition and also includes the core specific header files.</p>
148 <p>The definitions for <a class="el" href="group__peripheral__gr.html">Peripheral Access</a> can be generated using the <a href="https://open-cmsis-pack.github.io/svd-spec"><b>CMSIS-SVD</b></a> System View Description for Peripherals.</p>
149 <p>Each peripheral provides a data type definition with a name that is composed of:</p><ul>
150 <li>an optional prefix <b>&lt;<em>device abbreviation&gt;</em>_</b></li>
151 <li><b>&lt;<em>peripheral name</em>&gt;</b></li>
152 <li>postfix <b>_Type</b> or <b>_TypeDef</b> to identify a type definition.</li>
153 </ul>
154 <p>Examples:</p><ul>
155 <li><b>UART_TypeDef</b> for the peripheral <b>UART</b>.</li>
156 <li><b>IMX_UART_TypeDef</b> for the device family <b>IMX</b> and the peripheral <b>UART</b>.</li>
157 </ul>
158 <p>The data type definition uses standard C data types defined by the ANSI C header file &lt;stdint.h&gt;.</p>
159 <ul>
160 <li>IO Type Qualifiers are used to specify the access to peripheral variables. <table class="markdownTable">
161 <tr class="markdownTableHead">
162 <th class="markdownTableHeadLeft">IO Type Qualifier   </th><th class="markdownTableHeadLeft">Type   </th><th class="markdownTableHeadLeft">Description    </th></tr>
163 <tr class="markdownTableRowOdd">
164 <td class="markdownTableBodyLeft"><b>__IM</b>   </td><td class="markdownTableBodyLeft">Struct member   </td><td class="markdownTableBodyLeft">Defines 'read only' permissions    </td></tr>
165 <tr class="markdownTableRowEven">
166 <td class="markdownTableBodyLeft"><b>__OM</b>   </td><td class="markdownTableBodyLeft">Struct member   </td><td class="markdownTableBodyLeft">Defines 'write only' permissions    </td></tr>
167 <tr class="markdownTableRowOdd">
168 <td class="markdownTableBodyLeft"><b>__IOM</b>   </td><td class="markdownTableBodyLeft">Struct member   </td><td class="markdownTableBodyLeft">Defines 'read / write' permissions    </td></tr>
169 <tr class="markdownTableRowEven">
170 <td class="markdownTableBodyLeft"><b>__I</b>   </td><td class="markdownTableBodyLeft">Scalar variable   </td><td class="markdownTableBodyLeft">Defines 'read only' permissions    </td></tr>
171 <tr class="markdownTableRowOdd">
172 <td class="markdownTableBodyLeft"><b>__O</b>   </td><td class="markdownTableBodyLeft">Scalar variable   </td><td class="markdownTableBodyLeft">Defines 'write only' permissions    </td></tr>
173 <tr class="markdownTableRowEven">
174 <td class="markdownTableBodyLeft"><b>__IO</b>   </td><td class="markdownTableBodyLeft">Scalar variable   </td><td class="markdownTableBodyLeft">Defines 'read / write' permissions   </td></tr>
175 </table>
176 </li>
177 </ul>
178 <p>The typedef <b>&lt;<em>device abbreviation</em>&gt;_UART_TypeDef</b> shown below defines the generic register layout for all UART channels in a device.</p>
179 <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
180 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a7e25d9380f9ef903923964322e71f2f6">__O</a>  uint32_t UART_CR;            <span class="comment">// Offset: 0x0000 ( /W) Control Register </span></div>
181 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t UART_MR;            <span class="comment">// Offset: 0x0004 (R/W) Mode Register </span></div>
182 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a7e25d9380f9ef903923964322e71f2f6">__O</a>  uint32_t UART_IER;           <span class="comment">// Offset: 0x0008 ( /W) Interrupt Enable Register </span></div>
183 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a7e25d9380f9ef903923964322e71f2f6">__O</a>  uint32_t UART_IDR;           <span class="comment">// Offset: 0x000C ( /W) Interrupt Disable Register </span></div>
184 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>  uint32_t UART_IMR;           <span class="comment">// Offset: 0x0010 (R/ ) Interrupt Mask Register </span></div>
185 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>  uint32_t UART_SR;            <span class="comment">// Offset: 0x0014 (R/ ) Status Register </span></div>
186 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>  uint32_t UART_RHR;           <span class="comment">// Offset: 0x0018 (R/ ) Receive Holding Register </span></div>
187 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a7e25d9380f9ef903923964322e71f2f6">__O</a>  uint32_t UART_THR;           <span class="comment">// Offset: 0x001C ( /W) Transmit Holding Register </span></div>
188 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t UART_BRGR;          <span class="comment">// Offset: 0x0020 (R/W) Baud Rate Generator Register </span></div>
189 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t UART_CMPR;          <span class="comment">// Offset: 0x0024 (R/W) Comparison Register </span></div>
190 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t UART_RTOR;          <span class="comment">// Offset: 0x0028 (R/W) Receiver Time-out Register </span></div>
191 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>  uint32_t <a class="code hl_define" href="core__ca_8h.html#af7f66fda711fd46e157dbb6c1af88e04">RESERVED</a>[46];       <span class="comment">// Offset: 0x002C (R/ ) Reserved                     </span></div>
192 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t UART_WPMR;          <span class="comment">// Offset: 0x00E4 (R/W) Write Protection Mode Register </span></div>
193 <div class="line">} IMX_UART_TypeDef;</div>
194 <div class="ttc" id="acore__ca_8h_html_a7e25d9380f9ef903923964322e71f2f6"><div class="ttname"><a href="core__ca_8h.html#a7e25d9380f9ef903923964322e71f2f6">__O</a></div><div class="ttdeci">#define __O</div><div class="ttdoc">Defines 'write only' permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:174</div></div>
195 <div class="ttc" id="acore__ca_8h_html_aec43007d9998a0a0e01faede4133d6be"><div class="ttname"><a href="core__ca_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a></div><div class="ttdeci">#define __IO</div><div class="ttdoc">Defines 'read / write' permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:175</div></div>
196 <div class="ttc" id="acore__ca_8h_html_af63697ed9952cc71e1225efe205f6cd3"><div class="ttname"><a href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a></div><div class="ttdeci">#define __I</div><div class="ttdoc">Defines 'read only' permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:170</div></div>
197 <div class="ttc" id="acore__ca_8h_html_af7f66fda711fd46e157dbb6c1af88e04"><div class="ttname"><a href="core__ca_8h.html#af7f66fda711fd46e157dbb6c1af88e04">RESERVED</a></div><div class="ttdeci">#define RESERVED(N, T)</div><div class="ttdef"><b>Definition:</b> core_ca.h:181</div></div>
198 </div><!-- fragment --><p>To access the registers of the UART defined above, pointers to this register structure are defined. If more instances of a peripheral exist, the variables have a postfix (digit or letter) that identifies the peripheral.</p>
199 <p><b>Example:</b> In this example, <b>IMX_UART2</b> and <b>IMX_UART3</b> are two pointers to UARTs defined with above register structure. <br  />
200 </p><div class="fragment"><div class="line"><span class="preprocessor">#define IMX_UART2   ((IMX_UART_TypeDef *) IMX_UART2_BASE)</span></div>
201 <div class="line"><span class="preprocessor">#define IMX_UART3   ((IMX_UART_TypeDef *) IMX_UART3_BASE)</span></div>
202 </div><!-- fragment --><dl class="section note"><dt>Note</dt><dd><ul>
203 <li>The prefix <b>IMX</b> is optional.</li>
204 </ul>
205 </dd></dl>
206 <p>The registers in the various UARTs can now be referred in the user code as shown below:<br  />
207 </p><div class="fragment"><div class="line">val = IMX_UART2-&gt;SR   <span class="comment">// is the Status Register of UART2.</span></div>
208 </div><!-- fragment --><hr  />
209 <h1><a class="anchor" id="core_cmsis_pal_min_reqs"></a>
210 Minimal Requirements</h1>
211 <p>To access the peripheral registers and related function in a device, the files <b><em>device.h</em></b> and <b><a class="el" href="core__ca_8h.html">core_ca.h</a></b> define as a minimum: <br  />
212 <br  />
213 </p><ul>
214 <li>The <b>Register Layout Typedef</b> for each peripheral that defines all register names. RESERVED is used to introduce space into the structure for adjusting the addresses of the peripheral registers. <br  />
215 <br  />
216 <b>Example:</b> <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
217 <div class="line">{</div>
218 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_CTLR;              <span class="comment">// Offset: 0x0000 (R/W) CPU Interface Control Register </span></div>
219 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_PMR;               <span class="comment">// Offset: 0x0004 (R/W) Interrupt Priority Mask Register </span></div>
220 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_BPR;               <span class="comment">// Offset: 0x0008 (R/W) Binary Point Register </span></div>
221 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_IAR;               <span class="comment">// Offset: 0x000C (R/ ) Interrupt Acknowledge Register </span></div>
222 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a0ea2009ed8fd9ef35b48708280fdb758">__OM</a>  uint32_t C_EOIR;              <span class="comment">// Offset: 0x0010 ( /W) End Of Interrupt Register </span></div>
223 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_RPR;               <span class="comment">// Offset: 0x0014 (R/ ) Running Priority Register </span></div>
224 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_HPPIR;             <span class="comment">// Offset: 0x0018 (R/ ) Highest Priority Pending Interrupt Register </span></div>
225 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_ABPR;              <span class="comment">// Offset: 0x001C (R/W) Aliased Binary Point Register </span></div>
226 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_AIAR;              <span class="comment">// Offset: 0x0020 (R/ ) Aliased Interrupt Acknowledge Register </span></div>
227 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a0ea2009ed8fd9ef35b48708280fdb758">__OM</a>  uint32_t C_AEOIR;             <span class="comment">// Offset: 0x0024 ( /W) Aliased End Of Interrupt Register </span></div>
228 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_AHPPIR;            <span class="comment">// Offset: 0x0028 (R/ ) Aliased Highest Priority Pending Interrupt Register </span></div>
229 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_STATUSR;           <span class="comment">// Offset: 0x002C (R/W) Error Reporting Status Register, optional </span></div>
230 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>   uint32_t RESERVED1[40];       <span class="comment">// Offset: 0x0030 (R/ ) Reserved</span></div>
231 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_APR[4];            <span class="comment">// Offset: 0x00D0 (R/W) Active Priority Register </span></div>
232 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a> uint32_t C_NSAPR[4];          <span class="comment">// Offset: 0x00E0 (R/W) Non-secure Active Priority Register </span></div>
233 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>   uint32_t RESERVED2[3];        <span class="comment">// Offset: 0x00F6 (R/ ) Reserved</span></div>
234 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a>  uint32_t C_IIDR;              <span class="comment">// Offset: 0x00FC (R/ ) CPU Interface Identification Register </span></div>
235 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#af63697ed9952cc71e1225efe205f6cd3">__I</a>   uint32_t RESERVED3[960];      <span class="comment">// Offset: 0x0100 (R/ ) Reserved</span></div>
236 <div class="line">  <a class="code hl_define" href="core__ca_8h.html#a0ea2009ed8fd9ef35b48708280fdb758">__OM</a>  uint32_t C_DIR;               <span class="comment">// Offset: 0x1000 ( /W) Deactivate Interrupt Register </span></div>
237 <div class="line">}  <a class="code hl_struct" href="structGICInterface__Type.html">GICInterface_Type</a>;</div>
238 <div class="ttc" id="acore__ca_8h_html_a0ea2009ed8fd9ef35b48708280fdb758"><div class="ttname"><a href="core__ca_8h.html#a0ea2009ed8fd9ef35b48708280fdb758">__OM</a></div><div class="ttdeci">#define __OM</div><div class="ttdoc">Defines 'write only' structure member permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:179</div></div>
239 <div class="ttc" id="acore__ca_8h_html_a4cc1649793116d7c2d8afce7a4ffce43"><div class="ttname"><a href="core__ca_8h.html#a4cc1649793116d7c2d8afce7a4ffce43">__IM</a></div><div class="ttdeci">#define __IM</div><div class="ttdoc">Defines 'read only' structure member permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:178</div></div>
240 <div class="ttc" id="acore__ca_8h_html_ab6caba5853a60a17e8e04499b52bf691"><div class="ttname"><a href="core__ca_8h.html#ab6caba5853a60a17e8e04499b52bf691">__IOM</a></div><div class="ttdeci">#define __IOM</div><div class="ttdoc">Defines 'read / write' structure member permissions.</div><div class="ttdef"><b>Definition:</b> core_ca.h:180</div></div>
241 <div class="ttc" id="astructGICInterface__Type_html"><div class="ttname"><a href="structGICInterface__Type.html">GICInterface_Type</a></div><div class="ttdoc">Structure type to access the Generic Interrupt Controller Interface (GICC)</div><div class="ttdef"><b>Definition:</b> core_ca.h:962</div></div>
242 </div><!-- fragment --></li>
243 <li><b>Base Address</b> for each peripheral (in case of multiple peripherals that use the same <b>register layout typedef</b> multiple base addresses are defined). <br  />
244 <br  />
245 <b>Example:</b> <div class="fragment"><div class="line"><span class="preprocessor">#define GIC_INTERFACE_BASE (0xe8202000UL)   </span><span class="comment">// GIC Interface Base Address     </span></div>
246 </div><!-- fragment --></li>
247 <li><b>Access Definitions</b> for each peripheral. In case of multiple peripherals that are using the same <b>register layout typedef</b>, multiple access definitions exist. <br  />
248 <br  />
249 <b>Example:</b> <div class="fragment"><div class="line"><span class="preprocessor">#define GICInterface   ((GICInterface_Type *) GIC_INTERFACE_BASE)   </span><span class="comment">// GIC Interface Access Definition </span></div>
250 </div><!-- fragment --></li>
251 </ul>
252 <p>These definitions allow accessing peripheral registers with simple assignments.</p>
253 <ul>
254 <li><b>Example:</b> <br  />
255 <div class="fragment"><div class="line"><a class="code hl_define" href="group__GIC__functions.html#ga31a083dbdc5cb84178dbf184286180e3">GICInterface</a>-&gt;C_CTLR |= 1;   <span class="comment">// Enable Interface</span></div>
256 <div class="ttc" id="agroup__GIC__functions_html_ga31a083dbdc5cb84178dbf184286180e3"><div class="ttname"><a href="group__GIC__functions.html#ga31a083dbdc5cb84178dbf184286180e3">GICInterface</a></div><div class="ttdeci">#define GICInterface</div><div class="ttdoc">GIC Interface register set access pointer.</div></div>
257 </div><!-- fragment --></li>
258 </ul>
259 <hr  />
260 <h1><a class="anchor" id="core_cmsis_pal_opts"></a>
261 Optional Features</h1>
262 <p>Optionally, the file <b><em>device</em>.h</b> may define:</p>
263 <ul>
264 <li><a class="el" href="group__peripheral__gr.html#core_cmsis_pal_bitfields">Register Bit Fields</a> and #define constants that simplify access to peripheral registers. These constants may define bit-positions or other specific patterns that are required for programming peripheral registers. The identifiers should start with <b>&lt;<em>device abbreviation</em>&gt;_</b> and <b>&lt;<em>peripheral name</em>&gt;_</b>. It is recommended to use CAPITAL letters for #define constants.</li>
265 <li>More complex functions (i.e. status query before a sending register is accessed). Again, these functions start with <b>&lt;<em>device abbreviation</em>&gt;_</b> and <b>&lt;<em>peripheral name</em>&gt;_</b>.</li>
266 </ul>
267 <hr  />
268 <h1><a class="anchor" id="core_cmsis_pal_bitfields"></a>
269 Register Bit Fields</h1>
270 <p>For Core Register, macros define the position and the mask value for a bit field.</p>
271 <p><b>Example:</b></p>
272 <p>Bit field definitions for register ACTLR in CP15.</p>
273 <div class="fragment"><div class="line"><span class="comment">// CP15 Register ACTLR</span></div>
274 <div class="line"><span class="preprocessor">#define ACTLR_DDI_Pos                  28U                       </span></div>
275 <div class="line"><span class="preprocessor">#define ACTLR_DDI_Msk                  (1UL &lt;&lt; ACTLR_DDI_Pos)    </span></div>
276 <div class="line">                                       </div>
277 <div class="line"><span class="preprocessor">#define ACTLR_DDVM_Pos                 15U                       </span></div>
278 <div class="line"><span class="preprocessor">#define ACTLR_DDVM_Msk                 (1UL &lt;&lt; ACTLR_DDVM_Pos)   </span></div>
279 <div class="line">                                       </div>
280 <div class="line"><span class="preprocessor">#define ACTLR_L1PCTL_Pos               13U                       </span></div>
281 <div class="line"><span class="preprocessor">#define ACTLR_L1PCTL_Msk               (3UL &lt;&lt; ACTLR_L1PCTL_Pos) </span></div>
282 <div class="line">                                       </div>
283 <div class="line"><span class="preprocessor">#define ACTLR_L1RADIS_Pos              12U                       </span></div>
284 <div class="line"><span class="preprocessor">#define ACTLR_L1RADIS_Msk              (1UL &lt;&lt; ACTLR_L1RADIS_Pos)</span></div>
285 <div class="line">                                       </div>
286 <div class="line"><span class="preprocessor">#define ACTLR_L2RADIS_Pos              11U                       </span></div>
287 <div class="line"><span class="preprocessor">#define ACTLR_L2RADIS_Msk              (1UL &lt;&lt; ACTLR_L2RADIS_Pos)</span></div>
288 <div class="line">                                       </div>
289 <div class="line"><span class="preprocessor">#define ACTLR_DODMBS_Pos               10U                       </span></div>
290 <div class="line"><span class="preprocessor">#define ACTLR_DODMBS_Msk               (1UL &lt;&lt; ACTLR_DODMBS_Pos) </span></div>
291 <div class="line">                                       </div>
292 <div class="line"><span class="preprocessor">#define ACTLR_SMP_Pos                  6U                        </span></div>
293 <div class="line"><span class="preprocessor">#define ACTLR_SMP_Msk                  (1UL &lt;&lt; ACTLR_SMP_Pos)     </span></div>
294 </div><!-- fragment --><p>The macros <b><a class="el" href="group__peripheral__gr.html#ga286e3b913dbd236c7f48ea70c8821f4e" title="Mask and shift a bit field value for assigning the result to a peripheral register.">_VAL2FLD(field, value)</a></b> and <b><a class="el" href="group__peripheral__gr.html#ga139b6e261c981f014f386927ca4a8444" title="Extract from a peripheral register value the a bit field value.">_FLD2VAL(field, value)</a></b> enable access to bit fields. </p>
295 <h2 class="groupheader">Macro Definition Documentation</h2>
296 <a id="ga139b6e261c981f014f386927ca4a8444" name="ga139b6e261c981f014f386927ca4a8444"></a>
297 <h2 class="memtitle"><span class="permalink"><a href="#ga139b6e261c981f014f386927ca4a8444">&#9670;&#160;</a></span>_FLD2VAL</h2>
298
299 <div class="memitem">
300 <div class="memproto">
301       <table class="memname">
302         <tr>
303           <td class="memname">#define _FLD2VAL</td>
304           <td>(</td>
305           <td class="paramtype">&#160;</td>
306           <td class="paramname">field, </td>
307         </tr>
308         <tr>
309           <td class="paramkey"></td>
310           <td></td>
311           <td class="paramtype">&#160;</td>
312           <td class="paramname">value&#160;</td>
313         </tr>
314         <tr>
315           <td></td>
316           <td>)</td>
317           <td></td><td></td>
318         </tr>
319       </table>
320 </div><div class="memdoc">
321
322 <p>Extract from a peripheral register value the a bit field value. </p>
323 <dl class="params"><dt>Parameters</dt><dd>
324   <table class="params">
325     <tr><td class="paramname">field</td><td>name of bit field. </td></tr>
326     <tr><td class="paramname">value</td><td>value of the register. This parameter is interpreted as an uint32_t type.</td></tr>
327   </table>
328   </dd>
329 </dl>
330 <p>The macro <a class="el" href="core__ca_8h.html#a139b6e261c981f014f386927ca4a8444">_FLD2VAL</a> uses the #define's <em>_Pos</em> and <em>_Msk</em> of the related bit field to extract the value of a bit field from a register.</p>
331 <p><b>Example:</b> </p><div class="fragment"><div class="line">i = <a class="code hl_define" href="core__ca_8h.html#a139b6e261c981f014f386927ca4a8444">_FLD2VAL</a>(ACTLR_SMP, ACTLR);</div>
332 <div class="ttc" id="acore__ca_8h_html_a139b6e261c981f014f386927ca4a8444"><div class="ttname"><a href="core__ca_8h.html#a139b6e261c981f014f386927ca4a8444">_FLD2VAL</a></div><div class="ttdeci">#define _FLD2VAL(field, value)</div><div class="ttdoc">Mask and shift a register value to extract a bit field value.</div><div class="ttdef"><b>Definition:</b> core_ca.h:674</div></div>
333 </div><!-- fragment --> 
334 </div>
335 </div>
336 <a id="ga286e3b913dbd236c7f48ea70c8821f4e" name="ga286e3b913dbd236c7f48ea70c8821f4e"></a>
337 <h2 class="memtitle"><span class="permalink"><a href="#ga286e3b913dbd236c7f48ea70c8821f4e">&#9670;&#160;</a></span>_VAL2FLD</h2>
338
339 <div class="memitem">
340 <div class="memproto">
341       <table class="memname">
342         <tr>
343           <td class="memname">#define _VAL2FLD</td>
344           <td>(</td>
345           <td class="paramtype">&#160;</td>
346           <td class="paramname">field, </td>
347         </tr>
348         <tr>
349           <td class="paramkey"></td>
350           <td></td>
351           <td class="paramtype">&#160;</td>
352           <td class="paramname">value&#160;</td>
353         </tr>
354         <tr>
355           <td></td>
356           <td>)</td>
357           <td></td><td></td>
358         </tr>
359       </table>
360 </div><div class="memdoc">
361
362 <p>Mask and shift a bit field value for assigning the result to a peripheral register. </p>
363 <dl class="params"><dt>Parameters</dt><dd>
364   <table class="params">
365     <tr><td class="paramname">field</td><td>name of bit field. </td></tr>
366     <tr><td class="paramname">value</td><td>value for the bit field. This parameter is interpreted as an uint32_t type.</td></tr>
367   </table>
368   </dd>
369 </dl>
370 <p>The macro <a class="el" href="core__ca_8h.html#a286e3b913dbd236c7f48ea70c8821f4e">_VAL2FLD</a> uses the #define's <em>_Pos</em> and <em>_Msk</em> of the related bit field to shift bit-field values for assigning to a register.</p>
371 <p><b>Example:</b> </p><div class="fragment"><div class="line">ACTLR = <a class="code hl_define" href="core__ca_8h.html#a286e3b913dbd236c7f48ea70c8821f4e">_VAL2FLD</a>(ACTLR_SMP, 0x1)</div>
372 <div class="ttc" id="acore__ca_8h_html_a286e3b913dbd236c7f48ea70c8821f4e"><div class="ttname"><a href="core__ca_8h.html#a286e3b913dbd236c7f48ea70c8821f4e">_VAL2FLD</a></div><div class="ttdeci">#define _VAL2FLD(field, value)</div><div class="ttdoc">Mask and shift a bit field value for use in a register bit range.</div><div class="ttdef"><b>Definition:</b> core_ca.h:666</div></div>
373 </div><!-- fragment --> 
374 </div>
375 </div>
376 </div><!-- contents -->
377 </div><!-- doc-content -->
378 <!-- start footer part -->
379 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
380   <ul>
381     <li class="footer">
382       <script type="text/javascript">
383         <!--
384         writeFooter.call(this);
385         //-->
386       </script> 
387     </li>
388   </ul>
389 </div>
390 </body>
391 </html>