]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Ref_Trustzone.txt
Merge pull request #45 from GuentherMartin/CMSIS_ARMv8M
[cmsis] / CMSIS / DoxyGen / Core / src / Ref_Trustzone.txt
1 /**\r
2 \defgroup trustzone_functions TrustZone for ARMv8-M\r
3 \brief Functions that related to optional ARMv8-M security extension\r
4 \details\r
5 The ARMv8-M architecture has optional ARMv8-M security extension based on ARM TrustZone technology.\r
6 To access ARM TrustZone extensions for ARMv8-M additional CMSIS functions are provided:\r
7  - \ref nvic_trustzone_functions\r
8  - \ref systick_trustzone_functions\r
9  - \ref sau_trustzone_functions\r
10  - \ref coreregister_trustzone_functions\r
11 \r
12 @{\r
13 */\r
14 \r
15 /**\r
16   \defgroup nvic_trustzone_functions NVIC Functions\r
17   \brief Nested Vector Interrupt Controller (NVIC) functions related to TrustZone for ARMv8-M \r
18   @{\r
19 */\r
20 \r
21 /**\r
22   \brief   Set Priority Grouping (non-secure)\r
23   \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence.\r
24            The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
25            Only values from 0..7 are used.\r
26            In case of a conflict between priority grouping and available\r
27            priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.\r
28   \param [in]      PriorityGroup  Priority grouping field.\r
29   \note    Only available for ARMv8-M Mainline. \r
30   \sa     \r
31     - \ref NVIC_SetPriorityGrouping\r
32  */\r
33 void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup);\r
34 \r
35 /**\r
36   \brief   Get Priority Grouping (non-secure)\r
37   \details Reads the priority grouping field from the non-secure NVIC when in secure state.\r
38   \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).\r
39   \note    Only available for ARMv8-M Mainline. \r
40   \sa     \r
41     - \ref NVIC_GetPriorityGrouping\r
42  */\r
43 uint32_t TZ_NVIC_GetPriorityGrouping_NS(void);\r
44 \r
45 /**\r
46   \brief   Enable External Interrupt (non-secure)\r
47   \details Enables a device-specific interrupt in the non-secure NVIC when in secure state.\r
48   \param [in]      IRQn  External interrupt number. Value cannot be negative.\r
49   \sa     \r
50     - \ref NVIC_EnableIRQ\r
51  */\r
52 void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn);\r
53 \r
54 /**\r
55   \brief   Disable External Interrupt (non-secure)\r
56   \details Disables a device-specific interrupt in the non-secure NVIC when in secure state.\r
57   \param [in]      IRQn  External interrupt number. Value cannot be negative.\r
58   \sa     \r
59     - \ref NVIC_DisableIRQ\r
60  */\r
61 void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn);\r
62 \r
63 /**\r
64   \brief   Get Pending Interrupt (non-secure)\r
65   \details Reads the pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified interrupt.\r
66   \param [in]      IRQn  Interrupt number.\r
67   \return             0  Interrupt status is not pending.\r
68   \return             1  Interrupt status is pending.\r
69   \sa     \r
70     - \ref NVIC_GetPendingIRQ\r
71  */\r
72 uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn);\r
73 \r
74 /**\r
75   \brief   Set Pending Interrupt (non-secure)\r
76   \details Sets the pending bit of an non-secure external interrupt when in secure state.\r
77   \param [in]      IRQn  Interrupt number. Value cannot be negative.\r
78   \sa     \r
79     - \ref NVIC_SetPendingIRQ\r
80  */\r
81 void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn);\r
82 \r
83 /**\r
84   \brief   Clear Pending Interrupt (non-secure)\r
85   \details Clears the pending bit of an non-secure external interrupt when in secure state.\r
86   \param [in]      IRQn  External interrupt number. Value cannot be negative.\r
87   \sa     \r
88     - \ref NVIC_ClearPendingIRQ\r
89  */\r
90 void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn);\r
91 \r
92 /**\r
93   \brief   Get Active Interrupt (non-secure)\r
94   \details Reads the active register in non-secure NVIC when in secure state and returns the active bit.\r
95   \param [in]      IRQn  Interrupt number.\r
96   \return             0  Interrupt status is not active.\r
97   \return             1  Interrupt status is active.\r
98   \sa     \r
99     - \ref NVIC_GetActive\r
100  */\r
101 uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn);\r
102 \r
103 /**\r
104   \brief   Set Interrupt Priority (non-secure)\r
105   \details Sets the priority of an non-secure interrupt when in secure state.\r
106   \note    The priority cannot be set for every core interrupt.\r
107   \param [in]      IRQn  Interrupt number.\r
108   \param [in]  priority  Priority to set.\r
109   \sa     \r
110     - \ref NVIC_SetPriority\r
111  */\r
112 void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority);\r
113 \r
114 /**\r
115   \brief   Get Interrupt Priority (non-secure)\r
116   \details Reads the priority of an non-secure interrupt when in secure state.\r
117            The interrupt number can be positive to specify an external (device specific) interrupt,\r
118            or negative to specify an internal (core) interrupt.\r
119   \param [in]   IRQn  Interrupt number.\r
120   \return             Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller.\r
121   \sa     \r
122     - \ref NVIC_GetPriority\r
123  */\r
124 uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn);\r
125 \r
126 /** close nvic_trustzone_functions\r
127   @}\r
128 */\r
129 \r
130 \r
131 /**\r
132   \defgroup systick_trustzone_functions SysTick Functions\r
133   \brief SysTick functions related to TrustZone for ARMv8-M.\r
134   @{\r
135 */\r
136 \r
137 /**\r
138   \brief   System Tick Configuration (non-secure)\r
139   \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer.\r
140            Counter is in free running mode to generate periodic interrupts.\r
141   \param [in]  ticks  Number of ticks between two interrupts.\r
142   \return          0  Function succeeded.\r
143   \return          1  Function failed.\r
144   \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the\r
145            function <b>TZ_SysTick_Config_NS</b> is not included. In this case, the file <b><i>device</i>.h</b>\r
146            must contain a vendor-specific implementation of this function.\r
147   \sa     \r
148     - \ref SysTick_Config\r
149  */\r
150 uint32_t TZ_SysTick_Config_NS(uint32_t ticks);\r
151 \r
152 /** close systick_trustzone_functions\r
153   @}\r
154 */\r
155 \r
156 \r
157 /**\r
158   \defgroup sau_trustzone_functions SAU Functions\r
159   \brief Secure Attribution Unit (SAU) functions related to TrustZone for ARMv8-M.\r
160   @{\r
161 \details\r
162 The Secure Attribution Unit (SAU) functions SAU \r
163 \r
164 \note\r
165 TZ_SAU_* functions are only available if macro __SAU_PRESENT is set to 1.\r
166 \r
167  */\r
168 \r
169 /**\r
170 \brief   Setup Secure Attribute Unit (SAU) and non-secure interrupts\r
171 \details \r
172 The function \ref TZ_SAU_Setup uses the settings in the \ref partition_h_pg to initialize\r
173 the Secure Attribute Unit (SAU) and define non-secure interrupts.  It is called from\r
174 the function \ref SystemInit.\r
175  */\r
176 void TZ_SAU_Setup (void);\r
177 \r
178 /**\r
179   \brief   Enable Security Attribution Unit (SAU)\r
180   \details Enables the Security Attribution Unit (SAU).\r
181  */\r
182 void TZ_SAU_Enable(void);\r
183 \r
184 /**\r
185   \brief   Disable Security Attribution Unit (SAU)\r
186   \details Disables the Security Attribution Unit (SAU).\r
187  */\r
188 void TZ_SAU_Disable(void);\r
189 \r
190 /** close sau_trustzone_functions\r
191   @}\r
192 */\r
193 \r
194 \r
195 /**\r
196   \defgroup coreregister_trustzone_functions Core Register Access Functions\r
197   \brief Core register Access functions related to TrustZone for ARMv8-M .\r
198   @{\r
199 */\r
200 \r
201 /**\r
202   \brief   Get Control register (non-secure)\r
203   \details Returns the content of the non-secure Control register when in secure mode.\r
204   \return               non-secure Control register value\r
205   \sa     \r
206     - \ref __get_CONTROL; CONTROL_Type \r
207  */\r
208 uint32_t __TZ_get_CONTROL_NS(void);\r
209 \r
210 /**\r
211   \brief   Set Control register (non-secure)\r
212   \details Writes the given value to the non-secure Control register when in secure state.\r
213   \param [in]    control  Control register value to set\r
214   \sa     \r
215     - \ref __set_CONTROL; CONTROL_Type \r
216  */\r
217 void __TZ_set_CONTROL_NS(uint32_t control);\r
218 \r
219 /**\r
220   \brief   Get Process Stack Pointer (non-secure)\r
221   \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.\r
222   \return               PSP register value\r
223   \sa     \r
224     - \ref __get_PSP\r
225  */\r
226 uint32_t __TZ_get_PSP_NS(void);\r
227 \r
228 /**\r
229   \brief   Set Process Stack Pointer (non-secure)\r
230   \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.\r
231   \param [in]    topOfProcStack  Process Stack Pointer value to set\r
232   \sa     \r
233     - \ref __set_PSP\r
234  */\r
235 void __TZ_set_PSP_NS(uint32_t topOfProcStack);\r
236 \r
237 /**\r
238   \brief   Get Main Stack Pointer (non-secure)\r
239   \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.\r
240   \return               MSP register value\r
241   \sa     \r
242     - \ref __get_MSP\r
243  */\r
244 uint32_t __TZ_get_MSP_NS(void);\r
245 \r
246 /**\r
247   \brief   Set Main Stack Pointer (non-secure)\r
248   \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.\r
249   \param [in]    topOfMainStack  Main Stack Pointer value to set\r
250   \sa     \r
251     - \ref __set_MSP\r
252  */\r
253 void __TZ_set_MSP_NS(uint32_t topOfMainStack);\r
254 \r
255 /**\r
256   \brief   Get Priority Mask (non-secure)\r
257   \details Returns the current state of the non-secure priority mask bit from the Priority Mask register when in secure state.\r
258   \return               Priority Mask value\r
259   \sa     \r
260     - \ref __get_PRIMASK\r
261  */\r
262 uint32_t __TZ_get_PRIMASK_NS(void);\r
263 \r
264 /**\r
265   \brief   Set Priority Mask (non-secure)\r
266   \details Assigns the given value to the non-secure Priority Mask register when in secure state.\r
267   \param [in]    priMask  Priority Mask\r
268   \sa     \r
269     - \ref __set_PRIMASK\r
270  */\r
271 void __TZ_set_PRIMASK_NS(uint32_t priMask);\r
272 \r
273 /**\r
274   \brief   Get Base Priority (non-secure)\r
275   \details Returns the current value of the non-secure Base Priority register when in secure state.\r
276   \return               Base Priority register value\r
277   \sa     \r
278     - \ref __get_BASEPRI\r
279  */\r
280 uint32_t __TZ_get_BASEPRI_NS(void);\r
281 \r
282 /**\r
283   \brief   Set Base Priority (non-secure)\r
284   \details Assigns the given value to the non-secure Base Priority register when in secure state.\r
285   \param [in]    basePri  Base Priority value to set\r
286   \sa     \r
287     - \ref __set_BASEPRI\r
288  */\r
289 void __TZ_set_BASEPRI_NS(uint32_t basePri);\r
290 \r
291 /**\r
292   \brief   Get Fault Mask (non-secure)\r
293   \details Returns the current value of the non-secure Fault Mask register when in secure state.\r
294   \return               Fault Mask register value\r
295   \sa     \r
296     - \ref __get_FAULTMASK\r
297  */\r
298 uint32_t __TZ_get_FAULTMASK_NS(void);\r
299 \r
300 /**\r
301   \brief   Set Fault Mask (non-secure)\r
302   \details Assigns the given value to the non-secure Fault Mask register when in secure state.\r
303   \param [in]    faultMask  Fault Mask value to set\r
304   \sa     \r
305     - \ref __set_FAULTMASK\r
306  */\r
307 void __TZ_set_FAULTMASK_NS(uint32_t faultMask);\r
308 \r
309 /**\r
310   \brief   Get Process Stack Pointer Limit (non-secure)\r
311   \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
312   \return               PSPLIM register value\r
313   \note    Only available for ARMv8-M Mainline. \r
314  */\r
315 uint32_t __TZ_get_PSPLIM_NS(void);\r
316 \r
317 /**\r
318   \brief   Set Process Stack Pointer (non-secure)\r
319   \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.\r
320   \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set\r
321   \note    Only available for ARMv8-M Mainline. \r
322  */\r
323 void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit);\r
324 \r
325 /**\r
326   \brief   Get Main Stack Pointer Limit (non-secure)\r
327   \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.\r
328   \return               MSPLIM register value\r
329   \note    Only available for ARMv8-M Mainline. \r
330  */\r
331 uint32_t __TZ_get_MSPLIM_NS(void);\r
332 \r
333 /**\r
334   \brief   Set Main Stack Pointer Limit (non-secure)\r
335   \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.\r
336   \param [in]    MainStackPtrLimit  Main Stack Pointer value to set\r
337   \note    Only available for ARMv8-M Mainline. \r
338  */\r
339 void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit);\r
340 \r
341 /** close coreregister_trustzone_functions\r
342   @}\r
343 */\r
344 \r
345 \r
346 /** close trustzone_functions\r
347 @}\r
348 */\r