/* * DNM_Channel.c * * Created on: 2019年3月7日 * Author: no95 */ /* * DNM_Channel.h * * Created on: 2019年3月7日 * Author: no95 */ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ /* ymath.h internal header */ /* yvals.h values header for conforming compilers on various systems */ #pragma diag_push #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ #pragma CHECK_MISRA("-19.6") /* undef required for implementation */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ /*****************************************************************************/ /* stdarg.h v15.4.0I15142 */ /* */ /* Copyright (c) 1996-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ typedef struct __va_list { void * __ap; } va_list; #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*---------------------------------------------------------------------------*/ /* A header file conforming to ARM CLIB ABI (GENC-003539), should */ /* define _AEABI_PORTABLE when _AEABI_PORTABILITY_LEVEL is defined. */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* The macro definition that guards CLIB ABI (GENC-003539) requirements. */ /*---------------------------------------------------------------------------*/ /* You can predefine (on the compile command line, for example): _ALT_NS=1 -- to use namespace _Dinkum_std for C++ _ALT_NS=2 -- to use namespace _Dinkum_std for C++ and C _C_AS_CPP -- to compile C library as C++ _C_IN_NS -- to define C names in std/_Dinkum_std instead of global namespace _C99 -- to turn ON C99 library support _ABRCPP -- to turn ON Abridged C++ dialect (implies _ECPP) _ECPP -- to turn ON Embedded C++ dialect _NO_EX -- to turn OFF use of try/throw _NO_MT -- to turn OFF thread synchronization _NO_NS -- to turn OFF use of namespace declarations _STL_DB (or _STLP_DEBUG) -- to turn ON iterator/range debugging __NO_LONG_LONG -- to define _Longlong as long, not long long You can change (in this header): _ADDED_C_LIB -- from 1 to 0 to omit declarations for C extensions _COMPILER_TLS -- from 0 to 1 if _TLS_QUAL is not nil _EXFAIL -- from 1 to any nonzero value for EXIT_FAILURE _FILE_OP_LOCKS -- from 0 to 1 for file atomic locks _GLOBAL_LOCALE -- from 0 to 1 for shared locales instead of per-thread _HAS_IMMUTABLE_SETS -- from 1 to 0 to permit alterable set elements _HAS_STRICT_CONFORMANCE -- from 0 to 1 to disable nonconforming extensions _HAS_TRADITIONAL_IOSTREAMS -- from 1 to 0 to omit old iostreams functions _HAS_TRADITIONAL_ITERATORS -- from 0 to 1 for vector/string pointer iterators _HAS_TRADITIONAL_POS_TYPE -- from 0 to 1 for streampos same as streamoff _HAS_TRADITIONAL_STL -- from 1 to 0 to omit old STL functions _IOSTREAM_OP_LOCKS -- from 0 to 1 for iostream atomic locks _TLS_QUAL -- from nil to compiler TLS qualifier, such as __declspec(thread) _USE_EXISTING_SYSTEM_NAMES -- from 1 to 0 to disable mappings (_Open to open) Include directories needed to compile with Dinkum C: C -- include/c C99 -- include/c (define _C99) Embedded C++ -- include/c include/embedded (define _ECPP) Abridged C++ -- include/c include/embedded include (define _ABRCPP) Standard C++ -- include/c include Standard C++ with export -- include/c include/export include (--export --template_dir=lib/export) Include directories needed to compile with native C: C -- none C99 -- N/A Embedded C++ -- include/embedded (define _ECPP) Abridged C++ -- include/embedded include (define _ABRCPP) Standard C++ -- include Standard C++ with export -- include/export include (--export --template_dir=lib/export) */ /* targets with "native" mode libraries don't support C9X */ /* TI RTS supports the C9X snprintf() and vsnprintf() functions */ /* TI C6x supports complex arithmetic */ /* DETERMINE MACHINE TYPE */ /* _C99_MATH must be defined for using Dinkum Math */ /* DETERMINE _Ptrdifft AND _Sizet FROM MACHINE TYPE */ typedef long _Int32t; typedef unsigned long _Uint32t; typedef int _Ptrdifft; typedef unsigned _Sizet; /* EXCEPTION CONTROL */ /* NAMING PROPERTIES */ /* #define _STD_LINKAGE defines C names as extern "C++" */ /* #define _STD_USING defines C names in namespace std or _Dinkum_std */ /* THREAD AND LOCALE CONTROL */ /* THREAD-LOCAL STORAGE */ /* NAMESPACE CONTROL */ /* VC++ COMPILER PARAMETERS */ /* defined(__NO_LONG_LONG) && !defined (_MSC_VER) && ! TI 32 bit processor*/ /* MAKE MINGW LOOK LIKE WIN32 HEREAFTER */ /* FLOATING-POINT PROPERTIES */ typedef long long _Longlong; typedef unsigned long long _ULonglong; /* wchar_t AND wint_t PROPERTIES */ typedef unsigned short _Wchart; typedef unsigned short _Wintt; /* POINTER PROPERTIES */ /* signal PROPERTIES */ /* stdarg PROPERTIES */ typedef va_list _Va_list; /* stdlib PROPERTIES */ void _Atexit(void (*fn)(void)); /* stdio PROPERTIES */ typedef char _Sysch_t; /* STORAGE ALIGNMENT PROPERTIES */ /* time PROPERTIES */ /* MULTITHREAD PROPERTIES */ /* LOCK MACROS */ /* MISCELLANEOUS MACROS */ #pragma diag_push #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ #pragma diag_pop /*****************************************************************************/ /* linkage.h v15.4.0I15142 */ /* */ /* Copyright (c) 1998-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ /* No modifiers are needed to access code or data */ /*--------------------------------------------------------------------------*/ /* Define _IDECL ==> how inline functions are declared */ /*--------------------------------------------------------------------------*/ #pragma diag_pop /*****************************************************************************/ /* _lock.h v15.4.0I15142 */ /* */ /* Copyright (c) 2000-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* _nop(), _lock(), and _unlock() all accept zero or more optional arguments, which must remain as empty rather than (void) parameter lists to avoid breaking the API */ #pragma CHECK_MISRA("-16.5") void _nop(); extern void ( *_lock)(); extern void (*_unlock)(); void _register_lock (void ( *lock)()); void _register_unlock(void (*unlock)()); #pragma diag_pop #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /****************************************************************************/ /* float.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* float.h standard header -- IEEE 754 version */ #pragma diag_push #pragma CHECK_MISRA("-18.4") /* union required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ /* TYPE DEFINITIONS */ typedef struct { /* parameters for a floating-point type */ int _Ddig, _Dmdig, _Dmax10e, _Dmaxe, _Dmin10e, _Dmine; union { /* union of short array and all floats */ unsigned short _Us[8]; float _Float; double _Double; long double _Long_double; } _Deps, _Dmax, _Dmin; } _Dvals; /* DECLARATIONS */ extern /* const */ _Dvals _Dbl, _Flt, _Ldbl; /* COMMON PROPERTIES */ /* ---------------------------------------------------------------*/ /* NOTE: Float, Double and Long properties have been modified for */ /* EABI compatibility. */ /* ---------------------------------------------------------------*/ /* float PROPERTIES */ /* double PROPERTIES */ /* long double PROPERTIES */ #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ /* MACROS FOR _FPP_TYPE */ /* MACROS FOR _Dtest RETURN (0 => ZERO) */ /* MACROS FOR _Feraise ARGUMENT */ #pragma diag_push #pragma CHECK_MISRA("-19.6") /* undef required for implementation */ #pragma diag_pop /* TYPE DEFINITIONS */ #pragma diag_push #pragma CHECK_MISRA("-18.4") /* union required for implementation */ #pragma CHECK_MISRA("-5.7") /* keep names intact */ typedef union { /* pun float types as integer array */ unsigned short _Word[8]; float _Float; double _Double; long double _Long_double; } _Dconst; #pragma diag_pop /* ERROR REPORTING */ void _Feraise(int a); /* double DECLARATIONS */ double _Cosh(double a, double b); short _Exp(double *a, double b, short c); double _Log(double a, int b); double _Sin(double a, unsigned int b); double _Sinh(double a, double b); extern /* const */ _Dconst _Denorm, _Hugeval, _Inf, _Nan, _Snan; /* float DECLARATIONS */ float _FCosh(float a, float b); short _FExp(float *a, float b, short c); float _FLog(float a, int b); float _FSin(float a, unsigned int b); float _FSinh(float a, float b); extern /* const */ _Dconst _FDenorm, _FInf, _FNan, _FSnan; /* long double DECLARATIONS */ long double _LCosh(long double a, long double b); short _LExp(long double *a, long double b, short c); long double _LLog(long double a, int b); long double _LSin(long double a, unsigned int b); long double _LSinh(long double a, long double b); extern /* const */ _Dconst _LDenorm, _LInf, _LNan, _LSnan; /* _ILONG == 0 means 16-bit int so use long instead */ typedef unsigned int _TI_uint32_t; /* Assume all TI targets that have a 64-bit double have a 64-bit long long */ typedef unsigned long long _TI_uint64_t; /*---------------------------------------------------------------------------*/ /* FLOATING POINT INTRINSICS - FLOAT DEFINES */ /*---------------------------------------------------------------------------*/ #pragma diag_push /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") #pragma diag_pop /*---------------------------------------------------------------------------*/ /* FLOATING POINT INTRINSICS - DOUBLE DEFINES */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* This code requires the target to support type-punning intrinsics. These */ /* intrinsics treat the bits of a floating-point value as if it were an */ /* integer, to allow fast access to the sign, exponent, and fractional bits. */ /* We need to know whether the target has an intrinsic that can represent */ /* the entire floating-point type with one integral type. */ /*---------------------------------------------------------------------------*/ #pragma diag_push /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") /* Do not define _TI_FTOU_DOUBLE or _TI_UTOF_DOUBLE since the target does not support them. */ #pragma diag_pop /*---------------------------------------------------------------------------*/ /* FLOATING POINT INTRINSICS - LONG DOUBLE DEFINES */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* This code requires the target to support type-punning intrinsics. These */ /* intrinsics treat the bits of a floating-point value as if it were an */ /* integer, to allow fast access to the sign, exponent, and fractional bits. */ /* We need to know whether the target has an intrinsic that can represent */ /* the entire floating-point type with one integral type. */ /*---------------------------------------------------------------------------*/ #pragma diag_push /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") #pragma diag_pop #pragma diag_push /* __*test() functions */ #pragma CHECK_MISRA("-8.5") /* need to define inline function */ #pragma CHECK_MISRA("-8.11") /* need to use __inline as is */ #pragma CHECK_MISRA("-10.1") /* macros need implicit casts for implementation */ #pragma CHECK_MISRA("-12.4") /* false positive on non-existant side effect */ /* keep macros as direct #defines and not function-like macros or function names surrounded by parentheses to support all original supported use cases including taking their address through the macros and prefixing with namespace macros */ #pragma CHECK_MISRA("-19.4") /*---------------------------------------------------------------------------*/ /* SINGLE PRECISION (FLOAT) FUNCTION */ /* Exponent is checked using a right-shift by 16 to avoid assembly overhead */ /* within MSP430 and ARM calculations. Specifically within the MSP430, a */ /* shift by 16 results in the lower 16 bits to be ignored and no shift is */ /* actually executed in the assembly code. */ /*---------------------------------------------------------------------------*/ static __inline int __FDtest(float const *fd); static __inline int __FDtest(float const *fd) { int fdtest_result; if (((((unsigned int)(_ftoi(*fd) >> 16)) & 0x7f80u) == 0x7f80u)) { if(((_ftoi(*fd) & (((_TI_uint32_t)(1) << ((( 24))-1)) - 1)) == 0)) { fdtest_result = 1; } else { fdtest_result = 2; } } /* Zero check: ignores sign bit and checks the lower 31-bits for zero */ else if(((_ftoi(*fd) & ~((_TI_uint32_t)(1) << (32-1)))==0)) { fdtest_result = 0; } else { fdtest_result = (-1); } return fdtest_result; } /*---------------------------------------------------------------------------*/ /* DOUBLE PRECISION (DOUBLE) FUNCTION */ /* If the target has instrinsic which can handle the entire float with one */ /* integral type (64-bit), then do operation. Else, operate as 32-bit float */ /* or split into two 32-bit parts */ /* */ /* The 64-bit exponent is checked using a right-shift by 48 to avoid */ /* assembly overhead within MSP430. Specifically, a shift by 48 results */ /* in the lower 48 bits to be ignored and no shift is actually executed */ /* in the assembly code. */ /*---------------------------------------------------------------------------*/ static __inline int __Dtest(double const *d); static __inline int __Dtest(double const *d) { int dtest_result; if ((((_hi(*d) >> 16) & 0x7ff0u) == 0x7ff0u)) { if(((((_hi(*d) & (((_TI_uint32_t)(1) << ((( 53))-1-32)) - 1)) & (((_TI_uint32_t)(1) << ((( 53))-1-32)) - 1)) == 0) && ((_lo(*d)) == 0))) { dtest_result = 1; } else { dtest_result = 2; } } /* Zero check: ignores sign bit and checks the lower 63-bits for zero */ else if((((_hi(*d) & ~((_TI_uint32_t)(1) << (31)))==0)&&(_lo(*d)==0))) { dtest_result = 0; } else { dtest_result = (-1); } return dtest_result; } /*---------------------------------------------------------------------------*/ /* QUADRUPLE PRECISION(LONG DOUBLE) FUNCTION */ /* If the target doesn't support quadruple precision, */ /* operate as double precision (64-bit) */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* If the target has instrinsic which can handle the entire float with one */ /* integral type (128-bit) or by splitting it into two,then do operation */ /*---------------------------------------------------------------------------*/ #pragma diag_pop /* __*test() functions */ #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /*---------------------------------------------------------------------------*/ /* A header file conforming to ARM CLIB ABI (GENC-003539), should */ /* define _AEABI_PORTABLE when _AEABI_PORTABILITY_LEVEL is defined. */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* The macro definition that guards CLIB ABI (GENC-003539) requirements. */ /*---------------------------------------------------------------------------*/ /* CODES FOR is* FUNCTIONS */ /* CODES FOR ilogb FUNCTIONS */ /* TYPES */ typedef float float_t; typedef double double_t; /* MACROS */ int _FFpcomp(float a, float b); int _Fpcomp(double a, double b); int _LFpcomp(long double a, long double b); int _FDclass(float a); int _Dclass(double a); int _LDclass(long double a); int _FDsign(float a); int _Dsign(double a); int _LDsign(long double a); #pragma diag_push #pragma CHECK_MISRA("-19.10") /* need functions as macro params */ #pragma diag_pop /*---------------------------------------------------------------------------*/ /* If --fp_mode=relaxed is used and VFP is enabled, use the hardware square */ /* root directly instead of calling the sqrtx routine. This will not set */ /* errno if the argument is negative. */ /* */ /* This is done by defining sqrt to _relaxed_sqrt to allow other translation */ /* units to use the normal sqrt routine under strict mode. */ /*---------------------------------------------------------------------------*/ /***************************************************************/ /* TMU SUPPORT AND RELAXED MODE: USE INSTRINSICS. */ /***************************************************************/ /* double declarations */ double acos(double a); double asin(double a); double atan(double a); double atan2(double a, double b); double ceil(double a); double exp(double a); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ double fabs(double a); #pragma diag_pop double floor(double a); double fmod(double a, double b); double frexp(double a, int *b); double ldexp(double a, int b); double modf(double a, double *b); double pow(double a, double b); double sqrt(double a); double tan(double a); double tanh(double a); double acosh(double a); double asinh(double a); double atanh(double a); double cbrt(double a); double copysign(double a, double b); double erf(double a); double erfc(double a); double exp2(double a); double expm1(double a); double fdim(double a, double b); double fma(double a, double b, double c); double fmax(double a, double b); double fmin(double a, double b); double hypot(double a, double b); int ilogb(double a); double lgamma(double a); _Longlong llrint(double a); _Longlong llround(double a); double log1p(double a); double logb(double a); long lrint(double a); long lround(double a); double nan(const char *a); double nearbyint(double a); double nextafter(double a, double b); double nexttoward(double a, long double b); double remainder(double a, double b); double remquo(double a, double b, int *c); double rint(double a); double round(double a); double scalbn(double a, int b); double scalbln(double a, long b); double tgamma(double a); double trunc(double a); /* float declarations */ float acosf(float a); float asinf(float a); float atanf(float a); float atan2f(float a, float b); float ceilf(float a); float expf(float a); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ float fabsf(float a); #pragma diag_pop float floorf(float a); float fmodf(float a, float b); float frexpf(float a, int *b); float ldexpf(float a, int b); float modff(float a, float *b); float powf(float a, float b); float sqrtf(float a); float tanf(float a); float tanhf(float a); float acoshf(float a); float asinhf(float a); float atanhf(float a); float cbrtf(float a); float copysignf(float a, float b); float erff(float a); float erfcf(float a); float expm1f(float a); float exp2f(float a); float fdimf(float a, float b); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ float fmaf(float a, float b, float c); #pragma diag_pop float fmaxf(float a, float b); float fminf(float a, float b); float hypotf(float a, float b); int ilogbf(float a); float lgammaf(float a); _Longlong llrintf(float a); _Longlong llroundf(float a); float log1pf(float a); float logbf(float a); long lrintf(float a); long lroundf(float a); float nanf(const char *a); float nearbyintf(float a); float nextafterf(float a, float b); float nexttowardf(float a, long double b); float remainderf(float a, float b); float remquof(float a, float b, int *c); float rintf(float a); float roundf(float a); float scalbnf(float a, int b); float scalblnf(float a, long b); float tgammaf(float a); float truncf(float a); /* long double declarations */ long double acosl(long double a); long double asinl(long double a); long double atanl(long double a); long double atan2l(long double a, long double b); long double ceill(long double a); long double expl(long double a); long double fabsl(long double a); long double floorl(long double a); long double fmodl(long double a, long double b); long double frexpl(long double a, int *b); long double ldexpl(long double a, int b); long double modfl(long double a, long double * b); long double powl(long double a, long double b); long double sqrtl(long double a); long double tanl(long double a); long double tanhl(long double a); long double acoshl(long double a); long double asinhl(long double a); long double atanhl(long double a); long double cbrtl(long double a); long double copysignl(long double a, long double b); long double erfl(long double a); long double erfcl(long double a); long double exp2l(long double a); long double expm1l(long double a); long double fdiml(long double a, long double b); long double fmal(long double a, long double b, long double c); long double fmaxl(long double a, long double b); long double fminl(long double a, long double b); long double hypotl(long double a, long double b); int ilogbl(long double a); long double lgammal(long double a); _Longlong llrintl(long double a); _Longlong llroundl(long double a); long double log1pl(long double a); long double logbl(long double a); long lrintl(long double a); long lroundl(long double a); long double nanl(const char * a); long double nearbyintl(long double a); long double nextafterl(long double a, long double b); long double nexttowardl(long double a, long double b); long double remainderl(long double a, long double b); long double remquol(long double a, long double b, int *c); long double rintl(long double a); long double roundl(long double a); long double scalbnl(long double a, int b); long double scalblnl(long double a, long b); long double tgammal(long double a); long double truncl(long double a); /* double MACRO OVERRIDES, FOR C */ double cos(double a); double cosh(double a); double log(double a); double log10(double a); double sin(double a); double sinh(double a); double log2(double a); /* float MACRO OVERRIDES, FOR C */ float cosf(float a); float coshf(float a); float logf(float a); float log10f(float a); float sinf(float a); float sinhf(float a); float log2f(float a); /* long double MACRO OVERRIDES, FOR C */ long double cosl(long double a); long double coshl(long double a); long double logl(long double a); long double log10l(long double a); long double sinl(long double a); long double sinhl(long double a); long double log2l(long double a); #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ typedef unsigned size_t; #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ #pragma diag_pop size_t strlen(const char *string); char *strcpy(char *dest, const char *src); char *strncpy(char *dest, const char *src, size_t n); char *strcat(char *string1, const char *string2); char *strncat(char *dest, const char *src, size_t n); char *strchr(const char *string, int c); char *strrchr(const char *string, int c); int strcmp(const char *string1, const char *string2); int strncmp(const char *string1, const char *string2, size_t n); int strcoll(const char *string1, const char *_string2); size_t strxfrm(char *to, const char *from, size_t n); char *strpbrk(const char *string, const char *chs); size_t strspn(const char *string, const char *chs); size_t strcspn(const char *string, const char *chs); char *strstr(const char *string1, const char *string2); char *strtok(char *str1, const char *str2); char *strerror(int _errno); char *strdup(const char *string); void *memmove(void *s1, const void *s2, size_t n); #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ void *memcpy(void *s1, const void *s2, size_t n); #pragma diag_pop int memcmp(const void *cs, const void *ct, size_t n); void *memchr(const void *cs, int c, size_t n); void *memset(void *mem, int ch, size_t length); #pragma diag_pop #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* stdarg.h v15.4.0I15142 */ /* */ /* Copyright (c) 1996-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* A header file conforming to ARM CLIB ABI (GENC-003539), should */ /* define _AEABI_PORTABLE when _AEABI_PORTABILITY_LEVEL is defined. */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* The macro definition that guards CLIB ABI (GENC-003539) requirements. */ /*---------------------------------------------------------------------------*/ /****************************************************************************/ /* TYPES THAT ANSI REQUIRES TO BE DEFINED */ /****************************************************************************/ typedef struct { int fd; /* File descriptor */ unsigned char* buf; /* Pointer to start of buffer */ unsigned char* pos; /* Position in buffer */ unsigned char* bufend; /* Pointer to end of buffer */ unsigned char* buff_stop; /* Pointer to last read char in buffer */ unsigned int flags; /* File status flags (see below) */ } FILE; typedef long fpos_t; /****************************************************************************/ /* DEVICE AND STREAM RELATED MACROS */ /****************************************************************************/ /****************************************************************************/ /* MACROS THAT DEFINE AND USE FILE STATUS FLAGS */ /****************************************************************************/ /****************************************************************************/ /* MACROS THAT ANSI REQUIRES TO BE DEFINED */ /****************************************************************************/ /******** END OF ANSI MACROS ************************************************/ /****************************************************************************/ /* DEVICE AND STREAM RELATED DATA STRUCTURES AND MACROS */ /****************************************************************************/ extern FILE _ftable[10]; extern char __TI_tmpnams[10][16]; /****************************************************************************/ /* FUNCTION DEFINITIONS - ANSI */ /****************************************************************************/ /****************************************************************************/ /* OPERATIONS ON FILES */ /****************************************************************************/ extern int remove(const char *_file); extern int rename(const char *_old, const char *_new); extern FILE *tmpfile(void); extern char *tmpnam(char *_s); /****************************************************************************/ /* FILE ACCESS FUNCTIONS */ /****************************************************************************/ extern int fclose(FILE *_fp); extern FILE *fopen(const char *_fname, const char *_mode); extern FILE *freopen(const char *_fname, const char *_mode, register FILE *_fp); extern void setbuf(register FILE *_fp, char *_buf); extern int setvbuf(register FILE *_fp, register char *_buf, register int _type, register size_t _size); extern int fflush(register FILE *_fp); /****************************************************************************/ /* FORMATTED INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fprintf(FILE *_fp, const char *_format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int fscanf(FILE *_fp, const char *_fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int printf(const char *_format, ...) __attribute__((__format__ (__printf__, 1, 2))); extern int scanf(const char *_fmt, ...) __attribute__((__format__ (__scanf__, 1, 2))); extern int sprintf(char *_string, const char *_format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int snprintf(char *_string, size_t _n, const char *_format, ...) __attribute__((__format__ (__printf__, 3, 4))); extern int sscanf(const char *_str, const char *_fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int vfprintf(FILE *_fp, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vfscanf(FILE *_fp, const char *_fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int vprintf(const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 1, 0))); extern int vscanf(const char *_format, va_list _ap) __attribute__((__format__ (__scanf__, 1, 0))); extern int vsprintf(char *_string, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vsnprintf(char *_string, size_t _n, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 3, 0))); extern int vsscanf(const char *_str, const char *_fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); /****************************************************************************/ /* CHARACTER INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fgetc(register FILE *_fp); extern char *fgets(char *_ptr, register int _size, register FILE *_fp); extern int fputc(int _c, register FILE *_fp); extern int fputs(const char *_ptr, register FILE *_fp); extern int getc(FILE *_p); extern int getchar(void); extern char *gets(char *_ptr); extern int putc(int _x, FILE *_fp); extern int putchar(int _x); extern int puts(const char *_ptr); extern int ungetc(int _c, register FILE *_fp); /****************************************************************************/ /* DIRECT INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern size_t fread(void *_ptr, size_t _size, size_t _count, FILE *_fp); extern size_t fwrite(const void *_ptr, size_t _size, size_t _count, register FILE *_fp); /****************************************************************************/ /* FILE POSITIONING FUNCTIONS */ /****************************************************************************/ extern int fgetpos(FILE *_fp, fpos_t *_pos); extern int fseek(register FILE *_fp, long _offset, int _ptrname); extern int fsetpos(FILE *_fp, const fpos_t *_pos); extern long ftell(FILE *_fp); extern void rewind(register FILE *_fp); /****************************************************************************/ /* ERROR-HANDLING FUNCTIONS */ /****************************************************************************/ extern void clearerr(FILE *_fp); extern int feof(FILE *_fp); extern int ferror(FILE *_fp); extern void perror(const char *_s); /** * \file edma_event.h * * \brief EDMA event enumeration * */ /* * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /** * \file hw_types.h * * \brief Common type definitions and macros */ /* * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ //***************************************************************************** // // Define a boolean type, and values for true and false. // //***************************************************************************** typedef unsigned char tBoolean; //***************************************************************************** // // Macros for hardware access, both direct and via the bit-band region. // //***************************************************************************** /**************************************************************************** ** MACRO DEFINITIONS ****************************************************************************/ /********************* Direct Mapped Events ********************************/ /* Events for McASP 1*/ /* MCSPI0 Channel 0 transmit event */ /* MCSPI0 Channel 0 receive event */ /* MCSPI0 Channel 1 transmit event */ /* MCSPI0 Channel 1 receive event */ /* MMCSD0 transmit event. */ /* MMCSD0 receive event. */ /* UART0 Transmit Event. */ /* UART0 Receive Event. */ /* UART1 Transmit Event. */ /* UART1 Receive Event. */ /* UART2 Transmit Event. */ /* UART2 Receive Event. */ /* MCSPI1 Channel 0 transmit event */ /* MCSPI1 Channel 0 receive event */ /* MCSPI1 Channel 1 transmit event */ /* MCSPI1 Channel 1 receive event */ /* I2C0 Transmit Event */ /* I2C0 Receive Event */ /* I2C1 Receive Event */ /* I2C1 Transmit Event */ /********************** Crossbar Mapped Events ********************************/ /* I2C2 Receive Event */ /* I2C2 Transmit Event */ /* UART3 Transmit Event. */ /* UART3 Receive Event. */ /* UART4 Transmit Event. */ /* UART4 Receive Event. */ /* UART5 Transmit Event. */ /* UART5 Receive Event. */ /* Events for McASP 0*/ /* Events for McASP 1*/ /* **EDMA Event number list */ //EDMA3 channel setting typedef enum { McaSp1_RX = (11u), McaSp1_TX = (10u), }MCASP1_Int_Flag_e; extern unsigned short McASP0_Channel; void EDMA3IntSetup(void); void EDMA3_Init(void); //#define NUM_I2S_CHANNELS (2u) extern long McASP0_Tx_Buff[3][64][(4u)]; extern long McASP0_Rx_Buff[3][64][(4u)]; void McASP0_Init(void); void McASP0_DMA_Sync(void); //TDM //#define NUM_TDM_CHANNELS (32u) extern unsigned long McASP1_Tx_Buff[3][64][(8u)]; extern unsigned long McASP1_Rx_Buff[3][64][(8u)]; void McASP1_Init(void); void McASP1_DMA_Sync(void); //#define NUM_DOWNSLOT_CHANNEL NUM_I2S_CHANNELS //新增E槽 typedef enum { Ethernet_Audio_In_L, //0 Ethernet_Audio_In_R, //1 Index_VOIP_In, //2 Index_Mic1, //3 MAX_RX_CHANNEL, //4 }Index_Audio_In_s; typedef enum { Index_Amp_L, //0 Index_DNM_L, Index_VOIP_Out, //1 Index_Limiter_VOIP, //2 Index_DownSample_VOIP, //3 Index_FadeOut_L, //4 Index_Limiter_L, //5 MAX_TX_CHANNEL, // }Index_Audio_Out_s; typedef enum { EthL_L, //0 //eth left EthL_R, //1 //eth right //預留 VOIP_InL, //2 //VOIP Mic1_L, //3 AEC_Mic1_L, //4 NS_AEC_L, //5 AGC_VOIP_L, //6 AGC_Mic1_L, //7 Eq_VOIP_L, //8 Eq_Mic1_L, //9 Hi_VOIP_L, //10 Hi_Mic1_L, //11 Lo_VOIP_L, //12 Lo_Mic1_L, //13 PEQ_Eth_L, //14 Duck_Out_L, //15 Duck_Out_R, //16 //預留 Cal_Temp, //17 Cal_Temp2, //18 Zero_Temp, //19 Pink_Noise_L, //20 Gate_L, //21 Old_VOIP_L, //22 Num_Line, }Index_DSP_Line; enum Chip_Table { TABLE_SIZE, //0 SAMPLE_RATE, //1 HW_INPUT_AUDIO_CHANNELS_TABLE_MAPPING, //2 HW_OUTPUT_AUDIO_CHANNELS_TABLE_MAPPING, //3 }; typedef enum { Down_Board, //0 //順序不可改 Up_Board, //1 //順序不可改 E_Board, //2 //順序不可改 Num_Stage_Board, //3 //分成上下層兩段 //順序不可改 DMA_Receive, //4 DMA_Transmit, //5 Finish_Receive, //6 Finish_Cal, //7 SP1_Off, //8 //sp1 未使用 Same_Interrupt_SP01, //9 DSP_ON, //10 DSP_Bypass, //11 DMA_DigiMic_To_AMP, //12 //Rx DgMic to A DMA_AUX_To_AMP, //13 //使輸入port1對至輸出port1輸出 Tone_TO_MIC, //14 //自產tone 取代Mic輸入 for Flag_In_Set DATA_TO_AMP, //15 MCU丟聲音DATA到AMP輸出 }Common_Status_s; typedef struct { unsigned long TimeBase10ms; //sample 點計算 unsigned short Index_Function; unsigned short Fromat; //I2s or TDM unsigned short COMM_Rx; unsigned short COMM_Tx; unsigned short Flag_SP[3]; //SP0與SP1是否有收完 //[3] 紀錄sp1有無使用狀況 unsigned char Flag_First_NRT; unsigned char Update_NRT_Parameter; //參數改變時 //unsigned char First_I2S_Enable; unsigned short Board[3]; //目前只能接兩張卡, 0 為 C 位置, 1 為 D 位置, 2 為 E 位置//可能接 IO, TC //此對應到硬體版子 ID unsigned short Flag_In_Set; //Tone_TO_AUX unsigned short Flag_Out_Set; //DMA_Bypass, DMA_Arrange_Bypass unsigned short Flag_First_RT; }Process_Status; typedef struct { unsigned short Num[Num_Stage_Board]; //0: 下版, 1 : 上版In channel 數 unsigned short Index[Num_Stage_Board][(4u)]; // //0: 下版, 1 : 上版 }Index_Channel_s; typedef struct { unsigned short Board_HW_Table[2][3]; //[In:0, 1: out][board C :0, board D : 1, board E : 2] //從Comman 收到的 table 對應到OCTO_Sr_Slot_ID_e Index_Channel_s In; Index_Channel_s Out; float OutChan[MAX_TX_CHANNEL][64]; //int *ptr_In; }Audio_To_HW_Channel_s; extern Process_Status sProcess_Status; extern Audio_To_HW_Channel_s AudioTo_HWChan; extern float AudioBufferin[MAX_RX_CHANNEL][64]; extern float AudioBufferout[MAX_TX_CHANNEL][64]; extern float Audio_Temp_buffer[Num_Line][64]; extern float Buf_Trans_DSP[16][64]; extern const unsigned short Offset_To_FunctNo_NRTParaTable; extern const unsigned int BIT32_SET[32]; extern const unsigned int BIT32_CLEAR[32]; extern const unsigned short BIT16_SET[16]; extern const unsigned short BIT16_CLEAR[16]; extern const unsigned char BIT8_SET[8]; extern const unsigned char BIT8_CLEAR[8]; extern int Index_SP0_Temp; extern int Index_SP1_Temp; extern short Flag_Initial_RT_Inner; extern int DMA_SP0_Rx_Temp[2][64][(4u)]; extern int DMA_SP0_Tx_Temp[2][64][(4u)]; extern int DMA_SP1_Rx_Temp[2][64][(8u)]; extern int DMA_SP1_Tx_Temp[2][64][(8u)]; void DSPThread_Init(void); void Match_DSP_To_HW_Channel(Audio_To_HW_Channel_s *ptr); void DSP_Table_Reset(void); extern void Set_Audio_Line(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ extern float Level_Ref_Modify; extern float dB_Level_Ref_Modify; /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { Ethernet_Audio_In, //0 VOIP_In, //1 Mic1_In, //2 //沒問題後將此拿掉 NUM_DSP_INPUT, //3 }ID_DSP_INPUT_s; //=====Ap================= typedef struct { unsigned short Num_In; unsigned short LED_RTO; unsigned short LED_Signal; unsigned short LED_Clip; unsigned short Mute; unsigned short Bypass; unsigned short Clip_Th[2]; }New_Input_AP_s; typedef struct { unsigned short Index_In; unsigned short Level[2]; unsigned short Index_Out; unsigned short Display_Volume[2]; }New_Input_Channel_AP_s; typedef struct { New_Input_AP_s Main; New_Input_Channel_AP_s Ch[1]; }AP_New_Input_Struct; //=====RT================= typedef struct { int Command_Num; int Num_In; int Cnt; }New_Input_RT_s; typedef struct { float Sum_Square; float Level; unsigned long Address_In; unsigned long Address_Out; }New_Input_Channel_RT_s; typedef struct { New_Input_RT_s Main; New_Input_Channel_RT_s Ch[1]; }RT_New_Input_Struct; //=====Temp================= typedef struct { unsigned long Index; }New_Input_NRT_Temp_s; typedef struct { float Ave[8]; }New_Input_Channel_NRT_Temp_s; typedef struct { New_Input_NRT_Temp_s Main; New_Input_Channel_NRT_Temp_s Ch[1]; }NRT_Temp_New_Input_Struct; extern void NRT_Input(AP_New_Input_Struct *ptr_AP, RT_New_Input_Struct *ptr_RT, NRT_Temp_New_Input_Struct *ptr_NRT); void NRT_New_Input(void); extern void NRT_New_Input_Fix(New_Input_AP_s *ptr_AP, New_Input_RT_s *ptr_RT, New_Input_NRT_Temp_s *ptr_NRT_Temp); extern void Asm_Input_Fix(int *ptr_num); extern void Set_AudioLine_Input(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { ID_Output1, //0 ID_Output_VOIP, //1 NUM_DSP_OUTPUT, //2 }ID_DSP_OUTPUT_s; //=====Ap================= typedef struct { unsigned short Num_In; unsigned short Mute_Mode; //[0~12] Mute, [13~15]:Mode unsigned short LED_Signal; unsigned short LED_Overload; unsigned short Th_Over[2]; }New_Output_AP_s; typedef struct { unsigned short Index_In; unsigned short Level[2]; unsigned short Index_Out; unsigned short Display_Volume[2]; }New_Output_Channel_AP_s; typedef struct { New_Output_AP_s Main; New_Output_Channel_AP_s Ch[1]; }AP_New_Output_Struct; //=====RT================= typedef struct { int Command_Num; int Num_In; int Cnt; }New_Output_RT_s; typedef struct { float Sum_Square; float Level; unsigned long Address_In; unsigned long Address_Out; }New_Output_Channel_RT_s; typedef struct { New_Output_RT_s Main; New_Output_Channel_RT_s Ch[1]; }RT_New_Output_Struct; //=====NRT_Temp================= typedef struct { unsigned long Index; }New_Output_NRT_Temp_s; typedef struct { float Ave[8]; }New_Output_Channel_NRT_Temp_s; typedef struct { New_Output_NRT_Temp_s Main; New_Output_Channel_NRT_Temp_s Ch[1]; }NRT_Temp_New_Output_Struct; extern void NRT_Output(AP_New_Output_Struct *ptr_AP, RT_New_Output_Struct *ptr_RT, NRT_Temp_New_Output_Struct *ptr_NRT); void NRT_New_Output(void); extern void NRT_New_Output_Fix(New_Output_AP_s *ptr_AP, New_Output_RT_s *ptr_RT, New_Output_NRT_Temp_s *ptr_NRT_Temp); extern void Asm_Output_Fix(int *ptr); extern void Set_AudioLine_Output(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //=======RT Eq, filter use=================== typedef struct { //可拉式編輯rt table一開使會全清, 固定式寫法一開始需clean 一次 float x0[4]; //SIMD, 4band一起處理 float x1[4]; float x2[4]; float y0[4]; float y1[4]; }RT_Old_Band_s; //=======NRT Eq, filter use=================== typedef struct { float b0[4]; float b1[4]; float b2[4]; float a1_N[4]; //固意取負號 float a2_N[4]; }Coeff_Order2_SIMD_s; void Non_RealTime_Procedure_modify(void); typedef struct { float *ptr_coeff; float Old[4]; long Sum; }Filter_Return_RMS_s; typedef struct { float Old[10]; }Band2_EQ_s; typedef enum { ID_PEQ_Eth, //0 NUM_DSP_PEQ, //1 }ID_DSP_PEQ_s; //======AP===================== typedef struct { unsigned short Index_In; unsigned short Index_Out; unsigned short Allpass_Num_of_Band; //[0]:all pass, [1~5]:num of band unsigned short Bypass; unsigned short Fs; unsigned short Reserve; }PEQ_AP_s; typedef struct { unsigned short Fc[2]; unsigned short Q[2]; unsigned short Gain[2]; }PEQ_AP_Parameter_s; typedef struct { PEQ_AP_s Main; PEQ_AP_Parameter_s Band[16]; }AP_PEQ_Struct; //======RT===================== typedef struct { unsigned long Command_Num; unsigned long Address_In; unsigned long Address_Out; unsigned long Num_Band; unsigned long Address_Coeff; unsigned long Flag_PingPong; }PEQ_RT_s; typedef struct { PEQ_RT_s Main; RT_Old_Band_s Band[4]; }RT_PEQ_Struct; //======NRT===================== typedef struct { Coeff_Order2_SIMD_s Coeff[2][4]; //ping pong }NRT_PEQ_Struct; //對應到NRT Temp Table //======Inner===================== typedef struct { float Temp[2][64]; //節省效能 : 避免輸入輸出讀同一個位置, 只有4 band以上才會使用到此 }PEQ_DSP_Inner_s; //extern Filter_Return_RMS_s BP20k; extern void NRT_PEQ_Fix(PEQ_AP_s *ptr_AP, PEQ_RT_s *ptr_RT, Coeff_Order2_SIMD_s *ptr_NRT_Temp); void NRT_GEQ(void); void NRT_PEQ(); //extern void Asm_Input_Fix(int *ptr); extern void Asm_EQ_Fix(unsigned long out, unsigned long in, unsigned long *ptr_add, float *temp_buf); extern void Set_AudioLine_PEQ(void); extern float Temp_PEQ[2][64]; //for PEQ asm 中, 存取位置分開, 以節省效能 extern float CoeffOrder2_NS[5]; //調音質用 extern float Coeff_LP_8k[5]; extern Filter_Return_RMS_s VOIP_TX_LP8k; //1. 輸入長度不可小於4 //2. 輸入為4的倍數時, 輸出可聽聲音是否正確 void Filter_Return_RMS(float *out, float *in, int len, Filter_Return_RMS_s *ptr_s); void Asm_EQ_Const_Coeff_2Band(float *in,float *out, const float *coeff, float **ptr_old); //;因可拉式物件關係, 所以ptr_old要給位置的指標 ;len 改內建, 此處不可用物件指標, for 可拉式物件 //#include "RT_Processor.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { Level_To_dB_Cal, dB_To_Level, }TrasFunction_s; typedef enum { Fade_Far_DigiMic, //0 //和far near 定義值設的一樣, 不可更動 Fade_Local_DigiMic, //1 FADE_IN, //2 FADE_OUT, //3 }Define_Linear_Fade; typedef enum { Reset_Cycle =1, //1 Gate_Cycle, //2 Cal_All_ms, //3 }Cycle_DSP; typedef enum { PingRxTx_PongCal, //0 PongRxTx_PingCal, //1 Not_Full_PiPo, //2 Full_PiPo, //3 }Flag_PingPong; typedef struct { unsigned short Symmetry; unsigned short Quarter; unsigned short Total; unsigned short Log2; unsigned short Half; unsigned short Plus; float Inv; }Len_s; typedef struct { int Index; int Offset; unsigned int Log_Cycle[40]; float Log_ms[40]; float th; }Cycle_Record_s; typedef struct { int Cnt; float Level; float Step; Define_Linear_Fade Situation; //auto fade in => fade out 使用 Define_Linear_Fade Type; //標明目前為 fade in or out 使用 }Linear_Fade_s; typedef struct { float Old; float Inv; float Arph; //for new float Arph_Plus; //for old }Regulate_DC_s; typedef struct { float re; float im; }Complex_s; typedef struct { float *ptr_Rx; float *ptr_Tx; float *ptr_Cal_Rx; float *ptr_Cal_Tx; Flag_PingPong Flag; Flag_PingPong Flag_Full; unsigned short Cnt_Cal; unsigned short RT_Len; unsigned short Total_Len; }PingPong_S; typedef struct { int Cnt; int Ave_Time; float Square_Sum; float dB; }dB_Cal_s; //紀錄db 響應 typedef struct { float Old; //current float Target; float Arph; unsigned long Len; }Smooth_Cal_s; //紀錄db 響應; typedef struct { unsigned short Index; long long Cnt_RT; long long Log[50]; float Log_dB[50]; }Log_Timing; // void Set_Linear_Fade(Linear_Fade_s *ptr, int type); void Asm_Level_Multi(float *out, float *in, float *level, int len); void Initial_All_Counters(int do_reset, int enable_long_record); unsigned int Get_Cyclecount (void); void Pre_Cycle_Record(unsigned int * cycle); void Post_Cycle_Record(unsigned int * pre_cycle, float *ms); void Initial_Cycle_Counters(int); void Reset_Cycle_Counters(void); void Get_Cycle(unsigned int *); void Detect_Cyle(Cycle_Record_s *ptr, Cycle_DSP flag); void Test_Performance(void); void Complex_Abs(Complex_s *ptr, float *out, int len); void Asm_Abs_Complex(Complex_s *ptr, float *out, int len); void Asm_Window_Cal(float *, float *, float *, int); void Asm_Euler_Eq(float *in, float *coeff, Complex_s *ptr_out); //;r0 : in, r1 : 分母buf, r2: out void Asm_Atan_Eq(Complex_s *in, float *out, float *coeff); void Initial_Atan_Coeff(void); void Initial_Euler_Coeff(void); void Set_Full_Status_PiPo(PingPong_S *ptr_s); void Ping_Pong_RT(float *in, float *out, PingPong_S *ptr_s); void Initial_Cycle_Record(Cycle_Record_s *ptr, float th, int offset); void Initial_Cal_dB(dB_Cal_s *ptr, int len_ave_time); void Asm_Square_Sum_32Sample_Base(float *old, float *in, int *cnt, int len); //使用資料為32的倍數 void DC_Regulate(float *in, float *out, float *dc); void Reset_DC_Regulate(Regulate_DC_s *ptr); void Asm_DC_Regulate_P32(float *out, float *in, Regulate_DC_s *dc, long len); extern void Asm_Addition(float *out, float *inA, float *inB, long len); //長度需為16的倍數 extern unsigned short Down_Sample_48kTo16k( float *out, float *in, int len_in, unsigned long *index_record); extern unsigned long Trans_ms_To_SampleLen(float ms, float fs); void Asm_Copy32(float *out, float *in, long len); extern void Asm_GainSmooth32(float *out, float *in, Smooth_Cal_s *ptr); extern void Trnas_Function_Cal(unsigned short *out, unsigned short *in, TrasFunction_s mode); extern short Mark_Bit_Location(unsigned char data, unsigned char *location_buf); //location_buf 為8個 extern Linear_Fade_s Fade_AudioOut; extern Cycle_Record_s Record_Cycle; extern const unsigned int Bit_Check[32]; extern const unsigned int Bit_Clear[32]; extern Regulate_DC_s Mic_DC; //FFT_s 宣告指標, 方便程式重覆利用 //另外宣告各組長度要使用實體位置, 藉Initial Fuction將其設起, 再將gloab FFT_s指標指到那 typedef struct { Len_s *Len; Complex_s * W; unsigned short *IP; //指出各階段資料排列 unsigned short *Index; unsigned short *Index_Asm; }FFT_s; //=============實體位置 1024 宣告============================== typedef struct { Len_s Len; Complex_s W[(1024 >> 1)]; unsigned short IP[10][1024]; //指出各階段資料排列 unsigned short Index_Initial[1024]; unsigned short Index_Initial_Asm[1024]; }FFT_1024_s; //一組長度只需宣告一組, 讀取係數與排列使用 //=============實體位置 1024 宣告============================== typedef struct { Len_s Len; Complex_s W[(256 >> 1)]; unsigned short IP[8][256]; //指出各階段資料排列 unsigned short Index_Initial[256]; unsigned short Index_Initial_Asm[256]; }FFT_256_s; //一組長度只需宣告一組, 讀取係數與排列使用 //=============實體位置 64 宣告============================== typedef struct { Len_s Len; Complex_s W[(64 >> 1)]; unsigned short IP[6][64]; //指出各階段資料排列 unsigned short Index_Initial[64]; unsigned short Index_Initial_Asm[64]; }FFT_Len_64_s; //一組長度只需宣告一組, 讀取係數與排列使用 //=============實體位置 32 宣告============================== typedef struct { Len_s Len; Complex_s W[(32 >> 1)]; unsigned short IP[5][32]; //指出各階段資料排列 unsigned short Index_Initial[32]; unsigned short Index_Initial_Asm[32]; }FFT_Len_32_s; //一組長度只需宣告一組, 讀取係數與排列使用 //========================================================== typedef struct { float Rx_Ping_Buf[256]; float Rx_Pong_Buf[256]; float Tx_Ping_Buf[256]; float Tx_Pong_Buf[256]; PingPong_S Status; }FFT_PingPong_S; extern void Asm_FFT(Complex_s *, float *, unsigned short *, unsigned short *); extern void RFFT_Cal(Complex_s *out, FFT_s *ptr_s, float *in); extern void FFT_Initial(FFT_s *ptr_s); extern void FFT32_Initial(FFT_s *ptr_s); extern void FFT64_Initial(FFT_s *ptr_s); extern void FFT256_Initial(FFT_s *ptr_s); extern void FFT1024_Initial(FFT_s *ptr_s); //void Asm_RFFT_In_Arrange_ORI(float *, int, Complex_s *, unsigned short *); extern void Asm_RFFT_In_Arrange(float *, int, Complex_s *, unsigned short *); extern void CFFT_Cal(Complex_s *out, FFT_s *ptr_s, Complex_s *in); //直接fft運算, 結果為複數, 需再進行排列才可給聲音使用 extern void IFFT_Cal(float *out, FFT_s *ptr_s, Complex_s *in); //排列fft運算, 結果為浮點, 可給聲音轉換直接使用 extern void RT_FFT_Ping_Pong(float *in, float *out, FFT_PingPong_S *ptr_F); extern void Cal_FFT_Trans(FFT_PingPong_S *ptr_F, FFT_s *ptr_FFT); extern FFT_s FFT_Pitch; extern FFT_s FFT_AEC; extern FFT_s ptr_FFT64; //指標 extern FFT_s ptr_FFT256; extern FFT_s ptr_FFT1024; extern unsigned short Initial_Arrange[256]; //====================Overlap======================== //pitch overlap 使用 typedef struct { int Len_Step; //256 int Len_Total; //1024 int Size_Hop; //升降頻皆有對應的Size_Hop int Index_An_Pre; //最新剛算完的一段 int Index_An; //最舊的一段 int Index_Sy; }Overlap_Status_s; typedef struct { int Index_Circular; int Len[2]; //給組語抓circular buf 資料的長度 unsigned int ptr_End_Circular; //與len順序需固定 float Buf_Circular[256]; float Buf_Window[4][256]; }Overlap_Analysis_s; typedef struct { int Index; //Synthesis 要讀取的紀錄, 有寫入時將其歸0, 每次讀Size_Hop, 讀至Len_Total float Buf[256]; }Overlap_Synthesis_s; typedef struct { Overlap_Status_s Sta; //status Overlap_Analysis_s An; Overlap_Synthesis_s Sy[4]; }Overlap_s; extern void Initial_Overlap(Overlap_s *ptr); extern void Asm_Overlap_Analysis(float *in, float *circular, float *out, int *len); extern void Analysis_Overlap(float *in, Overlap_s *ptr); extern void Synthesis_Overlap(float *out, Overlap_s *ptr); extern const float Coeff_Window_Overlap[256]; typedef enum { ID_NS1, //0 NUM_ID_NS, //1 }ID_NS_s; //====================指標移動======================== //======================================================= //====================NS======================== //#define HOLD_TIME_NS 10 //50 //約50ms //====================AP======================== typedef enum //勿超過16 { Bypass_Noise_Total, //0 //直接copy in to out Bypass_EM, //1 //仍會經過overlap 與 fft 轉換 Initial_NS_Overlap, //2 //inner table initial 判斷使用 }Noise_Flag_AP; typedef struct { unsigned short Falg; unsigned short Input_Index; unsigned short Output_Index; unsigned short Th[2]; //u16 Vol_In[2]; //以下對應AP時需再討論 //先填到其他物件display unsigned short Vol_Out[2]; //先填到其他物件display unsigned short Reserve; //for 對齊 }NS_AP_s; //====================RT======================== typedef enum { Flag_Update_Noise=16, //16 //設起來時, update noise }Noise_Flag_RT; typedef struct { unsigned long Command_Num; unsigned long Flag; //low 16 bit給AP, high 16 bit inner 使用 unsigned long Flag_Initial; //inner table initial 判斷使用 unsigned long Add_Input; unsigned long Add_Out; unsigned long Cnt; long Cnt_Hold; float Th; float Square_Sum_In; float Old_Square_Sum_In; float Square_Sum_Out; }NS_RT_s; //====================Inner======================== typedef enum { Arph_Noise, //0 //for new //越小時, update越慢, th低時則人聲不易有雜音, 但人聲若都低於th時, 則人聲消除會有雜音, 且水聲越明顯, 反之, 越大時, 人聲都低於th不會有雜音, 但是小聲時人聲易有雜音 Arph_Priori_New, //1 // Arph_Zeor, //2 //for new //方便組語控制 Arph_Priori_NewS, //3 //同樣的Arph_Priori_New 值, 只是方便取值所以重覆填 Arph_Priori_Old, //4 //(1-Arph_Priori_New) Num_ArphIndex_Noise, //5 }Noise_Arph_s; typedef struct { Overlap_s Overlap; float Old_Th; float NoiseE[129]; //Noise 頻譜smooth 能量 float Gain[129]; //需old資料smooth, 所以需要存old值 float OldPost[129]; //需存之前資料計算用, 此與gain 相對位置不可更改 Filter_Return_RMS_s NS_PEQ; }Inner_NS_s; typedef struct { NS_AP_s AP; NS_RT_s RT; Inner_NS_s Inner; }NS_s; extern float Arph_NoiseSuppress[Num_ArphIndex_Noise]; extern float Sq_In_NS; extern NS_AP_s AP_NS; extern void NRT_NS(void); extern void RT_NS(void); extern void NRT_NS_Fix(NS_AP_s *ptr_AP, NS_RT_s *ptr_RT); extern void RT_NS_Fix( NS_RT_s *ptr_RT, Inner_NS_s *ptr_Inner); extern void Asm_Update_Noise_Post(float *post, float *out_noise, Complex_s *in, float *arph); extern void Asm_Gain_Priori_Noise(Complex_s *out, Complex_s *in, float *gain, float *arph); extern void Set_AudioLine_NS(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { ID_AGC_VOIP, //0 ID_AGC_Mic1, //1 NUM_DSP_AGC, //2 }ID_AGC_s; typedef struct { unsigned short Flag_Action_Bypass_Release; //0: LED Action, 1 : Bypass, 2 : Determine the release time working or not. unsigned short Input_Index; unsigned short Output_Index; unsigned short Time_Average; unsigned short Th[2]; unsigned short Attact_Time; unsigned short Release_Time; unsigned short Target[2]; unsigned short Max_Gain[2]; unsigned short Display_Compensation_Gain[2]; }AGC_AP_s; typedef struct { unsigned long Command_Num; unsigned long Add_Input; unsigned long Add_Out; float Square_Sum; float Old_Gain; float Current_Gain; float Arph; unsigned long Cnt_Input; }AGC_RT_s; typedef struct { unsigned long Cnt_AVG_OverTh; int Cnt_UnderTh; float Old_SquareSum; float Time_OldAVG; }AGC_NRT_Temp_s; typedef struct { AGC_AP_s AP; AGC_RT_s RT; AGC_NRT_Temp_s NRT_Temp; }AGC_s; extern void NRT_AGC_Fix_Cal(AGC_AP_s *ptr_AP, AGC_RT_s *ptr_RT, AGC_NRT_Temp_s *ptr_NRT_Temp); extern void Asm_AGC_Fix_Cal(long in, long out, long len, float *ptr); extern void NRT_AGC(void); extern void Set_AudioLine_AGC(void); typedef enum { Clear_HwAGC_S, //0 Hold_Status, //1 Auto_HwAGC, //2 Manually_HwAGC, //3 }HwAGC_Status_s; typedef enum { Mic_Sensivity_6dB, //0 Mic_Sensivity_8dB , //1, Mic_Sensivity_10dB, //2 Mic_Sensivity_12dB, //3 Mic_Sensivity_14dB, //4 Mic_Sensivity_16dB, //5 Mic_Sensivity_18dB, //6 Mic_Sensivity_20dB, //7 Mic_Sensivity_22dB, //8 Mic_Sensivity_24dB, //9 Mic_Sensivity_26dB, //10 Mic_Sensivity_28dB, //11 Mic_Sensivity_30dB, //12 Mic_Sensivity_32dB, //13 Mic_Sensivity_34dB, //14 Mic_Sensivity_36dB, //15 Num_Set_Mic_Sensivity, //20 }HwAGC_Set_s; typedef enum { Index_HWAGC_DgMic, //0 NUM_DSP_HWAGC, //1 }Index_HWAGC; typedef struct { unsigned long Mode; unsigned long Set; unsigned long Set_Pre; unsigned long Display; unsigned long Flag_Hold; unsigned long CntOver; unsigned long CntUnder; unsigned long CntHold; float Square_Sum; }HwAGC_Control_s; typedef struct { AGC_AP_s AGC_AP; unsigned short Mode; unsigned short Set; unsigned short Display; unsigned short Mute; unsigned short Display_Volume[2]; short Base_dBSet; //設定此基準點, 在autoset時, 會參考此基準點改變th short Reserve123; }AP_HwAGC; typedef struct { AGC_NRT_Temp_s AGC_NRT_Temp; unsigned long Set_Pre; unsigned long Flag_Hold; unsigned long CntOver; unsigned long CntUnder; unsigned long CntHold; }HWAGC_NRT_Temp_s; typedef struct { AGC_RT_s AGC_RT; }HWAGC_RT_s; extern HwAGC_Control_s HwAGC; extern long Display_Set_HwMic[Num_Set_Mic_Sensivity]; extern void Initial_HwAGC(AP_HwAGC *ptr_AP, HWAGC_NRT_Temp_s *ptr_NRT_Temp); extern void NRT_HwAGC_Fix_Cal(AP_HwAGC *ptrHw_AP, HWAGC_RT_s *ptrHw_RT, HWAGC_NRT_Temp_s *ptrHw_NRT_Temp, NS_AP_s *ptr_NS); extern void Set_AudioLine_HWAGC(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { ID_Ducker1, //0 NUM_ID_Ducker, //1 }ID_Ducker_s; typedef struct { unsigned short Flag_Active_Bypass_Stereo_Fs; //0: LED Active, 1 : Bypass, 2 : Stereo, 8~15 Sample rate ratio unsigned short Input_Index; unsigned short Speech_Index; unsigned short Output_Index; unsigned short Th[2]; unsigned short Response_Time; unsigned short Hold_Time; unsigned short Attact_Time; unsigned short Release_Time; unsigned short Deepth_Response[2]; unsigned short Gain_Speech[2]; unsigned short Input2_Index; unsigned short Output2_Index; }Ducker_Stereo_AP_s; typedef struct { unsigned short Flag_Active_Bypass_Stereo_Fs; //0: LED Active, 1 : Bypass, 2 : Stereo, 8~15 Sample rate ratio unsigned short Input_Index; unsigned short Speech_Index; unsigned short Output_Index; unsigned short Th[2]; unsigned short Response_Time; unsigned short Hold_Time; unsigned short Attact_Time; unsigned short Release_Time; unsigned short Deepth_Response[2]; unsigned short Gain_Speech[2]; }Ducker_Mono_AP_s; typedef struct { unsigned long Add_Input; unsigned long Add_Speech; unsigned long Add_Out; }Ducker_Mono_IO_s; typedef struct { unsigned long Add_Input; unsigned long Add_Input2; unsigned long Add_Speech; unsigned long Add_Out; unsigned long Add_Out2; }Ducker_Stereo_IO_s; typedef struct { float Peak_Speech_In; float Arph; float Gain_Target_Out; float Gain_Old_Out; float Gain_Target_Speech; float Gain_Old_Speech; float Peak_Sum_Speech_In; float Cnt_Sum_Speech; }Ducker_Cal_s; typedef struct { unsigned long Command_Num; Ducker_Stereo_IO_s IO; Ducker_Cal_s Cal; }Ducker_Stereo_RT_s; typedef struct { unsigned long Command_Num; Ducker_Mono_IO_s IO; Ducker_Cal_s Cal; }Ducker_Mono_RT_s; typedef struct { unsigned long Flag_Response_Hold; float Cnt_Response; float Cnt_Hold; }Ducker_NRT_Temp_s; extern void NRT_Ducker(); extern void NRT_Ducker_Fix(Ducker_Mono_AP_s *ptr_AP, Ducker_Cal_s *ptr_RT, Ducker_NRT_Temp_s *ptr_NRT_Temp); extern void Asm_Ducker_Mono(Ducker_Mono_IO_s *ptr_IO, Ducker_Cal_s *ptr); extern void Asm_Ducker_Stereo(Ducker_Stereo_IO_s *ptr_IO, Ducker_Cal_s *ptr); extern void Ducker_Initial(int *ptr_rt_table, unsigned short *ptr_ap_table); extern void Set_AudioLine_Ducker(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { Slop_6dB, //0 Slop_12dB, //1 Slop_18dB, //2 Slop_24dB, //3 Slop_30dB, //4 Slop_36dB, //5 Slop_42dB, //6 Slop_48dB, //7 }Slop_Filter_s; typedef enum { NUM_DSP_Filter=1, //for mcu use 1 }Index_DSP_Filter; //======AP===================== typedef struct { unsigned short Flag; //[0~3] slop, [4~6] Mode, [7]Mute, [8]Bypass, {9]Type unsigned short Fc[2]; unsigned short Index_In; unsigned short Index_Out; unsigned short Level[2]; unsigned short Reserve; }Filter_AP_s; //======RT===================== typedef struct { unsigned long Command_Num; unsigned long Address_In; unsigned long Address_Out; unsigned long Address_Coeff; float Level; unsigned long Flag_PingPong; RT_Old_Band_s Old; }FILTER_HiLo_RT_s; //======NRT===================== typedef struct { unsigned long Nun_Band; Coeff_Order2_SIMD_s Coeff[2]; //ping pong }NRT_FILTER_HiLo_Struct; //對應到NRT Temp Table //Total typedef struct { Filter_AP_s AP; FILTER_HiLo_RT_s RT; NRT_FILTER_HiLo_Struct NRT; }FILTER_HiLo_S; void NRT_Filter_HiLoPass_Fix(Filter_AP_s *ptr_AP, FILTER_HiLo_RT_s *ptr_RT, NRT_FILTER_HiLo_Struct *ptr_NRT_Temp); //extern void Asm_Filter_HiLoPass_Fix(u32 out, u32 in, u32 *ptr_add, PEQ_DSP_Inner_s *ptr_inner); void NRT_Filter_HiLoPass(); extern void Asm_HiLoPass_Fix(unsigned long out, unsigned long in, unsigned long *ptr_coeff); extern void BypassFilterCoeff(NRT_FILTER_HiLo_Struct *ptr_NRT_Temp, unsigned short index); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#include "RT_Processor.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //=========賡批=============================== typedef enum { ID_AEC1, //0 NUM_ID_AEC, //1 }ID_AEC_s; //=================================================== //===================AEC main======================================= //===================FIR======================================= //==================AEC FFT =================================== //===================NLMS======================================= //===================NLP======================================= //================InterAction======================= typedef enum { Index_Near_AEC, //0 Index_Ref_AEC, //1 Index_Out_AEC, //2 Mic_Too_Loud, //3 NLP_Bypass, //4 FilterBank_Bypass, //5 AEC_Bypass_RT, //6 AEC_Hold_RT, //7 AEC_Reset_RT, //8 DoubleTalk_AEC, //9 Detect_Echo, //10 Restore_AEC, //11 Error_RefAEC, //12 //ref 芣 }AEC_Use_s; typedef enum { Perform_AEC, //0 Bypass_AEC, //1 Hold_AEC_Coeff, //2 }AEC_AP_Coefficient_s; typedef enum { Soft_NLP, //0 Medium_NLP, //1 Aggressive_NLP, //2 Off_NLP, //3 }AEC_AP_NLP_s; typedef enum { LED_Echo_AEC, //0 LED_Near_Signal_AEC, //1 }AEC_LED_s; typedef enum { Normal_PathStatus, //0 //泱raing, 銝gain 1,0瘜 Traning_Echo_Status, //1 Path_Change_Status, //2 }Status_Path_AEC_s; //======AP===================== typedef struct { unsigned short Index_Ref; unsigned short Index_Ref_Channel; unsigned short Index_Near; unsigned short Index_Near_Channel; unsigned short Index_Out; unsigned short Index_Out_Channel; }AP_AEC_Index_s; typedef struct { unsigned short Flag_NLP; unsigned short LED_Echo_Signal; unsigned short ERLE[2]; //0: L, 1:H unsigned short Far_Volume[2]; unsigned short Near_Volume[2]; unsigned short Flag_AEC_Coeff; //[0~1] 0:perform, 1:bypass, 2:hold, [2]:reset, [3] noise reduction [4]BIT_Near_AEC unsigned short Th_Near[2]; unsigned short Level[2]; unsigned short NR_Level[2]; unsigned short Reserve; }AP_AEC_Display_Control_s; typedef struct { unsigned short ID_NumIn_NumOut; //[0~3]ID, [4~7]Num In, [8~11]Num Out unsigned short MaskIn_MaskOut; //[0~7]Mask In, [8~11]Mask Out AP_AEC_Index_s Index; AP_AEC_Display_Control_s Parameter; }AP_AEC_s; //==============NRT Temp===================== typedef struct { //霈 float Level_Speech_Ducker; float Level_OutL; float Level_OutR; float Level_Codec_Add; //桀隞 24 dB 箏箸 //頛詨 float Th_AGC_Hide; }NRT_InterAction_s; typedef struct { Filter_AP_s AP_Setting; //near far 閮凋璅 //銝畾萄芣撠蚓, }uf撠朣憿 NRT_FILTER_HiLo_Struct Coeff_Filter_AEC; NRT_InterAction_s InterAction; }NRT_AEC_s; //=====RT Inner============================= typedef struct { Len_s Len; Complex_s Cal[32]; Complex_s W[16]; unsigned short IP[5][32]; //箏畾菔 }AEC_FFT_s; typedef struct { int Index; float *ptr_End; float Old[10][32]; }Filter_Bank_s; typedef struct { int Index_RMS; float Buf_RMS[32]; float Ave_RMS; float dB; //ave 21 ms float dB_Immediate; float dB_Smooth; //smooth 500ms }dB_AEC_Cal_s; typedef struct { float Target; float Old; float Arph; }NLP_AEC_s; typedef struct { unsigned long Status; NLP_AEC_s Gain_Active; long Cnt_Continuous_Echo; //閮蝞臬阡蝥牠cho瘜 long Cnt_LessERLE; //閮蝞撠潭活 long Cnt_Reduce; //閮蝞銵唳 }Change_Path_AEC_s; typedef struct { Filter_Bank_s FB[3]; //0 :near, 1: far, 2:out Change_Path_AEC_s Path; }AEC_Inner_s; //==========RT======================= typedef struct { //批 : //u32 Detect_Echo; //敹恍, 蝯再GC雿輻 //孵莧EC_RT_Flag float Level_Ref; //撠Ref敺敶梢輸喲隞嗥level靘 float Level_Codec_Shift; //覓OIP Tx(頛詨16 bit), 亙蝡舀曉之頞憭, 甇文舐葬撠頞憭 float dB_MicOffset; float dB_SpkOffset; //撠Ref敺敶梢輸喲隞嗥dB靘 }RT_InterAction_s; typedef struct { unsigned long Command_Num; unsigned long Add_Ref; unsigned long Add_Near; unsigned long Add_Out; int Flag; //Bypass 閮剛絲撠雿蝵 int Flag_Hold; //喲撠, hold int Cnt_Hold; int Record_Reset; //reset 舫0 or 1, 寡撠梢脣餃 float Th_Mic_Min; //dB float Th_Mic_Max; //dB float Th_Ref_Min; //dB dB_AEC_Cal_s dCal[4]; //0:near, 1:Far, 2:out //甇山quare 箇嗆活rms 脣雿蝵 NLP_AEC_s NLP; unsigned long Flag_Initial; //inner table initial 斗瑚蝙 FILTER_HiLo_RT_s Near_Filter; FILTER_HiLo_RT_s Ref_Filter; RT_InterAction_s InterAction; }RT_AEC_s; extern void Check_NLMS_Reset(RT_AEC_s *ptr, AP_AEC_Display_Control_s *ptr_AP); //NRT check extern void Set_NLMS_Reset(RT_AEC_s *ptr, AP_AEC_Display_Control_s *ptr_AP); extern void ReduceLevel_ForChangePath(float *out, float *in, RT_AEC_s *ptr_RT, AEC_Inner_s *ptr_Inner); void Asm_Filter_Bank( Filter_Bank_s *ptr, float *Out, const float *Coeff); void Reset_Filter_Bank(Filter_Bank_s *ptr); extern void RT_AEC(void); extern void NRT_AEC(void); extern void NRT_AEC_Fix(AP_AEC_s *ptr_AP, RT_AEC_s *ptr_RT, NRT_AEC_s *ptr_NRT); extern void Reset_NRT_AEC(AP_AEC_Display_Control_s *ptr_AP, RT_AEC_s *ptr_RT, NRT_AEC_s *ptr_NRT); void CFFT_AEC(float *out, FFT_s *ptr_s, Complex_s *in, Complex_s *trans); void Asm_Filter_Bank_Shift(float *out, float *in); void Asm_Ref_Multi(float *in_re, float *in_im, float *ref_real, float *ref_im); void Denominator_NLMS_Cal(float *near_in, float *error, float *nlms_real, float *nlms_im); void W_NLMS_Cal(float *w, float *error, float *ref_re, float *ref_im); extern void NLMS_Function(float *Near_In, Complex_s ref[], float *Error, RT_AEC_s *ptr); extern void Initial_AEC(void); //(AEC_Inner_s *ptr); void Asm_RMS_AEC ( float *In, dB_AEC_Cal_s *ptr); void Cal_dB_AEC(float *In, dB_AEC_Cal_s *Cal); extern void Reset_RT_AEC(RT_AEC_s *ptr_RT, AEC_Inner_s *ptr_Inner); void Expander_AEC(float In_DB,float Expander_Threshold,float Expander_Ratio,float Inv_Expander_Ratio, float Expander_Range , NLP_AEC_s *ptr); void NLP_AEC_Function(float *out, float *in, RT_AEC_s *ptr); void Asm_NLP_AEC(float *Out, float *In, NLP_AEC_s *ptr); extern void NLMS_Reset(RT_AEC_s *ptr); extern long Detect_AEC_Status(RT_AEC_s *ptr_AEC); extern int flag_Bypass_NLMS; /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { Fixed_SPC, //0 Vox_SPC, //1 Contact_SPC, //2 Vox_Contact_SPC, //3 }Activation_SPC_Mode; //===========AP==================== typedef struct { unsigned short Act; unsigned short Priority; }AP_SPC_Mode_s; //使因參數長度調整與固定部份交錯, 所以無法與可拉式編輯直接共用, 每段固定式需將struct 與程式微調才可 typedef struct { unsigned short LED_Gate_On[2]; unsigned short LED_Busy[2]; unsigned short NumIn_Num_Out; //[0~7]Num In, [8~15]Num_Out unsigned short Index_In[5]; unsigned short Index_Out[1]; unsigned short Solo[2]; unsigned short TTL[2]; unsigned short Th[2]; unsigned short Response_Time; unsigned short Hold_Time; AP_SPC_Mode_s Mode[5]; unsigned short Mask_InOut[1][2]; unsigned short Reserve[3]; }AP_SPC_s; //===========RT==================== typedef struct { unsigned long Command_Num; unsigned long Address_NRT_Temp; unsigned long Address_Input[5]; unsigned long Address_Out[1]; }RT_SPC_s; //===========NRT Temp==================== typedef struct { float Peak; float Peak_Buf[8]; float Peak_Ave; unsigned long Flag_Attact_Release; //[0] attct, [1] release float Cnt_Response; float Cnt_Hold; }NRT_SPC_In_Channel_s; typedef struct { unsigned long Address_Input; float Gain_Output; float Old_Gain_Output; }NRT_SPC_Out_Channel_s; typedef struct { unsigned long Num_In; unsigned long Num_Out; unsigned long Cnt_Buf_Index; //[0~15] Cnt Sample. [16~19] Buf Index NRT_SPC_In_Channel_s In[5]; NRT_SPC_Out_Channel_s Out[1]; }NRT_SPC_s; extern void NRT_SPC(); extern void RT_SPC(); extern void Asm_SPC(); extern unsigned long *ptr_asm_SPC; /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum { Index_Write_Circula, //0 Index_Read_Circula, //1 Nono_Error_Circular, //2 Write_Touch_Read , //3 //write 追到read 指標 : 表示進來資料已超出緩衝 Read_Touch_Write , //4 //read 追到write 指標 : 表示進來資料已超出緩衝 }Circular_Status_e; typedef struct { float *Write; float *Read; float *Base; float *End; unsigned long Offset_Write; //ex: 3點取1點與輸入長度無法整除, 需紀錄下一次取時, 要從那個起始位置取 unsigned long Len_Write; //ex: 3點取1點, 實際輸出長度 }Circular_Poniter_Float_s; typedef struct { Circular_Poniter_Float_s Address; Circular_Status_e Status[2]; }Circular_Float_s; extern void Initial_Circular_Buf(Circular_Float_s *ptr, float *buf, long len); extern void Write_To_Circular_Buf(float *in, int len, Circular_Float_s *ptr); extern void Write_To_Circular_Buf_Standard(float *in, int len, Circular_Float_s *ptr, long len_max); extern void Closed_Circular_Buf(Circular_Float_s *ptr, long len_buf); extern long Read_Circular_Buf(float *out, int len, Circular_Float_s *ptr); extern unsigned long Detect_Space_Circular_Buf(Circular_Float_s *ptr); extern Circular_Float_s Circular_Rx_VOIP; extern Circular_Float_s Circular_Tx_VOIP; extern float Buf_Rx_VOIP[6400]; extern float Buf_Tx_VOIP[6400]; typedef struct { unsigned short Mute; unsigned short Message_Index; unsigned short Output_Index; unsigned short Level[2]; unsigned short Line_Index; unsigned short Display_Volume[2]; }UDP_RX_AP_s; typedef struct { unsigned short Mute; unsigned short Input_Index; unsigned short Level[2]; unsigned short Message_Index; unsigned short Output_Index; unsigned short Display_Volume[2]; }UDP_TX_AP_s; typedef struct { unsigned long Command_Num; unsigned long Index_Struct; //與message共用物件channel, 此將指出使用那一個物件 unsigned long Add_Input; unsigned long Cnt; float Square_Sum; float Level; float Smooth_Gain; unsigned long Add_Out; }UDP_RT_s; extern void NRT_UDP_Receiver(); extern void NRT_UDP_Transmitter(); extern void RT_UDP(); extern void Asm_UDP_Rx_Fix(float *out, float *in, unsigned long *ptr); extern Circular_Float_s Circular_UDP_RxL; extern Circular_Float_s Circular_UDP_RxR; extern float Buf_UDP_L[6400]; extern float Buf_UDP_R[6400]; /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#include "RT_Processor.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ typedef enum //勿超過16 { LED_GateOn_VG, //0 Mute_VG, //1 Bypass_VG, //1 }VoiceGate_Bit_s; typedef enum //勿超過16 { EasyVG, //0 MidVG, //1 HardVG, //2 NumType_VG, //3 }VoiceGate_Type_s; typedef struct { unsigned short Flag; unsigned short Index_In; unsigned short Index_Out; unsigned short Th[2]; unsigned short Recognition; unsigned short HoldTime; unsigned short ReleaseTime; }VoiceGate_AP_s; typedef struct { unsigned long Command_Num; Regulate_DC_s DC; unsigned long Flag; //VoiceGate_Bit_s unsigned long Address_In; long Cnt_Square; float SquareSum; unsigned long ptr_old_corrleation; //存 inner table位址 float RxOld; float ArphNew; long Recognition; long Flag_AudioOverTh; long HoldTime; unsigned long Address_Out; }VoiceGate_RT_s; typedef struct { float x0[2]; //in delay0 float x1[2]; float x2[2]; float y0[2]; //out delay0 float y1[2]; float OldCorrelation; float BufferTimeDomain[8]; float Acc; float Old_Envelop; float Sum_Envelop; float Cnt; float Last_AveEnvelop; float CntCondition; float ThPrepare; float ThVad; float CntHold; long CntDelayBuf; long Cnt24Sample; long IndexOldData; }VoiceGate_Inner_s; extern int Voice_Gate_Trigger; void NRT_Voice_Gate(void); void RT_Voice_Gate(void); void Asm_AutoCorrelation(float *in, float *Smooth_Rx_Temp); extern void Initial_VoiceGate(VoiceGate_AP_s *ptr); extern void Set_VoiceGate(unsigned short index, VoiceGate_AP_s *ptr); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ ///// AP structure ///// //Sample Rate Ratio (8 bit : 8~15) Bypass (1 bit : 2) Mute (1 bit : 1) @Gate on Flag (1 bit : 0) (Fix, 16 bit) //Input Index (Fix, 16 bit) //@Output Index (Fix, 16 bit) //Threshold (32 bit) (L,M) //Response time (16 bit) //Hold time (16 bit) //Attack time (16 bit) //Release time (16bit) //Depth(Gain) (32 bit) (L,M) typedef struct { unsigned short Sample_Bypass_Mute_Gate;//Sample Rate Ratio (8 bit : 8~15) Bypass (1 bit : 2) Mute (1 bit : 1) @Gate on Flag (1 bit : 0) (Fix, 16 bit) unsigned short Input_Index; unsigned short Output_Index; unsigned short Threshold_1; unsigned short Threshold_2; unsigned short Response_time; unsigned short Hold_time; unsigned short Attack_time; unsigned short Release_time; unsigned short Depth_Gain_1; unsigned short Depth_Gain_2; unsigned short Reserve; }Gate_Mono_AP_s; ///// RT structure ///// //Command Number(32 bit) //Input Address (Address, 32 bit) //Output Address (Address, 32 bit) //@Input Volumn Square Sum (Floating, 32 bit) //@Input Counter (Fix, 32 bit) //Output Gain (Floating 32bit) //Old Gain (Floating 32bit) //Arpha (Floating 32bit) typedef struct { unsigned long Command_Num; unsigned long Input_Address; unsigned long Output_Address; float Volumn_Square_Sum; int Counter; float Output_Gain; float Old_Gain; float Arpha; }Gate_Mono_RT_s; ///// RT_temp structure ///// //State[1:0] (00: OFF & Release, 01: Response, 10: Attack 11: ON & Hold) //Counter typedef struct { unsigned long State; unsigned long Counter; }Gate_Mono_temp_CH_NRT_s; typedef struct { Gate_Mono_AP_s AP; Gate_Mono_RT_s RT; Gate_Mono_temp_CH_NRT_s NRT_Temp; }Gate_Mono_s; void NRT_Gate_Mono_Fix_Cal(Gate_Mono_AP_s *ptr_AP, Gate_Mono_RT_s *ptr_RT, Gate_Mono_temp_CH_NRT_s *ptr_NRT_Temp); void Asm_Gate_Mono_Fix_Cal(long in, long out, long len, long Q_Debug); void RT_Gate_Mono(void); void NRT_Gate_Mono(void); //#include "../DSPThread.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ ///// AP structure ///// //Level Detector Type (2 bit : 3~4) Soft_knee (1 bit : 2 ) Byass (1 bit : 1) Compressing(Limiter,Expander) (1 bit : 0) //Input Address (Index, 16 bit) //Output Address (Index, 16 bit) //Threshold (Floating ,32 bit) //Threshold Range (Floating ,32 bit) //Ratio (Floating ,32 bit) //Attack Time (Fix 16bit) //Release Time (Fix 16bit) //Gain Reduction Volume (Floating, 32 bit) typedef struct { unsigned short Type_Softknee_Byass_Compressing; unsigned short Input_Index; unsigned short Output_Index; unsigned short Threshold_1; unsigned short Threshold_2; unsigned short Threshold_Range_1; unsigned short Threshold_Range_2; unsigned short Ratio_1; unsigned short Ratio_2; unsigned short Attack_time; unsigned short Release_time; unsigned short Gain_Reduction_Volume_1; unsigned short Gain_Reduction_Volume_2; }Compressor_AP_s; ///// RT structure ///// //Command Number(32 bit) //Function Type(32 bit) //Input Address (Address, 32 bit) //Output Address (Address, 32 bit) //@Input Volumn Square Sum (Floating, 32 bit) //@Input Counter (Fix, 32 bit) //Output Gain (Floating 32bit) //Old Gain (Floating 32bit) //Arpha (Floating 32bit) typedef struct { unsigned long Command_Num; unsigned long Function_Type; unsigned long Input_Address; unsigned long Output_Address; float Volumn_Square_Sum; int Counter; float Output_Gain; float Old_Gain; float Arpha; }Compressor_RT_s; ///// RT_temp structure ///// //State[1:0] (00: OFF & Release, 01: Response, 10: Attack 11: ON & Hold) //Counter typedef struct { unsigned long State; unsigned long Counter; float OLD_Threshold; float OLD_Threshold_Range; float OLD_Ratio; float SoftKness_parameter; }Compressor_temp_CH_NRT_s; void NRT_Compressor_Fix_Cal(Compressor_AP_s *ptr_AP, Compressor_RT_s *ptr_RT, Compressor_temp_CH_NRT_s *ptr_NRT_Temp); void Asm_Compressor_Fix_Cal(long in, long out, long len/*, long Q_Debug*/); void RT_Compressor(void); void NRT_Compressor(void); /* * Limiter.h * * Created on: 2016年3月18日 * Author: Owner */ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#define TYPE_LIMITER_OR 0x0008 //bit3 //#define TYPE_EXPANDER_OR 0x0010 //bit4 typedef enum { LED_Display_ORL, //0 Bypass_ORL, //1 Hard_Clip_ORL, //2 TYPE_LIMITER_OR, //3 TYPE_EXPANDER_OR, //4 Stereo_Limiter, //5 }OR_Limiter_AP_Bit_Define; typedef struct { float Arph_Limiter; float Th_Limiter; float Old_Limiter; float Current_Gain; //1.0, 方便組語一次取值與免載入值使用 }RT_Brick_Wall_Limiter_s; //============Ap=========================== typedef struct { unsigned short Flag; //[0]: active LED, [1]:bypass, [2]:hard_clip, [3-4]:type unsigned short Index_In; unsigned short Index_Out; unsigned short Th[2]; unsigned short Release_Time; //ms unsigned short Reduction_dB_Level[2]; }AP_Limiter_s; typedef struct { unsigned short Index_In; unsigned short Index_Out; }AP_Limiter_Stereo_s; //============RT=========================== typedef struct { unsigned long Command_Num; unsigned long Flag; //[0]:bypass, [1]:hardclip unsigned long Add_Input; unsigned long Add_Output; RT_Brick_Wall_Limiter_s Cal; }RT_Limiter_s; typedef struct { unsigned long Add_Input; unsigned long Add_Output; float Old_Limiter; float Current_Gain; //1.0, 方便組語一次取值與免載入值使用 }RT_Limiter_Stereo_s; extern RT_Brick_Wall_Limiter_s Limiter_Spk; extern RT_Brick_Wall_Limiter_s Limiter_USB_Tx; extern void RT_Brick_Wall(float *out, float *in, RT_Brick_Wall_Limiter_s *ptr_B); extern void NRT_Limiter_Fix_Cal(AP_Limiter_s *ptr_AP, RT_Limiter_s *ptr_RT); extern void NRT_Limiter(AP_Limiter_s *ptr_AP, RT_Limiter_s *ptr_RT); extern void RT_Limiter(RT_Limiter_s *ptr_RT); extern void RT_Limiter_Stereo(RT_Limiter_s *ptr_RT); extern void RT_Hard_Clip(float *out, float *in, float *th); extern RT_Brick_Wall_Limiter_s Limiter_Amp_L; extern RT_Brick_Wall_Limiter_s Limiter_Amp_R; extern RT_Brick_Wall_Limiter_s Limiter_VOIP_TX; //===============Compressor Limiter=============================== typedef enum { LED_Expander, //0 LED_Compressor, //1 LED_Limiter, //2 Bypass_AND_CLE, //3 SoftKnee_AND_CLE, //4 HardClip_AND_CLE, //5 }Bit_Set_AND_AP_Comporessor_Limiter_Expander_s; typedef struct { unsigned short Flag; unsigned short Index_In; unsigned short Index_Out; unsigned short Th_Limiter[2]; unsigned short Th_Expander[2]; unsigned short Th_Compressor[2]; unsigned short Ratio_Compressor[2]; unsigned short Ratio_Expander[2]; unsigned short Attack_Expander; unsigned short Release_Expander; unsigned short Attack_Compressor; unsigned short Release_Compressor; unsigned short Release_Limiter; unsigned short Reduction_dB_Level[2]; }AP_AND_Compliter_Limiter_Expander_s; typedef struct { Compressor_RT_s Compressor; RT_Brick_Wall_Limiter_s Limiter; }RT_Compliter_Limiter_s; extern void RT_Compressor_Limiter(RT_Compliter_Limiter_s *ptr_RT); extern void NRT_Compressor_Limiter(void); extern void Set_AudioLine_Compressor_Limiter(void); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //======AP===================== typedef struct { unsigned short Num_Message; unsigned short Index_Chan_M; unsigned short Index_Out; unsigned short Mute; unsigned short Level[2]; }Message_AP_s; typedef struct { unsigned long Command_Num; unsigned long Index_Message; unsigned long Address_In; unsigned long Address_Out; float Level; }Message_RT_s; extern Circular_Float_s Circular_Message_L; extern Circular_Float_s Circular_Message_R; extern float Buf_MessageL[19200]; extern float Buf_MessageR[19200]; extern void NRT_Message_Event(void); extern void RT_Message_Event(void); extern float Level_SD_File; extern float Level_Message_File; //MCU將file所設定的音量存至此位置 /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* typedef struct { u16 Selector; u16 Num_In; u16 Mask_L; u16 Mask_H; u16 Index[6]; //此為動態, 無法直接對應 u16 Index_Out; }AP_Selector_s; */ typedef struct { //int Command_Num; int Add_Input; int Add_Out; float Gain; }RT_Selector_s; typedef struct { unsigned short Selector; unsigned short Reserve; }AP_LR_Selector_s; typedef struct { int Add_Input[2]; int Add_Out[2]; }RT_LR_Selector_s; extern void NRT_Multi_In_Selector(); extern void RT_Multi_In_Selector(); extern void NRT_SelectorLR_Fix(); extern void RT_SelectorLR_Fix(RT_LR_Selector_s *ptr_RT); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //===========Rx================= typedef struct { unsigned short Index_In; unsigned short Index_Out; unsigned short Mute; unsigned short Level[2]; unsigned short Reserve; }AP_Rx_VOIP_s; typedef struct { unsigned long Command_Num; unsigned long Channel_Num; unsigned long Address_Out; float Level; }RT_Rx_VOIP_s; //===========Tx================= typedef struct { unsigned short Index_In; unsigned short Index_Out; unsigned short Mute; unsigned short Level[2]; unsigned short Reserve; }AP_Tx_VOIP_s; typedef struct { unsigned long Command_Num; unsigned long Address_Input; unsigned long Address_Out; float Level; }RT_Tx_VOIP_s; extern Circular_Float_s Circular_Rx_VOIP; extern Circular_Float_s Circular_Tx_VOIP; extern float Buf_Rx_VOIP[6400]; extern float Buf_Tx_VOIP[6400]; extern int Buf_UpSample_RxVOIP[2]; extern void NRT_VOIP_Rx(void); extern void NRT_VOIP_Tx(void); extern void VOIP_Receive(void); /* * Hi_LoPass_PEQ.h * * Created on: 2016年5月19日 * Author: Owner */ //因為全域宣告, 所以需宣告出實體位置 typedef enum { Id_FilterPEQ_VOIP, //0 Id_FilterPEQ_Mic1, //1 NUM_DSP_FilterPEQ, //2 }ID_DSP_FilterPEQ; typedef enum { Modify_PEQ, //0 Modify_HiPass, //1 Modify_LoPass, //2 }Modify_Index_HiLoPass_PEQ; //內部使用, 節省nrt 全部重算時間 typedef struct { PEQ_AP_s Main; PEQ_AP_Parameter_s Band[4]; }AP_PEQ_HiLo_Struct; typedef struct { PEQ_RT_s Main; RT_Old_Band_s Band[4]; }RT_PEQ_HiLo_Struct; //======AP===================== typedef struct { unsigned short OffsetGloabTable; //可拉式編輯使用, 便於跳至下一張table unsigned short Offset_PEQ; unsigned short Offset_HiPass; unsigned short Offset_LoPass; unsigned short Mute; AP_PEQ_HiLo_Struct PEQ; Filter_AP_s HiPass; Filter_AP_s LoPass; }HiLoPass_PEQ_AP_s; //=============RT===================== typedef struct { unsigned long Command_Num; unsigned long Mute_Set; //因為全域宣告, 所以需宣告出實體位置 RT_PEQ_HiLo_Struct PEQ; FILTER_HiLo_RT_s HiPass; FILTER_HiLo_RT_s LoPass; }HiLoPass_PEQ_RT_s; //=============NRT Temp===================== typedef struct { AP_PEQ_HiLo_Struct Record_PEQ; Filter_AP_s Record_HiPass; Filter_AP_s Record_LoPass; NRT_PEQ_Struct PEQ; NRT_FILTER_HiLo_Struct HiPass; NRT_FILTER_HiLo_Struct LoPass; }NRT_PEQ_HiLo_Struct; //對應到NRT Temp Table extern void NRT_HiLoPass_PEQ(void); enum ARRANGE_AUDIO_DATA { GATHER_DMA, //0 ARRANGE_DATA_BY_C, //1 ARRANGE_DATA_BY_ASM, //2 TONE_OUT, //3 DMA_CBYPASS, //4 }; typedef struct { RT_New_Input_Struct Input_DSP[NUM_DSP_INPUT]; UDP_RT_s UDP_Rx; RT_Rx_VOIP_s VOIP_Rx; AGC_RT_s AGC[NUM_DSP_AGC]; NS_RT_s NS; HWAGC_RT_s HWAGC; RT_PEQ_Struct PEQ[NUM_DSP_PEQ]; FILTER_HiLo_RT_s Filter[NUM_DSP_Filter]; RT_SPC_s SPC; Ducker_Mono_RT_s Ducker; RT_Tx_VOIP_s VOIP_Tx; RT_New_Output_Struct Output_DSP[NUM_DSP_OUTPUT]; VoiceGate_RT_s VoiceGate; HiLoPass_PEQ_RT_s HiLoPass_PEQ[NUM_DSP_FilterPEQ]; RT_AEC_s AEC; Gate_Mono_RT_s Gate; RT_Compliter_Limiter_s Compressor_Limiter; }DSP_RT_Table_s; typedef struct { PEQ_DSP_Inner_s PEQ[NUM_DSP_PEQ]; AEC_Inner_s AEC; Inner_NS_s NS; VoiceGate_Inner_s VoiceGate; }Inner_Table_DSP_RT_s; extern DSP_RT_Table_s RT_Table_DSP; extern Inner_Table_DSP_RT_s Inner_Table_DSP; extern int RT_Parameter_Table[10000]; extern float Buf_RT_Inner[5000]; extern int *ptr_rt_parameter_table; extern int *ptr_asm_table; extern float *ptr_RT_Inner; extern void RT_Process(DSP_RT_Table_s *ptr); void Arrange_DSP_In(void); void Arrange_DSP_Out(void); void C_DMA_Bypass(void); void Rx_Arrange_Asm(int *in, float *out); void Tx_Arrange_Asm(int *out, float *in); void DSP_Audio_Process(void); extern void Path_Mic1(DSP_RT_Table_s *ptr, Inner_Table_DSP_RT_s *ptr_Inner); /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#include "RT_Processor.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#include "../DSPThread.h" /* * Limiter.h * * Created on: 2016年3月18日 * Author: Owner */ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* * DNM.h * * Created on: 2017年2月13日 * Author: Owner */ /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ //#include "RT_Processor.h" /****************************************************************************/ /* math.h v15.4.0I15142 */ /* */ /* Copyright (c) 2010-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /****************************************************************************/ /* math.h standard header */ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /* * Copyright (c) 1992-2004 by P.J. Plauger. ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V4.02:1476 */ /*****************************************************************************/ /* string.h v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push /* using declarations must occur outside header guard to support including both C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */ /* this code is for C++ mode only and thus also not relevant for MISRA */ #pragma CHECK_MISRA("-19.15") #pragma diag_pop /*****************************************************************************/ /* STDIO.H v15.4.0I15142 */ /* */ /* Copyright (c) 1993-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* STDINT.H v15.4.0I15142 */ /* */ /* Copyright (c) 2002-2015 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* 7.18.1.1 Exact-width integer types */ typedef signed char int8_t; typedef unsigned char uint8_t; typedef unsigned char boolean; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; /* 7.18.1.2 Minimum-width integer types */ typedef int8_t int_least8_t; typedef uint8_t uint_least8_t; typedef int16_t int_least16_t; typedef uint16_t uint_least16_t; typedef int32_t int_least32_t; typedef uint32_t uint_least32_t; typedef int64_t int_least64_t; typedef uint64_t uint_least64_t; /* 7.18.1.3 Fastest minimum-width integer types */ typedef int32_t int_fast8_t; typedef uint32_t uint_fast8_t; typedef int32_t int_fast16_t; typedef uint32_t uint_fast16_t; typedef int32_t int_fast32_t; typedef uint32_t uint_fast32_t; typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; /* 7.18.1.4 Integer types capable of holding object pointers */ typedef int intptr_t; typedef unsigned int uintptr_t; /* 7.18.1.5 Greatest-width integer types */ typedef long long intmax_t; typedef unsigned long long uintmax_t; /* According to footnotes in the 1999 C standard, "C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before is included." */ /* 7.18.2 Limits of specified width integer types */ /* 7.18.3 Limits of other integer types */ /* 7.18.4.1 Macros for minimum-width integer constants */ /* There is a defect report filed against the C99 standard concerning how the (U)INTN_C macros should be implemented. Please refer to -- http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm for more information. These macros are implemented according to the suggestion given at this web site. */ /* 7.18.4.2 Macros for greatest-width integer constants */ //============================================ typedef enum { EXT_AMP, INT_AMP, VO3_AMP, FIREMAN, LINE_OUT, SLA_INT_AMP }Source_E; typedef enum { LowTh_KnobDecrease, HighTh_KnobDecrease, Num_Degree_KnobDecrease, }Th_Degree_VOLTAGE_KnobDecrease_S; typedef enum { N15dB_KnobDecrease, N12dB_KnobDecrease, N9dB_KnobDecrease, N6dB_KnobDecrease, N3dB_KnobDecrease, ZdB_KnobDecrease, Num_KnobDecrease, Null_KnobDecrease, //未panging 或是 未設定 monitor or 異常, 沒收到狀態 }Th_Value_VOLTAGE_KnobDecrease_S; typedef enum { Button_Max_Level_E, //0 Button_Min_Level_E, Bypass_E, Setting_MaxMalfunction_Level_E, Calibration_E, Setting_Mode_Static_Dynamic, //5 //目前此是在setting group 處決定, 運作後不會再更改 AR_Time_E, Index_In_E, Index_Out_E, Sampling_Time_E, Priority_E, //10 Gap_Time_E, OverNoiseLevel_E, MinGain_E, MaxGain_E, MalfunctionLevel_E, //15 IP_E, Record_Status_E, //非寫入至DSP AP buf, 而是將此值存到MCU使用 Record_Status2_E, Record_Status3_E, Record_Status4_E, //Record_FlagCalibration_E, //非寫入至DSP AP buf, 而是將此值存到MCU使用 Record_Decrease_Volume, Record_OverAmbient_E, //20 Manual_AmbientNoise, SettingVaule_AmbientNoise, DNME_END }DNM_E_s; typedef enum { Button_Max_Level_B, //0 Button_Min_Level_B, //1 Bypass_DNM_B, //2 Setting_MaxMalfunction_Level_B, //3 Button_Calibration_B, //4 Setting_Stop_B = 7, //7 //偵測到slave移除, 權重未滿100%時, MCU將第7 bit 設起, 使DSP將DNM 停止動作, 並禁止校正 Setting_AmbientNoise_B , //8 //for Dynamic使用, 如果設起時, 會去取AmbientNoise_SPL作為 環境噪音 (因校正與使用環境的環境噪音有可能不同,所以給使用者強制設定) Setting_MaxMode_B, //9 //for normal 使用 Setting_MinMode_B, //10 //for normal 使用 Mode_MaxMin_Range = 0x0600, //9, 10 //Max/Min Mode : 取帶權重百分比, 改為最大, 最小, 平均 Mode_DNM_Range = 0x0060, //5, 6 //DNM Mode : DNM : Static, Dynamic, DigiMic : Static Dynamic Mode_DNM_Static = 0, Mode_DNM_Dynamic = 0x0020, Mode_DG_Static = 0x0040, Mode_DG_Dynamic = 0x0060, Clear_DNM_Mode_Range = 0xff9f, }DNM_Set_AP1_s; typedef enum { Finish_Calibration_B, //0 Record_Finish_Calibration_B, //1 //此bit 感覺作用不大, 改跟隨NRT Rx FlagCal_Finish_Series 進行判斷 (原本此bit IDA8S應是用來暫停校正用後, 保持其仍可動作使用) Clear_LED_Calibration_Regulate = 0x0003, //3 //保留是否校正過紀錄, 並將LED都先清除 LED_Status_Calibration = 0x000c, //bit<3:2>: STATUS //00: reserved LED_Calibration_Succeed = 0x0004, //01: succeed LED_Calibration_Fault = 0x0008, //10: fault LED_Calibration_Process = 0x000c, //11: processing LED_Error_Calibration = 0x0030, //bit<5:4>: ERROR //00: reserved LED_Calibration_Over = 0x0010 , //01: over LED_Calibration_Under = 0x0020, //10: under LED_Calibration_Disconnection = 0x0030, //11: disconnect LED_DNM_Regulate = 0x00c0, //bit<7:6>: REGULATED STATUS //00: reserved LED_DNM_Increase = 0x0040, //01: increase LED_DNM_Decrease= 0x0080, //10: decrease LED_DNM_Inaction = 0x00c0, //11: //=================external 校正燈號=========================== LED_Calibration_Succeed_External = 0x0100, //256 //此為對應到變數值, 非bit LED_Calibration_Fault_External = 0x0200, //512 //此為對應到變數值, 非bit LED_Calibration_Process_External = 0x0300, //768 //記錄是否有在校正, 都用internal的即可 LED_Status_Calibration_External = 0x0300, //bit 8-9值, , 非bit LED_Calibration_Over_External = 0x0400, //1024 //此為對應到變數值, 非bit LED_Calibration_Under_External = 0x0800, //2048 //此為對應到變數值, 非bit LED_Calibration_Disconnection_External = 0x0c00, //3072 LED_Error_Calibration_External = 0x0c00, //bit 10-11值, 非bit //=================for max/min 校正錯誤狀態燈號====================== LED_Calibration_Defect_Internal = 0x2000, //for max / min mode中, 群組內有一顆以上DNM校正未過的問題 LED_Calibration_Defect_External = 0x1000, //for max / min mode中, Clear_LEDCalibrationRegulate_External = 0xe0f3, //3 //保留是否校正過紀錄, 並將LED都先清除 Clear_LEDCalibrationRegulate_Internal = 0xdf03, //0xff03 //保留是否校正過紀錄, 並將LED都先清除 Clear_Regulate_LED = 0xff3f, //0xff3f, 清除Regulate (Response) LED Clear_CalibrationResult = 0xfff0, Clear_CalibrationResult_Except_Record = 0xfff2, Clear_Calibration_Process = 0xfff3, Clear_Flag_Calibration = 0xfffc, //0xfffc, 清除Finish_Calibration_B, Record_Finish_Calibration_B }DNM_Calibration_LED_s; typedef enum { Index_Internal_OutBuf, Index_External_OutBuf, //以目前 Tx.Flag_Calibration 的 bit mask 寫法, 其實只能多一個 amp Num_Amp_Each_Ch = 1, //2 //Index_Zone1_OutBuf, //Index_Zone2_OutBuf, //Index_Zone3_OutBuf, //Index_Zone4_OutBuf, //Index_Zone5_OutBuf, //Index_Zone6_OutBuf, //Index_Zone7_OutBuf, //Index_Zone8_OutBuf, Error_Range_OutBuf = 0xffff, }DNM_Index_Amp; //audio out 對應 amp 位置 typedef struct { uint16_t Set_AP1; uint16_t AR_Time; uint16_t Index_In; //此在DG Mic為收DG Mic聲音 uint16_t Index_Out; uint16_t Sampling_Time; //此收到為ms, IDA8S 與 remote都是收 10ms為單位, 所以還需乘上0.1 給NRT_Tx uint16_t Calibration_LED; //DNM_Calibration_LED_s uint16_t Priority; uint16_t Gap_Time; uint16_t OverNoiseLevel[2]; uint16_t MinGain[2]; //dB //此 ANG與Static(需轉)不同, 在此單位都設為dB, Static需level再轉 uint16_t MaxGain[2]; //dB uint16_t MalfunctionLevel[2]; uint16_t ANG_Level[2]; //level for audio uint16_t Output_Level[2]; //source 經過 level 後的 輸出音量, ANG: LEQo, Static: Output_Level //Old_Sampling_Time_LEQo uint16_t dB_WhiteNoise[2]; //remote告知, 校正時主機輸出的MLS音量 //收到是level, 顯示要轉成dB, 以往給APlevev 其幫轉, 某些產品需要自己轉 uint16_t Th_Noise[2]; //環境音量:ANG使用, 其意義為此此音量為開始動作的門檻值, 等同static AmbientNoise_SPL uint16_t AmbientNoise_SPL[2]; //static 使用 應類似於Th_Noise //Background Noise SPL uint16_t LEQmp_CSensingMic[2]; //有經過空間係數的運算所收集到的能量 uint16_t LEQm_SensingMic[2]; //未經過空間係數的運算所收集到的能量 //static for smooth master mic uint16_t Differential_Level[2]; //E uint16_t Record_Decrease_Setting[2]; //紀錄校正時衰減器的值 uint16_t Record_OverAmbient[2]; uint16_t NumSlave; //需告知 Slave 長度, 可節省AP table 長度 uint16_t NumAmp; uint16_t IndexAmp; }AP_Main_DNM_s; typedef enum { Pre_Gain_MaxLED_B, Pre_Gain_MinLED_B, Clear_Range_Serier_Num = 0x0003, Clear_LowBit = 0xfffc, //最小2 bit清掉 }DNM_Record_Status_s; typedef struct { //將 amp or mode 會導致成員數量增減的部份放在此 uint16_t Record; }Amp_Mode_Struct_s; typedef enum { //==========0~7為Read =========================== LED_Unready_DNM, LED_Ready_DNM, //1 //此為對應到變數值, 非bit LED_Panging_DNM, //2 //此為對應到變數值, 非bit //表示目前音量在active mode LED_Disconnect_DNM, //3 //此為對應到變數值, 非bit /*這兩個不要理它*/ LED_Fail_Calibration_DNM, //4 //此為對應到變數值, 非bit Range_LED_Working_Status = 3, //==========8 以上為write =========================== DG_Mic_ACK_B = 8, // bit 8, MCU 告知DSP DG Mic Ack 正常 LED_Working_Status_Clear = 0xfff0, //bit 0-1值, 非bit }DNM_LED_Working_Status_s; typedef enum { ShiftR_Zone_Bit = 0, ShiftR_MechanicID_Bit = 8, Range_Zone_DNM = 0x00ff, Range_MechanicID_DNM = 0xff00, //relay 控制, Evac, 皆會使用到 }Zone_MechanicID_s; typedef struct { uint16_t IP[2]; //移除remote時此會歸0, 所以用此當有無設定的判斷標準 uint16_t Zone_MechanicID; //low 8: zone, high 8: 機器ID, 1~32 (1為Boutique Master) uint16_t LED_Working_Status; uint16_t SPL_SensingMic[2]; //static 時 for display uint16_t Weight[2]; //無法檢查剛開機狀況, 只能檢查後續變動 uint16_t HwVersion; }AP_Channel_DNM_s; typedef enum { AveAmp0, AveAmp1, //暫只有 Btq用到 MaxMinAmp0, MaxMinAmp1, //暫只有 Btq用到 NumAmpMode, //暫無法修改, 除非 Btq 和 DNM Remote 都要一起修改跟測試 }AmpMode_Index; typedef struct { //此為一個完整的 master AP_Main_DNM_s Main; Amp_Mode_Struct_s ModeAmp[NumAmpMode]; //amp 為複數時會為陣列; init all zero AP_Channel_DNM_s Ch; //slave 的此空間會另外開, 但 JR 應希望加在此後面; init all zero }AP_Master_DNM_s; typedef enum { Trans_Calibration_Mode_B, //0 Shift_ExternalAmp_B = 24, //24 MaxMin_Mode_B = 25, //bit 25(mode max/min) : 0 : ave, 1 : max/min mode Setting_Dynamic_AmbientNoise_B = 27, Shift_Trans_Static_B = 28, ID_BOTIQUE_AMP = 0x00010000, ID_IDA8S = 0x00020000, ID_IDA8C = 0x00030000, ID_IpSpeaker = 0x00040000, //==========Boutique 使用============================ //bit 24-25 : bit 設計如下, 有考慮相容, 不考慮Btq amp擴充 //若Btq 要擴充時, 需考慮增加只有單一邊更新的保護機制或相容機制, 或是為Btq2 整體隔開 //若其他產品要擴充時, 可用產品ID 區格 (ID_Amp_s), 不會受到Btq機制影響 //bit 24(amp) : 0 : internal, 1 : external //bit 25(mode max/min) : 0 : ave, 1 : max/min mode //Internal Ave 為預設值, 需與舊版硬體與軔體相容 ExternalAmp_DNM = 0x01000000, //Index_ExternalAve //external or other internal amp index放在24~27 bit //此index由1開始, 所以要減1使用, 0代表 internal 用 Index_MaxMin_IntAmp = 0x02000000, Index_MaxMin_ExtAmp = 0x03000000, //bit 26 不可直接擴充, 使用至6,7 時會被誤判成mode max/min 開啟 CHECK_INDEX_AMP = 0x07000000, //external or other internal amp index放在24~27 bit //此index由1開始, 所以要減1使用, 0代表 internal 用 CHECK_ID_PRODUCT = 0x00ff0000, //external amp 產品, 需設其ID與external amp index才可使用, ID放在16~23 bit, Setting_Dynamic_AmbientNoise = 0x08000000, Trans_Static_Mode = 0x10000000, //設起為static, 沒設為ang Clear_Static_Mode = 0x6fffffff, // Set_InternalAmp= 0x7effffff, //使用時最好都先清掉再or值 //使用 0xfeffffff 會有此waring: integer conversion resulted in a change of sign //只清bit 24 }NRT_Tx_Flag_Calibration_s; typedef struct { unsigned long Flag_Calibration; unsigned long Sampling_Time; float Old_Sampling_Time_LEQo; float MinGain; float MaxGain; }NRT_Tx_s; typedef enum { DecreaseZone_B, //0 //表示ANG Level 減少 DeadZone_B, //1 //表示ANG Level 沒有更改 StartTransMLS = 6, //6 //bigger than 6 than Btq Start play MLS audio IncreaseZone = 0x000c, //12 //含蓋IncreaseZone and FastIncreaseZone_B //bit2 + bit3 Finish_DNM_Initial_B = 16, //remote 告知有收到校正, 並已完成initial, +6表示收集完背景雜音, 可以開始送白雜訊 LED_Panging_B, //17 Shfit_Response_B, //18 DNM_CALIBRATE_COMM_B = 22, //command use Trans_FaultList_MaxMinMode_B = 23, //when calibration using this bit tell host the falut list of DNM Group in max/min mode, NRT Tx E => Fault list Cnt_Noise_Range = 0x0000ffff, //0~15 bit LED_Response_Range = 0x003c0000, //18~21bit DNM_CALIBRATE_COMM = 0x00400000, //22 bit //command use Trans_FaultList_MaxMinMode = 0x00800000, //23 bit //Trans_FaultList_MaxMinMode Clear_RxInitial_Cnt = 0x7FFE0000, }Set_Rx1_s; typedef enum { Rx_Calibration_Succeed_B, //0 //for FlagCal_Finish_Series Rx_HaveHW_ID_B = 5, //5 //表示為新版硬體, 有辨式碼 Shfit_Num_Cal_Series_B = 18, //18 //=====僅為定義某個值與名稱, 非對應到 bit ===== Successful_Calibration, //just define, 不需在某一位置 Fail_Calibration, //======================================== Rx_Version_110 = 0x00000020, //bit 5設起, 1~4 為0 HW_Version_Range = 0x0000003e, //bit 1 ~ bit5 SeriesNum_Calibration_B = 0x7fffc000, // 0xffffc0000 //18~31bit }Rx_FlagCal_Finish_Series_s; typedef enum { //此會對應到ThLow_TransSPL, ThMid_TransSPL, RatioToSPL, TH_dBA_Inactive, 更改時位置需要一起連動 Version102, //hw102版音頭 //舊版高品質音頭 Version103, //hw103版音頭 //目前量產版音頭 Version110, //hw110 //新版改良 //==============DigiMic ==================== DigiMic102_24dB, //==== 新增的由此後新增, 應有對應到 buf 相對位置============== Version104, //hw103版音頭 //目前量產版音頭 Num_MicVersion, //==============mode====================== dB_To_SPL, SPL_To_dB, Un_Receive_Version = 0xffff, //MidVolume_Trans_Static, }Trans_dBtoSPL_s; typedef struct { unsigned long Set_Rx1; //Noise Cnt: 校正時使用, rmote initial 完後會一直加6, 主機看到大於等於6即可開始送MLS float White_Noise_Level; //Calibration gain //傳給主機, 控制校正時白雜訊輸出音量 unsigned long FlagCal_Finish_Series; float dB_ANG; //控制normal時撥放音量是否要放大或縮小 float Background; //dB float SensingMic_dB; //表示為DNM所收到的頻域能量, ANG為LEQm float LEQmp; //表示為DNM所收到經過校正係數的頻域能量 float E; }NRT_Rx_s; typedef struct { unsigned long Cnt_Sampling_Time; float Old_Sampling_Time_LEQo; //與NRT_Tx_s中的Old_Sampling_Time_LEQo相同 float Last_LEQm; //表示為DNM所收到的頻域能量 float Cnt_Same_LEQm; }NRT_ANG_s; typedef enum { Lower_dBMin_B, //0 //內部辨識要輸出minimum level //收到音量小於 -60 dB }Static_Flag_s; typedef struct { float Rms_Output500ms; //0 float Cnt_ms; //1 float Average_Rms_Output500ms; //2 //25s 平均累加buf //smpt_output_rms float Average_SPL_Output500ms; //3 //將Average_Rms_Output500ms轉成 SPL //smpt_rms_mic_SPL_dB unsigned long Cnt_500ms; //4 // float Last_Sensing_Mic_dB; //5 float Cnt_Same_Sensing_Mic; //6 unsigned long Cnt_WaitSilent; //7 float InactiveSmooth_ANG; //8 //在panging 前決定 "目前環境噪音" - "校正時所取得環境噪音" unsigned long Flag; //9 //內部辨識要輸出minimum level //先將此拿掉便於測試, 之後應要加回 //float MLS_Level; //浮點架構不需要此 float Section_ms; //10 //此次進來的ms float InactiveSmooth_Slave[31]; //float OverAmbient[DNM_MAX_NUM]; }NRT_Static_s; typedef enum { Setting_Evac = 0x00010000, Clear_Evac = 0x0000ffff, Range_Record_Index = 0x0000ffff, Clear_Record_Index = 0xffff0000, }Record_Index_Evac_s; typedef enum { //=====low 16 給開始校正決定使用========= WaitRemoteClose_AC_B = 1, //AC = auto cal StartCal_AC_B, Dead_Remote_B, //認定remote已離線, 結束自動排序 Tell_RemoteClose_AC_B, //=====high 16 給結束校正決定使用========= Finish_ExteranalCal_AC_B= 16, //Finish_MaxMin_External_B, //Finish_InteranalCal_AC_B, //Finish_MaxMin_Internal_B, Series_Calibration_External_Internal, //external 確時有校正, 校正完後需等待一下, 再校正 internal }Flag_AutoCal_s; typedef enum { Collection_Background_Noise = 1, Modify_Gain_Upon_Background, Cal_Coeff_Calibration, Finish_DG_Calibration, }Flag_Cal_Step_s; typedef enum { Setting_Lower_AmbientNoise_B, //0, bit }FlagDG_ANG_s; typedef struct { float Coeff_ANG[((128 >> 1))]; float Gain_Calibration; float dB_Background; unsigned long Flag_SerialNum; }Need_Save_Coeff_s; typedef struct { Need_Save_Coeff_s Store[Num_Amp_Each_Ch]; float Noise_Spectrum_Square; //將雜訊的平譜視為平的, 所以值會一樣 float Mic_Spectrum_Square[((128 >> 1))]; float MS_mp; //對應到 NRT_Temp_buffer.MS_mp (MS_m 用時域算即可) float MS_mp_Smooth; float Cnt_Average_RMS_TIMES; //Average_RMS_TIMES_counter float ms_Start_Panging_TIMES; //剛開始時 主機的 output很小, 會使起始的E值算的很大, 在此將其hold. 過500ms 再動作 float Cnt_Keep_Minims; //如果ANG >0 且 mp 小於1, 維持500ms 降 0.5 (因改善卡住狀況) long FlagDG_ANG; }DG_NRT_ANG_s; typedef struct { //DigiMic NRT 應會近似, static 和 dynamic 都會用到, 所以放在此層 DG_NRT_ANG_s ANG; float ms; //給不同階段計算時間長度使用 float ms_Section; // 這次rt 進來經過多少ms float MS_m_Smooth; float Old_SquareSum; unsigned long Flag_Cal_Step; unsigned long Cnt_Over10dB_Calibration; //確保此音量於穩定狀態時結束校正 unsigned long Cnt_SquareSum; //此cnt 和時間無關, 和 筆數有關 (因其不會將所有 circular buf 資料都取出來) unsigned long Cnt_EnterNRT; }DG_NRT_s; typedef struct { NRT_Tx_s Tx; NRT_Rx_s Rx; NRT_ANG_s ANG; NRT_Static_s Static; DG_NRT_s DG; long Record_Index_Evac; //保護panging 狀態下進行校正動作, 校正完要將此index回復 //high 16 給 Evca紀錄使用 float Regulat_Calibration_Level; //校正level 產生 MLS 的音量與實際square 會有差值(因高低頻能量所引起, 在此將其補嘗) unsigned long Flag_AutoCal; //紀錄狀況, 為使external校正完可切至internal unsigned long HW_DNM_Version; //此為一個master 的硬體版本, 若群組內有舊版DNM, 有些功能會關掉 unsigned long Num_Slave; unsigned long Weight; //目前只先對Master保護, 未來此機制要改, 所以就不在此花太多時間保護Slave unsigned long Fault_List[Num_Amp_Each_Ch]; //max/min mode下校正時, 收到失敗的DNM紀錄 //bit 0放 DNM ID = 1 (master), bit 1 放 DNM ID = 2 }DNM_NRT_s; typedef struct { uint16_t ID_N1; //紀錄 max/min DNM 的 mechine ID NRT_Rx_s *ptrRx; float OverAmbient; float InactiveSmooth; unsigned long IP; }qsortDNM_s; typedef struct { unsigned long IP; unsigned long Port; DNM_NRT_s *ptr_NRT; //舊機制的行為, 在此保留 uint16_t Index; //group index uint16_t Group_HwVersion; //權組內是否都為新版硬體 qsortDNM_s Sort; }DNM_IO_Table_s; typedef enum { //校正時, 都先校正External Amp後, 再校正Internal Amp Finish_CalibrationExternal_ID0B, //0 //對應到MCU為Mechain ID1, 但他們對應的index 皆為0 Finish_CalibrationExternal_ID1B, //1 Finish_CalibrationExternal_ID2B, //2 Finish_CalibrationExternal_ID3B, //3 Finish_CalibrationExternal_ID4B, //4 Finish_CalibrationExternal_ID5B, //5 Finish_CalibrationExternal_ID6B, //6 Finish_CalibrationExternal_ID7B, //7 Finish_CalibrationExternal_ID8B, //8 Finish_CalibrationExternal_ID9B, //9 Finish_CalibrationExternal_ID10B, //10 Finish_CalibrationExternal_ID11B, //11 Finish_CalibrationExternal_ID12B, //12 Finish_CalibrationExternal_ID13B, //13 Finish_CalibrationExternal_ID14B, //14 Finish_CalibrationExternal_ID15B, //15 Finish_CalibrationExternal_ID16B, //16 Finish_CalibrationExternal_ID17B, //17 Finish_CalibrationExternal_ID18B, //18 Finish_CalibrationExternal_ID19B, //19 Finish_CalibrationExternal_ID20B, //20 Finish_CalibrationExternal_ID21B, //21 Finish_CalibrationExternal_ID22B, //22 Finish_CalibrationExternal_ID23B, //23 Finish_CalibrationExternal_ID24B, //24 Finish_CalibrationExternal_ID25B, //25 Finish_CalibrationExternal_ID26B, //26 Finish_CalibrationExternal_ID27B, //27 Finish_CalibrationExternal_ID28B, //28 Finish_CalibrationExternal_ID29B, //29 Finish_CalibrationExternal_ID30B, //30 Finish_CalibrationExternal_ID31B, //31 }Record_Finish_Calibration_External_Amp_s; typedef enum { Arrange_Calibtation_On_B, //0 //此有設起DNM權組才會進行校正, 如果auto arrange開起, 校正全部時, 會輪流校正 Relay_Calibtation_On_B, //1 //紀錄給 relay目前有某1個DNM正在校正 Record_Pre_Status_AC_B, //2 //AC: Arrange Calibration Using_ExternalAmp_AC_B, //3 //未設起就是使用internal Error_Index_Amp_AC_B, //4 //所給輸出index 錯誤 Interrupt_DSP_NRT_B, //5 //DNM NRT 執行到未完整, 跳至另一執行序 //用此保護持續監測cnt, 避免未屬完整進入其他中斷, 導致錯誤 //目前priority 設定相同, 應不會有此狀況 //MaxMin_Calibration_B, //6 //進行 masx/ min mode 校正 Shift_StoreZone_MechanicID_B = 16, //16 Clear_ZoneMechanicID_Range = 0x0000ffff, //最高bit 設起會有waring, 目前設定是最高32, 所以不會用到最高bit Zone_MechanicID_AC_Range = 0x7fff0000u, //最高bit 設起會有waring, 目前設定是最高32, 所以不會用到最高bit }DNM_Control_Flag_s; typedef enum { //給UI使用, 所以從UI角度來寫Rx, Tx //===============Rx From DSP ======================== Receive_DSP_Cal_Progressing, Receive_DNM_HwVersion, //===============Tx To DSP======================== TransTo_DSP_Stop_All_Calibration, TransIP_MaxMinMode, }Communication_DSP_with_UI_s; typedef enum //DSP使用, 從DSP角度寫 Rx, TX { //皆為bit 展開, 請用 or 加入, and 清掉 Stop_All_Calibration = 1, //1 Clear_Stop_All_Calibration = 0xfffe, //收到後, DSP去清掉 }Rx_From_UI_DMA_Control; typedef enum { //DSP使用, 從DSP角度寫 Rx, TX Progressing_Calibration = 1, //1 //設起時請檔住校正按鈕, 清掉才可按 Group_Version110, //2 此DNM Group Version 為 110, 此時才可做 DNM Manual Setting and DNM Static Mode Clear_Progressing_Calibration = 0xfffe, //DSP校正完後會自行清掉 }Tx_To_UI_DMA_Control; typedef struct { unsigned long Flag; //arrange DNM, panging control, store error index //unsigned long MaxMinMode_FinishCalibration; //對應到Mechain ID 0~ 31, 有校正過就將其標起 unsigned long ExternalAmp_FinishCalibration; //對應到Mechain ID 0~ 31, 有校正過就將其標起 unsigned long Initialize_Status3; unsigned short PrepareCheck_DNM_HwGroupVersion; //如果 master 與 slave 都有收到, 就將其 group bit 設起 (從0開始) unsigned short Status_MCU_Receive; unsigned short Status_MasterReceive; unsigned short Status_SlaveReceive; unsigned short Rx_From_UI; unsigned short Tx_To_UI; unsigned short Cnt_Componenet; //DNM_Componenet_counter; }DNM_Control_s; typedef struct { //此段記錄跟著DNM index, 而非zone (remote移除目前zone不會移除, 所以跟著index標記較單純) uint16_t Priority[1]; uint16_t Calibration[Num_Amp_Each_Ch]; uint16_t Evac[Num_Amp_Each_Ch]; uint16_t Panging_Amp_B[Num_Amp_Each_Ch]; //分別紀錄使用此amp 的是那幾個 DNM使用 uint16_t Control_Amp_Index[Num_Amp_Each_Ch]; //紀錄控制此amp 的 DNM是那一個 uint16_t Record_Control_Index[Num_Amp_Each_Ch]; //針對Evac 搶完時, 回復成被搶的優先權 unsigned long CommandNum_RT[Num_Amp_Each_Ch]; //最多只能執行兩個RT }DNM_RT_Arrange_Execution_s; typedef struct { //MCU 將 slave 資訊告知 long Status; //依bit 設起, 設起表示通訊正常, 0表示已斷線 long Status_RxNRT; //slave 收到 NRT Rx 的有幾個 unsigned short Num; //此group 有幾個Slave unsigned short HwVersion[31]; //DNM mechine ID : 1 2 3 4 ..... //bit 位置 : 0 1 2 3 ..... (ID N1) //Slave 存放位置 : x 0 1 2 ..... (mcu 存到 dsp [Reveice_MCU_SlaveDNM_Information_s] 裡面index unsigned short ID_N1[31]; //DNM mechine ID -1 的值, 會對應到ptr_NRT-> Fault_List[] 所放的 bit 位置處 NRT_Rx_s Rx[32]; }Reveice_MCU_SlaveDNM_Information_s; extern AP_Master_DNM_s AP_DNM[1]; extern DNM_NRT_s DNM_NRT[1]; extern DNM_RT_Arrange_Execution_s DNM_RT_Arrange; extern AP_Channel_DNM_s DNM_Slave[1][32]; extern void WriteElement_DNM(int IP, DNM_E_s ID, unsigned short * value, unsigned short Flag); extern AP_Master_DNM_s* ReadElement_DNM_M(int IP); extern AP_Channel_DNM_s* ReadElement_DNM_S(int IP); extern DNM_IO_Table_s DSP_DNM_IO_Table[1]; extern DNM_Control_s DNM_Control; extern float DNM_8kHz_LP_Filter_Coeff[5]; extern float DNM_12kHz_LP_Filter_Coeff[5]; extern float DG_800_9kHz_BP_Fs48k_Coeff[5]; extern float DG_450_8kHz_BP_Fs48k_Coeff[5]; extern float BufZero[64]; extern Reveice_MCU_SlaveDNM_Information_s SlaveDNM_Information[1]; extern void Clear_FaultListDNM(int IP, DNM_NRT_s *ptrNRT); extern void Receive_FaultListDNM(int IP, DNM_NRT_s *ptrNRT); extern void Initial_DNM_IO(AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT, DNM_IO_Table_s *ptr_IO); extern void Setting_MaxMinMode_TxNRT_NormalMode(AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern float Trans_dB_Between_SPL(float dB, Trans_dBtoSPL_s HW_Version, Trans_dBtoSPL_s mode); extern void DNM_NRT_Function(void); extern void RT_DNM_Function(void); extern void Changing_RelayForDNM_Calibration(void); extern void AutoArrange_CalibrationDNM(AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT, uint16_t situationCal_DNM, uint16_t index); extern void Stop_DNM_Working( AP_Master_DNM_s *ptr_AP, Smooth_Cal_s *ptr_RT); extern void Under_DNM_Calibration(int IP, AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern void Over_DNM_Calibration(int IP, AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern void SucceedCalibration_DNM(int IP, AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern void Stuck_DNM_Calibration(int IP, AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern void FlagLED_SettingDNM( AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT, Smooth_Cal_s *ptr_RT, uint16_t led_old); extern void Protect_Mode_Change( AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT, DNM_IO_Table_s *ptrIO, unsigned long ptr_NumRT, unsigned long NumRT); extern void Reset_DNM_Calibration( AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern char Calibration_AmpMode_Check(AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern void Regulat_Calibration_Level_Function( AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT, float *RT_Square_Sum, unsigned long *Cnt); extern void Initial_DG_Calibration(DNM_NRT_s *ptr_NRT, unsigned long *Cnt_Data_Collect); //extern void FFT_Trans_Cal_Energy_DG( Complex_s *out, DNM_NRT_s *ptr_NRT, uint16_t index_DG); extern void Recieve_DigiMic_TDM(void); extern void RemoteDG_Calibration_Progress( AP_Master_DNM_s *ptr_AP, DNM_NRT_s *ptr_NRT); extern unsigned long Communication_DSP_with_UI(DNM_Control_s *ptr_ctrl, Communication_DSP_with_UI_s mode, uint16_t flag); //flag 擴充使用, 填0 extern uint16_t Detect_Remote_Rx_DG(AP_Master_DNM_s *ptr_AP, float *old_level_ANG, float *db_regulate); extern float Manual_Setting; extern float Manual_Setting_dB; extern uint16_t Flag_Manual_Setting; extern uint16_t Record_LED_Working_Status[1]; extern uint16_t Detect_DNM_HwGroupVersion(DNM_Control_s *ptr_ctrl, DNM_NRT_s *ptr_NRT, AP_Channel_DNM_s *ptr_slave, uint16_t index); extern uint16_t Receive_Remote_HwVersion(uint16_t Rx_HwVersion); extern void Set_AudioLine_DNM(void); /* * Hi_LoPass_PEQ.h * * Created on: 2016年5月19日 * Author: Owner */ typedef struct { unsigned short NRTPara_PresetStatus; unsigned short NRTPara_PresetLength; unsigned short NRTPara_MasterPresetLength; unsigned short NRTPara_PresetVersion; unsigned short NRTPara_MachineLicense; unsigned short NRTPara_MachineID; unsigned short NRTPara_AudioBoardTable[2]; unsigned short NRTPara_PresetHeaderReserve1[2]; unsigned short NRTPara_MasterPresetNo; unsigned short NRTPara_SubPresetNo; unsigned short NRTPara_AudioBoardInfo; unsigned short NRTPara_LVDSMode; unsigned short NRTPara_SamplingRate; unsigned short NRTPara_SubPresetNumber; unsigned short NRTPara_TotalNetBufferIn; unsigned short NRTPara_TotalNetBufferOut; unsigned short NRTPara_TotalPPMIn; unsigned short NRTPara_TotalPPMOut; unsigned short NRTPara_GlobalChannelNum;//NRTPara_APInfoOffset unsigned short NRTPara_MasterPresetParaOffset; unsigned short NRTPara_PresetHeaderReserve[12]; unsigned short parameter_table[27000]; }Preset_table; typedef enum { Ch0_DSP, //0 Ch1_DSP, //1 }Channel_DSP_s; typedef enum { EQ_Modify, //0 HiLoPass_PEQ_Modify, //1 Num_Modify, //2 }ID_Modify; typedef struct { Message_AP_s Message; UDP_RX_AP_s UDP_Rx; AP_New_Input_Struct Input_DSP[NUM_DSP_INPUT]; AP_Rx_VOIP_s VOIP_Rx; AP_LR_Selector_s LR_Selector; AGC_AP_s AGC[NUM_DSP_AGC]; AP_HwAGC HWAGC; AP_PEQ_Struct PEQ[NUM_DSP_PEQ]; Filter_AP_s Filter[NUM_DSP_Filter]; AP_AEC_s AEC; NS_AP_s NS; AP_SPC_s SPC; Ducker_Stereo_AP_s Ducker; AP_Tx_VOIP_s VOIP_Tx; AP_New_Output_Struct Output_DSP[NUM_DSP_OUTPUT]; VoiceGate_AP_s VoiceGate; HiLoPass_PEQ_AP_s HiLoPass_PEQ[NUM_DSP_FilterPEQ]; Gate_Mono_AP_s Gate; AP_AND_Compliter_Limiter_Expander_s Compressor_Limiter; }DSP_AP_Table_v1; typedef struct { Message_AP_s Message; UDP_RX_AP_s UDP_Rx; AP_New_Input_Struct Input_DSP[NUM_DSP_INPUT]; AP_Rx_VOIP_s VOIP_Rx; AP_LR_Selector_s LR_Selector; AGC_AP_s AGC[NUM_DSP_AGC]; AP_HwAGC HWAGC; AP_PEQ_Struct PEQ[NUM_DSP_PEQ]; Filter_AP_s Filter[NUM_DSP_Filter]; AP_AEC_s AEC; NS_AP_s NS; AP_SPC_s SPC; Ducker_Stereo_AP_s Ducker; AP_Tx_VOIP_s VOIP_Tx; AP_New_Output_Struct Output_DSP[NUM_DSP_OUTPUT]; VoiceGate_AP_s VoiceGate; HiLoPass_PEQ_AP_s HiLoPass_PEQ[NUM_DSP_FilterPEQ]; Gate_Mono_AP_s Gate; AP_AND_Compliter_Limiter_Expander_s Compressor_Limiter; }DSP_AP_Table_v2; typedef struct { /*version1 and version2 are the same*/ Message_AP_s Message; UDP_RX_AP_s UDP_Rx; AP_New_Input_Struct Input_DSP[NUM_DSP_INPUT]; AP_Rx_VOIP_s VOIP_Rx; AP_LR_Selector_s LR_Selector; AGC_AP_s AGC[NUM_DSP_AGC]; AP_HwAGC HWAGC; AP_PEQ_Struct PEQ[NUM_DSP_PEQ]; Filter_AP_s Filter[NUM_DSP_Filter]; AP_AEC_s AEC; NS_AP_s NS; AP_SPC_s SPC; Ducker_Stereo_AP_s Ducker; AP_Tx_VOIP_s VOIP_Tx; AP_New_Output_Struct Output_DSP[NUM_DSP_OUTPUT]; VoiceGate_AP_s VoiceGate; HiLoPass_PEQ_AP_s HiLoPass_PEQ[NUM_DSP_FilterPEQ]; Gate_Mono_AP_s Gate; AP_AND_Compliter_Limiter_Expander_s Compressor_Limiter; /*verson 3*/ AP_Master_DNM_s DNM; }DSP_AP_Table_v3; typedef struct { NRT_Temp_New_Input_Struct Input_DSP[NUM_DSP_INPUT]; AGC_NRT_Temp_s AGC[NUM_DSP_AGC]; HWAGC_NRT_Temp_s HWAGC; NRT_PEQ_Struct PEQ[NUM_DSP_PEQ]; NRT_FILTER_HiLo_Struct Filter[NUM_DSP_Filter]; NRT_SPC_s SPC; Ducker_NRT_Temp_s Ducker; NRT_Temp_New_Output_Struct Output_DSP[NUM_DSP_OUTPUT]; NRT_PEQ_HiLo_Struct HiLoPass_PEQ[NUM_DSP_FilterPEQ]; NRT_AEC_s AEC; Gate_Mono_temp_CH_NRT_s Gate; }DSP_NRT_Temp_s; extern void (*NRT_Funtion_Table[131])(void); extern void NRT_Process(void); extern DSP_AP_Table_v3 AP_Table_DSP; extern DSP_NRT_Temp_s NRT_Temp_DSP; extern Preset_table sPreset_table; extern unsigned short *ptr_parameter_table, *ptr_NRT_parameter; extern float NRT_Temp_Buffer[10000]; extern float *ptr_NRT_Temp_Buffer; extern int *ptr_Transfer_temp; extern float Transfer_temp; extern unsigned short *DSP_Chip_Table_Ptr; extern void NRTProcessor_SetModifyFunction(ID_Modify Index, long ch); extern void Set_All_Modify(void); extern void Set_AudioLine_HiLoPass_PEQ(void); extern long Modify_Function[Num_Modify]; typedef struct DNMChannel_t DNMChannel_t; DNMChannel_t* DNMChannel_New(void); float DNMChannel_GetSensingMICLevel(DNMChannel_t* element); uint8_t DNMChannel_GetWorkState(DNMChannel_t* element); typedef enum { //product dsp PICU_DSP_INPUT_MIC = 0, //product dsp }UI_DSP_COMPONENT_e; typedef enum { UI_DSP_INPUT = 0, UI_DSP_OUTPUT, UI_DSP_PEQ, UI_DSP_PEQ_HI_LO_PASS, UI_DSP_HI_LO_PASS, UI_DSP_AGC, UI_DSP_AEC, UI_DSP_STANDARD_MIXER, }UI_DSP_COMPONENT_TYPE_e; typedef enum { UI_DSP_E_INPUT_SINGAL = 0, UI_DSP_E_OUTPUT_SINGAL, UI_DSP_E_MUTE, UI_DSP_E_BYPASS, UI_DSP_E_OVERLOAD_SINGAL, UI_DSP_E_OVERLOAD_THRESHOLD, UI_DSP_E_LEVEL, UI_DSP_E_VOLUME, // UI_DSP_E_NON_LINEAR_PROCESSING, UI_DSP_E_ECHO_SINGAL, UI_DSP_E_TALK_SINGAL, UI_DSP_E_ERLE, UI_DSP_E_FAR_END_VOLUME, UI_DSP_E_NEAR_END_VOLUME, UI_DSP_E_AEC_COEFFICIENT, UI_DSP_E_MICROPHONE_THRESHOLD, // UI_DSP_E_ACTIVE, UI_DSP_E_SAMPLING_TIME, UI_DSP_E_THRESHOLD, UI_DSP_E_ATTACT_TIME, UI_DSP_E_RELEASE_TIME, UI_DSP_E_TARGT_LEVEL, UI_DSP_E_MAX_GAIN, UI_DSP_E_AGC_GAIN, // UI_DSP_E_ALL_BYPASS, UI_DSP_E_EQ_BYPASS_1, UI_DSP_E_EQ_BYPASS_2, UI_DSP_E_EQ_BYPASS_3, UI_DSP_E_EQ_BYPASS_4, UI_DSP_E_EQ_FREQUENCE_1, UI_DSP_E_EQ_FREQUENCE_2, UI_DSP_E_EQ_FREQUENCE_3, UI_DSP_E_EQ_FREQUENCE_4, UI_DSP_E_EQ_BANDWIDTH_1, UI_DSP_E_EQ_BANDWIDTH_2, UI_DSP_E_EQ_BANDWIDTH_3, UI_DSP_E_EQ_BANDWIDTH_4, UI_DSP_E_EQ_GAIN_1, UI_DSP_E_EQ_GAIN_2, UI_DSP_E_EQ_GAIN_3, UI_DSP_E_EQ_GAIN_4, // UI_DSP_E_EQ_HI_PASS_SLOP, UI_DSP_E_EQ_HI_PASS_MODE, UI_DSP_E_EQ_HI_PASS_BYPASS, UI_DSP_E_EQ_HI_PASS_FREQ, UI_DSP_E_EQ_LO_PASS_SLOP, UI_DSP_E_EQ_LO_PASS_MODE, UI_DSP_E_EQ_LO_PASS_BYPASS, UI_DSP_E_EQ_LO_PASS_FREQ, // UI_DSP_E_HI_LO_PASS_TYPE, UI_DSP_E_HI_LO_PASS_MODE, UI_DSP_E_HI_LO_PASS_BYPASS, UI_DSP_E_HI_LO_PASS_MUTE, UI_DSP_E_HI_LO_PASS_SLOPE, UI_DSP_E_HI_LO_PASS_FREQ, UI_DSP_E_HI_LO_PASS_LEVEL, // UI_DSP_STAND_MIXER_IN_MUTE_1,// UI_DSP_STAND_MIXER_IN_MUTE_2, UI_DSP_STAND_MIXER_IN_MUTE_3, UI_DSP_STAND_MIXER_IN_MUTE_4, UI_DSP_STAND_MIXER_IN_MUTE_5, UI_DSP_STAND_MIXER_IN_MUTE_6, UI_DSP_STAND_MIXER_IN_MUTE_7, UI_DSP_STAND_MIXER_IN_MUTE_8, UI_DSP_STAND_MIXER_IN_MUTE_9, UI_DSP_STAND_MIXER_IN_MUTE_10, UI_DSP_STAND_MIXER_IN_MUTE_11, UI_DSP_STAND_MIXER_IN_MUTE_12, UI_DSP_STAND_MIXER_IN_MUTE_13, UI_DSP_STAND_MIXER_IN_MUTE_14, UI_DSP_STAND_MIXER_IN_MUTE_15, UI_DSP_STAND_MIXER_IN_MUTE_16, UI_DSP_STAND_MIXER_IN_LEVEL_1,// UI_DSP_STAND_MIXER_IN_LEVEL_2, UI_DSP_STAND_MIXER_IN_LEVEL_3, UI_DSP_STAND_MIXER_IN_LEVEL_4, UI_DSP_STAND_MIXER_IN_LEVEL_5, UI_DSP_STAND_MIXER_IN_LEVEL_6, UI_DSP_STAND_MIXER_IN_LEVEL_7, UI_DSP_STAND_MIXER_IN_LEVEL_8, UI_DSP_STAND_MIXER_IN_LEVEL_9, UI_DSP_STAND_MIXER_IN_LEVEL_10, UI_DSP_STAND_MIXER_IN_LEVEL_11, UI_DSP_STAND_MIXER_IN_LEVEL_12, UI_DSP_STAND_MIXER_IN_LEVEL_13, UI_DSP_STAND_MIXER_IN_LEVEL_14, UI_DSP_STAND_MIXER_IN_LEVEL_15, UI_DSP_STAND_MIXER_IN_LEVEL_16, UI_DSP_STAND_MIXER_OUT_MUTE_1,// UI_DSP_STAND_MIXER_OUT_MUTE_2, UI_DSP_STAND_MIXER_OUT_MUTE_3, UI_DSP_STAND_MIXER_OUT_MUTE_4, UI_DSP_STAND_MIXER_OUT_MUTE_5, UI_DSP_STAND_MIXER_OUT_MUTE_6, UI_DSP_STAND_MIXER_OUT_MUTE_7, UI_DSP_STAND_MIXER_OUT_MUTE_8, UI_DSP_STAND_MIXER_OUT_MUTE_9, UI_DSP_STAND_MIXER_OUT_MUTE_10, UI_DSP_STAND_MIXER_OUT_MUTE_11, UI_DSP_STAND_MIXER_OUT_MUTE_12, UI_DSP_STAND_MIXER_OUT_MUTE_13, UI_DSP_STAND_MIXER_OUT_MUTE_14, UI_DSP_STAND_MIXER_OUT_MUTE_15, UI_DSP_STAND_MIXER_OUT_MUTE_16, UI_DSP_STAND_MIXER_OUT_LEVEL_1,// UI_DSP_STAND_MIXER_OUT_LEVEL_2, UI_DSP_STAND_MIXER_OUT_LEVEL_3, UI_DSP_STAND_MIXER_OUT_LEVEL_4, UI_DSP_STAND_MIXER_OUT_LEVEL_5, UI_DSP_STAND_MIXER_OUT_LEVEL_6, UI_DSP_STAND_MIXER_OUT_LEVEL_7, UI_DSP_STAND_MIXER_OUT_LEVEL_8, UI_DSP_STAND_MIXER_OUT_LEVEL_9, UI_DSP_STAND_MIXER_OUT_LEVEL_10, UI_DSP_STAND_MIXER_OUT_LEVEL_11, UI_DSP_STAND_MIXER_OUT_LEVEL_12, UI_DSP_STAND_MIXER_OUT_LEVEL_13, UI_DSP_STAND_MIXER_OUT_LEVEL_14, UI_DSP_STAND_MIXER_OUT_LEVEL_15, UI_DSP_STAND_MIXER_OUT_LEVEL_16, UI_DSP_STAND_MIXER_EN_IN1_OUT1,// UI_DSP_STAND_MIXER_EN_IN1_OUT2, UI_DSP_STAND_MIXER_EN_IN1_OUT3, UI_DSP_STAND_MIXER_EN_IN1_OUT4, UI_DSP_STAND_MIXER_EN_IN1_OUT5, UI_DSP_STAND_MIXER_EN_IN1_OUT6, UI_DSP_STAND_MIXER_EN_IN1_OUT7, UI_DSP_STAND_MIXER_EN_IN1_OUT8, UI_DSP_STAND_MIXER_EN_IN1_OUT9, UI_DSP_STAND_MIXER_EN_IN1_OUT10, UI_DSP_STAND_MIXER_EN_IN1_OUT11, UI_DSP_STAND_MIXER_EN_IN1_OUT12, UI_DSP_STAND_MIXER_EN_IN1_OUT13, UI_DSP_STAND_MIXER_EN_IN1_OUT14, UI_DSP_STAND_MIXER_EN_IN1_OUT15, UI_DSP_STAND_MIXER_EN_IN1_OUT16, UI_DSP_STAND_MIXER_EN_IN2_OUT1,// UI_DSP_STAND_MIXER_EN_IN2_OUT2, UI_DSP_STAND_MIXER_EN_IN2_OUT3, UI_DSP_STAND_MIXER_EN_IN2_OUT4, UI_DSP_STAND_MIXER_EN_IN2_OUT5, UI_DSP_STAND_MIXER_EN_IN2_OUT6, UI_DSP_STAND_MIXER_EN_IN2_OUT7, UI_DSP_STAND_MIXER_EN_IN2_OUT8, UI_DSP_STAND_MIXER_EN_IN2_OUT9, UI_DSP_STAND_MIXER_EN_IN2_OUT10, UI_DSP_STAND_MIXER_EN_IN2_OUT11, UI_DSP_STAND_MIXER_EN_IN2_OUT12, UI_DSP_STAND_MIXER_EN_IN2_OUT13, UI_DSP_STAND_MIXER_EN_IN2_OUT14, UI_DSP_STAND_MIXER_EN_IN2_OUT15, UI_DSP_STAND_MIXER_EN_IN2_OUT16, UI_DSP_STAND_MIXER_EN_IN3_OUT1,// UI_DSP_STAND_MIXER_EN_IN3_OUT2, UI_DSP_STAND_MIXER_EN_IN3_OUT3, UI_DSP_STAND_MIXER_EN_IN3_OUT4, UI_DSP_STAND_MIXER_EN_IN3_OUT5, UI_DSP_STAND_MIXER_EN_IN3_OUT6, UI_DSP_STAND_MIXER_EN_IN3_OUT7, UI_DSP_STAND_MIXER_EN_IN3_OUT8, UI_DSP_STAND_MIXER_EN_IN3_OUT9, UI_DSP_STAND_MIXER_EN_IN3_OUT10, UI_DSP_STAND_MIXER_EN_IN3_OUT11, UI_DSP_STAND_MIXER_EN_IN3_OUT12, UI_DSP_STAND_MIXER_EN_IN3_OUT13, UI_DSP_STAND_MIXER_EN_IN3_OUT14, UI_DSP_STAND_MIXER_EN_IN3_OUT15, UI_DSP_STAND_MIXER_EN_IN3_OUT16, UI_DSP_STAND_MIXER_EN_IN4_OUT1,// UI_DSP_STAND_MIXER_EN_IN4_OUT2, UI_DSP_STAND_MIXER_EN_IN4_OUT3, UI_DSP_STAND_MIXER_EN_IN4_OUT4, UI_DSP_STAND_MIXER_EN_IN4_OUT5, UI_DSP_STAND_MIXER_EN_IN4_OUT6, UI_DSP_STAND_MIXER_EN_IN4_OUT7, UI_DSP_STAND_MIXER_EN_IN4_OUT8, UI_DSP_STAND_MIXER_EN_IN4_OUT9, UI_DSP_STAND_MIXER_EN_IN4_OUT10, UI_DSP_STAND_MIXER_EN_IN4_OUT11, UI_DSP_STAND_MIXER_EN_IN4_OUT12, UI_DSP_STAND_MIXER_EN_IN4_OUT13, UI_DSP_STAND_MIXER_EN_IN4_OUT14, UI_DSP_STAND_MIXER_EN_IN4_OUT15, UI_DSP_STAND_MIXER_EN_IN4_OUT16, UI_DSP_STAND_MIXER_EN_IN5_OUT1,// UI_DSP_STAND_MIXER_EN_IN5_OUT2, UI_DSP_STAND_MIXER_EN_IN5_OUT3, UI_DSP_STAND_MIXER_EN_IN5_OUT4, UI_DSP_STAND_MIXER_EN_IN5_OUT5, UI_DSP_STAND_MIXER_EN_IN5_OUT6, UI_DSP_STAND_MIXER_EN_IN5_OUT7, UI_DSP_STAND_MIXER_EN_IN5_OUT8, UI_DSP_STAND_MIXER_EN_IN5_OUT9, UI_DSP_STAND_MIXER_EN_IN5_OUT10, UI_DSP_STAND_MIXER_EN_IN5_OUT11, UI_DSP_STAND_MIXER_EN_IN5_OUT12, UI_DSP_STAND_MIXER_EN_IN5_OUT13, UI_DSP_STAND_MIXER_EN_IN5_OUT14, UI_DSP_STAND_MIXER_EN_IN5_OUT15, UI_DSP_STAND_MIXER_EN_IN5_OUT16, UI_DSP_STAND_MIXER_EN_IN6_OUT1,// UI_DSP_STAND_MIXER_EN_IN6_OUT2, UI_DSP_STAND_MIXER_EN_IN6_OUT3, UI_DSP_STAND_MIXER_EN_IN6_OUT4, UI_DSP_STAND_MIXER_EN_IN6_OUT5, UI_DSP_STAND_MIXER_EN_IN6_OUT6, UI_DSP_STAND_MIXER_EN_IN6_OUT7, UI_DSP_STAND_MIXER_EN_IN6_OUT8, UI_DSP_STAND_MIXER_EN_IN6_OUT9, UI_DSP_STAND_MIXER_EN_IN6_OUT10, UI_DSP_STAND_MIXER_EN_IN6_OUT11, UI_DSP_STAND_MIXER_EN_IN6_OUT12, UI_DSP_STAND_MIXER_EN_IN6_OUT13, UI_DSP_STAND_MIXER_EN_IN6_OUT14, UI_DSP_STAND_MIXER_EN_IN6_OUT15, UI_DSP_STAND_MIXER_EN_IN6_OUT16, UI_DSP_STAND_MIXER_EN_IN7_OUT1,// UI_DSP_STAND_MIXER_EN_IN7_OUT2, UI_DSP_STAND_MIXER_EN_IN7_OUT3, UI_DSP_STAND_MIXER_EN_IN7_OUT4, UI_DSP_STAND_MIXER_EN_IN7_OUT5, UI_DSP_STAND_MIXER_EN_IN7_OUT6, UI_DSP_STAND_MIXER_EN_IN7_OUT7, UI_DSP_STAND_MIXER_EN_IN7_OUT8, UI_DSP_STAND_MIXER_EN_IN7_OUT9, UI_DSP_STAND_MIXER_EN_IN7_OUT10, UI_DSP_STAND_MIXER_EN_IN7_OUT11, UI_DSP_STAND_MIXER_EN_IN7_OUT12, UI_DSP_STAND_MIXER_EN_IN7_OUT13, UI_DSP_STAND_MIXER_EN_IN7_OUT14, UI_DSP_STAND_MIXER_EN_IN7_OUT15, UI_DSP_STAND_MIXER_EN_IN7_OUT16, UI_DSP_STAND_MIXER_EN_IN8_OUT1,// UI_DSP_STAND_MIXER_EN_IN8_OUT2, UI_DSP_STAND_MIXER_EN_IN8_OUT3, UI_DSP_STAND_MIXER_EN_IN8_OUT4, UI_DSP_STAND_MIXER_EN_IN8_OUT5, UI_DSP_STAND_MIXER_EN_IN8_OUT6, UI_DSP_STAND_MIXER_EN_IN8_OUT7, UI_DSP_STAND_MIXER_EN_IN8_OUT8, UI_DSP_STAND_MIXER_EN_IN8_OUT9, UI_DSP_STAND_MIXER_EN_IN8_OUT10, UI_DSP_STAND_MIXER_EN_IN8_OUT11, UI_DSP_STAND_MIXER_EN_IN8_OUT12, UI_DSP_STAND_MIXER_EN_IN8_OUT13, UI_DSP_STAND_MIXER_EN_IN8_OUT14, UI_DSP_STAND_MIXER_EN_IN8_OUT15, UI_DSP_STAND_MIXER_EN_IN8_OUT16, UI_DSP_STAND_MIXER_EN_IN9_OUT1,// UI_DSP_STAND_MIXER_EN_IN9_OUT2, UI_DSP_STAND_MIXER_EN_IN9_OUT3, UI_DSP_STAND_MIXER_EN_IN9_OUT4, UI_DSP_STAND_MIXER_EN_IN9_OUT5, UI_DSP_STAND_MIXER_EN_IN9_OUT6, UI_DSP_STAND_MIXER_EN_IN9_OUT7, UI_DSP_STAND_MIXER_EN_IN9_OUT8, UI_DSP_STAND_MIXER_EN_IN9_OUT9, UI_DSP_STAND_MIXER_EN_IN9_OUT10, UI_DSP_STAND_MIXER_EN_IN9_OUT11, UI_DSP_STAND_MIXER_EN_IN9_OUT12, UI_DSP_STAND_MIXER_EN_IN9_OUT13, UI_DSP_STAND_MIXER_EN_IN9_OUT14, UI_DSP_STAND_MIXER_EN_IN9_OUT15, UI_DSP_STAND_MIXER_EN_IN9_OUT16, UI_DSP_STAND_MIXER_EN_IN10_OUT1,// UI_DSP_STAND_MIXER_EN_IN10_OUT2, UI_DSP_STAND_MIXER_EN_IN10_OUT3, UI_DSP_STAND_MIXER_EN_IN10_OUT4, UI_DSP_STAND_MIXER_EN_IN10_OUT5, UI_DSP_STAND_MIXER_EN_IN10_OUT6, UI_DSP_STAND_MIXER_EN_IN10_OUT7, UI_DSP_STAND_MIXER_EN_IN10_OUT8, UI_DSP_STAND_MIXER_EN_IN10_OUT9, UI_DSP_STAND_MIXER_EN_IN10_OUT10, UI_DSP_STAND_MIXER_EN_IN10_OUT11, UI_DSP_STAND_MIXER_EN_IN10_OUT12, UI_DSP_STAND_MIXER_EN_IN10_OUT13, UI_DSP_STAND_MIXER_EN_IN10_OUT14, UI_DSP_STAND_MIXER_EN_IN10_OUT15, UI_DSP_STAND_MIXER_EN_IN10_OUT16, UI_DSP_STAND_MIXER_EN_IN11_OUT1,// UI_DSP_STAND_MIXER_EN_IN11_OUT2, UI_DSP_STAND_MIXER_EN_IN11_OUT3, UI_DSP_STAND_MIXER_EN_IN11_OUT4, UI_DSP_STAND_MIXER_EN_IN11_OUT5, UI_DSP_STAND_MIXER_EN_IN11_OUT6, UI_DSP_STAND_MIXER_EN_IN11_OUT7, UI_DSP_STAND_MIXER_EN_IN11_OUT8, UI_DSP_STAND_MIXER_EN_IN11_OUT9, UI_DSP_STAND_MIXER_EN_IN11_OUT10, UI_DSP_STAND_MIXER_EN_IN11_OUT11, UI_DSP_STAND_MIXER_EN_IN11_OUT12, UI_DSP_STAND_MIXER_EN_IN11_OUT13, UI_DSP_STAND_MIXER_EN_IN11_OUT14, UI_DSP_STAND_MIXER_EN_IN11_OUT15, UI_DSP_STAND_MIXER_EN_IN11_OUT16, UI_DSP_STAND_MIXER_EN_IN12_OUT1,// UI_DSP_STAND_MIXER_EN_IN12_OUT2, UI_DSP_STAND_MIXER_EN_IN12_OUT3, UI_DSP_STAND_MIXER_EN_IN12_OUT4, UI_DSP_STAND_MIXER_EN_IN12_OUT5, UI_DSP_STAND_MIXER_EN_IN12_OUT6, UI_DSP_STAND_MIXER_EN_IN12_OUT7, UI_DSP_STAND_MIXER_EN_IN12_OUT8, UI_DSP_STAND_MIXER_EN_IN12_OUT9, UI_DSP_STAND_MIXER_EN_IN12_OUT10, UI_DSP_STAND_MIXER_EN_IN12_OUT11, UI_DSP_STAND_MIXER_EN_IN12_OUT12, UI_DSP_STAND_MIXER_EN_IN12_OUT13, UI_DSP_STAND_MIXER_EN_IN12_OUT14, UI_DSP_STAND_MIXER_EN_IN12_OUT15, UI_DSP_STAND_MIXER_EN_IN12_OUT16, UI_DSP_STAND_MIXER_EN_IN13_OUT1,// UI_DSP_STAND_MIXER_EN_IN13_OUT2, UI_DSP_STAND_MIXER_EN_IN13_OUT3, UI_DSP_STAND_MIXER_EN_IN13_OUT4, UI_DSP_STAND_MIXER_EN_IN13_OUT5, UI_DSP_STAND_MIXER_EN_IN13_OUT6, UI_DSP_STAND_MIXER_EN_IN13_OUT7, UI_DSP_STAND_MIXER_EN_IN13_OUT8, UI_DSP_STAND_MIXER_EN_IN13_OUT9, UI_DSP_STAND_MIXER_EN_IN13_OUT10, UI_DSP_STAND_MIXER_EN_IN13_OUT11, UI_DSP_STAND_MIXER_EN_IN13_OUT12, UI_DSP_STAND_MIXER_EN_IN13_OUT13, UI_DSP_STAND_MIXER_EN_IN13_OUT14, UI_DSP_STAND_MIXER_EN_IN13_OUT15, UI_DSP_STAND_MIXER_EN_IN13_OUT16, UI_DSP_STAND_MIXER_EN_IN14_OUT1,// UI_DSP_STAND_MIXER_EN_IN14_OUT2, UI_DSP_STAND_MIXER_EN_IN14_OUT3, UI_DSP_STAND_MIXER_EN_IN14_OUT4, UI_DSP_STAND_MIXER_EN_IN14_OUT5, UI_DSP_STAND_MIXER_EN_IN14_OUT6, UI_DSP_STAND_MIXER_EN_IN14_OUT7, UI_DSP_STAND_MIXER_EN_IN14_OUT8, UI_DSP_STAND_MIXER_EN_IN14_OUT9, UI_DSP_STAND_MIXER_EN_IN14_OUT10, UI_DSP_STAND_MIXER_EN_IN14_OUT11, UI_DSP_STAND_MIXER_EN_IN14_OUT12, UI_DSP_STAND_MIXER_EN_IN14_OUT13, UI_DSP_STAND_MIXER_EN_IN14_OUT14, UI_DSP_STAND_MIXER_EN_IN14_OUT15, UI_DSP_STAND_MIXER_EN_IN14_OUT16, UI_DSP_STAND_MIXER_EN_IN15_OUT1,// UI_DSP_STAND_MIXER_EN_IN15_OUT2, UI_DSP_STAND_MIXER_EN_IN15_OUT3, UI_DSP_STAND_MIXER_EN_IN15_OUT4, UI_DSP_STAND_MIXER_EN_IN15_OUT5, UI_DSP_STAND_MIXER_EN_IN15_OUT6, UI_DSP_STAND_MIXER_EN_IN15_OUT7, UI_DSP_STAND_MIXER_EN_IN15_OUT8, UI_DSP_STAND_MIXER_EN_IN15_OUT9, UI_DSP_STAND_MIXER_EN_IN15_OUT10, UI_DSP_STAND_MIXER_EN_IN15_OUT11, UI_DSP_STAND_MIXER_EN_IN15_OUT12, UI_DSP_STAND_MIXER_EN_IN15_OUT13, UI_DSP_STAND_MIXER_EN_IN15_OUT14, UI_DSP_STAND_MIXER_EN_IN15_OUT15, UI_DSP_STAND_MIXER_EN_IN15_OUT16, UI_DSP_STAND_MIXER_EN_IN16_OUT1,// UI_DSP_STAND_MIXER_EN_IN16_OUT2, UI_DSP_STAND_MIXER_EN_IN16_OUT3, UI_DSP_STAND_MIXER_EN_IN16_OUT4, UI_DSP_STAND_MIXER_EN_IN16_OUT5, UI_DSP_STAND_MIXER_EN_IN16_OUT6, UI_DSP_STAND_MIXER_EN_IN16_OUT7, UI_DSP_STAND_MIXER_EN_IN16_OUT8, UI_DSP_STAND_MIXER_EN_IN16_OUT9, UI_DSP_STAND_MIXER_EN_IN16_OUT10, UI_DSP_STAND_MIXER_EN_IN16_OUT11, UI_DSP_STAND_MIXER_EN_IN16_OUT12, UI_DSP_STAND_MIXER_EN_IN16_OUT13, UI_DSP_STAND_MIXER_EN_IN16_OUT14, UI_DSP_STAND_MIXER_EN_IN16_OUT15, UI_DSP_STAND_MIXER_EN_IN16_OUT16, }UI_DSP_ELEMENT_TYPE_e; typedef enum { UI_FORMAT_CHAR = 0, UI_FORMAT_SHORT, UI_FORMAT_INT, UI_FORMAT_LONG, UI_FORMAT_FLOAT, }UI_FORMAT_TYPE_e; typedef enum { UI_F_PARA_LEVEL = 0, }UI_FILE_PARAMETER_e; typedef enum { UI_PRECENT_UPDATE = 0, //user define //user define }UI_PRECENT_e; typedef enum { UI_STR_PRODUCT_NAME = 0, UI_STR_EFW_VERSION, UI_STR_NTP_ADDR, UI_STR_USER_PASSWORD, UI_STR_WEB_TITLE1, UI_STR_WEB_TITLE2, //user define //user define }UI_RW_STRING_TYPE_e; typedef enum { UI_VAL_DEFAULT = 0, UI_VAL_LANGUAGE, UI_VAL_LOGOUT_TIME, UI_VAL_SLAVER_TIME, UI_VAL_BRIGHTNESS, UI_VAL_NTP_EN, UI_VAL_NTP_HH, UI_VAL_NTP_MM, UI_VAL_TIME_ZONE, //user define UI_VAL_REMOTE_LIST_SIZE, UI_VAL_REAL_DNM_LIST_SIZE, UI_VAL_RECORD_MAX_LV_ACT, UI_VAL_RECORD_MIN_LV_ACT, UI_VAL_DNM_CALIBRATION_ACT, UI_VAL_SLAVE_DNM_LIST_SIZE, //user define }UI_RW_VALUE_TYPE_e; typedef enum { UI_ACT_DEFAULT = 0, UI_ACT_REBOOT, //user define //user define }UI_ACTTION_e; typedef enum { UI_MOC_LOG = 0, UI_MOC_FAULT, //user define //user define }UI_MALLOC_e; typedef enum { UI_STRUCT_EMPTY= 0, //user define UI_STRUCT_REMOTE_LIST, UI_STRUCT_DNM_REAL_LIST, UI_STRUCT_DSP_ETH_DNM_SD_INFO, UI_STRUCT_DSP_ETH_DNM_SLAVE_INFO, //user define }UI_STRUCT_FUNC_s; typedef enum { UI_IP = 0, UI_SUB_MASK, UI_GATEWAY, UI_DHCP_EN, UI_DNS_EN, UI_DNS, UI_MAC, }UI_ETHERNET_e; typedef enum { UI_OPERATE_READ = 0, UI_OPERATE_WRITE, UI_OPERATE_CREATE, UI_OPERATE_DELETE, }UI_OPERATION_MODE_e; typedef enum { UI_MASS_DATA_UPDATE = 0, UI_MASS_DATA_CONFIG_FILE, UI_MASS_DATA_MESSAGE_FILE, UI_MASS_DATA_FTY_FILE, }UI_MASS_DATA_e; typedef enum { UI_FSS_FOLDER = 0, UI_FSS_FILE, }UI_FSS_TYPE_e; typedef struct { uint16_t Y; uint16_t M; uint16_t D; uint16_t HH; uint16_t MM; uint16_t SS; }UI_Time_s; typedef struct { unsigned long Level; }UI_FSS_Info_s; //spical struct typedef struct { //user utf8 char Name[40];//'remote-01', get/add/delete use uint8_t IP[4];//'192.168.100.49' uint8_t Submask[4];//'0.0.0.0' char Serial[20];//'12345' uint16_t Type;//product type; 0x2A:Ethernet-DNM uint16_t Method;//0:Static 1:Dynamic uint16_t Group_Rule;//0:Ave 1:Max 2:Min // char OldName[40];//'remote-01', modify use uint16_t Operation;//0:new 1:modify 2:delete }UI_Remote_s; typedef struct { //user utf8 char Name[40];//'remote-01' char IP[4];//'192.168.100.49' }UI_DNM_RealList_s; typedef enum { UI_LED_GRAY = 0, UI_LED_PURPLE, UI_LED_GREEN, UI_LED_BLUE, UI_LED_RED, UI_LED_YELLOW, UI_LED_BLACK, }UI_DNM_LED_STATE_e; typedef struct { /*set_AP1*/ uint16_t AR_Time; /*index_in*/ /*index_out*/ uint16_t Sampling_Time; uint8_t Calibration_State;//by UI_DNM_LED_STATE_e //Calibration Error status /*priority*/ /*gap_time*/ float Over_Noise_Level; float Min_Gain; float Max_Gain; float Malfunction_Level; float Ang_Level; float Output_Level; float White_Noise_Level; float Noise_Threshold; float Ambient_Noise_SPL; float C_Sensing_MIC_Level; float Sensing_MIC_SPL; float Differential_Level; /*record_decrease_setting*/ /*record_overAmbient*/ /*numSlave*/ /*numAmp*/ /*indexAmp*/ unsigned int Noise_Reference :1; //Set_AP1: Setting_AmbientNoise_B Dynamic使用 float Noise_Level; //AmbientNoise_SPL[2]; dynamic 為手動設定音量的值 unsigned int Malfunction :1; //Set_AP1: Setting_MaxMalfunction_Level_B /* bit 5-6 in Set_AP1 Mode_DNM_Static = 00, Mode_DNM_Dynamic = 10, */ unsigned int Mode :1;//0:static //1:dynamic char Current_DNM[20]; //此為Group 設定 float Sensing_MIC_Level; //SPL_SensingMic //LED_Working_Status = DNM_LED_Working_Status_s uint8_t Work_State; /* Calibration_LED LED_DNM_Increase = 0x0040, //64 //此為對應到變數值, 非bit LED_DNM_Decrease= 0x0080, //128 //此為對應到變數值, 非bit LED_DNM_Inaction = 0x00c0, //192 //優先權較低或是 Evac狀態 LED_DNM_Regulate = 0x00c0, //bit 6-7值, 非bit */ uint8_t Regulated_State;//by UI_DNM_LED_STATE_e unsigned int Bypass :1; //Set_AP1: Bypass_DNM_B char TitleText[80]; }UI_DNM_SD_s; typedef struct { //user utf8 char Name[40];//'remote-01' uint8_t IP[4];//'192.168.100.49' float Sensing_MIC_SPL; uint8_t Working_LED;//by UI_DNM_LED_STATE_e }UI_DNM_Slave_s; //spical struct //external area, user define //external area, user define float UI_Read_Precent_Func(UI_PRECENT_e type, char *info); void UI_Read_TargetString_Func(UI_RW_STRING_TYPE_e type, char *buf_str, char *info); void UI_Write_TargetString_Func(UI_RW_STRING_TYPE_e type, char *buf_str, char *info); void UI_Read_TargetValue_Func(UI_RW_VALUE_TYPE_e type, char *value, UI_FORMAT_TYPE_e format, char *info); void UI_Write_TargetValue_Func(UI_RW_VALUE_TYPE_e type, char *value, UI_FORMAT_TYPE_e format, char *info); float UI_Read_DSP_Element_Func(UI_DSP_COMPONENT_TYPE_e com, UI_DSP_ELEMENT_TYPE_e ele, int cid); void UI_Write_DSP_Element_Func(UI_DSP_COMPONENT_TYPE_e com, UI_DSP_ELEMENT_TYPE_e ele, int cid, float value); uint16_t UI_DoAction(UI_ACTTION_e type, char *info); uint16_t UI_Read_FSS_File_Parameter_Func(char *path, UI_FSS_Info_s *info); uint16_t UI_Write_FSS_File_Parameter_Func(char *path, UI_FILE_PARAMETER_e parameter, UI_FORMAT_TYPE_e format, char *data); uint16_t UI_FSS_File_Operation_Func(char *path, UI_OPERATION_MODE_e operate, UI_FSS_TYPE_e type); void UI_Release_Buffer(unsigned long count, char *ptr); unsigned long UI_Read_StringArray_By_Malloc(UI_MALLOC_e type, char *ptr, unsigned long f_max_len, char *info); uint16_t UI_Ethernet_Data_Operate_Func(UI_OPERATION_MODE_e operate, UI_ETHERNET_e type, uint8_t *data); uint16_t UI_System_Time_Operate_Func(UI_OPERATION_MODE_e operate, UI_Time_s *time); uint16_t UI_User_Login_Func(char *name, char*password); uint16_t UI_User_Logout_Func(void); void UI_Set_ProgressBar(char *title_text, char *progress_text, char *box_text, float percent); uint16_t UI_Read_StructFunction(UI_STRUCT_FUNC_s type, void **structs, uint16_t max_point, void* info); uint16_t UI_Write_StructFunction(UI_STRUCT_FUNC_s type, void **structs, uint16_t write_length); uint16_t UI_MassData_Operation_Func(UI_OPERATION_MODE_e mode, UI_MASS_DATA_e TYPE, char *file_path, char *file_name, char *file_ptr, unsigned long *file_length); void num2str(unsigned long num, char *s); float long2float(unsigned long long_v); struct DNMChannel_t { union { uint32_t MCU_IP; uint16_t DSP_IP[2]; }IP; uint16_t Zone_MechanicID; uint16_t LED_Working_Status; union { float UI_SPL_SensingMic; uint16_t DSP_SPL_SensingMic[2]; }SPL_SensingMic; uint16_t Weight[2]; uint16_t HwVersion; }; extern DSP_AP_Table_v3 AP_Table_DSP; DNMChannel_t* DNMChannel_New(void) { return (DNMChannel_t*)&AP_Table_DSP.DNM.Ch; } float DNMChannel_GetSensingMICLevel(DNMChannel_t* element) { return element->SPL_SensingMic.UI_SPL_SensingMic; } uint8_t DNMChannel_GetWorkState(DNMChannel_t* element) { uint8_t result = 0; uint8_t tmp = 0; if(LED_Unready_DNM == element->LED_Working_Status) { result = UI_LED_GRAY; } else if(LED_Panging_DNM == element->LED_Working_Status) { result = UI_LED_BLUE; } else if(LED_Ready_DNM == element->LED_Working_Status) { result = UI_LED_GREEN; } else if(LED_Disconnect_DNM == element->LED_Working_Status) { result = UI_LED_BLACK; } else { /*Work state同時需要用到Main與Channel結構*/ /*不封裝了,很麻煩,之後再看怎麼處理*/ tmp = AP_Table_DSP.DNM.Main.Calibration_LED & LED_Status_Calibration; if(LED_Calibration_Process == tmp) { result = UI_LED_YELLOW; } else if(LED_Calibration_Fault == tmp) { result = UI_LED_RED; } } return result; }