Download edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h from edgeimpulse/Hey-Edge: direct link, hf CLI and curl.
- Browser
- Download file 5.22 kB
-
https://huggingface.co/edgeimpulse/Hey-Edge/resolve/main/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h
- Command line
-
hf download hf://edgeimpulse/Hey-Edge/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h
-
curl -L -o arm_math_memory.h https://huggingface.co/edgeimpulse/Hey-Edge/resolve/main/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h
5.22 kB
| /****************************************************************************** | |
| * @file arm_math_memory.h | |
| * @brief Public header file for CMSIS DSP Library | |
| * @version V1.10.0 | |
| * @date 08 July 2021 | |
| * Target Processor: Cortex-M and Cortex-A cores | |
| ******************************************************************************/ | |
| /* | |
| * Copyright (c) 2010-2021 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. | |
| */ | |
| extern "C" | |
| { | |
| /** | |
| @brief definition to read/write two 16 bit values. | |
| @deprecated | |
| */ | |
| /* SIMD replacement */ | |
| /** | |
| @brief Read 2 Q15 from Q15 pointer. | |
| @param[in] pQ15 points to input value | |
| @return Q31 value | |
| */ | |
| __STATIC_FORCEINLINE q31_t read_q15x2 ( | |
| q15_t const * pQ15) | |
| { | |
| q31_t val; | |
| memcpy (&val, pQ15, 4); | |
| val = (pQ15[1] << 16) | (pQ15[0] & 0x0FFFF) ; | |
| return (val); | |
| } | |
| /** | |
| @brief Read 2 Q15 from Q15 pointer and increment pointer afterwards. | |
| @param[in] pQ15 points to input value | |
| @return Q31 value | |
| */ | |
| /** | |
| @brief Read 2 Q15 from Q15 pointer and decrement pointer afterwards. | |
| @param[in] pQ15 points to input value | |
| @return Q31 value | |
| */ | |
| /** | |
| @brief Write 2 Q15 to Q15 pointer and increment pointer afterwards. | |
| @param[in] pQ15 points to input value | |
| @param[in] value Q31 value | |
| @return none | |
| */ | |
| __STATIC_FORCEINLINE void write_q15x2_ia ( | |
| q15_t ** pQ15, | |
| q31_t value) | |
| { | |
| q31_t val = value; | |
| memcpy (*pQ15, &val, 4); | |
| (*pQ15)[0] = (q15_t)(val & 0x0FFFF); | |
| (*pQ15)[1] = (q15_t)((val >> 16) & 0x0FFFF); | |
| *pQ15 += 2; | |
| } | |
| /** | |
| @brief Write 2 Q15 to Q15 pointer. | |
| @param[in] pQ15 points to input value | |
| @param[in] value Q31 value | |
| @return none | |
| */ | |
| __STATIC_FORCEINLINE void write_q15x2 ( | |
| q15_t * pQ15, | |
| q31_t value) | |
| { | |
| q31_t val = value; | |
| memcpy (pQ15, &val, 4); | |
| pQ15[0] = (q15_t)(val & 0x0FFFF); | |
| pQ15[1] = (q15_t)(val >> 16); | |
| } | |
| /** | |
| @brief Read 4 Q7 from Q7 pointer | |
| @param[in] pQ7 points to input value | |
| @return Q31 value | |
| */ | |
| __STATIC_FORCEINLINE q31_t read_q7x4 ( | |
| q7_t const * pQ7) | |
| { | |
| q31_t val; | |
| memcpy (&val, pQ7, 4); | |
| val =((pQ7[3] & 0x0FF) << 24) | ((pQ7[2] & 0x0FF) << 16) | ((pQ7[1] & 0x0FF) << 8) | (pQ7[0] & 0x0FF); | |
| return (val); | |
| } | |
| /** | |
| @brief Read 4 Q7 from Q7 pointer and increment pointer afterwards. | |
| @param[in] pQ7 points to input value | |
| @return Q31 value | |
| */ | |
| /** | |
| @brief Read 4 Q7 from Q7 pointer and decrement pointer afterwards. | |
| @param[in] pQ7 points to input value | |
| @return Q31 value | |
| */ | |
| /** | |
| @brief Write 4 Q7 to Q7 pointer and increment pointer afterwards. | |
| @param[in] pQ7 points to input value | |
| @param[in] value Q31 value | |
| @return none | |
| */ | |
| __STATIC_FORCEINLINE void write_q7x4_ia ( | |
| q7_t ** pQ7, | |
| q31_t value) | |
| { | |
| q31_t val = value; | |
| memcpy (*pQ7, &val, 4); | |
| (*pQ7)[0] = (q7_t)(val & 0x0FF); | |
| (*pQ7)[1] = (q7_t)((val >> 8) & 0x0FF); | |
| (*pQ7)[2] = (q7_t)((val >> 16) & 0x0FF); | |
| (*pQ7)[3] = (q7_t)((val >> 24) & 0x0FF); | |
| *pQ7 += 4; | |
| } | |
| } | |