// VERY IMPORTANT PROGRAM. THIS PROGRAM TESTS THE LATEST ITERATION OF THE CORRELATION ALGORITHM BY // lighting up an LED if the maximum correlation value equals a known value. It also sends a string of // characters to the console once the correlation process is done. /*****************************************************************************/ /* STDIO.H */ /* */ /* Copyright (c) 1993 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. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* _ti_config.h */ /* */ /* Copyright (c) 2017 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") #pragma CHECK_MISRA("-19.1") /* Common definitions */ /* C */ /* C89/C99 */ /* _TI_NOEXCEPT_CPP14 is defined to noexcept only when compiling for C++14. It is intended to be used for functions like abort and atexit that are supposed to be declared noexcept only in C++14 mode. */ /* Target-specific definitions */ /*****************************************************************************/ /* linkage.h */ /* */ /* Copyright (c) 1998 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 #pragma diag_pop /*****************************************************************************/ /* stdarg.h */ /* */ /* Copyright (c) 1996 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.7") /* need function-like macros */ #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Berkeley Software Design, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 * $FreeBSD$ */ #pragma diag_push #pragma CHECK_MISRA("none") /* * Testing against Clang-specific extensions. */ /* * This code has been put in place to help reduce the addition of * compiler specific defines in FreeBSD code. It helps to aid in * having a compiler-agnostic source tree. */ /* * Macro to test if we're using a specific version of gcc or later. */ /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI * mode -- there must be no spaces between its arguments, and for nested * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also * concatenate double-quoted strings produced by the __STRING macro, but * this only works with ANSI C. * * __XSTRING is like __STRING, but it expands any macros in its argument * first. It is only available with ANSI C. */ /* * Compiler-dependent macros to help declare dead (non-returning) and * pure (no side effects) functions, and unused variables. They are * null except for versions of gcc that are known to support the features * properly (old versions of gcc-2 supported the dead and pure features * in a different (wrong) way). If we do not provide an implementation * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ /* * TI ADD - check that __GNUC__ is defined before referencing it to avoid * generating an error when __GNUC__ treated as zero warning is * promoted to an error via -pdse195 option. */ /* * Keywords added in C11. */ /* * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode * without actually supporting the thread_local keyword. Don't check for * the presence of C++11 when defining _Thread_local. */ /* * Emulation of C11 _Generic(). Unlike the previously defined C11 * keywords, it is not possible to implement this using exactly the same * syntax. Therefore implement something similar under the name * __generic(). Unlike _Generic(), this macro can only distinguish * between a single type, so it requires nested invocations to * distinguish multiple cases. */ /* * C99 Static array indices in function parameter declarations. Syntax such as: * void bar(int myArray[static 10]); * is allowed in C99 but not in C++. Define __min_size appropriately so * headers using it can be compiled in either language. Use like this: * void bar(int myArray[__min_size(10)]); */ /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ /* C++11 exposes a load of C99 stuff */ /* * GCC 2.95 provides `__restrict' as an extension to C90 to support the * C99-specific `restrict' type qualifier. We happen to use `__restrict' as * a way to define the `restrict' type qualifier without disturbing older * software that is unaware of C99 keywords. * The TI compiler supports __restrict in all compilation modes. */ /* * GNU C version 2.96 adds explicit branch prediction so that * the CPU back-end can hint the processor and also so that * code blocks can be reordered such that the predicted path * sees a more linear flow, thus improving cache behavior, etc. * * The following two macros provide us with a way to utilize this * compiler feature. Use __predict_true() if you expect the expression * to evaluate to true, and __predict_false() if you expect the * expression to evaluate to false. * * A few notes about usage: * * * Generally, __predict_false() error condition checks (unless * you have some _strong_ reason to do otherwise, in which case * document it), and/or __predict_true() `no-error' condition * checks, assuming you want to optimize for the no-error case. * * * Other than that, if you don't know the likelihood of a test * succeeding from empirical or other `hard' evidence, don't * make predictions. * * * These are meant to be used in places that are run `a lot'. * It is wasteful to make predictions in code that is run * seldomly (e.g. at subsystem initialization time) as the * basic block reordering that this affects can often generate * larger code. */ /* * We define this here since , , and * require it. */ /* * Given the pointer x to the member m of the struct s, return * a pointer to the containing structure. When using GCC, we first * assign pointer x to a local variable, to check that its type is * compatible with member m. */ /* * Compiler-dependent macros to declare that functions take printf-like * or scanf-like arguments. They are null except for versions of gcc * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ /* * The following definition might not work well if used in header files, * but it should be better than nothing. If you want a "do nothing" * version, then it should generate some harmless declaration, such as: * #define __IDSTRING(name,string) struct __hack */ /* * Embed the rcs id of a source file in the resulting library. Note that in * more recent ELF binutils, we use .ident allowing the ID to be stripped. * Usage: * __FBSDID("$FreeBSD$"); */ /*- * The following definitions are an extension of the behavior originally * implemented in , but with a different level of granularity. * POSIX.1 requires that the macros we test be defined before any standard * header file is included. * * Here's a quick run-down of the versions: * defined(_POSIX_SOURCE) 1003.1-1988 * _POSIX_C_SOURCE == 1 1003.1-1990 * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option * _POSIX_C_SOURCE == 199309 1003.1b-1993 * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, * and the omnibus ISO/IEC 9945-1: 1996 * _POSIX_C_SOURCE == 200112 1003.1-2001 * _POSIX_C_SOURCE == 200809 1003.1-2008 * * In addition, the X/Open Portability Guide, which is now the Single UNIX * Specification, defines a feature-test macro which indicates the version of * that specification, and which subsumes _POSIX_C_SOURCE. * * Our macros begin with two underscores to avoid namespace screwage. */ /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ /* Deal with various X/Open Portability Guides and Single UNIX Spec. */ /* * Deal with all versions of POSIX. The ordering relative to the tests above is * important. */ /*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly * requested, then define our internal feature-test macros to zero. This * makes no difference to the preprocessor (undefined symbols in preprocessing * expressions are defined to have value zero), but makes it more convenient for * a test program to print out the values. * * If a program mistakenly defines _ANSI_SOURCE and some other macro such as * _POSIX_C_SOURCE, we will assume that it wants the broader compilation * environment (and in fact we will never get here). */ /* User override __EXT1_VISIBLE */ /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. */ /* * Nullability qualifiers: currently only supported by Clang. */ /* * Type Safety Checking * * Clang provides additional attributes to enable checking type safety * properties that cannot be enforced by the C type system. */ /* * Lock annotations. * * Clang provides support for doing basic thread-safety tests at * compile-time, by marking which locks will/should be held when * entering/leaving a functions. * * Furthermore, it is also possible to annotate variables and structure * members to enforce that they are only accessed when certain locks are * held. */ /* Structure implements a lock. */ /* Function acquires an exclusive or shared lock. */ /* Function attempts to acquire an exclusive or shared lock. */ /* Function releases a lock. */ /* Function asserts that an exclusive or shared lock is held. */ /* Function requires that an exclusive or shared lock is or is not held. */ /* Function should not be analyzed. */ /* Guard variables and structure members by lock. */ #pragma diag_pop /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 * $FreeBSD$ */ #pragma diag_push /* This file is required to use base types */ #pragma CHECK_MISRA("-6.3") /* * Basic types upon which most other types are built. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; /* LONGLONG */ typedef long long __int64_t; /* LONGLONG */ typedef unsigned long long __uint64_t; /* * Standard type definitions. */ typedef __uint32_t __clock_t; /* clock()... */ typedef __int32_t __critical_t; typedef double __double_t; typedef float __float_t; typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; typedef __int32_t __int_fast8_t; typedef __int32_t __int_fast16_t; typedef __int32_t __int_fast32_t; typedef __int64_t __int_fast64_t; typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int32_t __register_t; typedef __int32_t __segsz_t; /* segment size (in pages) */ typedef __uint32_t __size_t; /* sizeof() */ typedef __int32_t __ssize_t; /* byte count or error */ typedef __uint32_t __time_t; typedef __uint32_t __uintfptr_t; typedef __uint64_t __uintmax_t; typedef __uint32_t __uintptr_t; typedef __uint32_t __uint_fast8_t; typedef __uint32_t __uint_fast16_t; typedef __uint32_t __uint_fast32_t; typedef __uint64_t __uint_fast64_t; typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __uint32_t __vm_paddr_t; typedef __uint32_t __vm_size_t; typedef unsigned short ___wchar_t; /* * Unusual type definitions. */ typedef struct __va_list_t { void * __ap; } __va_list; #pragma diag_pop #pragma diag_push /* This file is required to use types without size and signedness */ #pragma CHECK_MISRA("-6.3") /* * Standard type definitions. */ typedef __int32_t __blksize_t; /* file block size */ typedef __int64_t __blkcnt_t; /* file block count */ typedef __int32_t __clockid_t; /* clock_gettime()... */ typedef __uint32_t __fflags_t; /* file flags */ typedef __uint64_t __fsblkcnt_t; typedef __uint64_t __fsfilcnt_t; typedef __uint32_t __gid_t; typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */ typedef __uint64_t __ino_t; /* inode number */ typedef long __key_t; /* IPC key (for Sys V IPC) */ typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ typedef __uint16_t __mode_t; /* permissions */ typedef int __accmode_t; /* access permissions */ typedef int __nl_item; typedef __uint64_t __nlink_t; /* link count */ typedef __int64_t __off_t; /* file offset */ typedef __int64_t __off64_t; /* file offset (alias) */ typedef __int32_t __pid_t; /* process [group] */ typedef __int64_t __rlim_t; /* resource limit - intentionally */ /* signed, because of legacy code */ /* that uses -1 for RLIM_INFINITY */ typedef __uint8_t __sa_family_t; typedef __uint32_t __socklen_t; typedef long __suseconds_t; /* microseconds (signed) */ typedef struct __timer *__timer_t; /* timer_gettime()... */ typedef struct __mq *__mqd_t; /* mq_open()... */ typedef __uint32_t __uid_t; typedef unsigned int __useconds_t; /* microseconds (unsigned) */ typedef int __cpuwhich_t; /* which parameter for cpuset. */ typedef int __cpulevel_t; /* level parameter for cpuset. */ typedef int __cpusetid_t; /* cpuset identifier. */ /* * Unusual type definitions. */ /* * rune_t is declared to be an ``int'' instead of the more natural * ``unsigned long'' or ``long''. Two things are happening here. It is not * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, * it looks like 10646 will be a 31 bit standard. This means that if your * ints cannot hold 32 bits, you will be in trouble. The reason an int was * chosen over a long is that the is*() and to*() routines take ints (says * ANSI C), but they use __ct_rune_t instead of int. * * NOTE: rune_t is not covered by ANSI nor other standards, and should not * be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and * rune_t must be the same type. Also, wint_t should be able to hold all * members of the largest character set plus one extra value (WEOF), and * must be at least 16 bits. */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ /* Clang already provides these types as built-ins, but only in C++ mode. */ typedef __uint_least16_t __char16_t; typedef __uint_least32_t __char32_t; /* In C++11, char16_t and char32_t are built-in types. */ typedef struct { long long __max_align1 __attribute__((aligned(__alignof__(long long)))); long double __max_align2 __attribute__((aligned(__alignof__(long double)))); } __max_align_t; typedef __uint64_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ /* * mbstate_t is an opaque object to keep conversion state during multibyte * stream conversions. */ typedef int _Mbstatet; typedef _Mbstatet __mbstate_t; typedef __uintmax_t __rman_res_t; /* * When the following macro is defined, the system uses 64-bit inode numbers. * Programs can use this to avoid including , with its associated * namespace pollution. */ #pragma diag_pop typedef __va_list va_list; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-20.2") /* reuse of standard macros/objects/funcs */ #pragma CHECK_MISRA("-20.1") /* redefining reserved identifiers */ #pragma CHECK_MISRA("-19.7") /* use function instead of function-like macro */ #pragma CHECK_MISRA("-19.4") /* macros should have only simple expansions */ #pragma CHECK_MISRA("-19.1") /* include should follow directive or comment */ #pragma CHECK_MISRA("-16.3") /* parameters without names */ #pragma CHECK_MISRA("-6.3") /* use size/sign-specific typedefs */ /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ /****************************************************************************/ /* TYPES THAT ANSI REQUIRES TO BE DEFINED */ /****************************************************************************/ typedef unsigned size_t; struct __sFILE { 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) */ }; typedef struct __sFILE 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 * __restrict _fp); extern FILE *fopen(const char * __restrict _fname, const char * __restrict _mode); extern FILE *freopen(const char * __restrict _fname, const char * __restrict _mode, FILE * __restrict _fp); extern void setbuf(FILE * __restrict _fp, char * __restrict _buf); extern int setvbuf(FILE * __restrict _fp, char * __restrict _buf, int _type, size_t _size); extern int fflush(FILE *_fp); /****************************************************************************/ /* FORMATTED INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fprintf(FILE * __restrict _fp, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int fscanf(FILE * __restrict _fp, const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int printf(const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 1, 2))); extern int scanf(const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 1, 2))); extern int sprintf(char * __restrict _string, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int snprintf(char * __restrict _string, size_t _n, const char * __restrict _format, ...) __attribute__((__format__ (__printf__, 3, 4))); extern int sscanf(const char * __restrict _str, const char * __restrict _fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int vfprintf(FILE * __restrict _fp, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vfscanf(FILE * __restrict _fp, const char * __restrict _fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int vprintf(const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 1, 0))); extern int vscanf(const char * __restrict _format, va_list _ap) __attribute__((__format__ (__scanf__, 1, 0))); extern int vsprintf(char * __restrict _string, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vsnprintf(char * __restrict _string, size_t _n, const char * __restrict _format, va_list _ap) __attribute__((__format__ (__printf__, 3, 0))); extern int vsscanf(const char * __restrict _str, const char * __restrict _fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int asprintf(char **, const char *, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int vasprintf(char **, const char *, va_list) __attribute__((__format__ (__printf__, 2, 0))); /****************************************************************************/ /* CHARACTER INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern int fgetc(FILE *_fp); extern char *fgets(char * __restrict _ptr, int _size, FILE * __restrict _fp); extern int fputc(int _c, FILE *_fp); extern int fputs(const char * __restrict _ptr, FILE * __restrict _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, FILE *_fp); /****************************************************************************/ /* DIRECT INPUT/OUTPUT FUNCTIONS */ /****************************************************************************/ extern size_t fread(void * __restrict _ptr, size_t _size, size_t _count, FILE * __restrict _fp); extern size_t fwrite(const void * __restrict _ptr, size_t _size, size_t _count, FILE * __restrict _fp); /****************************************************************************/ /* FILE POSITIONING FUNCTIONS */ /****************************************************************************/ extern int fgetpos(FILE * __restrict _fp, fpos_t * __restrict _pos); extern int fseek(FILE *_fp, long _offset, int _ptrname); extern int fsetpos(FILE * __restrict _fp, const fpos_t * __restrict _pos); extern long ftell(FILE *_fp); extern void rewind(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); #pragma diag_pop /*----------------------------------------------------------------------------*/ /* If sys/cdefs.h is available, go ahead and include it. xlocale.h assumes */ /* this file will have already included sys/cdefs.h. */ /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* Include xlocale/_stdio.h if xlocale.h has already been included. This is */ /* to conform with FreeBSD's xlocale implementation. */ /*----------------------------------------------------------------------------*/ /*****************************************************************************/ /* stdlib.h */ /* */ /* Copyright (c) 1993 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("-8.5") /* need to define inline function */ #pragma CHECK_MISRA("-19.1") /* #includes required for implementation */ #pragma CHECK_MISRA("-19.7") /* need function-like macros */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ /*---------------------------------------------------------------------------*/ /* Attributes are only available in relaxed ANSI mode. */ /*---------------------------------------------------------------------------*/ #pragma diag_push #pragma CHECK_MISRA("-5.7") /* keep names intact */ typedef struct { int quot, rem; } div_t; typedef struct { int quot, rem; } ldiv_t; typedef struct { long long quot, rem; } lldiv_t; #pragma diag_pop typedef unsigned short wchar_t; /*---------------------------------------------------------------*/ /* NOTE - Normally, abs, labs, and fabs are expanded inline, so */ /* no formal definition is really required. However, ANSI */ /* requires that they exist as separate functions, so */ /* they are supplied in the library. The prototype is */ /* here mainly for documentation. */ /*---------------------------------------------------------------*/ #pragma diag_push #pragma CHECK_MISRA("-16.4") /* false positives due to builtin declarations */ int abs(int _val); long labs(long _val); long long llabs(long long _val); #pragma diag_pop int atoi(const char *_st); long atol(const char *_st); long long atoll(const char *_st); int ltoa(long val, char *buffer); extern double atof(const char *_st); long strtol(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long strtoul(const char * __restrict _st, char ** __restrict _endptr, int _base); long long strtoll(const char * __restrict _st, char ** __restrict _endptr, int _base); unsigned long long strtoull(const char * __restrict _st, char ** __restrict _endptr, int _base); float strtof(const char * __restrict _st, char ** __restrict _endptr); double strtod(const char * __restrict _st, char ** __restrict _endptr); long double strtold(const char * __restrict _st, char ** __restrict _endptr); int rand(void); void srand(unsigned _seed); void *calloc(size_t _num, size_t _size) __attribute__((malloc)); void *malloc(size_t _size) __attribute__((malloc)); void *realloc(void *_ptr, size_t _size); void free(void *_ptr); void *memalign(size_t _aln, size_t _size) __attribute__((malloc)); void *aligned_alloc(size_t _aln, size_t _size) __attribute__((malloc)); void __TI_heap_stats(void); void *__TI_heap_check(void); size_t __TI_heap_total_available(void); size_t __TI_heap_largest_available(void); __attribute__((noreturn)) void abort(void) ; typedef void (*__TI_atexit_fn)(void); int atexit(__TI_atexit_fn _func) ; typedef int (*__TI_compar_fn)(const void *_a,const void *_b); void *bsearch(const void *_key, const void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void qsort(void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); __attribute__((noreturn)) void exit(int _status); __attribute__((noreturn)) void _Exit(int _status); __attribute__((noreturn)) void quick_exit(int _status); int at_quick_exit(__TI_atexit_fn _func) ; div_t div(int _numer, int _denom); ldiv_t ldiv(long _numer, long _denom); lldiv_t lldiv(long long _numer, long long _denom); char *getenv(const char *_string); int system(const char *_name); int mblen(const char *_s, size_t _n); size_t mbstowcs(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); int mbtowc(wchar_t * __restrict _dest, const char * __restrict _src, size_t _n); size_t wcstombs(char * __restrict _dest, const wchar_t * __restrict _src, size_t _n); int wctomb(char *_s, wchar_t _wc); /* C2000-specific additions to header implemented with #include */ #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") /* FreeBSD library requires code outside of the include guard */ /*----------------------------------------------------------------------------*/ /* If sys/cdefs.h is available, go ahead and include it. xlocale.h assumes */ /* this file will have already included sys/cdefs.h. */ /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* Include xlocale/_stdlib.h if xlocale.h has already been included. This */ /* comes from FreeBSD's stdlib.h. */ /*----------------------------------------------------------------------------*/ #pragma diag_pop /* * Copyright (c) 2000 Jeroen Ruigrok van der Werven * All rights reserved. * * Copyright (c) 2014-2014 Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD: release/10.0.0/include/stdbool.h 228878 2011-12-25 20:15:41Z ed $ */ /*****************************************************************************/ /* STDINT.H */ /* */ /* Copyright (c) 2002 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. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* _STDINT40.H */ /* */ /* Copyright (c) 2018 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. */ /* */ /*****************************************************************************/ /* According to footnotes in the 1999 C standard, "C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before is included." */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2001 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD * * Copyright (c) 2001, 2002 Mike Barcroft * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Klaus Klein. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. * * $FreeBSD$ */ #pragma diag_push /* 19.4 is issued for macros that are defined in terms of other macros. */ #pragma CHECK_MISRA("-19.4") /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types */ /* Minimum values of exact-width signed integer types. */ /* Maximum values of exact-width signed integer types. */ /* Maximum values of exact-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.2 Limits of minimum-width integer types */ /* Minimum values of minimum-width signed integer types. */ /* Maximum values of minimum-width signed integer types. */ /* Maximum values of minimum-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.3 Limits of fastest minimum-width integer types */ /* Minimum values of fastest minimum-width signed integer types. */ /* Maximum values of fastest minimum-width signed integer types. */ /* Maximum values of fastest minimum-width unsigned integer types. */ /* * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ /* * ISO/IEC 9899:1999 * 7.18.2.5 Limits of greatest-width integer types */ /* * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ /* Limits of ptrdiff_t. */ /* Limits of sig_atomic_t. */ /* Limit of size_t. */ /* Limits of wint_t. */ #pragma diag_pop /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 David E. O'Brien * Copyright (c) 2001 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; typedef __intptr_t intptr_t; typedef __uintptr_t uintptr_t; typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; typedef __int_fast8_t int_fast8_t; typedef __int_fast16_t int_fast16_t; typedef __int_fast32_t int_fast32_t; typedef __int_fast64_t int_fast64_t; typedef __uint_fast8_t uint_fast8_t; typedef __uint_fast16_t uint_fast16_t; typedef __uint_fast32_t uint_fast32_t; typedef __uint_fast64_t uint_fast64_t; /* GNU and Darwin define this and people seem to think it's portable */ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* Limits of wchar_t. */ #pragma diag_pop /* ISO/IEC 9899:2011 K.3.4.4 */ /* * Copyright (c) 2015-2015 Texas Instruments Incorporated * * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* * from: @(#)fdlibm.h 5.1 93/09/24 * $FreeBSD$ */ #pragma diag_push #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */ #pragma CHECK_MISRA("-12.7") /* bitwise operators not allowed on signed ints */ #pragma CHECK_MISRA("-16.4") /* identifiers in fn defn/decl identical??? fabs/fabsf */ #pragma CHECK_MISRA("-19.1") /* only comments and preproc before #include */ #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 */ /*****************************************************************************/ /* _defs.h */ /* */ /* Copyright (c) 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("-8.1") /* visible prototypes */ #pragma CHECK_MISRA("-8.5") /* functions in header files */ #pragma CHECK_MISRA("-8.11") /* use static on fns with internal linkage */ #pragma CHECK_MISRA("-10.1") /* implicit conversion ... bool to int??? */ #pragma CHECK_MISRA("-12.1") /* operator precedence */ #pragma CHECK_MISRA("-12.2") /* different order of operations??? */ #pragma CHECK_MISRA("-12.4") /* RHS of &&/|| has side effects??? */ #pragma CHECK_MISRA("-12.7") /* Bitwise operators on signed types */ #pragma CHECK_MISRA("-14.7") /* single point of return */ #pragma CHECK_MISRA("-14.9") /* only compound statement after if/else */ #pragma CHECK_MISRA("-19.1") /* only comments and preproc before #include??? */ #pragma CHECK_MISRA("-19.4") /* macro expands to unparenthesized */ #pragma diag_suppress 1558 /* --float_operations_allowed checks */ /*---------------------------------------------------------------------------*/ /* _INLINE_DEFINITION */ /* */ /* The regular (non-llvm-based) TI tools assume C++ inline semantics by */ /* default, so if a function ends up not being inlined, then its definition */ /* is kept in the compilation unit (but via COMDAT, we'll only keep one */ /* definition of the function for the whole application). */ /* */ /* However, llvm-based TI tools (like arm-llvm) use clang, and clang does */ /* not assume C++ inline semantics by default. With the below definition of */ /* _INLINE_DEFINITION for clang, we are going to force functions that are */ /* declared with __inline to be *always* inlined (even when optimization or */ /* inlining is somehow disabled). */ /*---------------------------------------------------------------------------*/ /* This file is included in other user header files; take care not to pollute the namespace */ /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)limits.h 8.3 (Berkeley) 1/4/94 * $FreeBSD$ */ /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the * same type as would an expression that is an object of the corresponding * type converted according to the integral promotions. The subtraction for * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). */ /* max value for an unsigned long long */ /* Quads and long longs are the same size. Ensure they stay in sync. */ /* Minimum signal stack size. */ /* normalize target-specific intrinsics */ /* always inline these functions so that calls to them don't appear in an object file and become part of the ABI. */ __inline int __isfinite(double d) { return (((((unsigned int)(((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) == 0; } __inline int __isfinitef(float f) { return (((((unsigned int)((_ftoi(f)) >> 16)) & 0x7f80u) == 0x7f80u)) == 0; } __inline int __isfinitel(long double e) { return (((((unsigned int)(((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) == 0; } __inline int __isnan(double d) { return (((((unsigned int)(((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) && ((((((((__uint64_t)_hi(d) << 32 | _lo(d)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0)) == 0); } __inline int __isnanf(float f) { return (((((unsigned int)((_ftoi(f)) >> 16)) & 0x7f80u) == 0x7f80u)) && (((((_ftoi(f)) & (((__uint32_t)(1) << (24-1)) - 1)) == 0)) == 0); } __inline int __isnanl(long double e) { return (((((unsigned int)(((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) && ((((((((__uint64_t)_hi(e) << 32 | _lo(e)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0)) == 0); } __inline int __isnormal(double d) { return (((((((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> (53-1)) & ((1024u * 2) - 1)) == 0)) == 0) && ((((((unsigned int)(((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) == 0); } __inline int __isnormalf(float f) { return ((((((unsigned int)((_ftoi(f)) >> (24-1))) & ((128u * 2) - 1)) == 0)) == 0) && ((((((unsigned int)((_ftoi(f)) >> 16)) & 0x7f80u) == 0x7f80u)) == 0); } __inline int __isnormall(long double e) { return (((((((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> (53-1)) & ((1024u * 2) - 1)) == 0)) == 0) && ((((((unsigned int)(((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) == 0); } __inline int __signbit(double d) { return (((((((__uint64_t)_hi(d) << 32 | _lo(d)))) & ((__uint64_t)(1) << (64-1))) == 0)) == 0; } __inline int __signbitf(float f) { return ((((_ftoi(f)) & ((__uint32_t)(1) << (32-1))) == 0)) == 0; } __inline int __signbitl(long double e) { return (((((((__uint64_t)_hi(e) << 32 | _lo(e)))) & ((__uint64_t)(1) << (64-1))) == 0)) == 0; } /* FreeBSD lib/libc/gen/isinf.c says "These routines belong in libm, but they must remain in libc for binary compat until we can bump libm's major version number" */ __inline int __isinff(float f) { return (((((unsigned int)((_ftoi(f)) >> 16)) & 0x7f80u) == 0x7f80u)) && ((((_ftoi(f)) & (((__uint32_t)(1) << (24-1)) - 1)) == 0)); } __inline int __isinf (double d) { return (((((unsigned int)(((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) && (((((((__uint64_t)_hi(d) << 32 | _lo(d)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0)); } __inline int __isinfl(long double e) { return (((((unsigned int)(((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> 48)) & 0x7ff0u) == 0x7ff0u)) && (((((((__uint64_t)_hi(e) << 32 | _lo(e)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0)); } /* Symbolic constants to classify floating point numbers. */ __inline int __fpclassifyf(float f) { if ((((((unsigned int)((_ftoi(f)) >> 16)) & 0x7f80u) == 0x7f80u))) { if (((((_ftoi(f)) & (((__uint32_t)(1) << (24-1)) - 1)) == 0))) return 1; else return 2; } if ((((((unsigned int)((_ftoi(f)) >> (24-1))) & ((128u * 2) - 1)) == 0))) { if (((((_ftoi(f)) & (((__uint32_t)(1) << (24-1)) - 1)) == 0))) return 0; else return (-2); } return (-1); } __inline int __fpclassify (double d) { if ((((((unsigned int)(((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> 48)) & 0x7ff0u) == 0x7ff0u))) { if ((((((((__uint64_t)_hi(d) << 32 | _lo(d)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0))) return 1; else return 2; } if (((((((((__uint64_t)_hi(d) << 32 | _lo(d)))) >> (53-1)) & ((1024u * 2) - 1)) == 0))) { if ((((((((__uint64_t)_hi(d) << 32 | _lo(d)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0))) return 0; else return (-2); } return (-1); } __inline int __fpclassifyl(long double e) { if ((((((unsigned int)(((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> 48)) & 0x7ff0u) == 0x7ff0u))) { if ((((((((__uint64_t)_hi(e) << 32 | _lo(e)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0))) return 1; else return 2; } if (((((((((__uint64_t)_hi(e) << 32 | _lo(e)))) >> (53-1)) & ((1024u * 2) - 1)) == 0))) { if ((((((((__uint64_t)_hi(e) << 32 | _lo(e)))) & (((__uint64_t)(1) << (53-1)) - 1)) == 0))) return 0; else return (-2); } return (-1); } /* * Relevant target macros indicating hardware float support * * all * __TI_STRICT_FP_MODE__ * ARM * __ARM_FP * C2000 * __TMS320C28XX_FPU32__ * __TMS320C28XX_FPU64__ * __TMS320C28XX_TMU__ adds div, sqrt, sin, cos, atan, atan2 * C6000 * _TMS320C6700 indicates C67x or later */ #pragma diag_pop /* * ANSI/POSIX */ /* Symbolic constants to classify floating point numbers. */ /* * XOPEN/SVID */ /*---------------------------------------------------------------------------*/ /* 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. */ /*---------------------------------------------------------------------------*/ /* Disable double_t and float_t for C28x because of Motorware (AY 2015) */ /* These typedefs depend on the value of FLT_EVAL_METHOD */ typedef double double_t; typedef float float_t; double acos(double x); float acosf(float x); long double acosl(long double x); double asin(double x); float asinf(float x); long double asinl(long double x); double atan(double x); float atanf(float x); long double atanl(long double x); double atan2(double y, double x); float atan2f(float y, float x); long double atan2l(long double y, long double x); double cos(double x); float cosf(float x); long double cosl(long double x); double sin(double x); float sinf(float x); long double sinl(long double x); double tan(double x); float tanf(float x); long double tanl(long double x); double acosh(double x); float acoshf(float x); long double acoshl(long double x); double asinh(double x); float asinhf(float x); long double asinhl(long double x); double atanh(double x); float atanhf(float x); long double atanhl(long double x); double cosh(double x); float coshf(float x); long double coshl(long double x); double sinh(double x); float sinhf(float x); long double sinhl(long double x); double tanh(double x); float tanhf(float x); long double tanhl(long double x); double exp(double x); float expf(float x); long double expl(long double x); double exp2(double x); float exp2f(float x); long double exp2l(long double x); double expm1(double x); float expm1f(float x); long double expm1l(long double x); double frexp(double val, int *e); float frexpf(float val, int *e); long double frexpl(long double val, int *e); int ilogb(double x); int ilogbf(float x); int ilogbl(long double x); double ldexp(double x, int e); float ldexpf(float x, int e); long double ldexpl(long double x, int e); double log(double x); float logf(float x); long double logl(long double x); double log10(double x); float log10f(float x); long double log10l(long double x); double log1p(double x); float log1pf(float x); long double log1pl(long double x); double log2(double x); float log2f(float x); long double log2l(long double x); double logb(double x); float logbf(float x); long double logbl(long double x); double modf(double val, double *iptr); float modff(float val, float *iptr); long double modfl(long double val, long double *iptr); double scalbn(double x, int n); float scalbnf(float x, int n); long double scalbnl(long double x, int n); double scalbln(double x, long n); float scalblnf(float x, long n); long double scalblnl(long double x, long n); double cbrt(double x); float cbrtf(float x); long double cbrtl(long double x); double fabs(double x); float fabsf(float x); long double fabsl(long double x); double hypot(double x, double y); float hypotf(float x, float y); long double hypotl(long double x, long double y); double pow(double x, double y); float powf(float x, float y); long double powl(long double x, long double y); double sqrt(double x); float sqrtf(float x); long double sqrtl(long double x); double erf(double x); float erff(float x); long double erfl(long double x); double erfc(double x); float erfcf(float x); long double erfcl(long double x); double lgamma(double x); float lgammaf(float x); long double lgammal(long double x); double tgamma(double x); float tgammaf(float x); long double tgammal(long double x); double ceil(double x); float ceilf(float x); long double ceill(long double x); double floor(double x); float floorf(float x); long double floorl(long double x); double nearbyint(double x); float nearbyintf(float x); long double nearbyintl(long double x); double rint(double x); float rintf(float x); long double rintl(long double x); long lrint(double x); long lrintf(float x); long lrintl(long double x); long long llrint(double x); long long llrintf(float x); long long llrintl(long double x); double round(double x); float roundf(float x); long double roundl(long double x); long lround(double x); long lroundf(float x); long lroundl(long double x); long long llround(double x); long long llroundf(float x); long long llroundl(long double x); double trunc(double x); float truncf(float x); long double truncl(long double x); double fmod(double x, double y); float fmodf(float x, float y); long double fmodl(long double x, long double y); double remainder(double x, double y); float remainderf(float x, float y); long double remainderl(long double x, long double y); double remquo(double x, double y, int *quo); float remquof(float x, float y, int *quo); long double remquol(long double x, long double y, int *quo); double copysign(double x, double y); float copysignf(float x, float y); long double copysignl(long double x, long double y); double nan(const char *tagp); float nanf(const char *tagp); long double nanl(const char *tagp); double nextafter(double x, double y); float nextafterf(float x, float y); long double nextafterl(long double x, long double y); double nexttoward(double x, long double y); float nexttowardf(float x, long double y); long double nexttowardl(long double x, long double y); double fdim(double x, double y); float fdimf(float x, float y); long double fdiml(long double x, long double y); double fmax(double x, double y); float fmaxf(float x, float y); long double fmaxl(long double x, long double y); double fmin(double x, double y); float fminf(float x, float y); long double fminl(long double x, long double y); double fma(double x, double y, double z); float fmaf(float x, float y, float z); long double fmal(long double x, long double y, long double z); #pragma diag_pop //***************************************************************************** // // adc.h - ADC headers for using the ADC driver functions. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCSequenceConfigure as the ui32Trigger // parameter. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCSequenceStepConfigure as the ui32Config // parameter. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCComparatorConfigure as part of the // ui32Config parameter. // //***************************************************************************** // (Hysteresis) // (Hysteresis) //***************************************************************************** // // Values that can be used to modify the sequence number passed to // ADCProcessorTrigger in order to get cross-module synchronous processor // triggers. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCPhaseDelaySet as the ui32Phase parameter and // returned from ADCPhaseDelayGet. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCReferenceSet as the ui32Ref parameter. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCIntDisableEx(), ADCIntEnableEx(), // ADCIntClearEx() and ADCIntStatusEx(). // //***************************************************************************** //***************************************************************************** // // Values that can be passed to ADCClockConfigSet() and ADCClockConfigGet(). // //***************************************************************************** //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern void ADCIntRegister(uint32_t ui32Base, uint32_t ui32SequenceNum, void (*pfnHandler)(void)); extern void ADCIntUnregister(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCIntDisable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCIntEnable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern uint32_t ADCIntStatus(uint32_t ui32Base, uint32_t ui32SequenceNum, _Bool bMasked); extern void ADCIntClear(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceEnable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceDisable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceConfigure(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t ui32Trigger, uint32_t ui32Priority); extern void ADCSequenceStepConfigure(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t ui32Step, uint32_t ui32Config); extern int32_t ADCSequenceOverflow(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceOverflowClear(uint32_t ui32Base, uint32_t ui32SequenceNum); extern int32_t ADCSequenceUnderflow(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceUnderflowClear(uint32_t ui32Base, uint32_t ui32SequenceNum); extern int32_t ADCSequenceDataGet(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t *pui32Buffer); extern void ADCProcessorTrigger(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSoftwareOversampleConfigure(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t ui32Factor); extern void ADCSoftwareOversampleStepConfigure(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t ui32Step, uint32_t ui32Config); extern void ADCSoftwareOversampleDataGet(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t *pui32Buffer, uint32_t ui32Count); extern void ADCHardwareOversampleConfigure(uint32_t ui32Base, uint32_t ui32Factor); extern void ADCClockConfigSet(uint32_t ui32Base, uint32_t ui32Config, uint32_t ui32ClockDiv); extern uint32_t ADCClockConfigGet(uint32_t ui32Base, uint32_t *pui32ClockDiv); extern void ADCComparatorConfigure(uint32_t ui32Base, uint32_t ui32Comp, uint32_t ui32Config); extern void ADCComparatorRegionSet(uint32_t ui32Base, uint32_t ui32Comp, uint32_t ui32LowRef, uint32_t ui32HighRef); extern void ADCComparatorReset(uint32_t ui32Base, uint32_t ui32Comp, _Bool bTrigger, _Bool bInterrupt); extern void ADCComparatorIntDisable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCComparatorIntEnable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern uint32_t ADCComparatorIntStatus(uint32_t ui32Base); extern void ADCComparatorIntClear(uint32_t ui32Base, uint32_t ui32Status); extern void ADCIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags); extern void ADCIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags); extern uint32_t ADCIntStatusEx(uint32_t ui32Base, _Bool bMasked); extern void ADCIntClearEx(uint32_t ui32Base, uint32_t ui32IntFlags); extern void ADCSequenceDMAEnable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern void ADCSequenceDMADisable(uint32_t ui32Base, uint32_t ui32SequenceNum); extern _Bool ADCBusy(uint32_t ui32Base); extern void ADCReferenceSet(uint32_t ui32Base, uint32_t ui32Ref); extern uint32_t ADCReferenceGet(uint32_t ui32Base); extern void ADCPhaseDelaySet(uint32_t ui32Base, uint32_t ui32Phase); extern uint32_t ADCPhaseDelayGet(uint32_t ui32Base); extern void ADCSampleRateSet(uint32_t ui32Base, uint32_t ui32ADCClock, uint32_t ui32Rate); extern uint32_t ADCSampleRateGet(uint32_t ui32Base); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** //***************************************************************************** // // gpio.h - Defines and Macros for GPIO API. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // The following values define the bit field for the ui8Pins argument to // several of the APIs. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to GPIODirModeSet as the ui32PinIO parameter, and // returned from GPIODirModeGet. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to GPIOIntTypeSet as the ui32IntType parameter, // and returned from GPIOIntTypeGet. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to GPIOPadConfigSet as the ui32Strength parameter, // and returned by GPIOPadConfigGet in the *pui32Strength parameter. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to GPIOPadConfigSet as the ui32PadType parameter, // and returned by GPIOPadConfigGet in the *pui32PadType parameter. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to GPIOIntEnable() and GPIOIntDisable() functions // in the ui32IntFlags parameter. // //***************************************************************************** //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern void GPIODirModeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32PinIO); extern uint32_t GPIODirModeGet(uint32_t ui32Port, uint8_t ui8Pin); extern void GPIOIntTypeSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32IntType); extern uint32_t GPIOIntTypeGet(uint32_t ui32Port, uint8_t ui8Pin); extern void GPIOPadConfigSet(uint32_t ui32Port, uint8_t ui8Pins, uint32_t ui32Strength, uint32_t ui32PadType); extern void GPIOPadConfigGet(uint32_t ui32Port, uint8_t ui8Pin, uint32_t *pui32Strength, uint32_t *pui32PadType); extern void GPIOIntEnable(uint32_t ui32Port, uint32_t ui32IntFlags); extern void GPIOIntDisable(uint32_t ui32Port, uint32_t ui32IntFlags); extern uint32_t GPIOIntStatus(uint32_t ui32Port, _Bool bMasked); extern void GPIOIntClear(uint32_t ui32Port, uint32_t ui32IntFlags); extern void GPIOIntRegister(uint32_t ui32Port, void (*pfnIntHandler)(void)); extern void GPIOIntUnregister(uint32_t ui32Port); extern void GPIOIntRegisterPin(uint32_t ui32Port, uint32_t ui32Pin, void (*pfnIntHandler)(void)); extern void GPIOIntUnregisterPin(uint32_t ui32Port, uint32_t ui32Pin); extern int32_t GPIOPinRead(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinWrite(uint32_t ui32Port, uint8_t ui8Pins, uint8_t ui8Val); extern void GPIOPinConfigure(uint32_t ui32PinConfig); extern void GPIOPinTypeADC(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeCAN(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeComparator(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeComparatorOutput(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeDIVSCLK(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeEPI(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeEthernetLED(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeEthernetMII(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeGPIOInput(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeGPIOOutput(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeGPIOOutputOD(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeHibernateRTCCLK(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeI2C(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeI2CSCL(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeLCD(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeOneWire(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypePWM(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeQEI(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeSSI(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeTimer(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeTrace(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeUART(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeUSBAnalog(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeUSBDigital(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeWakeHigh(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOPinTypeWakeLow(uint32_t ui32Port, uint8_t ui8Pins); extern uint32_t GPIOPinWakeStatus(uint32_t ui32Port); extern void GPIODMATriggerEnable(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIODMATriggerDisable(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOADCTriggerEnable(uint32_t ui32Port, uint8_t ui8Pins); extern void GPIOADCTriggerDisable(uint32_t ui32Port, uint8_t ui8Pins); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** //***************************************************************************** // // pin_map.h - Mapping of peripherals to pins for all parts. // // Copyright (c) 2007-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // TM4C1230C3PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1230D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1230E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1230H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231C3PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231D5PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231E6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231H6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1232C3PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1232D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1232E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1232H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233C3PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233D5PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233E6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233H6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1236D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1236E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1236H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237D5PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237D5PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237E6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237E6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237H6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237H6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123AE6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123AH6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BE6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BE6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BH6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BH6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123FE6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123FH6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GE6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GE6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GH6PM Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GH6PZ Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1231H6PGE Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1233H6PGE Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1237H6PGE Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BH6PGE Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123BH6ZRB Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GH6PGE Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GH6ZRB Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C123GH6ZXR Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1290NCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1290NCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1292NCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1292NCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1294KCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1294NCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1294NCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1297NCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1299KCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C1299NCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129CNCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129CNCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129DNCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129DNCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129EKCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129ENCPDT Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129ENCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129LNCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129XKCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // TM4C129XNCZAD Port/Pin Mapping Definitions // //***************************************************************************** //***************************************************************************** // // rom_map.h - Macros to facilitate calling functions in the ROM when they are // available and in flash otherwise. // // Copyright (c) 2008-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // Macros for the ADC API. // //***************************************************************************** //***************************************************************************** // // Macros for the AES API. // //***************************************************************************** //***************************************************************************** // // Macros for the CAN API. // //***************************************************************************** //***************************************************************************** // // Macros for the Comparator API. // //***************************************************************************** //***************************************************************************** // // Macros for the CRC API. // //***************************************************************************** //***************************************************************************** // // Macros for the DES API. // //***************************************************************************** //***************************************************************************** // // Macros for the EEPROM API. // //***************************************************************************** //***************************************************************************** // // Macros for the EPI API. // //***************************************************************************** //***************************************************************************** // // Macros for the EMAC API. // //***************************************************************************** //***************************************************************************** // // Macros for the Flash API. // //***************************************************************************** //***************************************************************************** // // Macros for the FPU API. // //***************************************************************************** //***************************************************************************** // // Macros for the GPIO API. // //***************************************************************************** //***************************************************************************** // // Macros for the Hibernate API. // //***************************************************************************** //***************************************************************************** // // Macros for the I2C API. // //***************************************************************************** //***************************************************************************** // // Macros for the Interrupt API. // //***************************************************************************** //***************************************************************************** // // Macros for the LCD API. // //***************************************************************************** //***************************************************************************** // // Macros for the MPU API. // //***************************************************************************** //***************************************************************************** // // Macros for the OneWire API. // //***************************************************************************** //***************************************************************************** // // Macros for the PWM API. // //***************************************************************************** //***************************************************************************** // // Macros for the QEI API. // //***************************************************************************** //***************************************************************************** // // Macros for the SHAMD5 API. // //***************************************************************************** //***************************************************************************** // // Macros for the SMBus API. // //***************************************************************************** //***************************************************************************** // // Macros for the SPIFlash API. // //***************************************************************************** //***************************************************************************** // // Macros for the SSI API. // //***************************************************************************** //***************************************************************************** // // Macros for the SysCtl API. // //***************************************************************************** //***************************************************************************** // // Macros for the SysExc API. // //***************************************************************************** //***************************************************************************** // // Macros for the SysTick API. // //***************************************************************************** //***************************************************************************** // // Macros for the Timer API. // //***************************************************************************** //***************************************************************************** // // Macros for the UART API. // //***************************************************************************** //***************************************************************************** // // Macros for the uDMA API. // //***************************************************************************** //***************************************************************************** // // Macros for the USB API. // //***************************************************************************** //***************************************************************************** // // Macros for the Watchdog API. // //***************************************************************************** //***************************************************************************** // // Macros for the Software API. // //***************************************************************************** //***************************************************************************** // // sysctl.h - Prototypes for the system control driver. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the // SysCtlPeripheralPresent(), SysCtlPeripheralEnable(), // SysCtlPeripheralDisable(), and SysCtlPeripheralReset() APIs as the // ui32Peripheral parameter. The peripherals in the fourth group (upper nibble // is 3) can only be used with the SysCtlPeripheralPresent() API. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlLDOSleepSet() and // SysCtlLDODeepSleepSet() APIs as the ui32Voltage value, or returned by the // SysCtlLDOSleepGet() and SysCtlLDODeepSleepGet() APIs. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlIntEnable(), // SysCtlIntDisable(), and SysCtlIntClear() APIs, or returned in the bit mask // by the SysCtlIntStatus() API. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlResetCauseClear() // API or returned by the SysCtlResetCauseGet() API. // //***************************************************************************** // Watchdog reset(Deprecated) //***************************************************************************** // // The following are values that can be passed to the SysCtlBrownOutConfigSet() // API as the ui32Config parameter. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlPWMClockSet() API // as the ui32Config parameter, and can be returned by the SysCtlPWMClockGet() // API. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlClockSet() API as // the ui32Config parameter. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlDeepSleepClockSet() // API as the ui32Config parameter. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlPIOSCCalibrate() // API as the ui32Type parameter. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlMOSCConfigSet() API // as the ui32Config parameter. // //***************************************************************************** //***************************************************************************** // // The following are values that can be passed to the SysCtlSleepPowerSet() and // SysCtlDeepSleepPowerSet() APIs as the ui32Config parameter. // //***************************************************************************** // (Deep Sleep Only) // (Deep Sleep Only) //***************************************************************************** // // Defines for the SysCtlResetBehaviorSet() and SysCtlResetBehaviorGet() APIs. // //***************************************************************************** //***************************************************************************** // // Values used with the SysCtlVoltageEventConfig() API. // //***************************************************************************** //***************************************************************************** // // Values used with the SysCtlVoltageEventStatus() and // SysCtlVoltageEventClear() APIs. // //***************************************************************************** //***************************************************************************** // // Values used with the SysCtlNMIStatus() API. // //***************************************************************************** //***************************************************************************** // // The defines for the SysCtlClockOutConfig() API. // //***************************************************************************** //***************************************************************************** // // The following defines are used with the SysCtlAltClkConfig() function. // //***************************************************************************** //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern uint32_t SysCtlSRAMSizeGet(void); extern uint32_t SysCtlFlashSizeGet(void); extern uint32_t SysCtlFlashSectorSizeGet(void); extern _Bool SysCtlPeripheralPresent(uint32_t ui32Peripheral); extern _Bool SysCtlPeripheralReady(uint32_t ui32Peripheral); extern void SysCtlPeripheralPowerOn(uint32_t ui32Peripheral); extern void SysCtlPeripheralPowerOff(uint32_t ui32Peripheral); extern void SysCtlPeripheralReset(uint32_t ui32Peripheral); extern void SysCtlPeripheralEnable(uint32_t ui32Peripheral); extern void SysCtlPeripheralDisable(uint32_t ui32Peripheral); extern void SysCtlPeripheralSleepEnable(uint32_t ui32Peripheral); extern void SysCtlPeripheralSleepDisable(uint32_t ui32Peripheral); extern void SysCtlPeripheralDeepSleepEnable(uint32_t ui32Peripheral); extern void SysCtlPeripheralDeepSleepDisable(uint32_t ui32Peripheral); extern void SysCtlPeripheralClockGating(_Bool bEnable); extern void SysCtlIntRegister(void (*pfnHandler)(void)); extern void SysCtlIntUnregister(void); extern void SysCtlIntEnable(uint32_t ui32Ints); extern void SysCtlIntDisable(uint32_t ui32Ints); extern void SysCtlIntClear(uint32_t ui32Ints); extern uint32_t SysCtlIntStatus(_Bool bMasked); extern void SysCtlLDOSleepSet(uint32_t ui32Voltage); extern uint32_t SysCtlLDOSleepGet(void); extern void SysCtlLDODeepSleepSet(uint32_t ui32Voltage); extern uint32_t SysCtlLDODeepSleepGet(void); extern void SysCtlSleepPowerSet(uint32_t ui32Config); extern void SysCtlDeepSleepPowerSet(uint32_t ui32Config); extern void SysCtlReset(void); extern void SysCtlSleep(void); extern void SysCtlDeepSleep(void); extern uint32_t SysCtlResetCauseGet(void); extern void SysCtlResetCauseClear(uint32_t ui32Causes); extern void SysCtlBrownOutConfigSet(uint32_t ui32Config, uint32_t ui32Delay); extern void SysCtlDelay(uint32_t ui32Count); extern void SysCtlMOSCConfigSet(uint32_t ui32Config); extern uint32_t SysCtlPIOSCCalibrate(uint32_t ui32Type); extern void SysCtlClockSet(uint32_t ui32Config); extern uint32_t SysCtlClockGet(void); extern void SysCtlDeepSleepClockSet(uint32_t ui32Config); extern void SysCtlDeepSleepClockConfigSet(uint32_t ui32Div, uint32_t ui32Config); extern void SysCtlPWMClockSet(uint32_t ui32Config); extern uint32_t SysCtlPWMClockGet(void); extern void SysCtlIOSCVerificationSet(_Bool bEnable); extern void SysCtlMOSCVerificationSet(_Bool bEnable); extern void SysCtlPLLVerificationSet(_Bool bEnable); extern void SysCtlClkVerificationClear(void); extern void SysCtlGPIOAHBEnable(uint32_t ui32GPIOPeripheral); extern void SysCtlGPIOAHBDisable(uint32_t ui32GPIOPeripheral); extern void SysCtlUSBPLLEnable(void); extern void SysCtlUSBPLLDisable(void); extern uint32_t SysCtlClockFreqSet(uint32_t ui32Config, uint32_t ui32SysClock); extern void SysCtlResetBehaviorSet(uint32_t ui32Behavior); extern uint32_t SysCtlResetBehaviorGet(void); extern void SysCtlClockOutConfig(uint32_t ui32Config, uint32_t ui32Div); extern void SysCtlAltClkConfig(uint32_t ui32Config); extern uint32_t SysCtlNMIStatus(void); extern void SysCtlNMIClear(uint32_t ui32Status); extern void SysCtlVoltageEventConfig(uint32_t ui32Config); extern uint32_t SysCtlVoltageEventStatus(void); extern void SysCtlVoltageEventClear(uint32_t ui32Status); extern _Bool SysCtlVCOGet(uint32_t ui32Crystal, uint32_t *pui32VCOFrequency); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** //***************************************************************************** // // hw_memmap.h - Macros defining the memory map of the device. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Firmware Development Package. // //***************************************************************************** //***************************************************************************** // // The following are defines for the base address of the memories and // peripherals. // //***************************************************************************** // (GPIOs) // (GPIOs) // (GPIOs) // Hardware-Accelerated Module // Accelerator (DES) //***************************************************************************** // // hw_types.h - Common types and macros. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Firmware Development Package. // //***************************************************************************** //***************************************************************************** // // Macros for hardware access, both direct and via the bit-band region. // //***************************************************************************** //***************************************************************************** // // Helper Macros for determining silicon revisions, etc. // // These macros will be used by Driverlib at "run-time" to create necessary // conditional code blocks that will allow a single version of the Driverlib // "binary" code to support multiple(all) Tiva silicon revisions. // // It is expected that these macros will be used inside of a standard 'C' // conditional block of code, e.g. // // if(CLASS_IS_TM4C123) // { // do some TM4C123-class specific code here. // } // // By default, these macros will be defined as run-time checks of the // appropriate register(s) to allow creation of run-time conditional code // blocks for a common DriverLib across the entire Tiva family. // // However, if code-space optimization is required, these macros can be "hard- // coded" for a specific version of Tiva silicon. Many compilers will then // detect the "hard-coded" conditionals, and appropriately optimize the code // blocks, eliminating any "unreachable" code. This would result in a smaller // Driverlib, thus producing a smaller final application size, but at the cost // of limiting the Driverlib binary to a specific Tiva silicon revision. // //***************************************************************************** //***************************************************************************** // // For TivaWare 2.1, we removed all references to Tiva IC codenames from the // source. To ensure that existing customer code doesn't break as a result // of this change, make sure that the old definitions are still available at // least for the time being. // //***************************************************************************** //***************************************************************************** // // hw_gpio.h - Defines and Macros for GPIO hardware. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Firmware Development Package. // //***************************************************************************** //***************************************************************************** // // The following are defines for the GPIO register offsets. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_IM register. // //***************************************************************************** // Enable //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_RIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_MIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_ICR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_LOCK register. // //***************************************************************************** // and may be modified // and may not be modified //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_SI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_DR12R register. // //***************************************************************************** // 12-mA drive. This encoding is // only valid if the GPIOPP EDE bit // is set and the appropriate // GPIOPC EDM bit field is // programmed to 0x3 //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_WAKEPEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_WAKELVL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_WAKESTAT // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_PC register. // //***************************************************************************** // are maintained. GPIO n Drive // Select (GPIODRnR) registers // function as normal // provided // setting the corresponding // GPIODR4R register bit adds 2 mA // and setting the corresponding // GPIODR8R of GPIODR12R register // bit adds an additional 4 mA //***************************************************************************** // // uart.h - Defines and Macros for the UART. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTIntEnable, UARTIntDisable, and UARTIntClear // as the ui32IntFlags parameter, and returned from UARTIntStatus. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTConfigSetExpClk as the ui32Config parameter // and returned by UARTConfigGetExpClk in the pui32Config parameter. // Additionally, the UART_CONFIG_PAR_* subset can be passed to // UARTParityModeSet as the ui32Parity parameter, and are returned by // UARTParityModeGet. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTFIFOLevelSet as the ui32TxLevel parameter // and returned by UARTFIFOLevelGet in the pui32TxLevel. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTFIFOLevelSet as the ui32RxLevel parameter // and returned by UARTFIFOLevelGet in the pui32RxLevel. // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTDMAEnable() and UARTDMADisable(). // //***************************************************************************** //***************************************************************************** // // Values returned from UARTRxErrorGet(). // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTHandshakeOutputsSet() or returned from // UARTHandshakeOutputGet(). // //***************************************************************************** //***************************************************************************** // // Values that can be returned from UARTHandshakeInputsGet(). // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTFlowControl() or returned from // UARTFlowControlGet(). // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTTxIntModeSet() or returned from // UARTTxIntModeGet(). // //***************************************************************************** //***************************************************************************** // // Values that can be passed to UARTClockSourceSet() or returned from // UARTClockSourceGet(). // //***************************************************************************** //***************************************************************************** // // API Function prototypes // //***************************************************************************** extern void UARTParityModeSet(uint32_t ui32Base, uint32_t ui32Parity); extern uint32_t UARTParityModeGet(uint32_t ui32Base); extern void UARTFIFOLevelSet(uint32_t ui32Base, uint32_t ui32TxLevel, uint32_t ui32RxLevel); extern void UARTFIFOLevelGet(uint32_t ui32Base, uint32_t *pui32TxLevel, uint32_t *pui32RxLevel); extern void UARTConfigSetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t ui32Baud, uint32_t ui32Config); extern void UARTConfigGetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t *pui32Baud, uint32_t *pui32Config); extern void UARTEnable(uint32_t ui32Base); extern void UARTDisable(uint32_t ui32Base); extern void UARTFIFOEnable(uint32_t ui32Base); extern void UARTFIFODisable(uint32_t ui32Base); extern void UARTEnableSIR(uint32_t ui32Base, _Bool bLowPower); extern void UARTDisableSIR(uint32_t ui32Base); extern _Bool UARTCharsAvail(uint32_t ui32Base); extern _Bool UARTSpaceAvail(uint32_t ui32Base); extern int32_t UARTCharGetNonBlocking(uint32_t ui32Base); extern int32_t UARTCharGet(uint32_t ui32Base); extern _Bool UARTCharPutNonBlocking(uint32_t ui32Base, unsigned char ucData); extern void UARTCharPut(uint32_t ui32Base, unsigned char ucData); extern void UARTBreakCtl(uint32_t ui32Base, _Bool bBreakState); extern _Bool UARTBusy(uint32_t ui32Base); extern void UARTIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)); extern void UARTIntUnregister(uint32_t ui32Base); extern void UARTIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags); extern void UARTIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags); extern uint32_t UARTIntStatus(uint32_t ui32Base, _Bool bMasked); extern void UARTIntClear(uint32_t ui32Base, uint32_t ui32IntFlags); extern void UARTDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags); extern void UARTDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags); extern uint32_t UARTRxErrorGet(uint32_t ui32Base); extern void UARTRxErrorClear(uint32_t ui32Base); extern void UARTSmartCardEnable(uint32_t ui32Base); extern void UARTSmartCardDisable(uint32_t ui32Base); extern void UARTModemControlSet(uint32_t ui32Base, uint32_t ui32Control); extern void UARTModemControlClear(uint32_t ui32Base, uint32_t ui32Control); extern uint32_t UARTModemControlGet(uint32_t ui32Base); extern uint32_t UARTModemStatusGet(uint32_t ui32Base); extern void UARTFlowControlSet(uint32_t ui32Base, uint32_t ui32Mode); extern uint32_t UARTFlowControlGet(uint32_t ui32Base); extern void UARTTxIntModeSet(uint32_t ui32Base, uint32_t ui32Mode); extern uint32_t UARTTxIntModeGet(uint32_t ui32Base); extern void UARTClockSourceSet(uint32_t ui32Base, uint32_t ui32Source); extern uint32_t UARTClockSourceGet(uint32_t ui32Base); extern void UART9BitEnable(uint32_t ui32Base); extern void UART9BitDisable(uint32_t ui32Base); extern void UART9BitAddrSet(uint32_t ui32Base, uint8_t ui8Addr, uint8_t ui8Mask); extern void UART9BitAddrSend(uint32_t ui32Base, uint8_t ui8Addr); extern void UARTLoopbackEnable(uint32_t ui32Base); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** //***************************************************************************** // // hw_ints.h - Macros that define the interrupt assignment on Tiva C Series // MCUs. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Firmware Development Package. // //***************************************************************************** //***************************************************************************** // // The following are defines for the fault assignments. // //***************************************************************************** //***************************************************************************** // // TM4C123 Class Interrupts // //***************************************************************************** // Control //***************************************************************************** // // TM4C129 Class Interrupts // //***************************************************************************** // (imprecise) //***************************************************************************** // // TM4C123 Interrupt Class Definition // //***************************************************************************** //***************************************************************************** // // TM4C129 Interrupt Class Definition // //***************************************************************************** //***************************************************************************** // // Macros to resolve the INT_PERIPH_CLASS name to a common INT_PERIPH name. // //***************************************************************************** //***************************************************************************** // // The following are defines for the interrupt assignments. // //***************************************************************************** //***************************************************************************** // // The following are defines for the total number of interrupts. // //***************************************************************************** //***************************************************************************** // // The following are defines for the total number of priority levels. // //***************************************************************************** //***************************************************************************** // // interrupt.h - Prototypes for the NVIC Interrupt Controller Driver. // // Copyright (c) 2005-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // 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. // // This is part of revision 2.1.4.178 of the Tiva Peripheral Driver Library. // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // Macro to generate an interrupt priority mask based on the number of bits // of priority supported by the hardware. // //***************************************************************************** //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern _Bool IntMasterEnable(void); extern _Bool IntMasterDisable(void); extern void IntRegister(uint32_t ui32Interrupt, void (*pfnHandler)(void)); extern void IntUnregister(uint32_t ui32Interrupt); extern void IntPriorityGroupingSet(uint32_t ui32Bits); extern uint32_t IntPriorityGroupingGet(void); extern void IntPrioritySet(uint32_t ui32Interrupt, uint8_t ui8Priority); extern int32_t IntPriorityGet(uint32_t ui32Interrupt); extern void IntEnable(uint32_t ui32Interrupt); extern void IntDisable(uint32_t ui32Interrupt); extern uint32_t IntIsEnabled(uint32_t ui32Interrupt); extern void IntPendSet(uint32_t ui32Interrupt); extern void IntPendClear(uint32_t ui32Interrupt); extern void IntPriorityMaskSet(uint32_t ui32PriorityMask); extern uint32_t IntPriorityMaskGet(void); extern void IntTrigger(uint32_t ui32Interrupt); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** // Macros (basically, constants that the processor calculates before running the program) // Macros increase performance. //#define TWICETIMEINCREMENT (2 * (PULSESNUMBER * (1 / DATAFREQ)) / ARRAYSIZE) // Global variables to change the analyzing wave's frequency and the number of samples // For the GUI's benefit _Bool runXCorr; uint16_t analyzingFreq; uint8_t samplesNumber; uint16_t averageValue; uint8_t buttonCount = 0; uint8_t dataWave[2048]; uint8_t analyzingWave[2048]; uint16_t counter = 0; // Creates data square wave (for testing purposes, for the real implementation actual ADC data will be used). This // square wave has unity magnitude. // The number of high values in each period is determined by high values = array size / (2 * number of pulses) void createDataWave(uint8_t wave[]){ uint16_t highValues = 2048 / (16 << 1);//(2 * PULSESNUMBER); uint16_t counter = 0; uint16_t p; for(p = 0; p < 2048; p++){ if ((counter % 2) == 0){ wave[p] = 1; } else{ wave[p] = 0; } if ((p + 1) % highValues == 0){ counter++; } } } // Creates analyzing square wave. This square wave has unity (1) magnitude. // The number of high values in each period is determined by high values = (analyzingT/2) / time increment void createAnalyzingWave(uint16_t analyzingFreq, uint8_t wave[]){ //uint8_t highValues = (1 / analyzingFreq) / (((PULSESNUMBER * (1 / DATAFREQ)) / ARRAYSIZE) << 1); //(2 * (PULSESNUMBER * (1 / DATAFREQ)) / ARRAYSIZE); uint16_t highValues = round((1300 * 2048) / (2 * 16 * analyzingFreq)); uint16_t counter = 0; uint16_t p; for(p = 1; p <= 2048; p++){ if ((counter % 2) == 0){ wave[p - 1] = 1; } else{ wave[p - 1] = 0; } if (p % highValues == 0){ counter++; } } } // Cross-Correlation algorithm. Cross-correlates 2 vectors of equal size with each other. // Returns maximum cross-correlation value as a double. // Inputs: // 2 vectors, must be equal size // Size of each vector uint16_t crossCorrelationV4(uint8_t dataWave[], uint8_t analyzingWave[]){ uint16_t maxCorr = 0; uint16_t i, j; uint16_t dec = 0; uint16_t lastArrayIndex = 2048 - 1; uint16_t inc = lastArrayIndex; uint16_t sum1 = 0; uint16_t sum2 = 0; for (i = 0; i < 2048; i++){ for (j = 0; j <= i; j++){ sum1 = dataWave[j] * analyzingWave[j + 2048 - 1 - dec] + sum1; sum2 = dataWave[j + inc] * analyzingWave[j] + sum2; } inc--; dec++; if (sum1 - sum2 > 0 && sum1 > maxCorr){ maxCorr = sum1; } else if (sum1 - sum2 <= 0 && sum2 > maxCorr){ maxCorr = sum2; } sum1 = 0; sum2 = 0; } //uint16_t tempMaxCorr = maxCorr; //maxCorr = 0; //return tempMaxCorr; return maxCorr; } int main(void){ // Enables the clock SysCtlClockSet(0xC1000000|0x00000000|0x00000000|0x00000540); // Enables pin F SysCtlPeripheralEnable(0xf0000805); // Enables the output LEDs GPIOPinTypeGPIOOutput(0x40025000, 0x00000002|0x00000004|0x00000008); //uint8_t analyzingWave[ARRAYSIZE]; //uint8_t dataWave[ARRAYSIZE]; /* uint8_t i; uint16_t sum = 0; for(i = 0; i < samplesNumber; i++){ createDataWave(dataWave); sum = crossCorrelationV4(dataWave, analyzingWave) + sum; } averageValue = sum / samplesNumber; */ while (1){ //Delay for a bit, see if this fixes the double click issue. Maybe XDS needs to wait for a new value SysCtlDelay(2000000); // For some reason, you have to double click the run correlation button before you enter the if statement // Each time you click the run correlation button, buttonCount is incremented by 1. So, you have to // set buttonCount to 0 at the end of the if statement. if (buttonCount > 0){ runXCorr = 1; // For some reason, analyzing wave is getting super dense at low frequencies createAnalyzingWave(analyzingFreq, analyzingWave); uint8_t i; uint16_t sum = 0; for(i = 1; i <= samplesNumber; i++){ // data wave created on every other button press, for some reason (NEED TO FIX THIS) createDataWave(dataWave); sum = crossCorrelationV4(dataWave, analyzingWave) + sum; } averageValue = sum / samplesNumber; buttonCount = 0; counter++; //sets analyzing wave to 0 //memset(analyzingWave, 0, sizeof(analyzingWave)); runXCorr = 0; } //sum = 0; //averageValue = 0; // For the GUI with toggle button /* if (runXCorr){ createAnalyzingWave(analyzingFreq, analyzingWave); uint8_t i; sum = 0; //uint16_t sum = 0; for(i = 0; i < samplesNumber; i++){ createDataWave(dataWave); sum = crossCorrelationV4(dataWave, analyzingWave) + sum; } averageValue = sum / samplesNumber; }else { averageValue = 0; sum = 0; }*/ /*if(averageValue == ARRAYSIZE >> 1){ //if(averageValue == ARRAYSIZE >> 1){ GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 8); } else { GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x00); } SysCtlDelay(2000000);*/ } }