STM MATLAB Simulator
Loading...
Searching...
No Matches
core_cm4_matlab.h
Go to the documentation of this file.
1/************************************************************************
2Данный файл является копией core_cm4.h, только первые ~160 строк, которые
3определяют компилятор АРМ, удалены.
4МАТЛАБ компилирует через код через комплилятор MSVC для блока S-Function
5Также добавлена структура имитирующая память ядра (~1360)
6**************************************************************************/
7#ifndef __CMSIS_GENERIC
8/* IO definitions (access restrictions to peripheral registers) */
17#ifdef __cplusplus
18 #define __I volatile
19#else
20 #define __I volatile const
21#endif
22#define __O volatile
23#define __IO volatile
25/* following defines should be used for structure members */
26#define __IM volatile const
27#define __OM volatile
28#define __IOM volatile
34/*******************************************************************************
35 * Register Abstraction
36 Core Register contain:
37 - Core Register
38 - Core NVIC Register
39 - Core SCB Register
40 - Core SysTick Register
41 - Core Debug Register
42 - Core MPU Register
43 - Core FPU Register
44 ******************************************************************************/
75
76/* APSR Register Definitions */
77#define APSR_N_Pos 31U
78#define APSR_N_Msk (1UL << APSR_N_Pos)
80#define APSR_Z_Pos 30U
81#define APSR_Z_Msk (1UL << APSR_Z_Pos)
83#define APSR_C_Pos 29U
84#define APSR_C_Msk (1UL << APSR_C_Pos)
86#define APSR_V_Pos 28U
87#define APSR_V_Msk (1UL << APSR_V_Pos)
89#define APSR_Q_Pos 27U
90#define APSR_Q_Msk (1UL << APSR_Q_Pos)
92#define APSR_GE_Pos 16U
93#define APSR_GE_Msk (0xFUL << APSR_GE_Pos)
99typedef union
100{
101 struct
102 {
105 } b;
107} IPSR_Type;
108
109/* IPSR Register Definitions */
110#define IPSR_ISR_Pos 0U
111#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/)
136
137/* xPSR Register Definitions */
138#define xPSR_N_Pos 31U
139#define xPSR_N_Msk (1UL << xPSR_N_Pos)
141#define xPSR_Z_Pos 30U
142#define xPSR_Z_Msk (1UL << xPSR_Z_Pos)
144#define xPSR_C_Pos 29U
145#define xPSR_C_Msk (1UL << xPSR_C_Pos)
147#define xPSR_V_Pos 28U
148#define xPSR_V_Msk (1UL << xPSR_V_Pos)
150#define xPSR_Q_Pos 27U
151#define xPSR_Q_Msk (1UL << xPSR_Q_Pos)
153#define xPSR_ICI_IT_2_Pos 25U
154#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos)
156#define xPSR_T_Pos 24U
157#define xPSR_T_Msk (1UL << xPSR_T_Pos)
159#define xPSR_GE_Pos 16U
160#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos)
162#define xPSR_ICI_IT_1_Pos 10U
163#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos)
165#define xPSR_ISR_Pos 0U
166#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/)
172typedef union
173{
174 struct
175 {
180 } b;
183
184/* CONTROL Register Definitions */
185#define CONTROL_FPCA_Pos 2U
186#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos)
188#define CONTROL_SPSEL_Pos 1U
189#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos)
191#define CONTROL_nPRIV_Pos 0U
192#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/)
207typedef struct
208{
209 __IOM uint32_t ISER[8U];
210 uint32_t RESERVED0[24U];
211 __IOM uint32_t ICER[8U];
212 uint32_t RSERVED1[24U];
213 __IOM uint32_t ISPR[8U];
214 uint32_t RESERVED2[24U];
215 __IOM uint32_t ICPR[8U];
216 uint32_t RESERVED3[24U];
217 __IOM uint32_t IABR[8U];
218 uint32_t RESERVED4[56U];
219 __IOM uint8_t IP[240U];
220 uint32_t RESERVED5[644U];
222} NVIC_Type;
223
224/* Software Triggered Interrupt Register Definitions */
225#define NVIC_STIR_INTID_Pos 0U
226#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/)
265
266/* SCB CPUID Register Definitions */
267#define SCB_CPUID_IMPLEMENTER_Pos 24U
268#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)
270#define SCB_CPUID_VARIANT_Pos 20U
271#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos)
273#define SCB_CPUID_ARCHITECTURE_Pos 16U
274#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)
276#define SCB_CPUID_PARTNO_Pos 4U
277#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos)
279#define SCB_CPUID_REVISION_Pos 0U
280#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/)
282/* SCB Interrupt Control State Register Definitions */
283#define SCB_ICSR_NMIPENDSET_Pos 31U
284#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos)
286#define SCB_ICSR_PENDSVSET_Pos 28U
287#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos)
289#define SCB_ICSR_PENDSVCLR_Pos 27U
290#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos)
292#define SCB_ICSR_PENDSTSET_Pos 26U
293#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos)
295#define SCB_ICSR_PENDSTCLR_Pos 25U
296#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos)
298#define SCB_ICSR_ISRPREEMPT_Pos 23U
299#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos)
301#define SCB_ICSR_ISRPENDING_Pos 22U
302#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos)
304#define SCB_ICSR_VECTPENDING_Pos 12U
305#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)
307#define SCB_ICSR_RETTOBASE_Pos 11U
308#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos)
310#define SCB_ICSR_VECTACTIVE_Pos 0U
311#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/)
313/* SCB Vector Table Offset Register Definitions */
314#define SCB_VTOR_TBLOFF_Pos 7U
315#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)
317/* SCB Application Interrupt and Reset Control Register Definitions */
318#define SCB_AIRCR_VECTKEY_Pos 16U
319#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
321#define SCB_AIRCR_VECTKEYSTAT_Pos 16U
322#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)
324#define SCB_AIRCR_ENDIANESS_Pos 15U
325#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos)
327#define SCB_AIRCR_PRIGROUP_Pos 8U
328#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos)
330#define SCB_AIRCR_SYSRESETREQ_Pos 2U
331#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos)
333#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U
334#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)
336#define SCB_AIRCR_VECTRESET_Pos 0U
337#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/)
339/* SCB System Control Register Definitions */
340#define SCB_SCR_SEVONPEND_Pos 4U
341#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos)
343#define SCB_SCR_SLEEPDEEP_Pos 2U
344#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos)
346#define SCB_SCR_SLEEPONEXIT_Pos 1U
347#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos)
349/* SCB Configuration Control Register Definitions */
350#define SCB_CCR_STKALIGN_Pos 9U
351#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos)
353#define SCB_CCR_BFHFNMIGN_Pos 8U
354#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos)
356#define SCB_CCR_DIV_0_TRP_Pos 4U
357#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos)
359#define SCB_CCR_UNALIGN_TRP_Pos 3U
360#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos)
362#define SCB_CCR_USERSETMPEND_Pos 1U
363#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos)
365#define SCB_CCR_NONBASETHRDENA_Pos 0U
366#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/)
368/* SCB System Handler Control and State Register Definitions */
369#define SCB_SHCSR_USGFAULTENA_Pos 18U
370#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos)
372#define SCB_SHCSR_BUSFAULTENA_Pos 17U
373#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos)
375#define SCB_SHCSR_MEMFAULTENA_Pos 16U
376#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos)
378#define SCB_SHCSR_SVCALLPENDED_Pos 15U
379#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos)
381#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U
382#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)
384#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U
385#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)
387#define SCB_SHCSR_USGFAULTPENDED_Pos 12U
388#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)
390#define SCB_SHCSR_SYSTICKACT_Pos 11U
391#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos)
393#define SCB_SHCSR_PENDSVACT_Pos 10U
394#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos)
396#define SCB_SHCSR_MONITORACT_Pos 8U
397#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos)
399#define SCB_SHCSR_SVCALLACT_Pos 7U
400#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos)
402#define SCB_SHCSR_USGFAULTACT_Pos 3U
403#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos)
405#define SCB_SHCSR_BUSFAULTACT_Pos 1U
406#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos)
408#define SCB_SHCSR_MEMFAULTACT_Pos 0U
409#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/)
411/* SCB Configurable Fault Status Register Definitions */
412#define SCB_CFSR_USGFAULTSR_Pos 16U
413#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)
415#define SCB_CFSR_BUSFAULTSR_Pos 8U
416#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)
418#define SCB_CFSR_MEMFAULTSR_Pos 0U
419#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)
421/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
422#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U)
423#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos)
425#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U)
426#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos)
428#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U)
429#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos)
431#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U)
432#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos)
434#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U)
435#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos)
437#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U)
438#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)
440/* BusFault Status Register (part of SCB Configurable Fault Status Register) */
441#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U)
442#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos)
444#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U)
445#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos)
447#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U)
448#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos)
450#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U)
451#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos)
453#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U)
454#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos)
456#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U)
457#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos)
459#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U)
460#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos)
462/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */
463#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U)
464#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos)
466#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U)
467#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos)
469#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U)
470#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos)
472#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U)
473#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos)
475#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U)
476#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos)
478#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U)
479#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos)
481/* SCB Hard Fault Status Register Definitions */
482#define SCB_HFSR_DEBUGEVT_Pos 31U
483#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos)
485#define SCB_HFSR_FORCED_Pos 30U
486#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos)
488#define SCB_HFSR_VECTTBL_Pos 1U
489#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos)
491/* SCB Debug Fault Status Register Definitions */
492#define SCB_DFSR_EXTERNAL_Pos 4U
493#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos)
495#define SCB_DFSR_VCATCH_Pos 3U
496#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos)
498#define SCB_DFSR_DWTTRAP_Pos 2U
499#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos)
501#define SCB_DFSR_BKPT_Pos 1U
502#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos)
504#define SCB_DFSR_HALTED_Pos 0U
505#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/)
520typedef struct
521{
522 uint32_t RESERVED0[1U];
526
527/* Interrupt Controller Type Register Definitions */
528#define SCnSCB_ICTR_INTLINESNUM_Pos 0U
529#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/)
531/* Auxiliary Control Register Definitions */
532#define SCnSCB_ACTLR_DISOOFP_Pos 9U
533#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos)
535#define SCnSCB_ACTLR_DISFPCA_Pos 8U
536#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos)
538#define SCnSCB_ACTLR_DISFOLD_Pos 2U
539#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos)
541#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U
542#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos)
544#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U
545#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/)
567
568/* SysTick Control / Status Register Definitions */
569#define SysTick_CTRL_COUNTFLAG_Pos 16U
570#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos)
572#define SysTick_CTRL_CLKSOURCE_Pos 2U
573#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos)
575#define SysTick_CTRL_TICKINT_Pos 1U
576#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos)
578#define SysTick_CTRL_ENABLE_Pos 0U
579#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/)
581/* SysTick Reload Register Definitions */
582#define SysTick_LOAD_RELOAD_Pos 0U
583#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/)
585/* SysTick Current Register Definitions */
586#define SysTick_VAL_CURRENT_Pos 0U
587#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/)
589/* SysTick Calibration Register Definitions */
590#define SysTick_CALIB_NOREF_Pos 31U
591#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos)
593#define SysTick_CALIB_SKEW_Pos 30U
594#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos)
596#define SysTick_CALIB_TENMS_Pos 0U
597#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/)
647
648/* ITM Trace Privilege Register Definitions */
649#define ITM_TPR_PRIVMASK_Pos 0U
650#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/)
652/* ITM Trace Control Register Definitions */
653#define ITM_TCR_BUSY_Pos 23U
654#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos)
656#define ITM_TCR_TraceBusID_Pos 16U
657#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos)
659#define ITM_TCR_GTSFREQ_Pos 10U
660#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos)
662#define ITM_TCR_TSPrescale_Pos 8U
663#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos)
665#define ITM_TCR_SWOENA_Pos 4U
666#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos)
668#define ITM_TCR_DWTENA_Pos 3U
669#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos)
671#define ITM_TCR_SYNCENA_Pos 2U
672#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos)
674#define ITM_TCR_TSENA_Pos 1U
675#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos)
677#define ITM_TCR_ITMENA_Pos 0U
678#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/)
680/* ITM Integration Write Register Definitions */
681#define ITM_IWR_ATVALIDM_Pos 0U
682#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/)
684/* ITM Integration Read Register Definitions */
685#define ITM_IRR_ATREADYM_Pos 0U
686#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/)
688/* ITM Integration Mode Control Register Definitions */
689#define ITM_IMCR_INTEGRATION_Pos 0U
690#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/)
692/* ITM Lock Status Register Definitions */
693#define ITM_LSR_ByteAcc_Pos 2U
694#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos)
696#define ITM_LSR_Access_Pos 1U
697#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos)
699#define ITM_LSR_Present_Pos 0U
700#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /* end of group CMSIS_ITM */
703
704
741
742/* DWT Control Register Definitions */
743#define DWT_CTRL_NUMCOMP_Pos 28U
744#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos)
746#define DWT_CTRL_NOTRCPKT_Pos 27U
747#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos)
749#define DWT_CTRL_NOEXTTRIG_Pos 26U
750#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos)
752#define DWT_CTRL_NOCYCCNT_Pos 25U
753#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos)
755#define DWT_CTRL_NOPRFCNT_Pos 24U
756#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos)
758#define DWT_CTRL_CYCEVTENA_Pos 22U
759#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos)
761#define DWT_CTRL_FOLDEVTENA_Pos 21U
762#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos)
764#define DWT_CTRL_LSUEVTENA_Pos 20U
765#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos)
767#define DWT_CTRL_SLEEPEVTENA_Pos 19U
768#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos)
770#define DWT_CTRL_EXCEVTENA_Pos 18U
771#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos)
773#define DWT_CTRL_CPIEVTENA_Pos 17U
774#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos)
776#define DWT_CTRL_EXCTRCENA_Pos 16U
777#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos)
779#define DWT_CTRL_PCSAMPLENA_Pos 12U
780#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos)
782#define DWT_CTRL_SYNCTAP_Pos 10U
783#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos)
785#define DWT_CTRL_CYCTAP_Pos 9U
786#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos)
788#define DWT_CTRL_POSTINIT_Pos 5U
789#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos)
791#define DWT_CTRL_POSTPRESET_Pos 1U
792#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos)
794#define DWT_CTRL_CYCCNTENA_Pos 0U
795#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/)
797/* DWT CPI Count Register Definitions */
798#define DWT_CPICNT_CPICNT_Pos 0U
799#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/)
801/* DWT Exception Overhead Count Register Definitions */
802#define DWT_EXCCNT_EXCCNT_Pos 0U
803#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/)
805/* DWT Sleep Count Register Definitions */
806#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U
807#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/)
809/* DWT LSU Count Register Definitions */
810#define DWT_LSUCNT_LSUCNT_Pos 0U
811#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/)
813/* DWT Folded-instruction Count Register Definitions */
814#define DWT_FOLDCNT_FOLDCNT_Pos 0U
815#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/)
817/* DWT Comparator Mask Register Definitions */
818#define DWT_MASK_MASK_Pos 0U
819#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/)
821/* DWT Comparator Function Register Definitions */
822#define DWT_FUNCTION_MATCHED_Pos 24U
823#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos)
825#define DWT_FUNCTION_DATAVADDR1_Pos 16U
826#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos)
828#define DWT_FUNCTION_DATAVADDR0_Pos 12U
829#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos)
831#define DWT_FUNCTION_DATAVSIZE_Pos 10U
832#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos)
834#define DWT_FUNCTION_LNK1ENA_Pos 9U
835#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos)
837#define DWT_FUNCTION_DATAVMATCH_Pos 8U
838#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos)
840#define DWT_FUNCTION_CYCMATCH_Pos 7U
841#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos)
843#define DWT_FUNCTION_EMITRANGE_Pos 5U
844#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos)
846#define DWT_FUNCTION_FUNCTION_Pos 0U
847#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /* end of group CMSIS_DWT */
850
851
889
890/* TPI Asynchronous Clock Prescaler Register Definitions */
891#define TPI_ACPR_PRESCALER_Pos 0U
892#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/)
894/* TPI Selected Pin Protocol Register Definitions */
895#define TPI_SPPR_TXMODE_Pos 0U
896#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/)
898/* TPI Formatter and Flush Status Register Definitions */
899#define TPI_FFSR_FtNonStop_Pos 3U
900#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos)
902#define TPI_FFSR_TCPresent_Pos 2U
903#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos)
905#define TPI_FFSR_FtStopped_Pos 1U
906#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos)
908#define TPI_FFSR_FlInProg_Pos 0U
909#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/)
911/* TPI Formatter and Flush Control Register Definitions */
912#define TPI_FFCR_TrigIn_Pos 8U
913#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos)
915#define TPI_FFCR_EnFCont_Pos 1U
916#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos)
918/* TPI TRIGGER Register Definitions */
919#define TPI_TRIGGER_TRIGGER_Pos 0U
920#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/)
922/* TPI Integration ETM Data Register Definitions (FIFO0) */
923#define TPI_FIFO0_ITM_ATVALID_Pos 29U
924#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos)
926#define TPI_FIFO0_ITM_bytecount_Pos 27U
927#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos)
929#define TPI_FIFO0_ETM_ATVALID_Pos 26U
930#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos)
932#define TPI_FIFO0_ETM_bytecount_Pos 24U
933#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos)
935#define TPI_FIFO0_ETM2_Pos 16U
936#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos)
938#define TPI_FIFO0_ETM1_Pos 8U
939#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos)
941#define TPI_FIFO0_ETM0_Pos 0U
942#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)
944/* TPI ITATBCTR2 Register Definitions */
945#define TPI_ITATBCTR2_ATREADY2_Pos 0U
946#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)
948#define TPI_ITATBCTR2_ATREADY1_Pos 0U
949#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)
951/* TPI Integration ITM Data Register Definitions (FIFO1) */
952#define TPI_FIFO1_ITM_ATVALID_Pos 29U
953#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)
955#define TPI_FIFO1_ITM_bytecount_Pos 27U
956#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos)
958#define TPI_FIFO1_ETM_ATVALID_Pos 26U
959#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos)
961#define TPI_FIFO1_ETM_bytecount_Pos 24U
962#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos)
964#define TPI_FIFO1_ITM2_Pos 16U
965#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos)
967#define TPI_FIFO1_ITM1_Pos 8U
968#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos)
970#define TPI_FIFO1_ITM0_Pos 0U
971#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)
973/* TPI ITATBCTR0 Register Definitions */
974#define TPI_ITATBCTR0_ATREADY2_Pos 0U
975#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)
977#define TPI_ITATBCTR0_ATREADY1_Pos 0U
978#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)
980/* TPI Integration Mode Control Register Definitions */
981#define TPI_ITCTRL_Mode_Pos 0U
982#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)
984/* TPI DEVID Register Definitions */
985#define TPI_DEVID_NRZVALID_Pos 11U
986#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos)
988#define TPI_DEVID_MANCVALID_Pos 10U
989#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos)
991#define TPI_DEVID_PTINVALID_Pos 9U
992#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos)
994#define TPI_DEVID_MinBufSz_Pos 6U
995#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos)
997#define TPI_DEVID_AsynClkIn_Pos 5U
998#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos)
1000#define TPI_DEVID_NrTraceInput_Pos 0U
1001#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)
1003/* TPI DEVTYPE Register Definitions */
1004#define TPI_DEVTYPE_SubType_Pos 4U
1005#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)
1007#define TPI_DEVTYPE_MajorType_Pos 0U
1008#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /* end of group CMSIS_TPI */
1011
1012
1013#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1024typedef struct
1025{
1026 __IM uint32_t TYPE;
1027 __IOM uint32_t CTRL;
1028 __IOM uint32_t RNR;
1029 __IOM uint32_t RBAR;
1030 __IOM uint32_t RASR;
1031 __IOM uint32_t RBAR_A1;
1032 __IOM uint32_t RASR_A1;
1033 __IOM uint32_t RBAR_A2;
1034 __IOM uint32_t RASR_A2;
1035 __IOM uint32_t RBAR_A3;
1036 __IOM uint32_t RASR_A3;
1037} MPU_Type;
1038
1039#define MPU_TYPE_RALIASES 4U
1040
1041/* MPU Type Register Definitions */
1042#define MPU_TYPE_IREGION_Pos 16U
1043#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos)
1045#define MPU_TYPE_DREGION_Pos 8U
1046#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos)
1048#define MPU_TYPE_SEPARATE_Pos 0U
1049#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/)
1051/* MPU Control Register Definitions */
1052#define MPU_CTRL_PRIVDEFENA_Pos 2U
1053#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos)
1055#define MPU_CTRL_HFNMIENA_Pos 1U
1056#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos)
1058#define MPU_CTRL_ENABLE_Pos 0U
1059#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/)
1061/* MPU Region Number Register Definitions */
1062#define MPU_RNR_REGION_Pos 0U
1063#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/)
1065/* MPU Region Base Address Register Definitions */
1066#define MPU_RBAR_ADDR_Pos 5U
1067#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)
1069#define MPU_RBAR_VALID_Pos 4U
1070#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos)
1072#define MPU_RBAR_REGION_Pos 0U
1073#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/)
1075/* MPU Region Attribute and Size Register Definitions */
1076#define MPU_RASR_ATTRS_Pos 16U
1077#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos)
1079#define MPU_RASR_XN_Pos 28U
1080#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos)
1082#define MPU_RASR_AP_Pos 24U
1083#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos)
1085#define MPU_RASR_TEX_Pos 19U
1086#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos)
1088#define MPU_RASR_S_Pos 18U
1089#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos)
1091#define MPU_RASR_C_Pos 17U
1092#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos)
1094#define MPU_RASR_B_Pos 16U
1095#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos)
1097#define MPU_RASR_SRD_Pos 8U
1098#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos)
1100#define MPU_RASR_SIZE_Pos 1U
1101#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos)
1103#define MPU_RASR_ENABLE_Pos 0U
1104#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/)
1107#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */
1108
1109
1129
1130/* Floating-Point Context Control Register Definitions */
1131#define FPU_FPCCR_ASPEN_Pos 31U
1132#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos)
1134#define FPU_FPCCR_LSPEN_Pos 30U
1135#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos)
1137#define FPU_FPCCR_MONRDY_Pos 8U
1138#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos)
1140#define FPU_FPCCR_BFRDY_Pos 6U
1141#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos)
1143#define FPU_FPCCR_MMRDY_Pos 5U
1144#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos)
1146#define FPU_FPCCR_HFRDY_Pos 4U
1147#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos)
1149#define FPU_FPCCR_THREAD_Pos 3U
1150#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos)
1152#define FPU_FPCCR_USER_Pos 1U
1153#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos)
1155#define FPU_FPCCR_LSPACT_Pos 0U
1156#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/)
1158/* Floating-Point Context Address Register Definitions */
1159#define FPU_FPCAR_ADDRESS_Pos 3U
1160#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos)
1162/* Floating-Point Default Status Control Register Definitions */
1163#define FPU_FPDSCR_AHP_Pos 26U
1164#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos)
1166#define FPU_FPDSCR_DN_Pos 25U
1167#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos)
1169#define FPU_FPDSCR_FZ_Pos 24U
1170#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos)
1172#define FPU_FPDSCR_RMode_Pos 22U
1173#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos)
1175/* Media and FP Feature Register 0 Definitions */
1176#define FPU_MVFR0_FP_rounding_modes_Pos 28U
1177#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos)
1179#define FPU_MVFR0_Short_vectors_Pos 24U
1180#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos)
1182#define FPU_MVFR0_Square_root_Pos 20U
1183#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos)
1185#define FPU_MVFR0_Divide_Pos 16U
1186#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos)
1188#define FPU_MVFR0_FP_excep_trapping_Pos 12U
1189#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos)
1191#define FPU_MVFR0_Double_precision_Pos 8U
1192#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos)
1194#define FPU_MVFR0_Single_precision_Pos 4U
1195#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos)
1197#define FPU_MVFR0_A_SIMD_registers_Pos 0U
1198#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/)
1200/* Media and FP Feature Register 1 Definitions */
1201#define FPU_MVFR1_FP_fused_MAC_Pos 28U
1202#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos)
1204#define FPU_MVFR1_FP_HPFP_Pos 24U
1205#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos)
1207#define FPU_MVFR1_D_NaN_mode_Pos 4U
1208#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos)
1210#define FPU_MVFR1_FtZ_mode_Pos 0U
1211#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/)
1233
1234/* Debug Halting Control and Status Register Definitions */
1235#define CoreDebug_DHCSR_DBGKEY_Pos 16U
1236#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)
1238#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U
1239#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)
1241#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U
1242#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)
1244#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U
1245#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)
1247#define CoreDebug_DHCSR_S_SLEEP_Pos 18U
1248#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)
1250#define CoreDebug_DHCSR_S_HALT_Pos 17U
1251#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos)
1253#define CoreDebug_DHCSR_S_REGRDY_Pos 16U
1254#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)
1256#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U
1257#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)
1259#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U
1260#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)
1262#define CoreDebug_DHCSR_C_STEP_Pos 2U
1263#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos)
1265#define CoreDebug_DHCSR_C_HALT_Pos 1U
1266#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos)
1268#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U
1269#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/)
1271/* Debug Core Register Selector Register Definitions */
1272#define CoreDebug_DCRSR_REGWnR_Pos 16U
1273#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos)
1275#define CoreDebug_DCRSR_REGSEL_Pos 0U
1276#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/)
1278/* Debug Exception and Monitor Control Register Definitions */
1279#define CoreDebug_DEMCR_TRCENA_Pos 24U
1280#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos)
1282#define CoreDebug_DEMCR_MON_REQ_Pos 19U
1283#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos)
1285#define CoreDebug_DEMCR_MON_STEP_Pos 18U
1286#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos)
1288#define CoreDebug_DEMCR_MON_PEND_Pos 17U
1289#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos)
1291#define CoreDebug_DEMCR_MON_EN_Pos 16U
1292#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos)
1294#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U
1295#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)
1297#define CoreDebug_DEMCR_VC_INTERR_Pos 9U
1298#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)
1300#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U
1301#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)
1303#define CoreDebug_DEMCR_VC_STATERR_Pos 7U
1304#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)
1306#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U
1307#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)
1309#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U
1310#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)
1312#define CoreDebug_DEMCR_VC_MMERR_Pos 4U
1313#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)
1315#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U
1316#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/)
1334#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
1335
1342#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
1343
1354/* Memory mapping of Core Hardware */
1355#define SCS_BASE_SHIFT (0x0000E000UL)
1356#define ITM_BASE_SHIFT (0x00000000UL)
1357#define DWT_BASE_SHIFT (0x00001000UL)
1358#define TPI_BASE_SHIFT (0x00040000UL)
1359#define CoreDebug_BASE_SHIFT (0x0000EDF0UL)
1361typedef struct _cortex_memory
1362{
1363 uint8_t CORTEX_PERIPH_BASE[0xE0100000 - 0xE0000000];
1366
1367#define SCS_BASE (MCU_CORTEX_MEM.CORTEX_PERIPH_BASE) + SCS_BASE_SHIFT
1368#define ITM_BASE (MCU_CORTEX_MEM.CORTEX_PERIPH_BASE) + SCS_BASE_SHIFT
1369#define DWT_BASE (MCU_CORTEX_MEM.CORTEX_PERIPH_BASE) + SCS_BASE_SHIFT
1370#define TPI_BASE (MCU_CORTEX_MEM.CORTEX_PERIPH_BASE) + SCS_BASE_SHIFT
1371#define CoreDebug_BASE (MCU_CORTEX_MEM.CORTEX_PERIPH_BASE) + SCS_BASE_SHIFT
1372#define SysTick_BASE (SCS_BASE + 0x0010UL)
1373#define NVIC_BASE (SCS_BASE + 0x0100UL)
1374#define SCB_BASE (SCS_BASE + 0x0D00UL)
1376#define SCnSCB ((SCnSCB_Type *) SCS_BASE )
1377#define SCB ((SCB_Type *) SCB_BASE )
1378#define SysTick ((SysTick_Type *) SysTick_BASE )
1379#define NVIC ((NVIC_Type *) NVIC_BASE )
1380#define ITM ((ITM_Type *) ITM_BASE )
1381#define DWT ((DWT_Type *) DWT_BASE )
1382#define TPI ((TPI_Type *) TPI_BASE )
1384#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1385#define MPU_BASE (SCS_BASE + 0x0D90UL)
1386#define MPU ((MPU_Type *) MPU_BASE )
1387#endif
1388
1389#define FPU_BASE (SCS_BASE + 0x0F30UL)
1390#define FPU ((FPU_Type *) FPU_BASE )
1398/*******************************************************************************
1399 * Hardware Abstraction Layer
1400 Core Function Interface contains:
1401 - Core NVIC Functions
1402 - Core SysTick Functions
1403 - Core Debug Functions
1404 - Core Register Access Functions
1405 ******************************************************************************/
1412/* ########################## NVIC functions #################################### */
1420#ifdef CMSIS_NVIC_VIRTUAL
1421 #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
1422 #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
1423 #endif
1424 #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
1425#else
1426 #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
1427 #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
1428 #define NVIC_EnableIRQ __NVIC_EnableIRQ
1429 #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
1430 #define NVIC_DisableIRQ __NVIC_DisableIRQ
1431 #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
1432 #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
1433 #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
1434 #define NVIC_GetActive __NVIC_GetActive
1435 #define NVIC_SetPriority __NVIC_SetPriority
1436 #define NVIC_GetPriority __NVIC_GetPriority
1437 #define NVIC_SystemReset __NVIC_SystemReset
1438#endif /* CMSIS_NVIC_VIRTUAL */
1439
1440#ifdef CMSIS_VECTAB_VIRTUAL
1441 #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1442 #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
1443 #endif
1444 #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
1445#else
1446 #define NVIC_SetVector __NVIC_SetVector
1447 #define NVIC_GetVector __NVIC_GetVector
1448#endif /* (CMSIS_VECTAB_VIRTUAL) */
1449
1450#define NVIC_USER_IRQ_OFFSET 16
1451
1452
1453/* The following EXC_RETURN values are saved the LR on exception entry */
1454#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
1455#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
1456#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
1457#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */
1458#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */
1459#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */
1460
1461
1472{
1473 uint32_t reg_value;
1474 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
1475
1476 reg_value = SCB->AIRCR; /* read old register configuration */
1477 reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
1478 reg_value = (reg_value |
1479 ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
1480 (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */
1481 SCB->AIRCR = reg_value;
1482}
1483
1484
1494
1495
1503{
1504 if ((int32_t)(IRQn) >= 0)
1505 {
1506 NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1507 }
1508}
1509
1510
1520{
1521 if ((int32_t)(IRQn) >= 0)
1522 {
1523 return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1524 }
1525 else
1526 {
1527 return(0U);
1528 }
1529}
1530
1531
1539{
1540 if ((int32_t)(IRQn) >= 0)
1541 {
1542 NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1543 __DSB();
1544 __ISB();
1545 }
1546}
1547
1548
1558{
1559 if ((int32_t)(IRQn) >= 0)
1560 {
1561 return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1562 }
1563 else
1564 {
1565 return(0U);
1566 }
1567}
1568
1569
1577{
1578 if ((int32_t)(IRQn) >= 0)
1579 {
1580 NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1581 }
1582}
1583
1584
1592{
1593 if ((int32_t)(IRQn) >= 0)
1594 {
1595 NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
1596 }
1597}
1598
1599
1609{
1610 if ((int32_t)(IRQn) >= 0)
1611 {
1612 return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1613 }
1614 else
1615 {
1616 return(0U);
1617 }
1618}
1619
1620
1631{
1632 if ((int32_t)(IRQn) >= 0)
1633 {
1634 NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1635 }
1636 else
1637 {
1638 SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1639 }
1640}
1641
1642
1653{
1654
1655 if ((int32_t)(IRQn) >= 0)
1656 {
1657 return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
1658 }
1659 else
1660 {
1661 return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
1662 }
1663}
1664
1665
1677__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
1678{
1679 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
1680 uint32_t PreemptPriorityBits;
1681 uint32_t SubPriorityBits;
1682
1683 PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
1684 SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
1685
1686 return (
1687 ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
1688 ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
1689 );
1690}
1691
1692
1704__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
1705{
1706 uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
1707 uint32_t PreemptPriorityBits;
1708 uint32_t SubPriorityBits;
1709
1710 PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
1711 SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
1712
1713 *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
1714 *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
1715}
1716
1717
1728{
1729 uint32_t *vectors = (uint32_t *)SCB->VTOR;
1730 vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
1731}
1732
1733
1743{
1744 uint32_t *vectors = (uint32_t *)SCB->VTOR;
1745 return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
1746}
1747
1748
1754{
1755 __DSB(); /* Ensure all outstanding memory accesses included
1756 buffered write are completed before reset */
1757 SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
1758 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
1759 SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
1760 __DSB(); /* Ensure completion of memory access */
1761
1762 for(;;) /* wait until reset */
1763 {
1764 __NOP();
1765 }
1766}
1767
1770/* ########################## MPU functions #################################### */
1771
1772#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1773
1774//#include "mpu_armv7.h"
1775
1776#endif
1777
1778
1779/* ########################## FPU functions #################################### */
1796{
1797 uint32_t mvfr0;
1798
1799 mvfr0 = FPU->MVFR0;
1801 {
1802 return 1U; /* Single precision FPU */
1803 }
1804 else
1805 {
1806 return 0U; /* No FPU */
1807 }
1808}
1809
1810
1815/* ################################## SysTick function ############################################ */
1823#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
1824
1836__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
1837{
1838 if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
1839 {
1840 return (1UL); /* Reload value impossible */
1841 }
1842
1843 SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
1844 NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
1845 SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
1848 SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
1849 return (0UL); /* Function successful */
1850}
1851
1852#endif
1853
1858/* ##################################### Debug In/Output function ########################################### */
1866extern volatile int32_t ITM_RxBuffer;
1867#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U)
1879{
1880 if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
1881 ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */
1882 {
1883 while (ITM->PORT[0U].u32 == 0UL)
1884 {
1885 __NOP();
1886 }
1887 ITM->PORT[0U].u8 = (uint8_t)ch;
1888 }
1889 return (ch);
1890}
1891
1892
1900{
1901 int32_t ch = -1; /* no character available */
1902
1904 {
1905 ch = ITM_RxBuffer;
1906 ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
1907 }
1908
1909 return (ch);
1910}
1911
1912
1920{
1921
1923 {
1924 return (0); /* no character available */
1925 }
1926 else
1927 {
1928 return (1); /* character available */
1929 }
1930}
1931
1937#ifdef __cplusplus
1938}
1939#endif
1940
1941
1942#endif /* __CMSIS_GENERIC */
#define __DSB()
Data Synchronization Barrier.
Definition arm_defines.h:131
#define __NOP()
No Operation.
Definition arm_defines.h:98
#define __NO_RETURN
Definition arm_defines.h:27
#define __ISB()
Instruction Synchronization Barrier.
Definition arm_defines.h:124
#define __STATIC_INLINE
Definition arm_defines.h:19
#define __OM
Definition core_cm4_matlab.h:27
#define __IM
Definition core_cm4_matlab.h:26
#define __IOM
Definition core_cm4_matlab.h:28
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
get FPU type
Definition core_cm4_matlab.h:1795
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
System Reset.
Definition core_cm4_matlab.h:1753
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
Set Interrupt Vector.
Definition core_cm4_matlab.h:1727
__STATIC_INLINE void NVIC_DecodePriority(uint32_t Priority, uint32_t PriorityGroup, uint32_t *const pPreemptPriority, uint32_t *const pSubPriority)
Decode Priority.
Definition core_cm4_matlab.h:1704
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
Get Interrupt Vector.
Definition core_cm4_matlab.h:1742
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
Set Interrupt Priority.
Definition core_cm4_matlab.h:1630
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
Clear Pending Interrupt.
Definition core_cm4_matlab.h:1591
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
Get Pending Interrupt.
Definition core_cm4_matlab.h:1557
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
Enable Interrupt.
Definition core_cm4_matlab.h:1502
#define NVIC_USER_IRQ_OFFSET
Definition core_cm4_matlab.h:1450
__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
Get Priority Grouping.
Definition core_cm4_matlab.h:1490
__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
Get Active Interrupt.
Definition core_cm4_matlab.h:1608
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
Set Pending Interrupt.
Definition core_cm4_matlab.h:1576
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
Get Interrupt Enable status.
Definition core_cm4_matlab.h:1519
__STATIC_INLINE uint32_t NVIC_EncodePriority(uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
Encode Priority.
Definition core_cm4_matlab.h:1677
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
Disable Interrupt.
Definition core_cm4_matlab.h:1538
#define NVIC_SetPriority
Definition core_cm4_matlab.h:1435
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
Get Interrupt Priority.
Definition core_cm4_matlab.h:1652
__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
Set Priority Grouping.
Definition core_cm4_matlab.h:1471
#define FPU_MVFR0_Double_precision_Msk
Definition core_cm4_matlab.h:1192
#define FPU_MVFR0_Single_precision_Msk
Definition core_cm4_matlab.h:1195
#define ITM_TCR_ITMENA_Msk
Definition core_cm4_matlab.h:678
#define SCB_AIRCR_PRIGROUP_Msk
Definition core_cm4_matlab.h:328
#define SCB_AIRCR_VECTKEY_Msk
Definition core_cm4_matlab.h:319
#define SCB_AIRCR_VECTKEY_Pos
Definition core_cm4_matlab.h:318
#define SCB_AIRCR_SYSRESETREQ_Msk
Definition core_cm4_matlab.h:331
#define SCB_AIRCR_PRIGROUP_Pos
Definition core_cm4_matlab.h:327
#define SysTick_CTRL_ENABLE_Msk
Definition core_cm4_matlab.h:579
#define SysTick_LOAD_RELOAD_Msk
Definition core_cm4_matlab.h:583
#define SysTick_CTRL_TICKINT_Msk
Definition core_cm4_matlab.h:576
#define SysTick_CTRL_CLKSOURCE_Msk
Definition core_cm4_matlab.h:573
__IOM uint32_t FPDSCR
Definition core_cm4_matlab.h:1125
__IM uint32_t MVFR1
Definition core_cm4_matlab.h:1127
__IOM uint32_t LOAD
Definition core_cm4_matlab.h:563
__IOM uint32_t CFSR
Definition core_cm4_matlab.h:251
volatile int32_t ITM_RxBuffer
__IOM uint32_t CYCCNT
Definition core_cm4_matlab.h:718
__IM uint32_t SSPSR
Definition core_cm4_matlab.h:864
__IOM uint32_t CLAIMCLR
Definition core_cm4_matlab.h:884
__IOM uint32_t COMP3
Definition core_cm4_matlab.h:737
__IOM uint32_t FPCCR
Definition core_cm4_matlab.h:1123
uint32_t FPCA
Definition core_cm4_matlab.h:178
__IM uint32_t CID0
Definition core_cm4_matlab.h:642
__IOM uint32_t CPICNT
Definition core_cm4_matlab.h:719
__IM uint32_t FFSR
Definition core_cm4_matlab.h:871
uint32_t nPRIV
Definition core_cm4_matlab.h:176
__IOM uint32_t MASK2
Definition core_cm4_matlab.h:734
uint8_t CORTEX_PERIPH_BASE[0xE0100000 - 0xE0000000]
Definition core_cm4_matlab.h:1363
__IM uint32_t FSCR
Definition core_cm4_matlab.h:873
__IOM uint32_t DFSR
Definition core_cm4_matlab.h:253
__IOM uint32_t AFSR
Definition core_cm4_matlab.h:256
__IOM uint32_t BFAR
Definition core_cm4_matlab.h:255
__IOM uint32_t TCR
Definition core_cm4_matlab.h:625
__IOM uint32_t SHCSR
Definition core_cm4_matlab.h:250
__IOM uint32_t ACPR
Definition core_cm4_matlab.h:867
__IM uint32_t PID4
Definition core_cm4_matlab.h:634
__OM uint8_t u8
Definition core_cm4_matlab.h:616
__IM uint32_t CID1
Definition core_cm4_matlab.h:643
__IOM uint32_t FPCAR
Definition core_cm4_matlab.h:1124
__IOM uint32_t MASK3
Definition core_cm4_matlab.h:738
__IM uint32_t TRIGGER
Definition core_cm4_matlab.h:875
uint32_t Z
Definition core_cm4_matlab.h:70
__IOM uint32_t COMP0
Definition core_cm4_matlab.h:725
__IOM uint32_t FOLDCNT
Definition core_cm4_matlab.h:723
__IM uint32_t PID2
Definition core_cm4_matlab.h:640
uint32_t Q
Definition core_cm4_matlab.h:67
__OM uint32_t IWR
Definition core_cm4_matlab.h:627
uint32_t T
Definition core_cm4_matlab.h:126
__IM uint32_t PID0
Definition core_cm4_matlab.h:638
__IOM uint32_t MASK1
Definition core_cm4_matlab.h:730
__IM uint32_t LSR
Definition core_cm4_matlab.h:632
__IM uint32_t ADR
Definition core_cm4_matlab.h:259
__IM uint32_t PCSR
Definition core_cm4_matlab.h:724
uint32_t C
Definition core_cm4_matlab.h:69
__IM uint32_t DEVTYPE
Definition core_cm4_matlab.h:887
__IM uint32_t PID6
Definition core_cm4_matlab.h:636
__IOM uint32_t MASK0
Definition core_cm4_matlab.h:726
__IOM uint32_t FUNCTION2
Definition core_cm4_matlab.h:735
__IOM uint32_t DHCSR
Definition core_cm4_matlab.h:1228
uint32_t _reserved1
Definition core_cm4_matlab.h:66
__IOM uint32_t CLAIMSET
Definition core_cm4_matlab.h:883
__IM uint32_t ITATBCTR2
Definition core_cm4_matlab.h:877
__IM uint32_t ITATBCTR0
Definition core_cm4_matlab.h:879
__IM uint32_t MVFR0
Definition core_cm4_matlab.h:1126
__IOM uint32_t AIRCR
Definition core_cm4_matlab.h:246
__IOM uint32_t TER
Definition core_cm4_matlab.h:621
#define ITM_RXBUFFER_EMPTY
Definition core_cm4_matlab.h:1867
uint32_t GE
Definition core_cm4_matlab.h:65
__IOM uint32_t DEMCR
Definition core_cm4_matlab.h:1231
__IM uint32_t DEVID
Definition core_cm4_matlab.h:886
__IOM uint32_t SLEEPCNT
Definition core_cm4_matlab.h:721
__OM uint32_t DCRSR
Definition core_cm4_matlab.h:1229
__IOM uint32_t CPACR
Definition core_cm4_matlab.h:263
__IOM uint32_t HFSR
Definition core_cm4_matlab.h:252
__IM uint32_t CID3
Definition core_cm4_matlab.h:645
__IM uint32_t FIFO1
Definition core_cm4_matlab.h:880
uint32_t N
Definition core_cm4_matlab.h:71
uint32_t ICI_IT_1
Definition core_cm4_matlab.h:123
__IOM uint32_t CSPSR
Definition core_cm4_matlab.h:865
__IM uint32_t PID5
Definition core_cm4_matlab.h:635
__IM uint32_t PID3
Definition core_cm4_matlab.h:641
__STATIC_INLINE int32_t ITM_ReceiveChar(void)
ITM Receive Character.
Definition core_cm4_matlab.h:1899
__IOM uint32_t CTRL
Definition core_cm4_matlab.h:562
uint32_t _reserved0
Definition core_cm4_matlab.h:64
__STATIC_INLINE uint32_t ITM_SendChar(uint32_t ch)
ITM Send Character.
Definition core_cm4_matlab.h:1878
__IOM uint32_t SCR
Definition core_cm4_matlab.h:247
__OM uint32_t LAR
Definition core_cm4_matlab.h:631
uint32_t V
Definition core_cm4_matlab.h:68
__IM uint32_t FIFO0
Definition core_cm4_matlab.h:876
__IOM uint32_t ICSR
Definition core_cm4_matlab.h:244
__IM uint32_t ICTR
Definition core_cm4_matlab.h:523
uint32_t w
Definition core_cm4_matlab.h:73
__IOM uint32_t DCRDR
Definition core_cm4_matlab.h:1230
__IOM uint32_t FUNCTION0
Definition core_cm4_matlab.h:727
uint32_t ISR
Definition core_cm4_matlab.h:103
__IOM uint32_t CCR
Definition core_cm4_matlab.h:248
__IM uint32_t CID2
Definition core_cm4_matlab.h:644
__OM uint32_t STIR
Definition core_cm4_matlab.h:221
__IM uint32_t CPUID
Definition core_cm4_matlab.h:243
uint32_t SPSEL
Definition core_cm4_matlab.h:177
uint32_t ICI_IT_2
Definition core_cm4_matlab.h:127
__IM uint32_t DFR
Definition core_cm4_matlab.h:258
__IM uint32_t IRR
Definition core_cm4_matlab.h:628
__IOM uint32_t VTOR
Definition core_cm4_matlab.h:245
__STATIC_INLINE int32_t ITM_CheckChar(void)
ITM Check Character.
Definition core_cm4_matlab.h:1919
__IOM uint32_t ITCTRL
Definition core_cm4_matlab.h:881
__IOM uint32_t VAL
Definition core_cm4_matlab.h:564
__IOM uint32_t LSUCNT
Definition core_cm4_matlab.h:722
__OM uint32_t u32
Definition core_cm4_matlab.h:618
__IOM uint32_t FUNCTION1
Definition core_cm4_matlab.h:731
__OM uint16_t u16
Definition core_cm4_matlab.h:617
__IOM uint32_t SPPR
Definition core_cm4_matlab.h:869
__IOM uint32_t MMFAR
Definition core_cm4_matlab.h:254
__IM uint32_t CALIB
Definition core_cm4_matlab.h:565
__IOM uint32_t COMP2
Definition core_cm4_matlab.h:733
__IOM uint32_t IMCR
Definition core_cm4_matlab.h:629
__IM uint32_t PID7
Definition core_cm4_matlab.h:637
__IOM uint32_t COMP1
Definition core_cm4_matlab.h:729
__IM uint32_t PID1
Definition core_cm4_matlab.h:639
__IOM uint32_t ACTLR
Definition core_cm4_matlab.h:524
__IOM uint32_t FUNCTION3
Definition core_cm4_matlab.h:739
__IOM uint32_t EXCCNT
Definition core_cm4_matlab.h:720
__IOM uint32_t FFCR
Definition core_cm4_matlab.h:872
__IOM uint32_t TPR
Definition core_cm4_matlab.h:623
struct _cortex_memory MCU_CortexMemoryTypeDef
MCU_CortexMemoryTypeDef MCU_CORTEX_MEM
Definition stm32f4xx_matlab_conf.c:9
#define SCB
Definition core_cm4_matlab.h:1377
#define ITM
Definition core_cm4_matlab.h:1380
#define FPU
Definition core_cm4_matlab.h:1390
#define NVIC
Definition core_cm4_matlab.h:1379
#define SysTick
Definition core_cm4_matlab.h:1378
#define __NVIC_PRIO_BITS
Definition stm32f407xx_matlab.h:60
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
Definition stm32f407xx_matlab.h:77
@ SysTick_IRQn
Definition stm32f407xx_matlab.h:86
unsigned int uint32_t
Definition stdint.h:64
signed int int32_t
Definition stdint.h:58
unsigned char uint8_t
Definition stdint.h:62
unsigned short int uint16_t
Definition stdint.h:63
Definition core_cm4_matlab.h:1362
Structure type to access the Core Debug Register (CoreDebug).
Definition core_cm4_matlab.h:1227
Structure type to access the Data Watchpoint and Trace Register (DWT).
Definition core_cm4_matlab.h:716
Structure type to access the Floating Point Unit (FPU).
Definition core_cm4_matlab.h:1121
Structure type to access the Instrumentation Trace Macrocell Register (ITM).
Definition core_cm4_matlab.h:613
Structure type to access the Nested Vectored Interrupt Controller (NVIC).
Definition core_cm4_matlab.h:208
Structure type to access the System Control Block (SCB).
Definition core_cm4_matlab.h:242
Structure type to access the System Control and ID Register not in the SCB.
Definition core_cm4_matlab.h:521
Structure type to access the System Timer (SysTick).
Definition core_cm4_matlab.h:561
Structure type to access the Trace Port Interface Register (TPI).
Definition core_cm4_matlab.h:863
Union type to access the Application Program Status Register (APSR).
Definition core_cm4_matlab.h:61
Union type to access the Control Registers (CONTROL).
Definition core_cm4_matlab.h:173
Union type to access the Interrupt Program Status Register (IPSR).
Definition core_cm4_matlab.h:100
Union type to access the Special-Purpose Program Status Registers (xPSR).
Definition core_cm4_matlab.h:118