29 #ifndef __CMSIS_ICCARM_H__ 30 #define __CMSIS_ICCARM_H__ 33 #error This file should only be compiled by ICCARM 36 #pragma system_include 38 #define __IAR_FT _Pragma("inline=forced") __intrinsic 40 #if (__VER__ >= 8000000) 48 #define __ALIGNED(x) __attribute__((aligned(x))) 49 #elif (__VER__ >= 7080000) 51 #define __ALIGNED(x) __attribute__((aligned(x))) 53 #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. 61 #if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ 64 #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) 65 #define __ARM_ARCH_8M_MAIN__ 1 66 #elif defined(__ARM8M_BASELINE__) 67 #define __ARM_ARCH_8M_BASE__ 1 68 #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' 70 #define __ARM_ARCH_6M__ 1 73 #define __ARM_ARCH_7EM__ 1 75 #define __ARM_ARCH_7M__ 1 82 #if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ 83 !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) 84 #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) 85 #define __ARM_ARCH_6M__ 1 86 #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) 87 #define __ARM_ARCH_7M__ 1 88 #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) 89 #define __ARM_ARCH_7EM__ 1 90 #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) 91 #define __ARM_ARCH_8M_BASE__ 1 92 #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) 93 #define __ARM_ARCH_8M_MAIN__ 1 94 #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) 95 #define __ARM_ARCH_8M_MAIN__ 1 97 #error "Unknown target." 103 #if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 104 #define __IAR_M0_FAMILY 1 105 #elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 106 #define __IAR_M0_FAMILY 1 108 #define __IAR_M0_FAMILY 0 116 #ifndef __COMPILER_BARRIER 117 #define __COMPILER_BARRIER() __ASM volatile("":::"memory") 121 #define __INLINE inline 126 #define __NO_RETURN __attribute__((__noreturn__)) 128 #define __NO_RETURN _Pragma("object_attribute=__noreturn") 134 #define __PACKED __attribute__((packed, aligned(1))) 137 #define __PACKED __packed 141 #ifndef __PACKED_STRUCT 143 #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) 146 #define __PACKED_STRUCT __packed struct 150 #ifndef __PACKED_UNION 152 #define __PACKED_UNION union __attribute__((packed, aligned(1))) 155 #define __PACKED_UNION __packed union 161 #define __RESTRICT __restrict 164 #define __RESTRICT restrict 168 #ifndef __STATIC_INLINE 169 #define __STATIC_INLINE static inline 172 #ifndef __FORCEINLINE 173 #define __FORCEINLINE _Pragma("inline=forced") 176 #ifndef __STATIC_FORCEINLINE 177 #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE 180 #ifndef __UNALIGNED_UINT16_READ 181 #pragma language=save 182 #pragma language=extended 185 return *(__packed uint16_t*)(ptr);
187 #pragma language=restore 188 #define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) 192 #ifndef __UNALIGNED_UINT16_WRITE 193 #pragma language=save 194 #pragma language=extended 197 *(__packed uint16_t*)(ptr) = val;;
199 #pragma language=restore 200 #define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) 203 #ifndef __UNALIGNED_UINT32_READ 204 #pragma language=save 205 #pragma language=extended 208 return *(__packed uint32_t*)(ptr);
210 #pragma language=restore 211 #define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) 214 #ifndef __UNALIGNED_UINT32_WRITE 215 #pragma language=save 216 #pragma language=extended 219 *(__packed uint32_t*)(ptr) = val;;
221 #pragma language=restore 222 #define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) 225 #ifndef __UNALIGNED_UINT32 226 #pragma language=save 227 #pragma language=extended 229 #pragma language=restore 230 #define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) 235 #define __USED __attribute__((used)) 237 #define __USED _Pragma("__root") 244 #define __WEAK __attribute__((weak)) 246 #define __WEAK _Pragma("__weak") 250 #ifndef __PROGRAM_START 251 #define __PROGRAM_START __iar_program_start 255 #define __INITIAL_SP CSTACK$$Limit 258 #ifndef __STACK_LIMIT 259 #define __STACK_LIMIT CSTACK$$Base 262 #ifndef __VECTOR_TABLE 263 #define __VECTOR_TABLE __vector_table 266 #ifndef __VECTOR_TABLE_ATTRIBUTE 267 #define __VECTOR_TABLE_ATTRIBUTE @".intvec" 270 #ifndef __ICCARM_INTRINSICS_VERSION__ 271 #define __ICCARM_INTRINSICS_VERSION__ 0 274 #if __ICCARM_INTRINSICS_VERSION__ == 2 292 #include "iccarm_builtin.h" 294 #define __disable_fault_irq __iar_builtin_disable_fiq 295 #define __disable_irq __iar_builtin_disable_interrupt 296 #define __enable_fault_irq __iar_builtin_enable_fiq 297 #define __enable_irq __iar_builtin_enable_interrupt 298 #define __arm_rsr __iar_builtin_rsr 299 #define __arm_wsr __iar_builtin_wsr 302 #define __get_APSR() (__arm_rsr("APSR")) 303 #define __get_BASEPRI() (__arm_rsr("BASEPRI")) 304 #define __get_CONTROL() (__arm_rsr("CONTROL")) 305 #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) 307 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ 308 (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) 309 #define __get_FPSCR() (__arm_rsr("FPSCR")) 310 #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) 312 #define __get_FPSCR() ( 0 ) 313 #define __set_FPSCR(VALUE) ((void)VALUE) 316 #define __get_IPSR() (__arm_rsr("IPSR")) 317 #define __get_MSP() (__arm_rsr("MSP")) 318 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 319 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) 321 #define __get_MSPLIM() (0U) 323 #define __get_MSPLIM() (__arm_rsr("MSPLIM")) 325 #define __get_PRIMASK() (__arm_rsr("PRIMASK")) 326 #define __get_PSP() (__arm_rsr("PSP")) 328 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 329 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) 331 #define __get_PSPLIM() (0U) 333 #define __get_PSPLIM() (__arm_rsr("PSPLIM")) 336 #define __get_xPSR() (__arm_rsr("xPSR")) 338 #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) 339 #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) 340 #define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE))) 341 #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) 342 #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) 344 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 345 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) 347 #define __set_MSPLIM(VALUE) ((void)(VALUE)) 349 #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) 351 #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) 352 #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) 353 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 354 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) 356 #define __set_PSPLIM(VALUE) ((void)(VALUE)) 358 #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) 361 #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) 362 #define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE))) 363 #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) 364 #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) 365 #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) 366 #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) 367 #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) 368 #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) 369 #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) 370 #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) 371 #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) 372 #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) 373 #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) 374 #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) 376 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 377 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) 379 #define __TZ_get_PSPLIM_NS() (0U) 380 #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) 382 #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) 383 #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) 386 #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) 387 #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) 389 #define __NOP __iar_builtin_no_operation 391 #define __CLZ __iar_builtin_CLZ 392 #define __CLREX __iar_builtin_CLREX 394 #define __DMB __iar_builtin_DMB 395 #define __DSB __iar_builtin_DSB 396 #define __ISB __iar_builtin_ISB 398 #define __LDREXB __iar_builtin_LDREXB 399 #define __LDREXH __iar_builtin_LDREXH 400 #define __LDREXW __iar_builtin_LDREX 402 #define __RBIT __iar_builtin_RBIT 403 #define __REV __iar_builtin_REV 404 #define __REV16 __iar_builtin_REV16 408 return (int16_t) __iar_builtin_REVSH(val);
411 #define __ROR __iar_builtin_ROR 412 #define __RRX __iar_builtin_RRX 414 #define __SEV __iar_builtin_SEV 417 #define __SSAT __iar_builtin_SSAT 420 #define __STREXB __iar_builtin_STREXB 421 #define __STREXH __iar_builtin_STREXH 422 #define __STREXW __iar_builtin_STREX 425 #define __USAT __iar_builtin_USAT 428 #define __WFE __iar_builtin_WFE 429 #define __WFI __iar_builtin_WFI 432 #define __SADD8 __iar_builtin_SADD8 433 #define __QADD8 __iar_builtin_QADD8 434 #define __SHADD8 __iar_builtin_SHADD8 435 #define __UADD8 __iar_builtin_UADD8 436 #define __UQADD8 __iar_builtin_UQADD8 437 #define __UHADD8 __iar_builtin_UHADD8 438 #define __SSUB8 __iar_builtin_SSUB8 439 #define __QSUB8 __iar_builtin_QSUB8 440 #define __SHSUB8 __iar_builtin_SHSUB8 441 #define __USUB8 __iar_builtin_USUB8 442 #define __UQSUB8 __iar_builtin_UQSUB8 443 #define __UHSUB8 __iar_builtin_UHSUB8 444 #define __SADD16 __iar_builtin_SADD16 445 #define __QADD16 __iar_builtin_QADD16 446 #define __SHADD16 __iar_builtin_SHADD16 447 #define __UADD16 __iar_builtin_UADD16 448 #define __UQADD16 __iar_builtin_UQADD16 449 #define __UHADD16 __iar_builtin_UHADD16 450 #define __SSUB16 __iar_builtin_SSUB16 451 #define __QSUB16 __iar_builtin_QSUB16 452 #define __SHSUB16 __iar_builtin_SHSUB16 453 #define __USUB16 __iar_builtin_USUB16 454 #define __UQSUB16 __iar_builtin_UQSUB16 455 #define __UHSUB16 __iar_builtin_UHSUB16 456 #define __SASX __iar_builtin_SASX 457 #define __QASX __iar_builtin_QASX 458 #define __SHASX __iar_builtin_SHASX 459 #define __UASX __iar_builtin_UASX 460 #define __UQASX __iar_builtin_UQASX 461 #define __UHASX __iar_builtin_UHASX 462 #define __SSAX __iar_builtin_SSAX 463 #define __QSAX __iar_builtin_QSAX 464 #define __SHSAX __iar_builtin_SHSAX 465 #define __USAX __iar_builtin_USAX 466 #define __UQSAX __iar_builtin_UQSAX 467 #define __UHSAX __iar_builtin_UHSAX 468 #define __USAD8 __iar_builtin_USAD8 469 #define __USADA8 __iar_builtin_USADA8 470 #define __SSAT16 __iar_builtin_SSAT16 471 #define __USAT16 __iar_builtin_USAT16 472 #define __UXTB16 __iar_builtin_UXTB16 473 #define __UXTAB16 __iar_builtin_UXTAB16 474 #define __SXTB16 __iar_builtin_SXTB16 475 #define __SXTAB16 __iar_builtin_SXTAB16 476 #define __SMUAD __iar_builtin_SMUAD 477 #define __SMUADX __iar_builtin_SMUADX 478 #define __SMMLA __iar_builtin_SMMLA 479 #define __SMLAD __iar_builtin_SMLAD 480 #define __SMLADX __iar_builtin_SMLADX 481 #define __SMLALD __iar_builtin_SMLALD 482 #define __SMLALDX __iar_builtin_SMLALDX 483 #define __SMUSD __iar_builtin_SMUSD 484 #define __SMUSDX __iar_builtin_SMUSDX 485 #define __SMLSD __iar_builtin_SMLSD 486 #define __SMLSDX __iar_builtin_SMLSDX 487 #define __SMLSLD __iar_builtin_SMLSLD 488 #define __SMLSLDX __iar_builtin_SMLSLDX 489 #define __SEL __iar_builtin_SEL 490 #define __QADD __iar_builtin_QADD 491 #define __QSUB __iar_builtin_QSUB 492 #define __PKHBT __iar_builtin_PKHBT 493 #define __PKHTB __iar_builtin_PKHTB 500 #define __CLZ __cmsis_iar_clz_not_active 501 #define __SSAT __cmsis_iar_ssat_not_active 502 #define __USAT __cmsis_iar_usat_not_active 503 #define __RBIT __cmsis_iar_rbit_not_active 504 #define __get_APSR __cmsis_iar_get_APSR_not_active 508 #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ 509 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) 510 #define __get_FPSCR __cmsis_iar_get_FPSR_not_active 511 #define __set_FPSCR __cmsis_iar_set_FPSR_not_active 514 #ifdef __INTRINSICS_INCLUDED 515 #error intrinsics.h is already included previously! 518 #include <intrinsics.h> 530 if (data == 0U) {
return 32U; }
533 uint32_t mask = 0x80000000U;
535 while ((data & mask) == 0U)
547 for (v >>= 1U;
v; v >>= 1U)
559 __asm(
"MRS %0,APSR" :
"=r" (res));
565 #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ 566 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) 569 #define __get_FPSCR() (0) 570 #define __set_FPSCR(VALUE) ((void)VALUE) 573 #pragma diag_suppress=Pe940 574 #pragma diag_suppress=Pe177 576 #define __enable_irq __enable_interrupt 577 #define __disable_irq __disable_interrupt 578 #define __NOP __no_operation 580 #define __get_xPSR __get_PSR 582 #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) 586 return __LDREX((
unsigned long *)ptr);
591 return __STREX(value, (
unsigned long *)ptr);
597 #if (__CORTEX_M >= 0x03) 599 __IAR_FT uint32_t __RRX(uint32_t value)
602 __ASM volatile(
"RRX %0, %1" :
"=r"(result) :
"r" (value));
606 __IAR_FT void __set_BASEPRI_MAX(uint32_t value)
608 __asm
volatile(
"MSR BASEPRI_MAX,%0"::
"r" (value));
612 #define __enable_fault_irq __enable_fiq 613 #define __disable_fault_irq __disable_fiq 620 return (op1 >> op2) | (op1 << ((
sizeof(op1)*8)-op2));
623 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ 624 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) 626 __IAR_FT uint32_t __get_MSPLIM(
void)
629 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 630 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 634 __asm
volatile(
"MRS %0,MSPLIM" :
"=r" (res));
639 __IAR_FT void __set_MSPLIM(uint32_t value)
641 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 642 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 646 __asm
volatile(
"MSR MSPLIM,%0" ::
"r" (value));
650 __IAR_FT uint32_t __get_PSPLIM(
void)
653 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 654 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 658 __asm
volatile(
"MRS %0,PSPLIM" :
"=r" (res));
663 __IAR_FT void __set_PSPLIM(uint32_t value)
665 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 666 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 670 __asm
volatile(
"MSR PSPLIM,%0" ::
"r" (value));
674 __IAR_FT uint32_t __TZ_get_CONTROL_NS(
void)
677 __asm
volatile(
"MRS %0,CONTROL_NS" :
"=r" (res));
681 __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value)
683 __asm
volatile(
"MSR CONTROL_NS,%0" ::
"r" (value));
686 __IAR_FT uint32_t __TZ_get_PSP_NS(
void)
689 __asm
volatile(
"MRS %0,PSP_NS" :
"=r" (res));
693 __IAR_FT void __TZ_set_PSP_NS(uint32_t value)
695 __asm
volatile(
"MSR PSP_NS,%0" ::
"r" (value));
698 __IAR_FT uint32_t __TZ_get_MSP_NS(
void)
701 __asm
volatile(
"MRS %0,MSP_NS" :
"=r" (res));
705 __IAR_FT void __TZ_set_MSP_NS(uint32_t value)
707 __asm
volatile(
"MSR MSP_NS,%0" ::
"r" (value));
710 __IAR_FT uint32_t __TZ_get_SP_NS(
void)
713 __asm
volatile(
"MRS %0,SP_NS" :
"=r" (res));
716 __IAR_FT void __TZ_set_SP_NS(uint32_t value)
718 __asm
volatile(
"MSR SP_NS,%0" ::
"r" (value));
721 __IAR_FT uint32_t __TZ_get_PRIMASK_NS(
void)
724 __asm
volatile(
"MRS %0,PRIMASK_NS" :
"=r" (res));
728 __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value)
730 __asm
volatile(
"MSR PRIMASK_NS,%0" ::
"r" (value));
733 __IAR_FT uint32_t __TZ_get_BASEPRI_NS(
void)
736 __asm
volatile(
"MRS %0,BASEPRI_NS" :
"=r" (res));
740 __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value)
742 __asm
volatile(
"MSR BASEPRI_NS,%0" ::
"r" (value));
745 __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(
void)
748 __asm
volatile(
"MRS %0,FAULTMASK_NS" :
"=r" (res));
752 __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value)
754 __asm
volatile(
"MSR FAULTMASK_NS,%0" ::
"r" (value));
757 __IAR_FT uint32_t __TZ_get_PSPLIM_NS(
void)
760 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 761 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 765 __asm
volatile(
"MRS %0,PSPLIM_NS" :
"=r" (res));
770 __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value)
772 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ 773 (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) 777 __asm
volatile(
"MSR PSPLIM_NS,%0" ::
"r" (value));
781 __IAR_FT uint32_t __TZ_get_MSPLIM_NS(
void)
784 __asm
volatile(
"MRS %0,MSPLIM_NS" :
"=r" (res));
788 __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value)
790 __asm
volatile(
"MSR MSPLIM_NS,%0" ::
"r" (value));
797 #define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) 802 if ((sat >= 1U) && (sat <= 32U))
804 const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
805 const int32_t min = -1 - max ;
822 const uint32_t max = ((1U << sat) - 1U);
823 if (val > (int32_t)max)
832 return (uint32_t)val;
836 #if (__CORTEX_M >= 0x03) 838 __IAR_FT uint8_t __LDRBT(
volatile uint8_t *addr)
841 __ASM volatile (
"LDRBT %0, [%1]" :
"=r" (res) :
"r" (addr) :
"memory");
842 return ((uint8_t)res);
845 __IAR_FT uint16_t __LDRHT(
volatile uint16_t *addr)
848 __ASM volatile (
"LDRHT %0, [%1]" :
"=r" (res) :
"r" (addr) :
"memory");
849 return ((uint16_t)res);
852 __IAR_FT uint32_t __LDRT(
volatile uint32_t *addr)
855 __ASM volatile (
"LDRT %0, [%1]" :
"=r" (res) :
"r" (addr) :
"memory");
859 __IAR_FT void __STRBT(uint8_t value,
volatile uint8_t *addr)
861 __ASM volatile (
"STRBT %1, [%0]" : :
"r" (addr),
"r" ((uint32_t)value) :
"memory");
864 __IAR_FT void __STRHT(uint16_t value,
volatile uint16_t *addr)
866 __ASM volatile (
"STRHT %1, [%0]" : :
"r" (addr),
"r" ((uint32_t)value) :
"memory");
869 __IAR_FT void __STRT(uint32_t value,
volatile uint32_t *addr)
871 __ASM volatile (
"STRT %1, [%0]" : :
"r" (addr),
"r" (value) :
"memory");
876 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ 877 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) 880 __IAR_FT uint8_t __LDAB(
volatile uint8_t *ptr)
883 __ASM volatile (
"LDAB %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
884 return ((uint8_t)res);
887 __IAR_FT uint16_t __LDAH(
volatile uint16_t *ptr)
890 __ASM volatile (
"LDAH %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
891 return ((uint16_t)res);
894 __IAR_FT uint32_t __LDA(
volatile uint32_t *ptr)
897 __ASM volatile (
"LDA %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
901 __IAR_FT void __STLB(uint8_t value,
volatile uint8_t *ptr)
903 __ASM volatile (
"STLB %1, [%0]" ::
"r" (ptr),
"r" (value) :
"memory");
906 __IAR_FT void __STLH(uint16_t value,
volatile uint16_t *ptr)
908 __ASM volatile (
"STLH %1, [%0]" ::
"r" (ptr),
"r" (value) :
"memory");
911 __IAR_FT void __STL(uint32_t value,
volatile uint32_t *ptr)
913 __ASM volatile (
"STL %1, [%0]" ::
"r" (ptr),
"r" (value) :
"memory");
916 __IAR_FT uint8_t __LDAEXB(
volatile uint8_t *ptr)
919 __ASM volatile (
"LDAEXB %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
920 return ((uint8_t)res);
923 __IAR_FT uint16_t __LDAEXH(
volatile uint16_t *ptr)
926 __ASM volatile (
"LDAEXH %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
927 return ((uint16_t)res);
930 __IAR_FT uint32_t __LDAEX(
volatile uint32_t *ptr)
933 __ASM volatile (
"LDAEX %0, [%1]" :
"=r" (res) :
"r" (ptr) :
"memory");
937 __IAR_FT uint32_t __STLEXB(uint8_t value,
volatile uint8_t *ptr)
940 __ASM volatile (
"STLEXB %0, %2, [%1]" :
"=r" (res) :
"r" (ptr),
"r" (value) :
"memory");
944 __IAR_FT uint32_t __STLEXH(uint16_t value,
volatile uint16_t *ptr)
947 __ASM volatile (
"STLEXH %0, %2, [%1]" :
"=r" (res) :
"r" (ptr),
"r" (value) :
"memory");
951 __IAR_FT uint32_t __STLEX(uint32_t value,
volatile uint32_t *ptr)
954 __ASM volatile (
"STLEX %0, %2, [%1]" :
"=r" (res) :
"r" (ptr),
"r" (value) :
"memory");
961 #undef __IAR_M0_FAMILY 964 #pragma diag_default=Pe940 965 #pragma diag_default=Pe177 967 #define __SXTB16_RORn(ARG1, ARG2) __SXTB16(__ROR(ARG1, ARG2)) __STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)
Unsigned Saturate.
Definition: cmsis_gcc.h:1407
uint32_t v
Definition: cmsis_iccarm.h:228
#define __STATIC_INLINE
Definition: cmsis_iccarm.h:169
#define __IAR_FT
Definition: cmsis_iccarm.h:38
__STATIC_FORCEINLINE int16_t __REVSH(int16_t value)
Reverse byte order (16 bit)
Definition: cmsis_gcc.h:1001
__IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2)
Definition: cmsis_iccarm.h:618
#define __ASM
Definition: cmsis_iccarm.h:113
__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value)
Reverse bit order of value.
Definition: cmsis_gcc.h:1048
__STATIC_FORCEINLINE uint32_t __get_APSR(void)
Get APSR Register.
Definition: cmsis_gcc.h:286
__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val)
Definition: cmsis_iccarm.h:217
__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
Count leading zeros.
Definition: cmsis_gcc.h:1078
__IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr)
Definition: cmsis_iccarm.h:584
__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)
Signed Saturate.
Definition: cmsis_gcc.h:1382
__IAR_FT uint32_t __iar_uint32_read(void const *ptr)
Definition: cmsis_iccarm.h:206
__IAR_FT uint16_t __iar_uint16_read(void const *ptr)
Definition: cmsis_iccarm.h:183
Definition: cmsis_iccarm.h:228
__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val)
Definition: cmsis_iccarm.h:195
__IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr)
Definition: cmsis_iccarm.h:589