| @@ -0,0 +1,127 @@ | |||
| /**************************************************************************//** | |||
| * @file ARMCM4.h | |||
| * @brief CMSIS Core Peripheral Access Layer Header File for | |||
| * ARMCM4 Device (configured for CM4 without FPU) | |||
| * @version V5.3.1 | |||
| * @date 09. July 2018 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2018 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef ARMCM4_H | |||
| #define ARMCM4_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* ------------------------- Interrupt Number Definition ------------------------ */ | |||
| typedef enum IRQn | |||
| { | |||
| /* ------------------- Processor Exceptions Numbers ----------------------------- */ | |||
| NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ | |||
| HardFault_IRQn = -13, /* 3 HardFault Interrupt */ | |||
| MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */ | |||
| BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */ | |||
| UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */ | |||
| SVCall_IRQn = -5, /* 11 SV Call Interrupt */ | |||
| DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */ | |||
| PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ | |||
| SysTick_IRQn = -1, /* 15 System Tick Interrupt */ | |||
| /* ------------------- Processor Interrupt Numbers ------------------------------ */ | |||
| Interrupt0_IRQn = 0, | |||
| Interrupt1_IRQn = 1, | |||
| Interrupt2_IRQn = 2, | |||
| Interrupt3_IRQn = 3, | |||
| Interrupt4_IRQn = 4, | |||
| Interrupt5_IRQn = 5, | |||
| Interrupt6_IRQn = 6, | |||
| Interrupt7_IRQn = 7, | |||
| Interrupt8_IRQn = 8, | |||
| Interrupt9_IRQn = 9 | |||
| /* Interrupts 10 .. 224 are left out */ | |||
| } IRQn_Type; | |||
| /* ================================================================================ */ | |||
| /* ================ Processor and Core Peripheral Section ================ */ | |||
| /* ================================================================================ */ | |||
| /* ------- Start of section using anonymous unions and disabling warnings ------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma push | |||
| #pragma anon_unions | |||
| #elif defined (__ICCARM__) | |||
| #pragma language=extended | |||
| #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wc11-extensions" | |||
| #pragma clang diagnostic ignored "-Wreserved-id-macro" | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning 586 | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| /* -------- Configuration of Core Peripherals ----------------------------------- */ | |||
| #define __CM4_REV 0x0001U /* Core revision r0p1 */ | |||
| #define __MPU_PRESENT 1U /* MPU present */ | |||
| #define __VTOR_PRESENT 1U /* VTOR present */ | |||
| #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */ | |||
| #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ | |||
| #define __FPU_PRESENT 0U /* no FPU present */ | |||
| #include "core_cm4.h" /* Processor and core peripherals */ | |||
| #include "system_ARMCM4.h" /* System Header */ | |||
| /* -------- End of section using anonymous unions and disabling warnings -------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma pop | |||
| #elif defined (__ICCARM__) | |||
| /* leave anonymous unions enabled */ | |||
| #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning restore | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ARMCM4_H */ | |||
| @@ -0,0 +1,127 @@ | |||
| /**************************************************************************//** | |||
| * @file ARMCM4_FP.h | |||
| * @brief CMSIS Core Peripheral Access Layer Header File for | |||
| * ARMCM4 Device (configured for CM4 with FPU) | |||
| * @version V5.3.1 | |||
| * @date 09. July 2018 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2018 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef ARMCM4_FP_H | |||
| #define ARMCM4_FP_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* ------------------------- Interrupt Number Definition ------------------------ */ | |||
| typedef enum IRQn | |||
| { | |||
| /* ------------------- Processor Exceptions Numbers ----------------------------- */ | |||
| NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ | |||
| HardFault_IRQn = -13, /* 3 HardFault Interrupt */ | |||
| MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */ | |||
| BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */ | |||
| UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */ | |||
| SVCall_IRQn = -5, /* 11 SV Call Interrupt */ | |||
| DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */ | |||
| PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ | |||
| SysTick_IRQn = -1, /* 15 System Tick Interrupt */ | |||
| /* ------------------- Processor Interrupt Numbers ------------------------------ */ | |||
| Interrupt0_IRQn = 0, | |||
| Interrupt1_IRQn = 1, | |||
| Interrupt2_IRQn = 2, | |||
| Interrupt3_IRQn = 3, | |||
| Interrupt4_IRQn = 4, | |||
| Interrupt5_IRQn = 5, | |||
| Interrupt6_IRQn = 6, | |||
| Interrupt7_IRQn = 7, | |||
| Interrupt8_IRQn = 8, | |||
| Interrupt9_IRQn = 9 | |||
| /* Interrupts 10 .. 224 are left out */ | |||
| } IRQn_Type; | |||
| /* ================================================================================ */ | |||
| /* ================ Processor and Core Peripheral Section ================ */ | |||
| /* ================================================================================ */ | |||
| /* ------- Start of section using anonymous unions and disabling warnings ------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma push | |||
| #pragma anon_unions | |||
| #elif defined (__ICCARM__) | |||
| #pragma language=extended | |||
| #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wc11-extensions" | |||
| #pragma clang diagnostic ignored "-Wreserved-id-macro" | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning 586 | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| /* -------- Configuration of Core Peripherals ----------------------------------- */ | |||
| #define __CM4_REV 0x0001U /* Core revision r0p1 */ | |||
| #define __MPU_PRESENT 1U /* MPU present */ | |||
| #define __VTOR_PRESENT 1U /* VTOR present */ | |||
| #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */ | |||
| #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ | |||
| #define __FPU_PRESENT 1U /* FPU present */ | |||
| #include "core_cm4.h" /* Processor and core peripherals */ | |||
| #include "system_ARMCM4.h" /* System Header */ | |||
| /* -------- End of section using anonymous unions and disabling warnings -------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma pop | |||
| #elif defined (__ICCARM__) | |||
| /* leave anonymous unions enabled */ | |||
| #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning restore | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ARMCM4_FP_H */ | |||
| @@ -0,0 +1,132 @@ | |||
| /**************************************************************************//** | |||
| * @file ARMCM7.h | |||
| * @brief CMSIS Core Peripheral Access Layer Header File for | |||
| * ARMCM7 Device (configured for CM7 without FPU) | |||
| * @version V5.3.2 | |||
| * @date 27. March 2020 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2020 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef ARMCM7_H | |||
| #define ARMCM7_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* ------------------------- Interrupt Number Definition ------------------------ */ | |||
| typedef enum IRQn | |||
| { | |||
| /* ------------------- Processor Exceptions Numbers ----------------------------- */ | |||
| NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ | |||
| HardFault_IRQn = -13, /* 3 HardFault Interrupt */ | |||
| MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */ | |||
| BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */ | |||
| UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */ | |||
| SVCall_IRQn = -5, /* 11 SV Call Interrupt */ | |||
| DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */ | |||
| PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ | |||
| SysTick_IRQn = -1, /* 15 System Tick Interrupt */ | |||
| /* ------------------- Processor Interrupt Numbers ------------------------------ */ | |||
| Interrupt0_IRQn = 0, | |||
| Interrupt1_IRQn = 1, | |||
| Interrupt2_IRQn = 2, | |||
| Interrupt3_IRQn = 3, | |||
| Interrupt4_IRQn = 4, | |||
| Interrupt5_IRQn = 5, | |||
| Interrupt6_IRQn = 6, | |||
| Interrupt7_IRQn = 7, | |||
| Interrupt8_IRQn = 8, | |||
| Interrupt9_IRQn = 9 | |||
| /* Interrupts 10 .. 224 are left out */ | |||
| } IRQn_Type; | |||
| /* ================================================================================ */ | |||
| /* ================ Processor and Core Peripheral Section ================ */ | |||
| /* ================================================================================ */ | |||
| /* ------- Start of section using anonymous unions and disabling warnings ------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma push | |||
| #pragma anon_unions | |||
| #elif defined (__ICCARM__) | |||
| #pragma language=extended | |||
| #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wc11-extensions" | |||
| #pragma clang diagnostic ignored "-Wreserved-id-macro" | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning 586 | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| /* -------- Configuration of Core Peripherals ----------------------------------- */ | |||
| #define __CM7_REV 0x0000U /* Core revision r0p0 */ | |||
| #define __MPU_PRESENT 1U /* MPU present */ | |||
| #define __VTOR_PRESENT 1U /* VTOR present */ | |||
| #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */ | |||
| #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ | |||
| #define __FPU_PRESENT 0U /* no FPU present */ | |||
| #define __FPU_DP 0U /* unused */ | |||
| #define __ICACHE_PRESENT 1U /* Instruction Cache present */ | |||
| #define __DCACHE_PRESENT 1U /* Data Cache present */ | |||
| #define __DTCM_PRESENT 1U /* Data Tightly Coupled Memory present */ | |||
| #include "core_cm7.h" /* Processor and core peripherals */ | |||
| #include "system_ARMCM7.h" /* System Header */ | |||
| /* -------- End of section using anonymous unions and disabling warnings -------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma pop | |||
| #elif defined (__ICCARM__) | |||
| /* leave anonymous unions enabled */ | |||
| #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning restore | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ARMCM7_H */ | |||
| @@ -0,0 +1,132 @@ | |||
| /**************************************************************************//** | |||
| * @file ARMCM7_DP.h | |||
| * @brief CMSIS Core Peripheral Access Layer Header File for | |||
| * ARMCM7 Device (configured for CM7 with double precision FPU) | |||
| * @version V5.3.2 | |||
| * @date 27. March 2020 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2020 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef ARMCM7_DP_H | |||
| #define ARMCM7_DP_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* ------------------------- Interrupt Number Definition ------------------------ */ | |||
| typedef enum IRQn | |||
| { | |||
| /* ------------------- Processor Exceptions Numbers ----------------------------- */ | |||
| NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ | |||
| HardFault_IRQn = -13, /* 3 HardFault Interrupt */ | |||
| MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */ | |||
| BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */ | |||
| UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */ | |||
| SVCall_IRQn = -5, /* 11 SV Call Interrupt */ | |||
| DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */ | |||
| PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ | |||
| SysTick_IRQn = -1, /* 15 System Tick Interrupt */ | |||
| /* ------------------- Processor Interrupt Numbers ------------------------------ */ | |||
| Interrupt0_IRQn = 0, | |||
| Interrupt1_IRQn = 1, | |||
| Interrupt2_IRQn = 2, | |||
| Interrupt3_IRQn = 3, | |||
| Interrupt4_IRQn = 4, | |||
| Interrupt5_IRQn = 5, | |||
| Interrupt6_IRQn = 6, | |||
| Interrupt7_IRQn = 7, | |||
| Interrupt8_IRQn = 8, | |||
| Interrupt9_IRQn = 9 | |||
| /* Interrupts 10 .. 224 are left out */ | |||
| } IRQn_Type; | |||
| /* ================================================================================ */ | |||
| /* ================ Processor and Core Peripheral Section ================ */ | |||
| /* ================================================================================ */ | |||
| /* ------- Start of section using anonymous unions and disabling warnings ------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma push | |||
| #pragma anon_unions | |||
| #elif defined (__ICCARM__) | |||
| #pragma language=extended | |||
| #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wc11-extensions" | |||
| #pragma clang diagnostic ignored "-Wreserved-id-macro" | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning 586 | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| /* -------- Configuration of Core Peripherals ----------------------------------- */ | |||
| #define __CM7_REV 0x0000U /* Core revision r0p0 */ | |||
| #define __MPU_PRESENT 1U /* MPU present */ | |||
| #define __VTOR_PRESENT 1U /* VTOR present */ | |||
| #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */ | |||
| #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ | |||
| #define __FPU_PRESENT 1U /* FPU present */ | |||
| #define __FPU_DP 1U /* double precision FPU */ | |||
| #define __ICACHE_PRESENT 1U /* Instruction Cache present */ | |||
| #define __DCACHE_PRESENT 1U /* Data Cache present */ | |||
| #define __DTCM_PRESENT 1U /* Data Tightly Coupled Memory present */ | |||
| #include "core_cm7.h" /* Processor and core peripherals */ | |||
| #include "system_ARMCM7.h" /* System Header */ | |||
| /* -------- End of section using anonymous unions and disabling warnings -------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma pop | |||
| #elif defined (__ICCARM__) | |||
| /* leave anonymous unions enabled */ | |||
| #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning restore | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ARMCM7_DP_H */ | |||
| @@ -0,0 +1,132 @@ | |||
| /**************************************************************************//** | |||
| * @file ARMCM7_SP.h | |||
| * @brief CMSIS Core Peripheral Access Layer Header File for | |||
| * ARMCM7 Device (configured for CM7 with single precision FPU) | |||
| * @version V5.3.2 | |||
| * @date 27. March 2020 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2020 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef ARMCM7_SP_H | |||
| #define ARMCM7_SP_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* ------------------------- Interrupt Number Definition ------------------------ */ | |||
| typedef enum IRQn | |||
| { | |||
| /* ------------------- Processor Exceptions Numbers ----------------------------- */ | |||
| NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ | |||
| HardFault_IRQn = -13, /* 3 HardFault Interrupt */ | |||
| MemoryManagement_IRQn = -12, /* 4 Memory Management Interrupt */ | |||
| BusFault_IRQn = -11, /* 5 Bus Fault Interrupt */ | |||
| UsageFault_IRQn = -10, /* 6 Usage Fault Interrupt */ | |||
| SVCall_IRQn = -5, /* 11 SV Call Interrupt */ | |||
| DebugMonitor_IRQn = -4, /* 12 Debug Monitor Interrupt */ | |||
| PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ | |||
| SysTick_IRQn = -1, /* 15 System Tick Interrupt */ | |||
| /* ------------------- Processor Interrupt Numbers ------------------------------ */ | |||
| Interrupt0_IRQn = 0, | |||
| Interrupt1_IRQn = 1, | |||
| Interrupt2_IRQn = 2, | |||
| Interrupt3_IRQn = 3, | |||
| Interrupt4_IRQn = 4, | |||
| Interrupt5_IRQn = 5, | |||
| Interrupt6_IRQn = 6, | |||
| Interrupt7_IRQn = 7, | |||
| Interrupt8_IRQn = 8, | |||
| Interrupt9_IRQn = 9 | |||
| /* Interrupts 10 .. 224 are left out */ | |||
| } IRQn_Type; | |||
| /* ================================================================================ */ | |||
| /* ================ Processor and Core Peripheral Section ================ */ | |||
| /* ================================================================================ */ | |||
| /* ------- Start of section using anonymous unions and disabling warnings ------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma push | |||
| #pragma anon_unions | |||
| #elif defined (__ICCARM__) | |||
| #pragma language=extended | |||
| #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wc11-extensions" | |||
| #pragma clang diagnostic ignored "-Wreserved-id-macro" | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning 586 | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| /* -------- Configuration of Core Peripherals ----------------------------------- */ | |||
| #define __CM7_REV 0x0000U /* Core revision r0p0 */ | |||
| #define __MPU_PRESENT 1U /* MPU present */ | |||
| #define __VTOR_PRESENT 1U /* VTOR present */ | |||
| #define __NVIC_PRIO_BITS 3U /* Number of Bits used for Priority Levels */ | |||
| #define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ | |||
| #define __FPU_PRESENT 1U /* FPU present */ | |||
| #define __FPU_DP 0U /* single precision FPU */ | |||
| #define __ICACHE_PRESENT 1U /* Instruction Cache present */ | |||
| #define __DCACHE_PRESENT 1U /* Data Cache present */ | |||
| #define __DTCM_PRESENT 1U /* Data Tightly Coupled Memory present */ | |||
| #include "core_cm7.h" /* Processor and core peripherals */ | |||
| #include "system_ARMCM7.h" /* System Header */ | |||
| /* -------- End of section using anonymous unions and disabling warnings -------- */ | |||
| #if defined (__CC_ARM) | |||
| #pragma pop | |||
| #elif defined (__ICCARM__) | |||
| /* leave anonymous unions enabled */ | |||
| #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TMS470__) | |||
| /* anonymous unions are enabled by default */ | |||
| #elif defined (__TASKING__) | |||
| #pragma warning restore | |||
| #elif defined (__CSMC__) | |||
| /* anonymous unions are enabled by default */ | |||
| #else | |||
| #warning Not supported compiler type | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ARMCM7_SP_H */ | |||
| @@ -0,0 +1,517 @@ | |||
| /* ---------------------------------------------------------------------- | |||
| * Project: CMSIS DSP Library | |||
| * Title: arm_common_tables.h | |||
| * Description: Extern declaration for common tables | |||
| * | |||
| * $Date: 27. January 2017 | |||
| * $Revision: V.1.5.1 | |||
| * | |||
| * Target Processor: Cortex-M cores | |||
| * -------------------------------------------------------------------- */ | |||
| /* | |||
| * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef _ARM_COMMON_TABLES_H | |||
| #define _ARM_COMMON_TABLES_H | |||
| #include "arm_math.h" | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) | |||
| /* Double Precision Float CFFT twiddles */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) | |||
| extern const uint16_t armBitRevTable[1024]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_16) | |||
| extern const uint64_t twiddleCoefF64_16[32]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_32) | |||
| extern const uint64_t twiddleCoefF64_32[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_64) | |||
| extern const uint64_t twiddleCoefF64_64[128]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_128) | |||
| extern const uint64_t twiddleCoefF64_128[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_256) | |||
| extern const uint64_t twiddleCoefF64_256[512]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_512) | |||
| extern const uint64_t twiddleCoefF64_512[1024]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_1024) | |||
| extern const uint64_t twiddleCoefF64_1024[2048]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_2048) | |||
| extern const uint64_t twiddleCoefF64_2048[4096]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F64_4096) | |||
| extern const uint64_t twiddleCoefF64_4096[8192]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_16) | |||
| extern const float32_t twiddleCoef_16[32]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_32) | |||
| extern const float32_t twiddleCoef_32[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_64) | |||
| extern const float32_t twiddleCoef_64[128]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_128) | |||
| extern const float32_t twiddleCoef_128[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_256) | |||
| extern const float32_t twiddleCoef_256[512]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_512) | |||
| extern const float32_t twiddleCoef_512[1024]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_1024) | |||
| extern const float32_t twiddleCoef_1024[2048]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_2048) | |||
| extern const float32_t twiddleCoef_2048[4096]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) | |||
| extern const float32_t twiddleCoef_4096[8192]; | |||
| #define twiddleCoef twiddleCoef_4096 | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_16) | |||
| extern const q31_t twiddleCoef_16_q31[24]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_32) | |||
| extern const q31_t twiddleCoef_32_q31[48]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_64) | |||
| extern const q31_t twiddleCoef_64_q31[96]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_128) | |||
| extern const q31_t twiddleCoef_128_q31[192]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_256) | |||
| extern const q31_t twiddleCoef_256_q31[384]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_512) | |||
| extern const q31_t twiddleCoef_512_q31[768]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) | |||
| extern const q31_t twiddleCoef_1024_q31[1536]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) | |||
| extern const q31_t twiddleCoef_2048_q31[3072]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) | |||
| extern const q31_t twiddleCoef_4096_q31[6144]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_16) | |||
| extern const q15_t twiddleCoef_16_q15[24]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_32) | |||
| extern const q15_t twiddleCoef_32_q15[48]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_64) | |||
| extern const q15_t twiddleCoef_64_q15[96]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_128) | |||
| extern const q15_t twiddleCoef_128_q15[192]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_256) | |||
| extern const q15_t twiddleCoef_256_q15[384]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_512) | |||
| extern const q15_t twiddleCoef_512_q15[768]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_1024) | |||
| extern const q15_t twiddleCoef_1024_q15[1536]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_2048) | |||
| extern const q15_t twiddleCoef_2048_q15[3072]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) | |||
| extern const q15_t twiddleCoef_4096_q15[6144]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| /* Double Precision Float RFFT twiddles */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_32) | |||
| extern const uint64_t twiddleCoefF64_rfft_32[32]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_64) | |||
| extern const uint64_t twiddleCoefF64_rfft_64[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_128) | |||
| extern const uint64_t twiddleCoefF64_rfft_128[128]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_256) | |||
| extern const uint64_t twiddleCoefF64_rfft_256[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_512) | |||
| extern const uint64_t twiddleCoefF64_rfft_512[512]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_1024) | |||
| extern const uint64_t twiddleCoefF64_rfft_1024[1024]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_2048) | |||
| extern const uint64_t twiddleCoefF64_rfft_2048[2048]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F64_4096) | |||
| extern const uint64_t twiddleCoefF64_rfft_4096[4096]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_32) | |||
| extern const float32_t twiddleCoef_rfft_32[32]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_64) | |||
| extern const float32_t twiddleCoef_rfft_64[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_128) | |||
| extern const float32_t twiddleCoef_rfft_128[128]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_256) | |||
| extern const float32_t twiddleCoef_rfft_256[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_512) | |||
| extern const float32_t twiddleCoef_rfft_512[512]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_1024) | |||
| extern const float32_t twiddleCoef_rfft_1024[1024]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_2048) | |||
| extern const float32_t twiddleCoef_rfft_2048[2048]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_RFFT_F32_4096) | |||
| extern const float32_t twiddleCoef_rfft_4096[4096]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| /* Double precision floating-point bit reversal tables */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_16) | |||
| #define ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH ((uint16_t)12) | |||
| extern const uint16_t armBitRevIndexTableF64_16[ARMBITREVINDEXTABLEF64_16_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_32) | |||
| #define ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH ((uint16_t)24) | |||
| extern const uint16_t armBitRevIndexTableF64_32[ARMBITREVINDEXTABLEF64_32_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_64) | |||
| #define ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH ((uint16_t)56) | |||
| extern const uint16_t armBitRevIndexTableF64_64[ARMBITREVINDEXTABLEF64_64_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_128) | |||
| #define ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH ((uint16_t)112) | |||
| extern const uint16_t armBitRevIndexTableF64_128[ARMBITREVINDEXTABLEF64_128_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_256) | |||
| #define ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH ((uint16_t)240) | |||
| extern const uint16_t armBitRevIndexTableF64_256[ARMBITREVINDEXTABLEF64_256_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_512) | |||
| #define ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH ((uint16_t)480) | |||
| extern const uint16_t armBitRevIndexTableF64_512[ARMBITREVINDEXTABLEF64_512_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_1024) | |||
| #define ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH ((uint16_t)992) | |||
| extern const uint16_t armBitRevIndexTableF64_1024[ARMBITREVINDEXTABLEF64_1024_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_2048) | |||
| #define ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH ((uint16_t)1984) | |||
| extern const uint16_t armBitRevIndexTableF64_2048[ARMBITREVINDEXTABLEF64_2048_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT64_4096) | |||
| #define ARMBITREVINDEXTABLEF64_4096_TABLE_LENGTH ((uint16_t)4032) | |||
| extern const uint16_t armBitRevIndexTableF64_4096[ARMBITREVINDEXTABLEF64_4096_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| /* floating-point bit reversal tables */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_16) | |||
| #define ARMBITREVINDEXTABLE_16_TABLE_LENGTH ((uint16_t)20) | |||
| extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE_16_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_32) | |||
| #define ARMBITREVINDEXTABLE_32_TABLE_LENGTH ((uint16_t)48) | |||
| extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE_32_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_64) | |||
| #define ARMBITREVINDEXTABLE_64_TABLE_LENGTH ((uint16_t)56) | |||
| extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE_64_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_128) | |||
| #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208) | |||
| extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_256) | |||
| #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440) | |||
| extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_512) | |||
| #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448) | |||
| extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_1024) | |||
| #define ARMBITREVINDEXTABLE_1024_TABLE_LENGTH ((uint16_t)1800) | |||
| extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE_1024_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_2048) | |||
| #define ARMBITREVINDEXTABLE_2048_TABLE_LENGTH ((uint16_t)3808) | |||
| extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE_2048_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FLT_4096) | |||
| #define ARMBITREVINDEXTABLE_4096_TABLE_LENGTH ((uint16_t)4032) | |||
| extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE_4096_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| /* fixed-point bit reversal tables */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_16) | |||
| #define ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH ((uint16_t)12) | |||
| extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_32) | |||
| #define ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH ((uint16_t)24) | |||
| extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_64) | |||
| #define ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH ((uint16_t)56) | |||
| extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_128) | |||
| #define ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH ((uint16_t)112) | |||
| extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_256) | |||
| #define ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH ((uint16_t)240) | |||
| extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_512) | |||
| #define ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH ((uint16_t)480) | |||
| extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_1024) | |||
| #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992) | |||
| extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_2048) | |||
| #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) | |||
| extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) | |||
| #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) | |||
| extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_F32) | |||
| extern const float32_t realCoefA[8192]; | |||
| extern const float32_t realCoefB[8192]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_Q31) | |||
| extern const q31_t realCoefAQ31[8192]; | |||
| extern const q31_t realCoefBQ31[8192]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_Q15) | |||
| extern const q15_t realCoefAQ15[8192]; | |||
| extern const q15_t realCoefBQ15[8192]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_F32_128) | |||
| extern const float32_t Weights_128[256]; | |||
| extern const float32_t cos_factors_128[128]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_F32_512) | |||
| extern const float32_t Weights_512[1024]; | |||
| extern const float32_t cos_factors_512[512]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_F32_2048) | |||
| extern const float32_t Weights_2048[4096]; | |||
| extern const float32_t cos_factors_2048[2048]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_F32_8192) | |||
| extern const float32_t Weights_8192[16384]; | |||
| extern const float32_t cos_factors_8192[8192]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q15_128) | |||
| extern const q15_t WeightsQ15_128[256]; | |||
| extern const q15_t cos_factorsQ15_128[128]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q15_512) | |||
| extern const q15_t WeightsQ15_512[1024]; | |||
| extern const q15_t cos_factorsQ15_512[512]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q15_2048) | |||
| extern const q15_t WeightsQ15_2048[4096]; | |||
| extern const q15_t cos_factorsQ15_2048[2048]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q15_8192) | |||
| extern const q15_t WeightsQ15_8192[16384]; | |||
| extern const q15_t cos_factorsQ15_8192[8192]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q31_128) | |||
| extern const q31_t WeightsQ31_128[256]; | |||
| extern const q31_t cos_factorsQ31_128[128]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q31_512) | |||
| extern const q31_t WeightsQ31_512[1024]; | |||
| extern const q31_t cos_factorsQ31_512[512]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q31_2048) | |||
| extern const q31_t WeightsQ31_2048[4096]; | |||
| extern const q31_t cos_factorsQ31_2048[2048]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q31_8192) | |||
| extern const q31_t WeightsQ31_8192[16384]; | |||
| extern const q31_t cos_factorsQ31_8192[8192]; | |||
| #endif | |||
| #endif /* if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_ALLOW_TABLES) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_RECIP_Q15) | |||
| extern const q15_t armRecipTableQ15[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_RECIP_Q31) | |||
| extern const q31_t armRecipTableQ31[64]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| /* Tables for Fast Math Sine and Cosine */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_F32) | |||
| extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q31) | |||
| extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q15) | |||
| extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #if defined(ARM_MATH_MVEI) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q31_MVE) | |||
| extern const q31_t sqrtTable_Q31[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #endif | |||
| #if defined(ARM_MATH_MVEI) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q15_MVE) | |||
| extern const q15_t sqrtTable_Q15[256]; | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ | |||
| #endif | |||
| #endif /* if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_TABLES) */ | |||
| #if (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) | |||
| extern const float32_t exp_tab[8]; | |||
| extern const float32_t __logf_lut_f32[8]; | |||
| #endif /* (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) */ | |||
| #if (defined(ARM_MATH_MVEI) || defined(ARM_MATH_HELIUM)) | |||
| extern const unsigned char hwLUT[256]; | |||
| #endif /* (defined(ARM_MATH_MVEI) || defined(ARM_MATH_HELIUM)) */ | |||
| #endif /* ARM_COMMON_TABLES_H */ | |||
| @@ -0,0 +1,76 @@ | |||
| /* ---------------------------------------------------------------------- | |||
| * Project: CMSIS DSP Library | |||
| * Title: arm_const_structs.h | |||
| * Description: Constant structs that are initialized for user convenience. | |||
| * For example, some can be given as arguments to the arm_cfft_f32() function. | |||
| * | |||
| * $Date: 27. January 2017 | |||
| * $Revision: V.1.5.1 | |||
| * | |||
| * Target Processor: Cortex-M cores | |||
| * -------------------------------------------------------------------- */ | |||
| /* | |||
| * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef _ARM_CONST_STRUCTS_H | |||
| #define _ARM_CONST_STRUCTS_H | |||
| #include "arm_math.h" | |||
| #include "arm_common_tables.h" | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len16; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len32; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len64; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len128; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len256; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len512; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len1024; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len2048; | |||
| extern const arm_cfft_instance_f64 arm_cfft_sR_f64_len4096; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; | |||
| extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; | |||
| extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; | |||
| extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; | |||
| #endif | |||
| @@ -0,0 +1,348 @@ | |||
| /* ---------------------------------------------------------------------- | |||
| * Project: CMSIS DSP Library | |||
| * Title: arm_helium_utils.h | |||
| * Description: Utility functions for Helium development | |||
| * | |||
| * $Date: 09. September 2019 | |||
| * $Revision: V.1.5.1 | |||
| * | |||
| * Target Processor: Cortex-M cores | |||
| * -------------------------------------------------------------------- */ | |||
| /* | |||
| * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef _ARM_UTILS_HELIUM_H_ | |||
| #define _ARM_UTILS_HELIUM_H_ | |||
| /*************************************** | |||
| Definitions available for MVEF and MVEI | |||
| ***************************************/ | |||
| #if defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) || defined(ARM_MATH_MVEI) | |||
| #define INACTIVELANE 0 /* inactive lane content */ | |||
| #endif /* defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) || defined(ARM_MATH_MVEI) */ | |||
| /*************************************** | |||
| Definitions available for MVEF only | |||
| ***************************************/ | |||
| #if defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) | |||
| __STATIC_FORCEINLINE float32_t vecAddAcrossF32Mve(float32x4_t in) | |||
| { | |||
| float32_t acc; | |||
| acc = vgetq_lane(in, 0) + vgetq_lane(in, 1) + | |||
| vgetq_lane(in, 2) + vgetq_lane(in, 3); | |||
| return acc; | |||
| } | |||
| /* newton initial guess */ | |||
| #define INVSQRT_MAGIC_F32 0x5f3759df | |||
| #define INVSQRT_NEWTON_MVE_F32(invSqrt, xHalf, xStart)\ | |||
| { \ | |||
| float32x4_t tmp; \ | |||
| \ | |||
| /* tmp = xhalf * x * x */ \ | |||
| tmp = vmulq(xStart, xStart); \ | |||
| tmp = vmulq(tmp, xHalf); \ | |||
| /* (1.5f - xhalf * x * x) */ \ | |||
| tmp = vsubq(vdupq_n_f32(1.5f), tmp); \ | |||
| /* x = x*(1.5f-xhalf*x*x); */ \ | |||
| invSqrt = vmulq(tmp, xStart); \ | |||
| } | |||
| #endif /* defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) */ | |||
| /*************************************** | |||
| Definitions available for MVEI only | |||
| ***************************************/ | |||
| #if defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEI) | |||
| #include "arm_common_tables.h" | |||
| /* Following functions are used to transpose matrix in f32 and q31 cases */ | |||
| __STATIC_INLINE arm_status arm_mat_trans_32bit_2x2_mve( | |||
| uint32_t * pDataSrc, | |||
| uint32_t * pDataDest) | |||
| { | |||
| static const uint32x4_t vecOffs = { 0, 2, 1, 3 }; | |||
| /* | |||
| * | |||
| * | 0 1 | => | 0 2 | | |||
| * | 2 3 | | 1 3 | | |||
| * | |||
| */ | |||
| uint32x4_t vecIn = vldrwq_u32((uint32_t const *)pDataSrc); | |||
| vstrwq_scatter_shifted_offset_u32(pDataDest, vecOffs, vecIn); | |||
| return (ARM_MATH_SUCCESS); | |||
| } | |||
| __STATIC_INLINE arm_status arm_mat_trans_32bit_3x3_mve( | |||
| uint32_t * pDataSrc, | |||
| uint32_t * pDataDest) | |||
| { | |||
| const uint32x4_t vecOffs1 = { 0, 3, 6, 1}; | |||
| const uint32x4_t vecOffs2 = { 4, 7, 2, 5}; | |||
| /* | |||
| * | |||
| * | 0 1 2 | | 0 3 6 | 4 x 32 flattened version | 0 3 6 1 | | |||
| * | 3 4 5 | => | 1 4 7 | => | 4 7 2 5 | | |||
| * | 6 7 8 | | 2 5 8 | (row major) | 8 . . . | | |||
| * | |||
| */ | |||
| uint32x4_t vecIn1 = vldrwq_u32((uint32_t const *) pDataSrc); | |||
| uint32x4_t vecIn2 = vldrwq_u32((uint32_t const *) &pDataSrc[4]); | |||
| vstrwq_scatter_shifted_offset_u32(pDataDest, vecOffs1, vecIn1); | |||
| vstrwq_scatter_shifted_offset_u32(pDataDest, vecOffs2, vecIn2); | |||
| pDataDest[8] = pDataSrc[8]; | |||
| return (ARM_MATH_SUCCESS); | |||
| } | |||
| __STATIC_INLINE arm_status arm_mat_trans_32bit_4x4_mve(uint32_t * pDataSrc, uint32_t * pDataDest) | |||
| { | |||
| /* | |||
| * 4x4 Matrix transposition | |||
| * is 4 x de-interleave operation | |||
| * | |||
| * 0 1 2 3 0 4 8 12 | |||
| * 4 5 6 7 1 5 9 13 | |||
| * 8 9 10 11 2 6 10 14 | |||
| * 12 13 14 15 3 7 11 15 | |||
| */ | |||
| uint32x4x4_t vecIn; | |||
| vecIn = vld4q((uint32_t const *) pDataSrc); | |||
| vstrwq(pDataDest, vecIn.val[0]); | |||
| pDataDest += 4; | |||
| vstrwq(pDataDest, vecIn.val[1]); | |||
| pDataDest += 4; | |||
| vstrwq(pDataDest, vecIn.val[2]); | |||
| pDataDest += 4; | |||
| vstrwq(pDataDest, vecIn.val[3]); | |||
| return (ARM_MATH_SUCCESS); | |||
| } | |||
| __STATIC_INLINE arm_status arm_mat_trans_32bit_generic_mve( | |||
| uint16_t srcRows, | |||
| uint16_t srcCols, | |||
| uint32_t * pDataSrc, | |||
| uint32_t * pDataDest) | |||
| { | |||
| uint32x4_t vecOffs; | |||
| uint32_t i; | |||
| uint32_t blkCnt; | |||
| uint32_t const *pDataC; | |||
| uint32_t *pDataDestR; | |||
| uint32x4_t vecIn; | |||
| vecOffs = vidupq_u32((uint32_t)0, 1); | |||
| vecOffs = vecOffs * srcCols; | |||
| i = srcCols; | |||
| do | |||
| { | |||
| pDataC = (uint32_t const *) pDataSrc; | |||
| pDataDestR = pDataDest; | |||
| blkCnt = srcRows >> 2; | |||
| while (blkCnt > 0U) | |||
| { | |||
| vecIn = vldrwq_gather_shifted_offset_u32(pDataC, vecOffs); | |||
| vstrwq(pDataDestR, vecIn); | |||
| pDataDestR += 4; | |||
| pDataC = pDataC + srcCols * 4; | |||
| /* | |||
| * Decrement the blockSize loop counter | |||
| */ | |||
| blkCnt--; | |||
| } | |||
| /* | |||
| * tail | |||
| */ | |||
| blkCnt = srcRows & 3; | |||
| if (blkCnt > 0U) | |||
| { | |||
| mve_pred16_t p0 = vctp32q(blkCnt); | |||
| vecIn = vldrwq_gather_shifted_offset_u32(pDataC, vecOffs); | |||
| vstrwq_p(pDataDestR, vecIn, p0); | |||
| } | |||
| pDataSrc += 1; | |||
| pDataDest += srcRows; | |||
| } | |||
| while (--i); | |||
| return (ARM_MATH_SUCCESS); | |||
| } | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q31_MVE) | |||
| __STATIC_INLINE q31x4_t FAST_VSQRT_Q31(q31x4_t vecIn) | |||
| { | |||
| q63x2_t vecTmpLL; | |||
| q31x4_t vecTmp0, vecTmp1; | |||
| q31_t scale; | |||
| q63_t tmp64; | |||
| q31x4_t vecNrm, vecDst, vecIdx, vecSignBits; | |||
| vecSignBits = vclsq(vecIn); | |||
| vecSignBits = vbicq(vecSignBits, 1); | |||
| /* | |||
| * in = in << no_of_sign_bits; | |||
| */ | |||
| vecNrm = vshlq(vecIn, vecSignBits); | |||
| /* | |||
| * index = in >> 24; | |||
| */ | |||
| vecIdx = vecNrm >> 24; | |||
| vecIdx = vecIdx << 1; | |||
| vecTmp0 = vldrwq_gather_shifted_offset_s32(sqrtTable_Q31, vecIdx); | |||
| vecIdx = vecIdx + 1; | |||
| vecTmp1 = vldrwq_gather_shifted_offset_s32(sqrtTable_Q31, vecIdx); | |||
| vecTmp1 = vqrdmulhq(vecTmp1, vecNrm); | |||
| vecTmp0 = vecTmp0 - vecTmp1; | |||
| vecTmp1 = vqrdmulhq(vecTmp0, vecTmp0); | |||
| vecTmp1 = vqrdmulhq(vecNrm, vecTmp1); | |||
| vecTmp1 = vdupq_n_s32(0x18000000) - vecTmp1; | |||
| vecTmp0 = vqrdmulhq(vecTmp0, vecTmp1); | |||
| vecTmpLL = vmullbq_int(vecNrm, vecTmp0); | |||
| /* | |||
| * scale elements 0, 2 | |||
| */ | |||
| scale = 26 + (vecSignBits[0] >> 1); | |||
| tmp64 = asrl(vecTmpLL[0], scale); | |||
| vecDst[0] = (q31_t) tmp64; | |||
| scale = 26 + (vecSignBits[2] >> 1); | |||
| tmp64 = asrl(vecTmpLL[1], scale); | |||
| vecDst[2] = (q31_t) tmp64; | |||
| vecTmpLL = vmulltq_int(vecNrm, vecTmp0); | |||
| /* | |||
| * scale elements 1, 3 | |||
| */ | |||
| scale = 26 + (vecSignBits[1] >> 1); | |||
| tmp64 = asrl(vecTmpLL[0], scale); | |||
| vecDst[1] = (q31_t) tmp64; | |||
| scale = 26 + (vecSignBits[3] >> 1); | |||
| tmp64 = asrl(vecTmpLL[1], scale); | |||
| vecDst[3] = (q31_t) tmp64; | |||
| /* | |||
| * set negative values to 0 | |||
| */ | |||
| vecDst = vdupq_m(vecDst, 0, vcmpltq_n_s32(vecIn, 0)); | |||
| return vecDst; | |||
| } | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q15_MVE) | |||
| __STATIC_INLINE q15x8_t FAST_VSQRT_Q15(q15x8_t vecIn) | |||
| { | |||
| q31x4_t vecTmpLev, vecTmpLodd, vecSignL; | |||
| q15x8_t vecTmp0, vecTmp1; | |||
| q15x8_t vecNrm, vecDst, vecIdx, vecSignBits; | |||
| vecDst = vuninitializedq_s16(); | |||
| vecSignBits = vclsq(vecIn); | |||
| vecSignBits = vbicq(vecSignBits, 1); | |||
| /* | |||
| * in = in << no_of_sign_bits; | |||
| */ | |||
| vecNrm = vshlq(vecIn, vecSignBits); | |||
| vecIdx = vecNrm >> 8; | |||
| vecIdx = vecIdx << 1; | |||
| vecTmp0 = vldrhq_gather_shifted_offset_s16(sqrtTable_Q15, vecIdx); | |||
| vecIdx = vecIdx + 1; | |||
| vecTmp1 = vldrhq_gather_shifted_offset_s16(sqrtTable_Q15, vecIdx); | |||
| vecTmp1 = vqrdmulhq(vecTmp1, vecNrm); | |||
| vecTmp0 = vecTmp0 - vecTmp1; | |||
| vecTmp1 = vqrdmulhq(vecTmp0, vecTmp0); | |||
| vecTmp1 = vqrdmulhq(vecNrm, vecTmp1); | |||
| vecTmp1 = vdupq_n_s16(0x1800) - vecTmp1; | |||
| vecTmp0 = vqrdmulhq(vecTmp0, vecTmp1); | |||
| vecSignBits = vecSignBits >> 1; | |||
| vecTmpLev = vmullbq_int(vecNrm, vecTmp0); | |||
| vecTmpLodd = vmulltq_int(vecNrm, vecTmp0); | |||
| vecTmp0 = vecSignBits + 10; | |||
| /* | |||
| * negate sign to apply register based vshl | |||
| */ | |||
| vecTmp0 = -vecTmp0; | |||
| /* | |||
| * shift even elements | |||
| */ | |||
| vecSignL = vmovlbq(vecTmp0); | |||
| vecTmpLev = vshlq(vecTmpLev, vecSignL); | |||
| /* | |||
| * shift odd elements | |||
| */ | |||
| vecSignL = vmovltq(vecTmp0); | |||
| vecTmpLodd = vshlq(vecTmpLodd, vecSignL); | |||
| /* | |||
| * merge and narrow odd and even parts | |||
| */ | |||
| vecDst = vmovnbq_s32(vecDst, vecTmpLev); | |||
| vecDst = vmovntq_s32(vecDst, vecTmpLodd); | |||
| /* | |||
| * set negative values to 0 | |||
| */ | |||
| vecDst = vdupq_m(vecDst, 0, vcmpltq_n_s16(vecIn, 0)); | |||
| return vecDst; | |||
| } | |||
| #endif | |||
| #endif /* defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEI) */ | |||
| #endif | |||
| @@ -0,0 +1,235 @@ | |||
| /* ---------------------------------------------------------------------- | |||
| * Project: CMSIS DSP Library | |||
| * Title: arm_mve_tables.h | |||
| * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc | |||
| * used for MVE implementation only | |||
| * | |||
| * $Date: 08. January 2020 | |||
| * $Revision: V1.7.0 | |||
| * | |||
| * Target Processor: Cortex-M cores | |||
| * -------------------------------------------------------------------- */ | |||
| /* | |||
| * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef _ARM_MVE_TABLES_H | |||
| #define _ARM_MVE_TABLES_H | |||
| #include "arm_math.h" | |||
| #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_16) || defined(ARM_TABLE_TWIDDLECOEF_F32_32) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_16_f32[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_16_f32[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_16_f32[2]; | |||
| extern float32_t rearranged_twiddle_stride1_16_f32[8]; | |||
| extern float32_t rearranged_twiddle_stride2_16_f32[8]; | |||
| extern float32_t rearranged_twiddle_stride3_16_f32[8]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_64) || defined(ARM_TABLE_TWIDDLECOEF_F32_128) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_64_f32[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_64_f32[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_64_f32[3]; | |||
| extern float32_t rearranged_twiddle_stride1_64_f32[40]; | |||
| extern float32_t rearranged_twiddle_stride2_64_f32[40]; | |||
| extern float32_t rearranged_twiddle_stride3_64_f32[40]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_256) || defined(ARM_TABLE_TWIDDLECOEF_F32_512) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_256_f32[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_256_f32[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_256_f32[4]; | |||
| extern float32_t rearranged_twiddle_stride1_256_f32[168]; | |||
| extern float32_t rearranged_twiddle_stride2_256_f32[168]; | |||
| extern float32_t rearranged_twiddle_stride3_256_f32[168]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_1024) || defined(ARM_TABLE_TWIDDLECOEF_F32_2048) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_1024_f32[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_1024_f32[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_1024_f32[5]; | |||
| extern float32_t rearranged_twiddle_stride1_1024_f32[680]; | |||
| extern float32_t rearranged_twiddle_stride2_1024_f32[680]; | |||
| extern float32_t rearranged_twiddle_stride3_1024_f32[680]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) || defined(ARM_TABLE_TWIDDLECOEF_F32_8192) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_4096_f32[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_4096_f32[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_4096_f32[6]; | |||
| extern float32_t rearranged_twiddle_stride1_4096_f32[2728]; | |||
| extern float32_t rearranged_twiddle_stride2_4096_f32[2728]; | |||
| extern float32_t rearranged_twiddle_stride3_4096_f32[2728]; | |||
| #endif | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ | |||
| #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ | |||
| #if defined(ARM_MATH_MVEI) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_16) || defined(ARM_TABLE_TWIDDLECOEF_Q31_32) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_16_q31[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_16_q31[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_16_q31[2]; | |||
| extern q31_t rearranged_twiddle_stride1_16_q31[8]; | |||
| extern q31_t rearranged_twiddle_stride2_16_q31[8]; | |||
| extern q31_t rearranged_twiddle_stride3_16_q31[8]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_64) || defined(ARM_TABLE_TWIDDLECOEF_Q31_128) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_64_q31[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_64_q31[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_64_q31[3]; | |||
| extern q31_t rearranged_twiddle_stride1_64_q31[40]; | |||
| extern q31_t rearranged_twiddle_stride2_64_q31[40]; | |||
| extern q31_t rearranged_twiddle_stride3_64_q31[40]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_256) || defined(ARM_TABLE_TWIDDLECOEF_Q31_512) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_256_q31[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_256_q31[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_256_q31[4]; | |||
| extern q31_t rearranged_twiddle_stride1_256_q31[168]; | |||
| extern q31_t rearranged_twiddle_stride2_256_q31[168]; | |||
| extern q31_t rearranged_twiddle_stride3_256_q31[168]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) || defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_1024_q31[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_1024_q31[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_1024_q31[5]; | |||
| extern q31_t rearranged_twiddle_stride1_1024_q31[680]; | |||
| extern q31_t rearranged_twiddle_stride2_1024_q31[680]; | |||
| extern q31_t rearranged_twiddle_stride3_1024_q31[680]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) || defined(ARM_TABLE_TWIDDLECOEF_Q31_8192) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_4096_q31[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_4096_q31[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_4096_q31[6]; | |||
| extern q31_t rearranged_twiddle_stride1_4096_q31[2728]; | |||
| extern q31_t rearranged_twiddle_stride2_4096_q31[2728]; | |||
| extern q31_t rearranged_twiddle_stride3_4096_q31[2728]; | |||
| #endif | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ | |||
| #endif /* defined(ARM_MATH_MVEI) */ | |||
| #if defined(ARM_MATH_MVEI) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_16) || defined(ARM_TABLE_TWIDDLECOEF_Q15_32) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_16_q15[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_16_q15[2]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_16_q15[2]; | |||
| extern q15_t rearranged_twiddle_stride1_16_q15[8]; | |||
| extern q15_t rearranged_twiddle_stride2_16_q15[8]; | |||
| extern q15_t rearranged_twiddle_stride3_16_q15[8]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_64) || defined(ARM_TABLE_TWIDDLECOEF_Q15_128) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_64_q15[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_64_q15[3]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_64_q15[3]; | |||
| extern q15_t rearranged_twiddle_stride1_64_q15[40]; | |||
| extern q15_t rearranged_twiddle_stride2_64_q15[40]; | |||
| extern q15_t rearranged_twiddle_stride3_64_q15[40]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_256) || defined(ARM_TABLE_TWIDDLECOEF_Q15_512) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_256_q15[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_256_q15[4]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_256_q15[4]; | |||
| extern q15_t rearranged_twiddle_stride1_256_q15[168]; | |||
| extern q15_t rearranged_twiddle_stride2_256_q15[168]; | |||
| extern q15_t rearranged_twiddle_stride3_256_q15[168]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_1024) || defined(ARM_TABLE_TWIDDLECOEF_Q15_2048) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_1024_q15[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_1024_q15[5]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_1024_q15[5]; | |||
| extern q15_t rearranged_twiddle_stride1_1024_q15[680]; | |||
| extern q15_t rearranged_twiddle_stride2_1024_q15[680]; | |||
| extern q15_t rearranged_twiddle_stride3_1024_q15[680]; | |||
| #endif | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) || defined(ARM_TABLE_TWIDDLECOEF_Q15_8192) | |||
| extern uint32_t rearranged_twiddle_tab_stride1_arr_4096_q15[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride2_arr_4096_q15[6]; | |||
| extern uint32_t rearranged_twiddle_tab_stride3_arr_4096_q15[6]; | |||
| extern q15_t rearranged_twiddle_stride1_4096_q15[2728]; | |||
| extern q15_t rearranged_twiddle_stride2_4096_q15[2728]; | |||
| extern q15_t rearranged_twiddle_stride3_4096_q15[2728]; | |||
| #endif | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ | |||
| #endif /* defined(ARM_MATH_MVEI) */ | |||
| #if defined(ARM_MATH_MVEI) | |||
| #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) | |||
| #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ | |||
| #endif /* defined(ARM_MATH_MVEI) */ | |||
| #endif /*_ARM_MVE_TABLES_H*/ | |||
| @@ -0,0 +1,372 @@ | |||
| /****************************************************************************** | |||
| * @file arm_vec_math.h | |||
| * @brief Public header file for CMSIS DSP Library | |||
| * @version V1.7.0 | |||
| * @date 15. October 2019 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2010-2019 Arm Limited or its affiliates. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef _ARM_VEC_MATH_H | |||
| #define _ARM_VEC_MATH_H | |||
| #include "arm_math.h" | |||
| #include "arm_common_tables.h" | |||
| #include "arm_helium_utils.h" | |||
| #ifdef __cplusplus | |||
| extern "C" | |||
| { | |||
| #endif | |||
| #if (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) | |||
| #define INV_NEWTON_INIT_F32 0x7EF127EA | |||
| static const float32_t __logf_rng_f32=0.693147180f; | |||
| /* fast inverse approximation (3x newton) */ | |||
| __STATIC_INLINE f32x4_t vrecip_medprec_f32( | |||
| f32x4_t x) | |||
| { | |||
| q31x4_t m; | |||
| f32x4_t b; | |||
| any32x4_t xinv; | |||
| f32x4_t ax = vabsq(x); | |||
| xinv.f = ax; | |||
| m = 0x3F800000 - (xinv.i & 0x7F800000); | |||
| xinv.i = xinv.i + m; | |||
| xinv.f = 1.41176471f - 0.47058824f * xinv.f; | |||
| xinv.i = xinv.i + m; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| xinv.f = vdupq_m(xinv.f, INFINITY, vcmpeqq(x, 0.0f)); | |||
| /* | |||
| * restore sign | |||
| */ | |||
| xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq(x, 0.0f)); | |||
| return xinv.f; | |||
| } | |||
| /* fast inverse approximation (4x newton) */ | |||
| __STATIC_INLINE f32x4_t vrecip_hiprec_f32( | |||
| f32x4_t x) | |||
| { | |||
| q31x4_t m; | |||
| f32x4_t b; | |||
| any32x4_t xinv; | |||
| f32x4_t ax = vabsq(x); | |||
| xinv.f = ax; | |||
| m = 0x3F800000 - (xinv.i & 0x7F800000); | |||
| xinv.i = xinv.i + m; | |||
| xinv.f = 1.41176471f - 0.47058824f * xinv.f; | |||
| xinv.i = xinv.i + m; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| b = 2.0f - xinv.f * ax; | |||
| xinv.f = xinv.f * b; | |||
| xinv.f = vdupq_m(xinv.f, INFINITY, vcmpeqq(x, 0.0f)); | |||
| /* | |||
| * restore sign | |||
| */ | |||
| xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq(x, 0.0f)); | |||
| return xinv.f; | |||
| } | |||
| __STATIC_INLINE f32x4_t vdiv_f32( | |||
| f32x4_t num, f32x4_t den) | |||
| { | |||
| return vmulq(num, vrecip_hiprec_f32(den)); | |||
| } | |||
| /** | |||
| @brief Single-precision taylor dev. | |||
| @param[in] x f32 quad vector input | |||
| @param[in] coeffs f32 quad vector coeffs | |||
| @return destination f32 quad vector | |||
| */ | |||
| __STATIC_INLINE f32x4_t vtaylor_polyq_f32( | |||
| f32x4_t x, | |||
| const float32_t * coeffs) | |||
| { | |||
| f32x4_t A = vfmasq(vdupq_n_f32(coeffs[4]), x, coeffs[0]); | |||
| f32x4_t B = vfmasq(vdupq_n_f32(coeffs[6]), x, coeffs[2]); | |||
| f32x4_t C = vfmasq(vdupq_n_f32(coeffs[5]), x, coeffs[1]); | |||
| f32x4_t D = vfmasq(vdupq_n_f32(coeffs[7]), x, coeffs[3]); | |||
| f32x4_t x2 = vmulq(x, x); | |||
| f32x4_t x4 = vmulq(x2, x2); | |||
| f32x4_t res = vfmaq(vfmaq_f32(A, B, x2), vfmaq_f32(C, D, x2), x4); | |||
| return res; | |||
| } | |||
| __STATIC_INLINE f32x4_t vmant_exp_f32( | |||
| f32x4_t x, | |||
| int32x4_t * e) | |||
| { | |||
| any32x4_t r; | |||
| int32x4_t n; | |||
| r.f = x; | |||
| n = r.i >> 23; | |||
| n = n - 127; | |||
| r.i = r.i - (n << 23); | |||
| *e = n; | |||
| return r.f; | |||
| } | |||
| __STATIC_INLINE f32x4_t vlogq_f32(f32x4_t vecIn) | |||
| { | |||
| q31x4_t vecExpUnBiased; | |||
| f32x4_t vecTmpFlt0, vecTmpFlt1; | |||
| f32x4_t vecAcc0, vecAcc1, vecAcc2, vecAcc3; | |||
| f32x4_t vecExpUnBiasedFlt; | |||
| /* | |||
| * extract exponent | |||
| */ | |||
| vecTmpFlt1 = vmant_exp_f32(vecIn, &vecExpUnBiased); | |||
| vecTmpFlt0 = vecTmpFlt1 * vecTmpFlt1; | |||
| /* | |||
| * a = (__logf_lut_f32[4] * r.f) + (__logf_lut_f32[0]); | |||
| */ | |||
| vecAcc0 = vdupq_n_f32(__logf_lut_f32[0]); | |||
| vecAcc0 = vfmaq(vecAcc0, vecTmpFlt1, __logf_lut_f32[4]); | |||
| /* | |||
| * b = (__logf_lut_f32[6] * r.f) + (__logf_lut_f32[2]); | |||
| */ | |||
| vecAcc1 = vdupq_n_f32(__logf_lut_f32[2]); | |||
| vecAcc1 = vfmaq(vecAcc1, vecTmpFlt1, __logf_lut_f32[6]); | |||
| /* | |||
| * c = (__logf_lut_f32[5] * r.f) + (__logf_lut_f32[1]); | |||
| */ | |||
| vecAcc2 = vdupq_n_f32(__logf_lut_f32[1]); | |||
| vecAcc2 = vfmaq(vecAcc2, vecTmpFlt1, __logf_lut_f32[5]); | |||
| /* | |||
| * d = (__logf_lut_f32[7] * r.f) + (__logf_lut_f32[3]); | |||
| */ | |||
| vecAcc3 = vdupq_n_f32(__logf_lut_f32[3]); | |||
| vecAcc3 = vfmaq(vecAcc3, vecTmpFlt1, __logf_lut_f32[7]); | |||
| /* | |||
| * a = a + b * xx; | |||
| */ | |||
| vecAcc0 = vfmaq(vecAcc0, vecAcc1, vecTmpFlt0); | |||
| /* | |||
| * c = c + d * xx; | |||
| */ | |||
| vecAcc2 = vfmaq(vecAcc2, vecAcc3, vecTmpFlt0); | |||
| /* | |||
| * xx = xx * xx; | |||
| */ | |||
| vecTmpFlt0 = vecTmpFlt0 * vecTmpFlt0; | |||
| vecExpUnBiasedFlt = vcvtq_f32_s32(vecExpUnBiased); | |||
| /* | |||
| * r.f = a + c * xx; | |||
| */ | |||
| vecAcc0 = vfmaq(vecAcc0, vecAcc2, vecTmpFlt0); | |||
| /* | |||
| * add exponent | |||
| * r.f = r.f + ((float32_t) m) * __logf_rng_f32; | |||
| */ | |||
| vecAcc0 = vfmaq(vecAcc0, vecExpUnBiasedFlt, __logf_rng_f32); | |||
| // set log0 down to -inf | |||
| vecAcc0 = vdupq_m(vecAcc0, -INFINITY, vcmpeqq(vecIn, 0.0f)); | |||
| return vecAcc0; | |||
| } | |||
| __STATIC_INLINE f32x4_t vexpq_f32( | |||
| f32x4_t x) | |||
| { | |||
| // Perform range reduction [-log(2),log(2)] | |||
| int32x4_t m = vcvtq_s32_f32(vmulq_n_f32(x, 1.4426950408f)); | |||
| f32x4_t val = vfmsq_f32(x, vcvtq_f32_s32(m), vdupq_n_f32(0.6931471805f)); | |||
| // Polynomial Approximation | |||
| f32x4_t poly = vtaylor_polyq_f32(val, exp_tab); | |||
| // Reconstruct | |||
| poly = (f32x4_t) (vqaddq_s32((q31x4_t) (poly), vqshlq_n_s32(m, 23))); | |||
| poly = vdupq_m(poly, 0.0f, vcmpltq_n_s32(m, -126)); | |||
| return poly; | |||
| } | |||
| __STATIC_INLINE f32x4_t arm_vec_exponent_f32(f32x4_t x, int32_t nb) | |||
| { | |||
| f32x4_t r = x; | |||
| nb--; | |||
| while (nb > 0) { | |||
| r = vmulq(r, x); | |||
| nb--; | |||
| } | |||
| return (r); | |||
| } | |||
| __STATIC_INLINE f32x4_t vrecip_f32(f32x4_t vecIn) | |||
| { | |||
| f32x4_t vecSx, vecW, vecTmp; | |||
| any32x4_t v; | |||
| vecSx = vabsq(vecIn); | |||
| v.f = vecIn; | |||
| v.i = vsubq(vdupq_n_s32(INV_NEWTON_INIT_F32), v.i); | |||
| vecW = vmulq(vecSx, v.f); | |||
| // v.f = v.f * (8 + w * (-28 + w * (56 + w * (-70 + w *(56 + w * (-28 + w * (8 - w))))))); | |||
| vecTmp = vsubq(vdupq_n_f32(8.0f), vecW); | |||
| vecTmp = vfmasq(vecW, vecTmp, -28.0f); | |||
| vecTmp = vfmasq(vecW, vecTmp, 56.0f); | |||
| vecTmp = vfmasq(vecW, vecTmp, -70.0f); | |||
| vecTmp = vfmasq(vecW, vecTmp, 56.0f); | |||
| vecTmp = vfmasq(vecW, vecTmp, -28.0f); | |||
| vecTmp = vfmasq(vecW, vecTmp, 8.0f); | |||
| v.f = vmulq(v.f, vecTmp); | |||
| v.f = vdupq_m(v.f, INFINITY, vcmpeqq(vecIn, 0.0f)); | |||
| /* | |||
| * restore sign | |||
| */ | |||
| v.f = vnegq_m(v.f, v.f, vcmpltq(vecIn, 0.0f)); | |||
| return v.f; | |||
| } | |||
| __STATIC_INLINE f32x4_t vtanhq_f32( | |||
| f32x4_t val) | |||
| { | |||
| f32x4_t x = | |||
| vminnmq_f32(vmaxnmq_f32(val, vdupq_n_f32(-10.f)), vdupq_n_f32(10.0f)); | |||
| f32x4_t exp2x = vexpq_f32(vmulq_n_f32(x, 2.f)); | |||
| f32x4_t num = vsubq_n_f32(exp2x, 1.f); | |||
| f32x4_t den = vaddq_n_f32(exp2x, 1.f); | |||
| f32x4_t tanh = vmulq_f32(num, vrecip_f32(den)); | |||
| return tanh; | |||
| } | |||
| __STATIC_INLINE f32x4_t vpowq_f32( | |||
| f32x4_t val, | |||
| f32x4_t n) | |||
| { | |||
| return vexpq_f32(vmulq_f32(n, vlogq_f32(val))); | |||
| } | |||
| #endif /* (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE)*/ | |||
| #if (defined(ARM_MATH_MVEI) || defined(ARM_MATH_HELIUM)) | |||
| #endif /* (defined(ARM_MATH_MVEI) || defined(ARM_MATH_HELIUM)) */ | |||
| #if (defined(ARM_MATH_NEON) || defined(ARM_MATH_NEON_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) | |||
| #include "NEMath.h" | |||
| /** | |||
| * @brief Vectorized integer exponentiation | |||
| * @param[in] x value | |||
| * @param[in] nb integer exponent >= 1 | |||
| * @return x^nb | |||
| * | |||
| */ | |||
| __STATIC_INLINE float32x4_t arm_vec_exponent_f32(float32x4_t x, int32_t nb) | |||
| { | |||
| float32x4_t r = x; | |||
| nb --; | |||
| while(nb > 0) | |||
| { | |||
| r = vmulq_f32(r , x); | |||
| nb--; | |||
| } | |||
| return(r); | |||
| } | |||
| __STATIC_INLINE float32x4_t __arm_vec_sqrt_f32_neon(float32x4_t x) | |||
| { | |||
| float32x4_t x1 = vmaxq_f32(x, vdupq_n_f32(FLT_MIN)); | |||
| float32x4_t e = vrsqrteq_f32(x1); | |||
| e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e); | |||
| e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e); | |||
| return vmulq_f32(x, e); | |||
| } | |||
| __STATIC_INLINE int16x8_t __arm_vec_sqrt_q15_neon(int16x8_t vec) | |||
| { | |||
| float32x4_t tempF; | |||
| int32x4_t tempHI,tempLO; | |||
| tempLO = vmovl_s16(vget_low_s16(vec)); | |||
| tempF = vcvtq_n_f32_s32(tempLO,15); | |||
| tempF = __arm_vec_sqrt_f32_neon(tempF); | |||
| tempLO = vcvtq_n_s32_f32(tempF,15); | |||
| tempHI = vmovl_s16(vget_high_s16(vec)); | |||
| tempF = vcvtq_n_f32_s32(tempHI,15); | |||
| tempF = __arm_vec_sqrt_f32_neon(tempF); | |||
| tempHI = vcvtq_n_s32_f32(tempF,15); | |||
| return(vcombine_s16(vqmovn_s32(tempLO),vqmovn_s32(tempHI))); | |||
| } | |||
| __STATIC_INLINE int32x4_t __arm_vec_sqrt_q31_neon(int32x4_t vec) | |||
| { | |||
| float32x4_t temp; | |||
| temp = vcvtq_n_f32_s32(vec,31); | |||
| temp = __arm_vec_sqrt_f32_neon(temp); | |||
| return(vcvtq_n_s32_f32(temp,31)); | |||
| } | |||
| #endif /* (defined(ARM_MATH_NEON) || defined(ARM_MATH_NEON_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* _ARM_VEC_MATH_H */ | |||
| /** | |||
| * | |||
| * End of file. | |||
| */ | |||
| @@ -0,0 +1,411 @@ | |||
| /****************************************************************************** | |||
| * @file cachel1_armv7.h | |||
| * @brief CMSIS Level 1 Cache API for Armv7-M and later | |||
| * @version V1.0.0 | |||
| * @date 03. March 2020 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2020 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #if defined ( __ICCARM__ ) | |||
| #pragma system_include /* treat file as system include file for MISRA check */ | |||
| #elif defined (__clang__) | |||
| #pragma clang system_header /* treat file as system include file */ | |||
| #endif | |||
| #ifndef ARM_CACHEL1_ARMV7_H | |||
| #define ARM_CACHEL1_ARMV7_H | |||
| /** | |||
| \ingroup CMSIS_Core_FunctionInterface | |||
| \defgroup CMSIS_Core_CacheFunctions Cache Functions | |||
| \brief Functions that configure Instruction and Data cache. | |||
| @{ | |||
| */ | |||
| /* Cache Size ID Register Macros */ | |||
| #define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos) | |||
| #define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos ) | |||
| #ifndef __SCB_DCACHE_LINE_SIZE | |||
| #define __SCB_DCACHE_LINE_SIZE 32U /*!< Cortex-M7 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ | |||
| #endif | |||
| #ifndef __SCB_ICACHE_LINE_SIZE | |||
| #define __SCB_ICACHE_LINE_SIZE 32U /*!< Cortex-M7 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ | |||
| #endif | |||
| /** | |||
| \brief Enable I-Cache | |||
| \details Turns on I-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_EnableICache (void) | |||
| { | |||
| #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) | |||
| if (SCB->CCR & SCB_CCR_IC_Msk) return; /* return if ICache is already enabled */ | |||
| __DSB(); | |||
| __ISB(); | |||
| SCB->ICIALLU = 0UL; /* invalidate I-Cache */ | |||
| __DSB(); | |||
| __ISB(); | |||
| SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Disable I-Cache | |||
| \details Turns off I-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_DisableICache (void) | |||
| { | |||
| #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) | |||
| __DSB(); | |||
| __ISB(); | |||
| SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; /* disable I-Cache */ | |||
| SCB->ICIALLU = 0UL; /* invalidate I-Cache */ | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Invalidate I-Cache | |||
| \details Invalidates I-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_InvalidateICache (void) | |||
| { | |||
| #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) | |||
| __DSB(); | |||
| __ISB(); | |||
| SCB->ICIALLU = 0UL; | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief I-Cache Invalidate by address | |||
| \details Invalidates I-Cache for the given address. | |||
| I-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. | |||
| I-Cache memory blocks which are part of given address + given size are invalidated. | |||
| \param[in] addr address | |||
| \param[in] isize size of memory block (in number of bytes) | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (void *addr, int32_t isize) | |||
| { | |||
| #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) | |||
| if ( isize > 0 ) { | |||
| int32_t op_size = isize + (((uint32_t)addr) & (__SCB_ICACHE_LINE_SIZE - 1U)); | |||
| uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_ICACHE_LINE_SIZE - 1U) */; | |||
| __DSB(); | |||
| do { | |||
| SCB->ICIMVAU = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ | |||
| op_addr += __SCB_ICACHE_LINE_SIZE; | |||
| op_size -= __SCB_ICACHE_LINE_SIZE; | |||
| } while ( op_size > 0 ); | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Enable D-Cache | |||
| \details Turns on D-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_EnableDCache (void) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| uint32_t ccsidr; | |||
| uint32_t sets; | |||
| uint32_t ways; | |||
| if (SCB->CCR & SCB_CCR_DC_Msk) return; /* return if DCache is already enabled */ | |||
| SCB->CSSELR = 0U; /* select Level 1 data cache */ | |||
| __DSB(); | |||
| ccsidr = SCB->CCSIDR; | |||
| /* invalidate D-Cache */ | |||
| sets = (uint32_t)(CCSIDR_SETS(ccsidr)); | |||
| do { | |||
| ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); | |||
| do { | |||
| SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | | |||
| ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); | |||
| #if defined ( __CC_ARM ) | |||
| __schedule_barrier(); | |||
| #endif | |||
| } while (ways-- != 0U); | |||
| } while(sets-- != 0U); | |||
| __DSB(); | |||
| SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; /* enable D-Cache */ | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Disable D-Cache | |||
| \details Turns off D-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_DisableDCache (void) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| uint32_t ccsidr; | |||
| uint32_t sets; | |||
| uint32_t ways; | |||
| SCB->CSSELR = 0U; /* select Level 1 data cache */ | |||
| __DSB(); | |||
| SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ | |||
| __DSB(); | |||
| ccsidr = SCB->CCSIDR; | |||
| /* clean & invalidate D-Cache */ | |||
| sets = (uint32_t)(CCSIDR_SETS(ccsidr)); | |||
| do { | |||
| ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); | |||
| do { | |||
| SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | | |||
| ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); | |||
| #if defined ( __CC_ARM ) | |||
| __schedule_barrier(); | |||
| #endif | |||
| } while (ways-- != 0U); | |||
| } while(sets-- != 0U); | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Invalidate D-Cache | |||
| \details Invalidates D-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_InvalidateDCache (void) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| uint32_t ccsidr; | |||
| uint32_t sets; | |||
| uint32_t ways; | |||
| SCB->CSSELR = 0U; /* select Level 1 data cache */ | |||
| __DSB(); | |||
| ccsidr = SCB->CCSIDR; | |||
| /* invalidate D-Cache */ | |||
| sets = (uint32_t)(CCSIDR_SETS(ccsidr)); | |||
| do { | |||
| ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); | |||
| do { | |||
| SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | | |||
| ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); | |||
| #if defined ( __CC_ARM ) | |||
| __schedule_barrier(); | |||
| #endif | |||
| } while (ways-- != 0U); | |||
| } while(sets-- != 0U); | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Clean D-Cache | |||
| \details Cleans D-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_CleanDCache (void) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| uint32_t ccsidr; | |||
| uint32_t sets; | |||
| uint32_t ways; | |||
| SCB->CSSELR = 0U; /* select Level 1 data cache */ | |||
| __DSB(); | |||
| ccsidr = SCB->CCSIDR; | |||
| /* clean D-Cache */ | |||
| sets = (uint32_t)(CCSIDR_SETS(ccsidr)); | |||
| do { | |||
| ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); | |||
| do { | |||
| SCB->DCCSW = (((sets << SCB_DCCSW_SET_Pos) & SCB_DCCSW_SET_Msk) | | |||
| ((ways << SCB_DCCSW_WAY_Pos) & SCB_DCCSW_WAY_Msk) ); | |||
| #if defined ( __CC_ARM ) | |||
| __schedule_barrier(); | |||
| #endif | |||
| } while (ways-- != 0U); | |||
| } while(sets-- != 0U); | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief Clean & Invalidate D-Cache | |||
| \details Cleans and Invalidates D-Cache | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_CleanInvalidateDCache (void) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| uint32_t ccsidr; | |||
| uint32_t sets; | |||
| uint32_t ways; | |||
| SCB->CSSELR = 0U; /* select Level 1 data cache */ | |||
| __DSB(); | |||
| ccsidr = SCB->CCSIDR; | |||
| /* clean & invalidate D-Cache */ | |||
| sets = (uint32_t)(CCSIDR_SETS(ccsidr)); | |||
| do { | |||
| ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); | |||
| do { | |||
| SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | | |||
| ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); | |||
| #if defined ( __CC_ARM ) | |||
| __schedule_barrier(); | |||
| #endif | |||
| } while (ways-- != 0U); | |||
| } while(sets-- != 0U); | |||
| __DSB(); | |||
| __ISB(); | |||
| #endif | |||
| } | |||
| /** | |||
| \brief D-Cache Invalidate by address | |||
| \details Invalidates D-Cache for the given address. | |||
| D-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. | |||
| D-Cache memory blocks which are part of given address + given size are invalidated. | |||
| \param[in] addr address | |||
| \param[in] dsize size of memory block (in number of bytes) | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (void *addr, int32_t dsize) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| if ( dsize > 0 ) { | |||
| int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); | |||
| uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; | |||
| __DSB(); | |||
| do { | |||
| SCB->DCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ | |||
| op_addr += __SCB_DCACHE_LINE_SIZE; | |||
| op_size -= __SCB_DCACHE_LINE_SIZE; | |||
| } while ( op_size > 0 ); | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| #endif | |||
| } | |||
| /** | |||
| \brief D-Cache Clean by address | |||
| \details Cleans D-Cache for the given address | |||
| D-Cache is cleaned starting from a 32 byte aligned address in 32 byte granularity. | |||
| D-Cache memory blocks which are part of given address + given size are cleaned. | |||
| \param[in] addr address | |||
| \param[in] dsize size of memory block (in number of bytes) | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| if ( dsize > 0 ) { | |||
| int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); | |||
| uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; | |||
| __DSB(); | |||
| do { | |||
| SCB->DCCMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ | |||
| op_addr += __SCB_DCACHE_LINE_SIZE; | |||
| op_size -= __SCB_DCACHE_LINE_SIZE; | |||
| } while ( op_size > 0 ); | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| #endif | |||
| } | |||
| /** | |||
| \brief D-Cache Clean and Invalidate by address | |||
| \details Cleans and invalidates D_Cache for the given address | |||
| D-Cache is cleaned and invalidated starting from a 32 byte aligned address in 32 byte granularity. | |||
| D-Cache memory blocks which are part of given address + given size are cleaned and invalidated. | |||
| \param[in] addr address (aligned to 32-byte boundary) | |||
| \param[in] dsize size of memory block (in number of bytes) | |||
| */ | |||
| __STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) | |||
| { | |||
| #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) | |||
| if ( dsize > 0 ) { | |||
| int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); | |||
| uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; | |||
| __DSB(); | |||
| do { | |||
| SCB->DCCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ | |||
| op_addr += __SCB_DCACHE_LINE_SIZE; | |||
| op_size -= __SCB_DCACHE_LINE_SIZE; | |||
| } while ( op_size > 0 ); | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| #endif | |||
| } | |||
| /*@} end of CMSIS_Core_CacheFunctions */ | |||
| #endif /* ARM_CACHEL1_ARMV7_H */ | |||
| @@ -0,0 +1,283 @@ | |||
| /**************************************************************************//** | |||
| * @file cmsis_compiler.h | |||
| * @brief CMSIS compiler generic header file | |||
| * @version V5.1.0 | |||
| * @date 09. October 2018 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2018 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef __CMSIS_COMPILER_H | |||
| #define __CMSIS_COMPILER_H | |||
| #include <stdint.h> | |||
| /* | |||
| * Arm Compiler 4/5 | |||
| */ | |||
| #if defined ( __CC_ARM ) | |||
| #include "cmsis_armcc.h" | |||
| /* | |||
| * Arm Compiler 6.6 LTM (armclang) | |||
| */ | |||
| #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) | |||
| #include "cmsis_armclang_ltm.h" | |||
| /* | |||
| * Arm Compiler above 6.10.1 (armclang) | |||
| */ | |||
| #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) | |||
| #include "cmsis_armclang.h" | |||
| /* | |||
| * GNU Compiler | |||
| */ | |||
| #elif defined ( __GNUC__ ) | |||
| #include "cmsis_gcc.h" | |||
| /* | |||
| * IAR Compiler | |||
| */ | |||
| #elif defined ( __ICCARM__ ) | |||
| #include <cmsis_iccarm.h> | |||
| /* | |||
| * TI Arm Compiler | |||
| */ | |||
| #elif defined ( __TI_ARM__ ) | |||
| #include <cmsis_ccs.h> | |||
| #ifndef __ASM | |||
| #define __ASM __asm | |||
| #endif | |||
| #ifndef __INLINE | |||
| #define __INLINE inline | |||
| #endif | |||
| #ifndef __STATIC_INLINE | |||
| #define __STATIC_INLINE static inline | |||
| #endif | |||
| #ifndef __STATIC_FORCEINLINE | |||
| #define __STATIC_FORCEINLINE __STATIC_INLINE | |||
| #endif | |||
| #ifndef __NO_RETURN | |||
| #define __NO_RETURN __attribute__((noreturn)) | |||
| #endif | |||
| #ifndef __USED | |||
| #define __USED __attribute__((used)) | |||
| #endif | |||
| #ifndef __WEAK | |||
| #define __WEAK __attribute__((weak)) | |||
| #endif | |||
| #ifndef __PACKED | |||
| #define __PACKED __attribute__((packed)) | |||
| #endif | |||
| #ifndef __PACKED_STRUCT | |||
| #define __PACKED_STRUCT struct __attribute__((packed)) | |||
| #endif | |||
| #ifndef __PACKED_UNION | |||
| #define __PACKED_UNION union __attribute__((packed)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32 /* deprecated */ | |||
| struct __attribute__((packed)) T_UINT32 { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_WRITE | |||
| __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_READ | |||
| __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_WRITE | |||
| __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_READ | |||
| __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __ALIGNED | |||
| #define __ALIGNED(x) __attribute__((aligned(x))) | |||
| #endif | |||
| #ifndef __RESTRICT | |||
| #define __RESTRICT __restrict | |||
| #endif | |||
| #ifndef __COMPILER_BARRIER | |||
| #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. | |||
| #define __COMPILER_BARRIER() (void)0 | |||
| #endif | |||
| /* | |||
| * TASKING Compiler | |||
| */ | |||
| #elif defined ( __TASKING__ ) | |||
| /* | |||
| * The CMSIS functions have been implemented as intrinsics in the compiler. | |||
| * Please use "carm -?i" to get an up to date list of all intrinsics, | |||
| * Including the CMSIS ones. | |||
| */ | |||
| #ifndef __ASM | |||
| #define __ASM __asm | |||
| #endif | |||
| #ifndef __INLINE | |||
| #define __INLINE inline | |||
| #endif | |||
| #ifndef __STATIC_INLINE | |||
| #define __STATIC_INLINE static inline | |||
| #endif | |||
| #ifndef __STATIC_FORCEINLINE | |||
| #define __STATIC_FORCEINLINE __STATIC_INLINE | |||
| #endif | |||
| #ifndef __NO_RETURN | |||
| #define __NO_RETURN __attribute__((noreturn)) | |||
| #endif | |||
| #ifndef __USED | |||
| #define __USED __attribute__((used)) | |||
| #endif | |||
| #ifndef __WEAK | |||
| #define __WEAK __attribute__((weak)) | |||
| #endif | |||
| #ifndef __PACKED | |||
| #define __PACKED __packed__ | |||
| #endif | |||
| #ifndef __PACKED_STRUCT | |||
| #define __PACKED_STRUCT struct __packed__ | |||
| #endif | |||
| #ifndef __PACKED_UNION | |||
| #define __PACKED_UNION union __packed__ | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32 /* deprecated */ | |||
| struct __packed__ T_UINT32 { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_WRITE | |||
| __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_READ | |||
| __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_WRITE | |||
| __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_READ | |||
| __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __ALIGNED | |||
| #define __ALIGNED(x) __align(x) | |||
| #endif | |||
| #ifndef __RESTRICT | |||
| #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. | |||
| #define __RESTRICT | |||
| #endif | |||
| #ifndef __COMPILER_BARRIER | |||
| #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. | |||
| #define __COMPILER_BARRIER() (void)0 | |||
| #endif | |||
| /* | |||
| * COSMIC Compiler | |||
| */ | |||
| #elif defined ( __CSMC__ ) | |||
| #include <cmsis_csm.h> | |||
| #ifndef __ASM | |||
| #define __ASM _asm | |||
| #endif | |||
| #ifndef __INLINE | |||
| #define __INLINE inline | |||
| #endif | |||
| #ifndef __STATIC_INLINE | |||
| #define __STATIC_INLINE static inline | |||
| #endif | |||
| #ifndef __STATIC_FORCEINLINE | |||
| #define __STATIC_FORCEINLINE __STATIC_INLINE | |||
| #endif | |||
| #ifndef __NO_RETURN | |||
| // NO RETURN is automatically detected hence no warning here | |||
| #define __NO_RETURN | |||
| #endif | |||
| #ifndef __USED | |||
| #warning No compiler specific solution for __USED. __USED is ignored. | |||
| #define __USED | |||
| #endif | |||
| #ifndef __WEAK | |||
| #define __WEAK __weak | |||
| #endif | |||
| #ifndef __PACKED | |||
| #define __PACKED @packed | |||
| #endif | |||
| #ifndef __PACKED_STRUCT | |||
| #define __PACKED_STRUCT @packed struct | |||
| #endif | |||
| #ifndef __PACKED_UNION | |||
| #define __PACKED_UNION @packed union | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32 /* deprecated */ | |||
| @packed struct T_UINT32 { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_WRITE | |||
| __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT16_READ | |||
| __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; | |||
| #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_WRITE | |||
| __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) | |||
| #endif | |||
| #ifndef __UNALIGNED_UINT32_READ | |||
| __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; | |||
| #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) | |||
| #endif | |||
| #ifndef __ALIGNED | |||
| #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. | |||
| #define __ALIGNED(x) | |||
| #endif | |||
| #ifndef __RESTRICT | |||
| #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. | |||
| #define __RESTRICT | |||
| #endif | |||
| #ifndef __COMPILER_BARRIER | |||
| #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. | |||
| #define __COMPILER_BARRIER() (void)0 | |||
| #endif | |||
| #else | |||
| #error Unknown compiler. | |||
| #endif | |||
| #endif /* __CMSIS_COMPILER_H */ | |||
| @@ -0,0 +1,39 @@ | |||
| /**************************************************************************//** | |||
| * @file cmsis_version.h | |||
| * @brief CMSIS Core(M) Version definitions | |||
| * @version V5.0.4 | |||
| * @date 23. July 2019 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2019 ARM Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #if defined ( __ICCARM__ ) | |||
| #pragma system_include /* treat file as system include file for MISRA check */ | |||
| #elif defined (__clang__) | |||
| #pragma clang system_header /* treat file as system include file */ | |||
| #endif | |||
| #ifndef __CMSIS_VERSION_H | |||
| #define __CMSIS_VERSION_H | |||
| /* CMSIS Version definitions */ | |||
| #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ | |||
| #define __CM_CMSIS_VERSION_SUB ( 4U) /*!< [15:0] CMSIS Core(M) sub version */ | |||
| #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ | |||
| __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ | |||
| #endif | |||
| @@ -0,0 +1,275 @@ | |||
| /****************************************************************************** | |||
| * @file mpu_armv7.h | |||
| * @brief CMSIS MPU API for Armv7-M MPU | |||
| * @version V5.1.2 | |||
| * @date 25. May 2020 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2017-2020 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #if defined ( __ICCARM__ ) | |||
| #pragma system_include /* treat file as system include file for MISRA check */ | |||
| #elif defined (__clang__) | |||
| #pragma clang system_header /* treat file as system include file */ | |||
| #endif | |||
| #ifndef ARM_MPU_ARMV7_H | |||
| #define ARM_MPU_ARMV7_H | |||
| #define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes | |||
| #define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes | |||
| #define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes | |||
| #define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes | |||
| #define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes | |||
| #define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte | |||
| #define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes | |||
| #define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes | |||
| #define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes | |||
| #define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes | |||
| #define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes | |||
| #define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes | |||
| #define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes | |||
| #define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes | |||
| #define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes | |||
| #define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte | |||
| #define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes | |||
| #define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes | |||
| #define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes | |||
| #define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes | |||
| #define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes | |||
| #define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes | |||
| #define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes | |||
| #define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes | |||
| #define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes | |||
| #define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte | |||
| #define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes | |||
| #define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes | |||
| #define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access | |||
| #define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only | |||
| #define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only | |||
| #define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access | |||
| #define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only | |||
| #define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access | |||
| /** MPU Region Base Address Register Value | |||
| * | |||
| * \param Region The region to be configured, number 0 to 15. | |||
| * \param BaseAddress The base address for the region. | |||
| */ | |||
| #define ARM_MPU_RBAR(Region, BaseAddress) \ | |||
| (((BaseAddress) & MPU_RBAR_ADDR_Msk) | \ | |||
| ((Region) & MPU_RBAR_REGION_Msk) | \ | |||
| (MPU_RBAR_VALID_Msk)) | |||
| /** | |||
| * MPU Memory Access Attributes | |||
| * | |||
| * \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. | |||
| * \param IsShareable Region is shareable between multiple bus masters. | |||
| * \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. | |||
| * \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. | |||
| */ | |||
| #define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \ | |||
| ((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \ | |||
| (((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \ | |||
| (((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \ | |||
| (((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk)) | |||
| /** | |||
| * MPU Region Attribute and Size Register Value | |||
| * | |||
| * \param DisableExec Instruction access disable bit, 1= disable instruction fetches. | |||
| * \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. | |||
| * \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_. | |||
| * \param SubRegionDisable Sub-region disable field. | |||
| * \param Size Region size of the region to be configured, for example 4K, 8K. | |||
| */ | |||
| #define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \ | |||
| ((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ | |||
| (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ | |||
| (((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \ | |||
| (((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ | |||
| (((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ | |||
| (((MPU_RASR_ENABLE_Msk)))) | |||
| /** | |||
| * MPU Region Attribute and Size Register Value | |||
| * | |||
| * \param DisableExec Instruction access disable bit, 1= disable instruction fetches. | |||
| * \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. | |||
| * \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. | |||
| * \param IsShareable Region is shareable between multiple bus masters. | |||
| * \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. | |||
| * \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. | |||
| * \param SubRegionDisable Sub-region disable field. | |||
| * \param Size Region size of the region to be configured, for example 4K, 8K. | |||
| */ | |||
| #define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \ | |||
| ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size) | |||
| /** | |||
| * MPU Memory Access Attribute for strongly ordered memory. | |||
| * - TEX: 000b | |||
| * - Shareable | |||
| * - Non-cacheable | |||
| * - Non-bufferable | |||
| */ | |||
| #define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U) | |||
| /** | |||
| * MPU Memory Access Attribute for device memory. | |||
| * - TEX: 000b (if shareable) or 010b (if non-shareable) | |||
| * - Shareable or non-shareable | |||
| * - Non-cacheable | |||
| * - Bufferable (if shareable) or non-bufferable (if non-shareable) | |||
| * | |||
| * \param IsShareable Configures the device memory as shareable or non-shareable. | |||
| */ | |||
| #define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U)) | |||
| /** | |||
| * MPU Memory Access Attribute for normal memory. | |||
| * - TEX: 1BBb (reflecting outer cacheability rules) | |||
| * - Shareable or non-shareable | |||
| * - Cacheable or non-cacheable (reflecting inner cacheability rules) | |||
| * - Bufferable or non-bufferable (reflecting inner cacheability rules) | |||
| * | |||
| * \param OuterCp Configures the outer cache policy. | |||
| * \param InnerCp Configures the inner cache policy. | |||
| * \param IsShareable Configures the memory as shareable or non-shareable. | |||
| */ | |||
| #define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) >> 1U), ((InnerCp) & 1U)) | |||
| /** | |||
| * MPU Memory Access Attribute non-cacheable policy. | |||
| */ | |||
| #define ARM_MPU_CACHEP_NOCACHE 0U | |||
| /** | |||
| * MPU Memory Access Attribute write-back, write and read allocate policy. | |||
| */ | |||
| #define ARM_MPU_CACHEP_WB_WRA 1U | |||
| /** | |||
| * MPU Memory Access Attribute write-through, no write allocate policy. | |||
| */ | |||
| #define ARM_MPU_CACHEP_WT_NWA 2U | |||
| /** | |||
| * MPU Memory Access Attribute write-back, no write allocate policy. | |||
| */ | |||
| #define ARM_MPU_CACHEP_WB_NWA 3U | |||
| /** | |||
| * Struct for a single MPU Region | |||
| */ | |||
| typedef struct { | |||
| uint32_t RBAR; //!< The region base address register value (RBAR) | |||
| uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR | |||
| } ARM_MPU_Region_t; | |||
| /** Enable the MPU. | |||
| * \param MPU_Control Default access permissions for unconfigured regions. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) | |||
| { | |||
| __DMB(); | |||
| MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; | |||
| #ifdef SCB_SHCSR_MEMFAULTENA_Msk | |||
| SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; | |||
| #endif | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| /** Disable the MPU. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_Disable(void) | |||
| { | |||
| __DMB(); | |||
| #ifdef SCB_SHCSR_MEMFAULTENA_Msk | |||
| SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; | |||
| #endif | |||
| MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; | |||
| __DSB(); | |||
| __ISB(); | |||
| } | |||
| /** Clear and disable the given MPU region. | |||
| * \param rnr Region number to be cleared. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) | |||
| { | |||
| MPU->RNR = rnr; | |||
| MPU->RASR = 0U; | |||
| } | |||
| /** Configure an MPU region. | |||
| * \param rbar Value for RBAR register. | |||
| * \param rasr Value for RASR register. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr) | |||
| { | |||
| MPU->RBAR = rbar; | |||
| MPU->RASR = rasr; | |||
| } | |||
| /** Configure the given MPU region. | |||
| * \param rnr Region number to be configured. | |||
| * \param rbar Value for RBAR register. | |||
| * \param rasr Value for RASR register. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr) | |||
| { | |||
| MPU->RNR = rnr; | |||
| MPU->RBAR = rbar; | |||
| MPU->RASR = rasr; | |||
| } | |||
| /** Memcopy with strictly ordered memory access, e.g. for register targets. | |||
| * \param dst Destination data is copied to. | |||
| * \param src Source data is copied from. | |||
| * \param len Amount of data words to be copied. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) | |||
| { | |||
| uint32_t i; | |||
| for (i = 0U; i < len; ++i) | |||
| { | |||
| dst[i] = src[i]; | |||
| } | |||
| } | |||
| /** Load the given number of MPU regions from a table. | |||
| * \param table Pointer to the MPU configuration table. | |||
| * \param cnt Amount of regions to be configured. | |||
| */ | |||
| __STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) | |||
| { | |||
| const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; | |||
| while (cnt > MPU_TYPE_RALIASES) { | |||
| ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize); | |||
| table += MPU_TYPE_RALIASES; | |||
| cnt -= MPU_TYPE_RALIASES; | |||
| } | |||
| ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize); | |||
| } | |||
| #endif | |||
| @@ -0,0 +1,62 @@ | |||
| /**************************************************************************//** | |||
| * @file system_ARMCM4.h | |||
| * @brief CMSIS Device System Header File for | |||
| * ARMCM4 Device | |||
| * @version V5.3.2 | |||
| * @date 15. November 2019 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2019 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef SYSTEM_ARMCM4_H | |||
| #define SYSTEM_ARMCM4_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /** | |||
| \brief Exception / Interrupt Handler Function Prototype | |||
| */ | |||
| typedef void(*VECTOR_TABLE_Type)(void); | |||
| /** | |||
| \brief System Clock Frequency (Core Clock) | |||
| */ | |||
| extern uint32_t SystemCoreClock; | |||
| /** | |||
| \brief Setup the microcontroller system. | |||
| Initialize the System and update the SystemCoreClock variable. | |||
| */ | |||
| extern void SystemInit (void); | |||
| /** | |||
| \brief Update SystemCoreClock variable. | |||
| Updates the SystemCoreClock with current core Clock retrieved from cpu registers. | |||
| */ | |||
| extern void SystemCoreClockUpdate (void); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* SYSTEM_ARMCM4_H */ | |||
| @@ -0,0 +1,62 @@ | |||
| /**************************************************************************//** | |||
| * @file system_ARMCM7.h | |||
| * @brief CMSIS Device System Header File for | |||
| * ARMCM7 Device | |||
| * @version V5.3.2 | |||
| * @date 15. November 2019 | |||
| ******************************************************************************/ | |||
| /* | |||
| * Copyright (c) 2009-2019 Arm Limited. All rights reserved. | |||
| * | |||
| * SPDX-License-Identifier: Apache-2.0 | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the License); you may | |||
| * not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an AS IS BASIS, WITHOUT | |||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| #ifndef SYSTEM_ARMCM7_H | |||
| #define SYSTEM_ARMCM7_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /** | |||
| \brief Exception / Interrupt Handler Function Prototype | |||
| */ | |||
| typedef void(*VECTOR_TABLE_Type)(void); | |||
| /** | |||
| \brief System Clock Frequency (Core Clock) | |||
| */ | |||
| extern uint32_t SystemCoreClock; | |||
| /** | |||
| \brief Setup the microcontroller system. | |||
| Initialize the System and update the SystemCoreClock variable. | |||
| */ | |||
| extern void SystemInit (void); | |||
| /** | |||
| \brief Update SystemCoreClock variable. | |||
| Updates the SystemCoreClock with current core Clock retrieved from cpu registers. | |||
| */ | |||
| extern void SystemCoreClockUpdate (void); | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* SYSTEM_ARMCM7_H */ | |||
| @@ -0,0 +1,38 @@ | |||
| { | |||
| "name": "CMSIS", | |||
| "version": "5.7.0", | |||
| "description": "ARM CMSIS 5", | |||
| "keywords": "arm,cmsis", | |||
| "repository": | |||
| { | |||
| "type": "git", | |||
| "url": "https://git.thevis.us/v3s5s1y/cmsis.git" | |||
| }, | |||
| "authors": | |||
| [ | |||
| { | |||
| "name": "John Robinson", | |||
| "email": "iam@thevis.us", | |||
| "url": "https://thevis.us", | |||
| "maintainer": true | |||
| } | |||
| ], | |||
| "license": "MIT", | |||
| "dependencies": { | |||
| }, | |||
| "frameworks": "arduino", | |||
| "platforms": "teensy", | |||
| "export": { | |||
| "exclude": [ | |||
| "docs", | |||
| "extras" | |||
| ] | |||
| }, | |||
| "build": { | |||
| "srcFilter": [ | |||
| "+<*.c>", | |||
| "+<*.cpp>", | |||
| "+<*.h>" | |||
| ] | |||
| } | |||
| } | |||
| @@ -0,0 +1 @@ | |||
| 5.7.0 | |||