/* * Can.c */ #pragma diag_push #pragma CHECK_MISRA("none") /* * Can.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * ComStack_Types.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * Std_Types.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * 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. */ /* */ /*****************************************************************************/ /*- * 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-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. */ /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. */ /* * 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-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$ */ /*- * 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 /*- * 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 */ typedef enum { E_NOT_OK, E_OK }Std_ReturnType; /* * ComStack_Cfg.h * * Created on: May 4, 2018 * Author: Ahmed Usama Khalifa */ /* * ComStack_Cfg.h shall be generated by the generator to generate / * the type definition of the PduIdType and PduLengthType from the/ * EcuC Virtual Layer based on the configuration e.g. typedef uint8/ * PduIdType if number of PDUs are less than 256 */ typedef uint8_t PduLengthType_t; typedef enum { BUFREQ_OK = 0, // Data has been copied to the transmit buffer completely as requested /* * Request could not be fulfilled, because the required amount of Tx data is not available. * The lower layer module may retry this call later on. No data has been copied. */ BUFREQ_E_BUSY, BUFREQ_E_NOT_OK // Data has not been copied. Request failed } BufReq_ReturnType_t; /* Type of PDU Length, * Allowed ranges: uint8 .. uint32 */ /* * Variables of this type shall be used to store the basic information about a PDU of any type, * namely a pointer variable pointing to its SDU (payload), * a pointer to Meta Data of the PDU, * and the corresponding length of the SDU in bytes. */ typedef struct PduInfoType { uint8_t* SduDataptr; uint8_t* MetaDataptr; PduLengthType_t SduLength; } PduInfoType_t; typedef struct { } RetryInfoType_t; /* * Can_GeneralTypes.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * * Can_GeneralTypes.h shall contain all types and constants that * are shared among the AUTOSAR CAN modules Can, CanIf and CanTrcv. */ typedef uint32_t Can_IdType_t; typedef uint16_t Can_HwHandleType_t; typedef uint32_t PduIdType_t; typedef struct Can_PduType { PduIdType_t swPduHandle; uint8_t length; Can_IdType_t id; uint8_t* sdu; } Can_PduType_t; typedef enum { CAN_CS_UNINIT = 0x00, CAN_CS_STARTED = 0x01, CAN_CS_STOPPED = 0x02, CAN_CS_SLEEP = 0x03 }Can_ControllerStateType; /* Can_StateTransitionType */ typedef enum { CAN_T_START, CAN_T_STOP, CAN_T_SLEEP, CAN_T_WAKEUP }Can_StateTransitionType_t; typedef enum { CAN_OK, CAN_NOT_OK, CAN_BUSY } Can_ReturnType_t; typedef struct Can_HwType { Can_IdType_t id; Can_HwHandleType_t hoh; uint8_t ctrlId; }Can_HwType_t; /* * Can_Cfg.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * Static_Can_Cfg.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ //#define CTRL0 0 //#define CTRL1 1 //#define NUM_OF_HRH 16 //#define NUM_OF_CONFIGS 1 //#define CAN0_BASE_ADDRESS 0x40040000 //#define CAN1_BASE_ADDRESS 0x40041000 //#define CPU_CLOCK 16000000 //#define DEFAULT_BR 100000 //#define BR1 500000 /* SYSCTL_PERIPH_CAN0 */ /* * Mcu_Cfg.h * * Created on: May 5, 2018 * Author: Ahmed Usama Khalifa */ typedef uint32_t Mcu_ClockType; typedef struct McuClockReferencePoint { uint32_t McuClockReferencePointFrequency; }McuClockReferencePoint_t; typedef struct { // This parameter shall represent the Data pre-setting to be initialized uint32_t McuRamDefaultValue; // This parameter shall represent the MCU RAM section base address uint32_t McuRamSectionBaseAddress; // This parameter shall represent the MCU RAM Section size uint32_t McuRamSectionSize; } Mcu_RamSectorSettingConfigType; typedef struct { uint32_t AHBClocksEnable; uint32_t APB1ClocksEnable; uint32_t APB2ClocksEnable; } Mcu_PerClockConfigType; /* [SWS_Mcu_00131]: The structure Mcu_ConfigType is an external data structure and shall contain the initialization data for the MCU module. It shall contain: MCU dependent properties Reset Configuration Definition of MCU modes Definition of Clock settings Definition of RAM sections */ typedef struct { // Enables/Disables clock failure notification. In case this feature is not supported // by HW the setting should be disabled. uint8_t McuClockSrcFailureNotification; // This parameter shall represent the number of Modes available for the // MCU. calculationFormula = Number of configured McuModeSettingConf //uint8_t McuNumberOfMcuModes; /* Not supported */ // This parameter shall represent the number of RAM sectors available for // the MCU. calculationFormula = Number of configured McuRamSectorSet- // tingConf uint8_t McuRamSectors; // This parameter shall represent the number of clock setting available for // the MCU. uint8_t McuClockSettings; // This parameter defines the default clock settings that should be used // It is an index into the McuClockSettingsConfig Mcu_ClockType McuDefaultClockSettings; // This parameter relates to the MCU specific reset configuration. This ap- // plies to the function Mcu_PerformReset, which performs a microcontroller // reset using the hardware feature of the microcontroller. //uint32 McuResetSetting; // This container contains the configuration (parameters) for the // Clock settings of the MCU. Please see MCU031 for more in- // formation on the MCU clock settings. const McuClockReferencePoint_t * McuClockSettingConfig; // This container contains the configuration (parameters) for the // Mode setting of the MCU. Please see MCU035 for more information // on the MCU mode settings. //Mcu_ModeSettingConfigType *McuModeSettingConfig; // This container contains the configuration (parameters) for the // RAM Sector setting. Please see MCU030 for more information // on RAM sec-tor settings. const Mcu_RamSectorSettingConfigType *McuRamSectorSettingConfig; }Mcu_ConfigType; /* * All the CANIDs are of type extended only (29 bit). * */ /* * All the CANIDs are of type standard only (11bit). */ typedef uint32_t Can_IdType; /* * The type of CANIDs can be both Standard or Extended. */ /* This container contains bit timing related configuration/ * parameters of the CAN controller(s)./ * This container is a Sub container of "CanController" container with/ * upperMultiplicity = * ,lowerMultiplicity = 1/ */ typedef struct CanControllerBaudrateConfig { /*Specifies the baud rate of the controller in kbps. *Range 0 .. 2000, Multiplicity 1 */ uint32_t CanControllerBaudRate; /*Specifies propagation delay in time quantas. *Range 0 .. 255, Multiplicity 1 */ uint8_t CanControllerPropSeg; /*Specifies phase segment 1 in time quantas. *Range 0 .. 255, Multiplicity 1 */ uint8_t CanControllerSeg1; /*Specifies phase segment 1 in time quantas. *Range 0 .. 255, Multiplicity 1 */ uint8_t CanControllerSeg2; /*Specifies the synchronization jump width for the controller in time quanta. *Range 0 .. 255, Multiplicity 1 */ uint8_t CanControllerSyncJumpWidth; /*Uniquely identifies a specific baud rate configuration. This ID is used by SetBaudrate API. *Range 0 .. 65535, Multiplicity 1 *Default value = 0 */ uint16_t CanControllerBaudRateConfigID; }CanControllerBaudrateConfig_t; /* * Enables / disables API Can_MainFunction_Read() * for handling PDU reception events in polling mode. * * * Enables / disables API Can_MainFunction_Write() * for handling PDU transmission events in polling mode. * * * Enables / disables API Can_MainFunction_Wakeup() * for handling wakeup events in polling mode. */ typedef enum CanProcessing { INTERRUPT, POLLING }CanProcessing_t; /* This container "CanController" contains the configuration / * parameters of the CAN controller(s)./ * This container is a Sub container of "CanConfigSet" container with / * upperMultiplicity = * ,lowerMultiplicity = 1 */ typedef struct CanController { /* This parameter provides the controller ID which is unique in a given CAN Driver./ * The value for this parameter starts with 0 and continue without any gaps./ * The Range of CanControllerId is 0 .. 255, with Multiplicity 1. */ uint8_t CanControllerId; /* This parameter defines if a CAN controller is used in the configuration. * The Multiplicity 1. */ _Bool CanControllerActivation; /* This parameter specifies the CAN controller base address. * The Range of CanControllerBaseAddress is 0 .. 4294967295, with Multiplicity 1 */ uint32_t CanControllerBaseAddress; /* This parameter defines CAN driver support for wake up over CAN Bus. * The Multiplicity 1 */ _Bool CanWakeupSupport; /* Adds/removes the service Can_CheckWakeup() from the code. * True: Can_CheckWakeup can be used. False: Can_CheckWakeup cannot be used. * The Multiplicity 1. * Default value = false */ _Bool CanWakeupFunctionalityAPI; /* This parameter contains a reference to the Wake up Source for this controller / * as defined in the ECU State Manager./ * Multiplicity 0..1 / * COMMENTED AS ITS DESTINATION IS ECUM */ //EcuM_WakeupSourceType * CanWakeupSourceRef; /* Reference to the CPU clock configuration,/ * which is set in the MCU driver configuration./ * COMMENTED AS ITS DESTINATION IS MCU */ McuClockReferencePoint_t CanCpuClockRef; /* This container contains bit timing related configuration parameters of the CAN / * controller(s).The Multiplicity is 1..many / */ CanControllerBaudrateConfig_t CanControllerBaudrateConfig; /* Reference to baud rate configuration container configured for the Can Controller. * The Multiplicity is 1. */ CanControllerBaudrateConfig_t CanControllerDefaultBaudrate; /* Enables/disables API Can_MainFunction_Write() for handling PDU transmission / * events in polling mode.Its range: INTERRUPT,POLLING. */ CanProcessing_t CanTxProcessing; /* Enables/disables API Can_MainFunction_Read() for handling PDU reception / * events in polling mode. Its range: INTERRUPT,POLLING. */ CanProcessing_t CanRxProcessing; /* Enables/disables API Can_MainFunction_BusOff() for handling bus off events/ * in polling mode. Its range: INTERRUPT,POLLING. */ CanProcessing_t CanBusoffProcessing; /* Enables / disables API Can_MainFunction_Wakeup() for handling wake up events in polling mode. * Its range: INTERRUPT,POLLING. */ CanProcessing_t CanWakeupProcessing; }CanController_t; /* * This container is only valid for HRHs and contains / * the configuration (parameters) of one hardware filter. */ typedef struct CanHwFilter { /* * Describes a mask for hardware-based filtering of CAN identifiers./ * The CAN identifiers of incoming messages are masked with the appropriate/ * CanFilterMaskValue.Bits holding a 0 mean don't care,/ * i.e. do not compare the message's identifier in the respective bit position./ * The mask shall be build by filling with leading 0./ * The In case of CanIdType EXTENDED or MIXED a 29 bit mask shall */ uint32_t CanHwFilterMask ; /* * Specifies (together with the filter mask) the identifiers range that passes the hardware filter. */ uint32_t CanHwFilterCode ; }CanHwFilter_t; typedef enum CanObjectType { /* * Receive HOH */ RECEIVE, /* * Transmit HOH */ TRANSMIT }CanObjectType_t; /* * Specifies the type (Full-CAN or Basic-CAN) of a hardware object. * */ typedef enum CanHandleType { /* * For several L-PDUs are hadled by the hardware object * */ BASIC, /* * For only one L-PDU (identifier) is handled by the hardware object * */ FULL, }CanHandleType_t; /* * This container contains the parameter for configuring the period for cyclic call * to Can_MainFunction_Read or Can_MainFunction_Write depending on the referring item. */ typedef struct CanMainFunctionRWPeriods { /* * Unit is seconds. more info. in CAN SWS ->> 10.2.9 */ float CanMainFunctionPeriod; }CanMainFunctionRWPeriods_t ; /* * This container contains the configuration (parameters) of CAN Hardware Objects. */ typedef struct CanHardwareObject { /* * Reference to CAN Controller to which the HOH is associated to. * */ CanController_t* CanControllerRef ; /* * Specifies whether the IdValue is of type * standard identifier * extended identifier * mixed mode */ Can_IdType CanIdType; /* * Holds the handle ID of HRH or HTH. The value of this parameter is unique in a given CAN Driver, * and it should start with 0 and continue without any gaps. *The HRH and HTH Ids share a common ID range. * Example: HRH0-0, HRH1-1, HTH0-2, HTH1-3 * */ uint16_t CanObjectId; /* * Specifies if the HardwareObject is used as Transmit or as Receive object * */ CanObjectType_t CanObjectType; /* * Specifies the type (Full-CAN or Basic-CAN) of a hardware object. */ CanHandleType_t CanHandleType; /* * This container is only valid for HRHs and contains the configuration (parameters) of one hardware filter. */ CanHwFilter_t CanHwFilter;//done /* * Number of hardware objects used to implement one HOH. * In case of a HRH this parameter defines the number of elements in the hardware FIFO or the number of shadow buffers, * in case of a HTH it defines the number of hardware objects used for multiplexed transmission or * for a hardware FIFO used by a FullCAN HTH. * */ uint16_t CanHwObjectCount; /* * This parameter defines if or if not Can supports the trigger-transmit API for this handle. * */ _Bool CanTriggerTransmitEnable; /* * * Reference to CanMainFunctionPeriod */ CanMainFunctionRWPeriods_t* CanMainFunctionRWPeriodRef; uint8_t HOH ; // custom parameter }CanHardwareObject_t; /* * This parameter defines the operation, * which shall be used to verify the signal value creates a wakeup condition. * */ typedef enum CanIcomSignalOperation{ /* * The received signal value masked by CanIcomSignalMask has/ * at least one bit set in common withCanIcomSignalValue (binary AND). */ AND, /* * The received signal value masked by CanIcomSignalMask is equal to CanIcomSignalValue. * */ EQUAL, /* * The received signal value masked by CanIcomSignalMask is strictly greater than CanIcomSignalValue. * Values are interpreted as unsigned integers. * */ GREATER, /* * The received signal value masked by CanIcomSignalMask is strictly smaller than CanIcomSignalValue. * Values are interpreted as unsigned integers. * */ SMALLER, /* * The received signal value masked by CanIcomSignalMask then XORed to CanIcomSignalValue is not null. * */ XOR, }CanIcomSignalOperation_t; /* * This enum didn't support In SWS Can driver * */ typedef enum ComSignal { Notused, }ComSignal_t; typedef struct CanIcomRxMessageSignalConfig { /* *This parameter shall be used to mask a signal in the payload of a CAN message. *The mask is binary AND with the signal payload. *The The result will be used in combination of the operations/ *The defined in CanIcomSignalOperation with the CanIcomSignalValue. * */ uint32_t CanIcomSignalMask; /* * This parameter defines the operation, * which shall be used to verify the signal value creates a wakeup condition. * */ CanIcomSignalOperation_t CanIcomSignalOperation; /* * * This parameter shall be used to define a signal value which shall be compared/ * (CanIcomSignalOperation) with the masked CanIcomSignalMask value of the received signal (CanIcomSignalRef). */ uint32_t CanIcomSignalValue; /* * This parameter defines a reference to the signal which shall be checked additional to the message id (CanIcomMessageId). * This reference is used for documentation to define which ComSignal originates this filter setting./ * All signals being referred by this reference shall point to the same PDU. * */ ComSignal_t CanIcomSignalRef; }CanIcomRxMessageSignalConfig_t; /* * This container contains the configuration parameters for/ * the wakeup causes for matching received messages. * It has to be configured as often as received messages are/ * defined as wakeup cause. */ typedef struct CanIcomRxMessage { /* * This parameter defines that the MCU shall wake if the message with the ID is received n times on the communication channel. * */ uint16_t CanIcomCounterValue; /* * This parameter defines the message ID the wakeup causes of this CanIcomRxMessage are configured for. * In addition a mask (CanIcomMessageIdMask) can be defined, * in that case it is possible to define a range of rx messages, * which can create a wakeup condition. * */ uint32_t CanIcomMessageId; /* * Describes a mask for filtering of CAN identifiers. * he CAN identifiers of incoming messages are masked with this CanIcomMessageIdMask. * If the masked identifier matches the masked value of CanIcomMessageId, * it can create a wakeup condition for this CanIcomRxMessage. Bits holding a 0 mean don't care, * i.e. do not compare the message's identifier in the respective bit position. * The mask shall be build by filling with leading 0. */ uint32_t CanIcomMessageIdMask; /* * This parameter defines that the MCU shall wake if the message with the ID is not received/ * for a specific time in s on thecommunication channel. * */ float CanIcomMissingMessageTimerValue; /* * This parameter defines that the MCU shall wake if a payload error occurs * */ _Bool CanIcomPayloadLengthError; /* * This container contains the configuration parameters for the wakeup causes for matching signals. * It has to be configured as often as a signal is defined as wakeup cause. * If at least one Signal conditions defined in a CanIcomRxMessageSignalConfig evaluates to true or if/ * no CanIcomRxMessageSignalConfig are defined, * the whole wakeup condition is considered to be true. * All instances of this container refer to the same frame/pdu (see CanIcomMessageId). * */ CanIcomRxMessageSignalConfig_t CanIcomRxMessageSignalConfig; }CanIcomRxMessage_t; /* * This container contains the configuration parameters of / * the wakeup causes to leave the power saving mode. */ typedef struct CanIcomWakeupCauses { /* * This container contains the configuration parameters for/ * the wakeup causes for matching received messages. * It has to be configured as often as received messages are/ * defined as wakeup cause. */ CanIcomRxMessage_t CanIcomRxMessage; }CanIcomWakeupCauses_t; /* * This container contains the configuration parameters of the ICOM Configuration. */ typedef struct CanIcomConfig { /* * This parameter identifies the ID of the ICOM configuration. */ uint8_t CanIcomConfigId; /* * This parameter defines that the MCU shall wake if the bus off is detected or not. */ _Bool CanIcomWakeOnBusOff; /* * This container contains the configuration parameters of the wakeup * causes to leave the power saving mode */ CanIcomWakeupCauses_t CanIcomWakeupCauses ; }CanIcomConfig_t; /* * This container contains the parameters for configuring pretended networking */ typedef struct CanIcom { /* * This container contains the configuration parameters of the ICOM Configuration. */ CanIcomConfig_t CanIcomConfig; }CanIcom_t; /* * This container contains the configuration parameters and sub containers of the AUTOSAR Can module. * */ typedef struct CanConfigSet_t { /* * This container contains the configuration parameters of the CAN controller(s). */ CanController_t CanController[2]; /* * This container contains the configuration (parameters) of CAN Hardware Objects. */ CanHardwareObject_t CanHardwareObject[4U]; /* * This container contains the parameters for configuring pretended networking */ CanIcom_t CanIcom; }CanConfigSet_t; /* * Defines the level of Pretended Networking. * This parameter is reserved for future implementations (Pretended Networking level 2). */ typedef enum CanIcomLevel { CAN_ICOM_LEVEL_ONE, CAN_ICOM_LEVEL_TWO } CanIcomLevel_t ; /* * Defines the variant, which is supported by this CanController */ typedef enum CanIcomVariant { CAN_ICOM_VARIANT_HW, CAN_ICOM_VARIANT_NONE, CAN_ICOM_VARIANT_SW, }CanIcomVariant_t ; /* * This container contains the general configuration parameters of the ICOM Configuration */ typedef struct CanIcomGeneral { CanIcomLevel_t CanIcomLevel ; CanIcomVariant_t CanIcomVariant ; }CanIcomGeneral_t; /* * CanGenreral: contains the parameters related each CAN Driver Unit. * NOTE: this srtucture does NOT support ERROR DETECTION */ typedef struct CanGeneral { /*InstanceId of this module instance.If only 1 instance it shall have the Id 0 */ uint8_t CanIndex ; /* pointer to function * defines existence & name of a callout function that is * called after a successful * reception of a received CAN Rx L-PDU. */ //void * CanLPduReceiveCalloutFunction (void); /* * This parameter describes the period for cyclic * call to Can_MainFunction_Busoff. Unit is seconds */ float CanMainFunctionBusoffPeriod ; /* * This parameter describes the period for cyclic call * to Can_MainFunction_Mode. Unit is seconds. */ float CanMainFunctionModePeriod ; /* * describes the period for cyclic call * to Can_MainFunction_Wakeup. Unit is seconds. */ float CanMainFunctionWakeupPeriod ; /* * Specifies if multiplexed transmission * shall be supported.ON or OFF * NOTE: * dependency: CAN Hardware Unit supports multiplexed transmission */ _Bool CanMultiplexedTransmission ; /* * Selects support of Pretended Network features in Can driver. * True: Enabled * False: Disabled */ _Bool CanPublicIcomSupport ; /* * Can_SetBaudrate API is optional if this parameter * true: the API shall be supported * otherwise the API isn't supported */ _Bool CanSetBaudrateApi ; /* * the max time for blocking function untill * the timeout is detected. Unit is seconds. */ float CanTimeoutDuration ; /* * This parameter contains a reference to the OsCounter * which is used by the CAN driver. */ // pointer to the OScounter ?? /* * The parameter refers to CanIfSupportTTCAN parameter in * the CAN Interface Module configuration. * The CanIfSupportTTCAN parameter defines whether TTCAN is supported */ // Reference to [ CanIfPrivateCfg ] ?? /* * contains the general configuration parameters of the ICOM Configuration */ CanIcomGeneral_t CanIcomGeneral; /* * contains the parameter for configuring the period for cyclic call to * Can_MainFunction_Read or Can_MainFunction_Write depending on the referring item */ CanMainFunctionRWPeriods_t CanMainFunctionRWPeriods; }CanGeneral_t; /* Can: * This container holds the configuration of a single CAN Driver. */ typedef struct Can{ /* * CanGenreral: contains the parameters related each CAN Driver Unit. * NOTE: this srtucture does NOT support ERROR DETECTION */ CanGeneral_t CanGeneral; /* * This container contains the configuration parameters and sub containers of the AUTOSAR Can module. * */ CanConfigSet_t CanConfigSet; }Can_t; /* * Os.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* * Defines the prototype to which task functions must conform. Defined in this * file to ensure the type is known before portable.h is included. */ typedef void (*TaskFunction_t)( void * ); /* Converts a time in milliseconds to a time in ticks. This macro can be overridden by a macro of the same name defined in FreeRTOSConfig.h in case the definition here is not suitable for your application. */ /* FreeRTOS error definitions. */ /* Macros used for basic data corruption checks. */ /* The following errno values are used by FreeRTOS+ components, not FreeRTOS itself. */ /* The following endian values are used by FreeRTOS+ components, not FreeRTOS itself. */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* * Include the generic headers required for the FreeRTOS port being used. */ /*****************************************************************************/ /* stddef.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("-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 */ typedef int ptrdiff_t; typedef unsigned size_t; typedef unsigned short wchar_t; /*----------------------------------------------------------------------------*/ /* C++11 and C11 required max_align_t to be defined. The libc++ cstddef */ /* header expects the macro __DEFINED_max_align_t to be defined if it is to */ /* use the definintion of max_align_t from stddef.h. Only define it if */ /* compiling for C11 or we're in non strict ansi mode. */ /*----------------------------------------------------------------------------*/ typedef long double max_align_t; #pragma diag_push #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ #pragma diag_pop /* * If stdint.h cannot be located then: * + If using GCC ensure the -nostdint options is *not* being used. * + Ensure the project's include path includes the directory in which your * compiler stores stdint.h. * + Set any compiler options necessary for it to support C99, as technically * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any * other way). * + The FreeRTOS download includes a simple stdint.h definition that can be * used in cases where none is provided by the compiler. The files only * contains the typedefs required to build FreeRTOS. Read the instructions * in FreeRTOS/source/stdint.readme for more information. */ /*****************************************************************************/ /* 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. */ /* */ /*****************************************************************************/ /* Application specific configuration options. */ /* Here is a good place to include header files that are required across your application. */ //#define configENABLE_BACKWARD_COMPATIBILITY 1 /* Memory allocation related definitions. */ /* Hook function related definitions. */ /* Run time and task stats gathering related definitions. */ /* Co-routine related definitions. */ /* Software timer related definitions. */ /* Interrupt nesting behaviour configuration. */ /* Define to trap errors during development. */ /* FreeRTOS MPU specific definitions. */ /* Optional functions - most linkers will remove unused functions anyway. */ /* A header file that defines trace macro can be included here. */ /* Basic FreeRTOS definitions. */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* Definitions specific to the port being used. */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /*----------------------------------------------------------- * Portable layer API. Each function must be defined for each port. *----------------------------------------------------------*/ /* Each FreeRTOS port has a unique portmacro.h header file. Originally a pre-processor definition was used to ensure the pre-processor found the correct portmacro.h file for the port being used. That scheme was deprecated in favour of setting the compiler's include path such that it found the correct portmacro.h file - removing the need for the constant and allowing the portmacro.h file to be located anywhere in relation to the port being used. Purely for reasons of backward compatibility the old method is still valid, but to make it clear that new projects should not use it, support for the port specific constants has been moved into the deprecated_definitions.h header file. */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* Each FreeRTOS port has a unique portmacro.h header file. Originally a pre-processor definition was used to ensure the pre-processor found the correct portmacro.h file for the port being used. That scheme was deprecated in favour of setting the compiler's include path such that it found the correct portmacro.h file - removing the need for the constant and allowing the portmacro.h file to be located anywhere in relation to the port being used. The definitions below remain in the code for backward compatibility only. New projects should not use them. */ /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h did not result in a portmacro.h header file being included - and it should be included here. In this case the path to the correct portmacro.h header file must be set in the compiler's include path. */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /*----------------------------------------------------------- * Port specific definitions. * * The settings in this file configure FreeRTOS correctly for the * given hardware and compiler. * * These settings should not be altered. *----------------------------------------------------------- */ /* Type definitions. */ typedef uint32_t StackType_t; typedef long BaseType_t; typedef unsigned long UBaseType_t; typedef uint32_t TickType_t; /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do not need to be guarded with a critical section. */ /*-----------------------------------------------------------*/ /* Architecture specifics. */ /*-----------------------------------------------------------*/ /* Scheduler utilities. */ /*-----------------------------------------------------------*/ /* Architecture specific optimisations. */ /*-----------------------------------------------------------*/ /* Critical section management. */ extern void vPortEnterCritical( void ); extern void vPortExitCritical( void ); /*-----------------------------------------------------------*/ /* Tickless idle/low power functionality. */ extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ); /*-----------------------------------------------------------*/ /* Task function macros as described on the FreeRTOS.org WEB site. These are not necessary for to use this port. They are defined so the common demo files (which build with all the ports) will build. */ /*-----------------------------------------------------------*/ void vPortValidateInterruptPriority( void ); /* portNOP() is not required by this port. */ /*-----------------------------------------------------------*/ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* This file redefines API functions to be called through a wrapper macro, but only for ports that are using the MPU. */ /* * Setup the stack of a new task so it is ready to be placed under the * scheduler control. The registers have to be placed on the stack in * the order that the port expects to find them. * */ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) ; /* Used by heap_5.c. */ typedef struct HeapRegion { uint8_t *pucStartAddress; size_t xSizeInBytes; } HeapRegion_t; /* * Used to define multiple heap regions for use by heap_5.c. This function * must be called before any calls to pvPortMalloc() - not creating a task, * queue, semaphore, mutex, software timer, event group, etc. will result in * pvPortMalloc being called. * * pxHeapRegions passes in an array of HeapRegion_t structures - each of which * defines a region of memory that can be used as the heap. The array is * terminated by a HeapRegions_t structure that has a size of 0. The region * with the lowest start address must appear first in the array. */ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) ; /* * Map to the memory management routines required for the port. */ void *pvPortMalloc( size_t xSize ) ; void vPortFree( void *pv ) ; void vPortInitialiseBlocks( void ) ; size_t xPortGetFreeHeapSize( void ) ; size_t xPortGetMinimumEverFreeHeapSize( void ) ; /* * Setup the hardware ready for the scheduler to take control. This generally * sets up a tick interrupt and sets timers for the correct tick frequency. */ BaseType_t xPortStartScheduler( void ) ; /* * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so * the hardware is left in its original condition after the scheduler stops * executing. */ void vPortEndScheduler( void ) ; /* * The structures and methods of manipulating the MPU are contained within the * port layer. * * Fills the xMPUSettings structure with the memory region information * contained in xRegions. */ /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */ /* Required if struct _reent is used. */ /* * Check all the required application specific macros have been defined. * These macros are application specific and (as downloaded) are defined * within FreeRTOSConfig.h. */ /* The timers module relies on xTaskGetSchedulerState(). */ /* Remove any unused trace macros. */ /* Used to perform any necessary initialisation - for example, open a file into which trace is to be written. */ /* Use to close a trace, for example close a file into which trace has been written. */ /* Called after a task has been selected to run. pxCurrentTCB holds a pointer to the task control block of the selected task. */ /* Called before stepping the tick count after waking from tickless idle sleep. */ /* Called immediately before entering tickless idle. */ /* Called when returning to the Idle task after a tickless idle. */ /* Called before a task has been selected to run. pxCurrentTCB holds a pointer to the task control block of the task being switched out. */ /* Called when a task attempts to take a mutex that is already held by a lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task that holds the mutex. uxInheritedPriority is the priority the mutex holder will inherit (the priority of the task that is attempting to obtain the muted. */ /* Called when a task releases a mutex, the holding of which had resulted in the task inheriting the priority of a higher priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the mutex. uxOriginalPriority is the task's configured (base) priority. */ /* Task is about to block because it cannot read from a queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore upon which the read was attempted. pxCurrentTCB points to the TCB of the task that attempted the read. */ /* Task is about to block because it cannot write to a queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore upon which the write was attempted. pxCurrentTCB points to the TCB of the task that attempted the write. */ /* The following event macros are embedded in the kernel API calls. */ /* Sanity check the configuration. */ /* The tick type can be read atomically, so critical sections used when the tick count is returned can be defined away. */ /* Definitions to allow backward compatibility with FreeRTOS versions prior to V8 if desired. */ /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even if floating point hardware is otherwise supported by the FreeRTOS port in use. This constant is not supported by all FreeRTOS ports that include floating point support. */ /* * In line with software engineering best practice, FreeRTOS implements a strict * data hiding policy, so the real structures used by FreeRTOS to maintain the * state of tasks, queues, semaphores, etc. are not accessible to the application * code. However, if the application writer wants to statically allocate such * an object then the size of the object needs to be know. Dummy structures * that are guaranteed to have the same size and alignment requirements of the * real objects are used for this purpose. The dummy list and list item * structures below are used for inclusion in such a dummy structure. */ struct xSTATIC_LIST_ITEM { TickType_t xDummy1; void *pvDummy2[ 4 ]; }; typedef struct xSTATIC_LIST_ITEM StaticListItem_t; /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ struct xSTATIC_MINI_LIST_ITEM { TickType_t xDummy1; void *pvDummy2[ 2 ]; }; typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ typedef struct xSTATIC_LIST { UBaseType_t uxDummy1; void *pvDummy2; StaticMiniListItem_t xDummy3; } StaticList_t; /* * In line with software engineering best practice, especially when supplying a * library that is likely to change in future versions, FreeRTOS implements a * strict data hiding policy. This means the Task structure used internally by * FreeRTOS is not accessible to application code. However, if the application * writer wants to statically allocate the memory required to create a task then * the size of the task object needs to be know. The StaticTask_t structure * below is provided for this purpose. Its sizes and alignment requirements are * guaranteed to match those of the genuine structure, no matter which * architecture is being used, and no matter how the values in FreeRTOSConfig.h * are set. Its contents are somewhat obfuscated in the hope users will * recognise that it would be unwise to make direct use of the structure members. */ typedef struct xSTATIC_TCB { void *pxDummy1; StaticListItem_t xDummy3[ 2 ]; UBaseType_t uxDummy5; void *pxDummy6; uint8_t ucDummy7[ 16 ]; UBaseType_t uxDummy10[ 2 ]; UBaseType_t uxDummy12[ 2 ]; uint32_t ulDummy18; uint8_t ucDummy19; } StaticTask_t; /* * In line with software engineering best practice, especially when supplying a * library that is likely to change in future versions, FreeRTOS implements a * strict data hiding policy. This means the Queue structure used internally by * FreeRTOS is not accessible to application code. However, if the application * writer wants to statically allocate the memory required to create a queue * then the size of the queue object needs to be know. The StaticQueue_t * structure below is provided for this purpose. Its sizes and alignment * requirements are guaranteed to match those of the genuine structure, no * matter which architecture is being used, and no matter how the values in * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope * users will recognise that it would be unwise to make direct use of the * structure members. */ typedef struct xSTATIC_QUEUE { void *pvDummy1[ 3 ]; union { void *pvDummy2; UBaseType_t uxDummy2; } u; StaticList_t xDummy3[ 2 ]; UBaseType_t uxDummy4[ 3 ]; uint8_t ucDummy5[ 2 ]; UBaseType_t uxDummy8; uint8_t ucDummy9; } StaticQueue_t; typedef StaticQueue_t StaticSemaphore_t; /* * In line with software engineering best practice, especially when supplying a * library that is likely to change in future versions, FreeRTOS implements a * strict data hiding policy. This means the event group structure used * internally by FreeRTOS is not accessible to application code. However, if * the application writer wants to statically allocate the memory required to * create an event group then the size of the event group object needs to be * know. The StaticEventGroup_t structure below is provided for this purpose. * Its sizes and alignment requirements are guaranteed to match those of the * genuine structure, no matter which architecture is being used, and no matter * how the values in FreeRTOSConfig.h are set. Its contents are somewhat * obfuscated in the hope users will recognise that it would be unwise to make * direct use of the structure members. */ typedef struct xSTATIC_EVENT_GROUP { TickType_t xDummy1; StaticList_t xDummy2; UBaseType_t uxDummy3; } StaticEventGroup_t; /* * In line with software engineering best practice, especially when supplying a * library that is likely to change in future versions, FreeRTOS implements a * strict data hiding policy. This means the software timer structure used * internally by FreeRTOS is not accessible to application code. However, if * the application writer wants to statically allocate the memory required to * create a software timer then the size of the queue object needs to be know. * The StaticTimer_t structure below is provided for this purpose. Its sizes * and alignment requirements are guaranteed to match those of the genuine * structure, no matter which architecture is being used, and no matter how the * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in * the hope users will recognise that it would be unwise to make direct use of * the structure members. */ typedef struct xSTATIC_TIMER { void *pvDummy1; StaticListItem_t xDummy2; TickType_t xDummy3; UBaseType_t uxDummy4; void *pvDummy5[ 2 ]; UBaseType_t uxDummy6; } StaticTimer_t; /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* * This is the list implementation used by the scheduler. While it is tailored * heavily for the schedulers needs, it is also available for use by * application code. * * list_ts can only store pointers to list_item_ts. Each ListItem_t contains a * numeric value (xItemValue). Most of the time the lists are sorted in * descending item value order. * * Lists are created already containing one list item. The value of this * item is the maximum possible that can be stored, it is therefore always at * the end of the list and acts as a marker. The list member pxHead always * points to this marker - even though it is at the tail of the list. This * is because the tail contains a wrap back pointer to the true head of * the list. * * In addition to it's value, each list item contains a pointer to the next * item in the list (pxNext), a pointer to the list it is in (pxContainer) * and a pointer to back to the object that contains it. These later two * pointers are included for efficiency of list manipulation. There is * effectively a two way link between the object containing the list item and * the list item itself. * * * \page ListIntroduction List Implementation * \ingroup FreeRTOSIntro */ /* * The list structure members are modified from within interrupts, and therefore * by rights should be declared volatile. However, they are only modified in a * functionally atomic way (within critical sections of with the scheduler * suspended) and are either passed by reference into a function or indexed via * a volatile variable. Therefore, in all use cases tested so far, the volatile * qualifier can be omitted in order to provide a moderate performance * improvement without adversely affecting functional behaviour. The assembly * instructions generated by the IAR, ARM and GCC compilers when the respective * compiler's options were set for maximum optimisation has been inspected and * deemed to be as intended. That said, as compiler technology advances, and * especially if aggressive cross module optimisation is used (a use case that * has not been exercised to any great extend) then it is feasible that the * volatile qualifier will be needed for correct optimisation. It is expected * that a compiler removing essential code because, without the volatile * qualifier on the list structure members and with aggressive cross module * optimisation, the compiler deemed the code unnecessary will result in * complete and obvious failure of the scheduler. If this is ever experienced * then the volatile qualifier can be inserted in the relevant places within the * list structures by simply defining configLIST_VOLATILE to volatile in * FreeRTOSConfig.h (as per the example at the bottom of this comment block). * If configLIST_VOLATILE is not defined then the preprocessor directives below * will simply #define configLIST_VOLATILE away completely. * * To use volatile list structure members then add the following line to * FreeRTOSConfig.h (without the quotes): * "#define configLIST_VOLATILE volatile" */ /* Macros that can be used to place known values within the list structures, then check that the known values do not get corrupted during the execution of the application. These may catch the list data structures being overwritten in memory. They will not catch data errors caused by incorrect configuration or use of FreeRTOS.*/ /* Define the macros to do nothing. */ /* * Definition of the only type of object that a list can contain. */ struct xLIST_ITEM { /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */ struct xLIST_ITEM * pxNext; /*< Pointer to the next ListItem_t in the list. */ struct xLIST_ITEM * pxPrevious; /*< Pointer to the previous ListItem_t in the list. */ void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */ void * pvContainer; /*< Pointer to the list in which this list item is placed (if any). */ /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ }; typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */ struct xMINI_LIST_ITEM { /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ TickType_t xItemValue; struct xLIST_ITEM * pxNext; struct xLIST_ITEM * pxPrevious; }; typedef struct xMINI_LIST_ITEM MiniListItem_t; /* * Definition of the type of queue used by the scheduler. */ typedef struct xLIST { /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ UBaseType_t uxNumberOfItems; ListItem_t * pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */ MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */ /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ } List_t; /* * Access macro to set the owner of a list item. The owner of a list item * is the object (usually a TCB) that contains the list item. * * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER * \ingroup LinkedList */ /* * Access macro to get the owner of a list item. The owner of a list item * is the object (usually a TCB) that contains the list item. * * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER * \ingroup LinkedList */ /* * Access macro to set the value of the list item. In most cases the value is * used to sort the list in descending order. * * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE * \ingroup LinkedList */ /* * Access macro to retrieve the value of the list item. The value can * represent anything - for example the priority of a task, or the time at * which a task should be unblocked. * * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE * \ingroup LinkedList */ /* * Access macro to retrieve the value of the list item at the head of a given * list. * * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE * \ingroup LinkedList */ /* * Return the list item at the head of the list. * * \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY * \ingroup LinkedList */ /* * Return the list item at the head of the list. * * \page listGET_NEXT listGET_NEXT * \ingroup LinkedList */ /* * Return the list item that marks the end of the list * * \page listGET_END_MARKER listGET_END_MARKER * \ingroup LinkedList */ /* * Access macro to determine if a list contains any items. The macro will * only have the value true if the list is empty. * * \page listLIST_IS_EMPTY listLIST_IS_EMPTY * \ingroup LinkedList */ /* * Access macro to return the number of items in the list. */ /* * Access function to obtain the owner of the next entry in a list. * * The list member pxIndex is used to walk through a list. Calling * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list * and returns that entry's pxOwner parameter. Using multiple calls to this * function it is therefore possible to move through every item contained in * a list. * * The pxOwner parameter of a list item is a pointer to the object that owns * the list item. In the scheduler this is normally a task control block. * The pxOwner parameter effectively creates a two way link between the list * item and its owner. * * @param pxTCB pxTCB is set to the address of the owner of the next list item. * @param pxList The list from which the next item owner is to be returned. * * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY * \ingroup LinkedList */ /* * Access function to obtain the owner of the first entry in a list. Lists * are normally sorted in ascending item value order. * * This function returns the pxOwner member of the first item in the list. * The pxOwner parameter of a list item is a pointer to the object that owns * the list item. In the scheduler this is normally a task control block. * The pxOwner parameter effectively creates a two way link between the list * item and its owner. * * @param pxList The list from which the owner of the head item is to be * returned. * * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY * \ingroup LinkedList */ /* * Check to see if a list item is within a list. The list item maintains a * "container" pointer that points to the list it is in. All this macro does * is check to see if the container and the list match. * * @param pxList The list we want to know if the list item is within. * @param pxListItem The list item we want to know if is in the list. * @return pdTRUE if the list item is in the list, otherwise pdFALSE. */ /* * Return the list a list item is contained within (referenced from). * * @param pxListItem The list item being queried. * @return A pointer to the List_t object that references the pxListItem */ /* * This provides a crude means of knowing if a list has been initialised, as * pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise() * function. */ /* * Must be called before a list is used! This initialises all the members * of the list structure and inserts the xListEnd item into the list as a * marker to the back of the list. * * @param pxList Pointer to the list being initialised. * * \page vListInitialise vListInitialise * \ingroup LinkedList */ void vListInitialise( List_t * const pxList ) ; /* * Must be called before a list item is used. This sets the list container to * null so the item does not think that it is already contained in a list. * * @param pxItem Pointer to the list item being initialised. * * \page vListInitialiseItem vListInitialiseItem * \ingroup LinkedList */ void vListInitialiseItem( ListItem_t * const pxItem ) ; /* * Insert a list item into a list. The item will be inserted into the list in * a position determined by its item value (descending item value order). * * @param pxList The list into which the item is to be inserted. * * @param pxNewListItem The item that is to be placed in the list. * * \page vListInsert vListInsert * \ingroup LinkedList */ void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) ; /* * Insert a list item into a list. The item will be inserted in a position * such that it will be the last item within the list returned by multiple * calls to listGET_OWNER_OF_NEXT_ENTRY. * * The list member pxIndex is used to walk through a list. Calling * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list. * Placing an item in a list using vListInsertEnd effectively places the item * in the list position pointed to by pxIndex. This means that every other * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before * the pxIndex parameter again points to the item being inserted. * * @param pxList The list into which the item is to be inserted. * * @param pxNewListItem The list item to be inserted into the list. * * \page vListInsertEnd vListInsertEnd * \ingroup LinkedList */ void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ) ; /* * Remove an item from a list. The list item has a pointer to the list that * it is in, so only the list item need be passed into the function. * * @param uxListRemove The item to be removed. The item will remove itself from * the list pointed to by it's pxContainer parameter. * * @return The number of items that remain in the list after the list item has * been removed. * * \page uxListRemove uxListRemove * \ingroup LinkedList */ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) ; /*----------------------------------------------------------- * MACROS AND DEFINITIONS *----------------------------------------------------------*/ /** * task. h * * Type by which tasks are referenced. For example, a call to xTaskCreate * returns (via a pointer parameter) an TaskHandle_t variable that can then * be used as a parameter to vTaskDelete to delete the task. * * \defgroup TaskHandle_t TaskHandle_t * \ingroup Tasks */ typedef void * TaskHandle_t; /* * Defines the prototype to which the application task hook function must * conform. */ typedef BaseType_t (*TaskHookFunction_t)( void * ); /* Task states returned by eTaskGetState. */ typedef enum { eRunning = 0, /* A task is querying the state of itself, so must be running. */ eReady, /* The task being queried is in a read or pending ready list. */ eBlocked, /* The task being queried is in the Blocked state. */ eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */ eInvalid /* Used as an 'invalid state' value. */ } eTaskState; /* Actions that can be performed when vTaskNotify() is called. */ typedef enum { eNoAction = 0, /* Notify the task without updating its notify value. */ eSetBits, /* Set bits in the task's notification value. */ eIncrement, /* Increment the task's notification value. */ eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */ eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */ } eNotifyAction; /* * Used internally only. */ typedef struct xTIME_OUT { BaseType_t xOverflowCount; TickType_t xTimeOnEntering; } TimeOut_t; /* * Defines the memory ranges allocated to the task when an MPU is used. */ typedef struct xMEMORY_REGION { void *pvBaseAddress; uint32_t ulLengthInBytes; uint32_t ulParameters; } MemoryRegion_t; /* * Parameters required to create an MPU protected task. */ typedef struct xTASK_PARAMETERS { TaskFunction_t pvTaskCode; const char * const pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ uint16_t usStackDepth; void *pvParameters; UBaseType_t uxPriority; StackType_t *puxStackBuffer; MemoryRegion_t xRegions[ 1 ]; } TaskParameters_t; /* Used with the uxTaskGetSystemState() function to return the state of each task in the system. */ typedef struct xTASK_STATUS { TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */ const char *pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ UBaseType_t xTaskNumber; /* A number unique to the task. */ eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */ UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */ UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */ uint32_t ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */ StackType_t *pxStackBase; /* Points to the lowest address of the task's stack area. */ uint16_t usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */ } TaskStatus_t; /* Possible return values for eTaskConfirmSleepModeStatus(). */ typedef enum { eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */ eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */ eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */ } eSleepModeStatus; /** * Defines the priority used by the idle task. This must not be modified. * * \ingroup TaskUtils */ /** * task. h * * Macro for forcing a context switch. * * \defgroup taskYIELD taskYIELD * \ingroup SchedulerControl */ /** * task. h * * Macro to mark the start of a critical code region. Preemptive context * switches cannot occur when in a critical region. * * NOTE: This may alter the stack (depending on the portable implementation) * so must be used with care! * * \defgroup taskENTER_CRITICAL taskENTER_CRITICAL * \ingroup SchedulerControl */ /** * task. h * * Macro to mark the end of a critical code region. Preemptive context * switches cannot occur when in a critical region. * * NOTE: This may alter the stack (depending on the portable implementation) * so must be used with care! * * \defgroup taskEXIT_CRITICAL taskEXIT_CRITICAL * \ingroup SchedulerControl */ /** * task. h * * Macro to disable all maskable interrupts. * * \defgroup taskDISABLE_INTERRUPTS taskDISABLE_INTERRUPTS * \ingroup SchedulerControl */ /** * task. h * * Macro to enable microcontroller interrupts. * * \defgroup taskENABLE_INTERRUPTS taskENABLE_INTERRUPTS * \ingroup SchedulerControl */ /* Definitions returned by xTaskGetSchedulerState(). taskSCHEDULER_SUSPENDED is 0 to generate more optimal code when configASSERT() is defined as the constant is used in assert() statements. */ /*----------------------------------------------------------- * TASK CREATION API *----------------------------------------------------------*/ /** * task. h *
 BaseType_t xTaskCreate(
							  TaskFunction_t pvTaskCode,
							  const char * const pcName,
							  uint16_t usStackDepth,
							  void *pvParameters,
							  UBaseType_t uxPriority,
							  TaskHandle_t *pvCreatedTask
						  );
* * Create a new task and add it to the list of tasks that are ready to run. * * Internally, within the FreeRTOS implementation, tasks use two blocks of * memory. The first block is used to hold the task's data structures. The * second block is used by the task as its stack. If a task is created using * xTaskCreate() then both blocks of memory are automatically dynamically * allocated inside the xTaskCreate() function. (see * http://www.freertos.org/a00111.html). If a task is created using * xTaskCreateStatic() then the application writer must provide the required * memory. xTaskCreateStatic() therefore allows a task to be created without * using any dynamic memory allocation. * * See xTaskCreateStatic() for a version that does not use any dynamic memory * allocation. * * xTaskCreate() can only be used to create a task that has unrestricted * access to the entire microcontroller memory map. Systems that include MPU * support can alternatively create an MPU constrained task using * xTaskCreateRestricted(). * * @param pvTaskCode Pointer to the task entry function. Tasks * must be implemented to never return (i.e. continuous loop). * * @param pcName A descriptive name for the task. This is mainly used to * facilitate debugging. Max length defined by configMAX_TASK_NAME_LEN - default * is 16. * * @param usStackDepth The size of the task stack specified as the number of * variables the stack can hold - not the number of bytes. For example, if * the stack is 16 bits wide and usStackDepth is defined as 100, 200 bytes * will be allocated for stack storage. * * @param pvParameters Pointer that will be used as the parameter for the task * being created. * * @param uxPriority The priority at which the task should run. Systems that * include MPU support can optionally create tasks in a privileged (system) * mode by setting bit portPRIVILEGE_BIT of the priority parameter. For * example, to create a privileged task at priority 2 the uxPriority parameter * should be set to ( 2 | portPRIVILEGE_BIT ). * * @param pvCreatedTask Used to pass back a handle by which the created task * can be referenced. * * @return pdPASS if the task was successfully created and added to a ready * list, otherwise an error code defined in the file projdefs.h * * Example usage:
 // Task to be created.
 void vTaskCode( void * pvParameters )
 {
	 for( ;; )
	 {
		 // Task code goes here.
	 }
 }

 // Function that creates a task.
 void vOtherFunction( void )
 {
 static uint8_t ucParameterToPass;
 TaskHandle_t xHandle = NULL;

	 // Create the task, storing the handle.  Note that the passed parameter ucParameterToPass
	 // must exist for the lifetime of the task, so in this case is declared static.  If it was just an
	 // an automatic stack variable it might no longer exist, or at least have been corrupted, by the time
	 // the new task attempts to access it.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, &ucParameterToPass, tskIDLE_PRIORITY, &xHandle );
     configASSERT( xHandle );

	 // Use the handle to delete the task.
     if( xHandle != NULL )
     {
	     vTaskDelete( xHandle );
     }
 }
   
* \defgroup xTaskCreate xTaskCreate * \ingroup Tasks */ BaseType_t xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /** * task. h *
 TaskHandle_t xTaskCreateStatic( TaskFunction_t pvTaskCode,
								 const char * const pcName,
								 uint32_t ulStackDepth,
								 void *pvParameters,
								 UBaseType_t uxPriority,
								 StackType_t *pxStackBuffer,
								 StaticTask_t *pxTaskBuffer );
* * Create a new task and add it to the list of tasks that are ready to run. * * Internally, within the FreeRTOS implementation, tasks use two blocks of * memory. The first block is used to hold the task's data structures. The * second block is used by the task as its stack. If a task is created using * xTaskCreate() then both blocks of memory are automatically dynamically * allocated inside the xTaskCreate() function. (see * http://www.freertos.org/a00111.html). If a task is created using * xTaskCreateStatic() then the application writer must provide the required * memory. xTaskCreateStatic() therefore allows a task to be created without * using any dynamic memory allocation. * * @param pvTaskCode Pointer to the task entry function. Tasks * must be implemented to never return (i.e. continuous loop). * * @param pcName A descriptive name for the task. This is mainly used to * facilitate debugging. The maximum length of the string is defined by * configMAX_TASK_NAME_LEN in FreeRTOSConfig.h. * * @param ulStackDepth The size of the task stack specified as the number of * variables the stack can hold - not the number of bytes. For example, if * the stack is 32-bits wide and ulStackDepth is defined as 100 then 400 bytes * will be allocated for stack storage. * * @param pvParameters Pointer that will be used as the parameter for the task * being created. * * @param uxPriority The priority at which the task will run. * * @param pxStackBuffer Must point to a StackType_t array that has at least * ulStackDepth indexes - the array will then be used as the task's stack, * removing the need for the stack to be allocated dynamically. * * @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will * then be used to hold the task's data structures, removing the need for the * memory to be allocated dynamically. * * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will * be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer * are NULL then the task will not be created and * errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned. * * Example usage:

    // Dimensions the buffer that the task being created will use as its stack.
    // NOTE:  This is the number of words the stack will hold, not the number of
    // bytes.  For example, if each stack item is 32-bits, and this is set to 100,
    // then 400 bytes (100 * 32-bits) will be allocated.
    #define STACK_SIZE 200

    // Structure that will hold the TCB of the task being created.
    StaticTask_t xTaskBuffer;

    // Buffer that the task being created will use as its stack.  Note this is
    // an array of StackType_t variables.  The size of StackType_t is dependent on
    // the RTOS port.
    StackType_t xStack[ STACK_SIZE ];

    // Function that implements the task being created.
    void vTaskCode( void * pvParameters )
    {
        // The parameter value is expected to be 1 as 1 is passed in the
        // pvParameters value in the call to xTaskCreateStatic().
        configASSERT( ( uint32_t ) pvParameters == 1UL );

        for( ;; )
        {
            // Task code goes here.
        }
    }

    // Function that creates a task.
    void vOtherFunction( void )
    {
        TaskHandle_t xHandle = NULL;

        // Create the task without using any dynamic memory allocation.
        xHandle = xTaskCreateStatic(
                      vTaskCode,       // Function that implements the task.
                      "NAME",          // Text name for the task.
                      STACK_SIZE,      // Stack size in words, not bytes.
                      ( void * ) 1,    // Parameter passed into the task.
                      tskIDLE_PRIORITY,// Priority at which the task is created.
                      xStack,          // Array to use as the task's stack.
                      &xTaskBuffer );  // Variable to hold the task's data structure.

        // puxStackBuffer and pxTaskBuffer were not NULL, so the task will have
        // been created, and xHandle will be the task's handle.  Use the handle
        // to suspend the task.
        vTaskSuspend( xHandle );
    }
   
* \defgroup xTaskCreateStatic xTaskCreateStatic * \ingroup Tasks */ /** * task. h *
 BaseType_t xTaskCreateRestricted( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );
* * xTaskCreateRestricted() should only be used in systems that include an MPU * implementation. * * Create a new task and add it to the list of tasks that are ready to run. * The function parameters define the memory regions and associated access * permissions allocated to the task. * * @param pxTaskDefinition Pointer to a structure that contains a member * for each of the normal xTaskCreate() parameters (see the xTaskCreate() API * documentation) plus an optional stack buffer and the memory region * definitions. * * @param pxCreatedTask Used to pass back a handle by which the created task * can be referenced. * * @return pdPASS if the task was successfully created and added to a ready * list, otherwise an error code defined in the file projdefs.h * * Example usage:
// Create an TaskParameters_t structure that defines the task to be created.
static const TaskParameters_t xCheckTaskParameters =
{
	vATask,		// pvTaskCode - the function that implements the task.
	"ATask",	// pcName - just a text name for the task to assist debugging.
	100,		// usStackDepth	- the stack size DEFINED IN WORDS.
	NULL,		// pvParameters - passed into the task function as the function parameters.
	( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state.
	cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack.

	// xRegions - Allocate up to three separate memory regions for access by
	// the task, with appropriate access permissions.  Different processors have
	// different memory alignment requirements - refer to the FreeRTOS documentation
	// for full information.
	{
		// Base address					Length	Parameters
        { cReadWriteArray,				32,		portMPU_REGION_READ_WRITE },
        { cReadOnlyArray,				32,		portMPU_REGION_READ_ONLY },
        { cPrivilegedOnlyAccessArray,	128,	portMPU_REGION_PRIVILEGED_READ_WRITE }
	}
};

int main( void )
{
TaskHandle_t xHandle;

	// Create a task from the const structure defined above.  The task handle
	// is requested (the second parameter is not NULL) but in this case just for
	// demonstration purposes as its not actually used.
	xTaskCreateRestricted( &xRegTest1Parameters, &xHandle );

	// Start the scheduler.
	vTaskStartScheduler();

	// Will only get here if there was insufficient memory to create the idle
	// and/or timer task.
	for( ;; );
}
   
* \defgroup xTaskCreateRestricted xTaskCreateRestricted * \ingroup Tasks */ /** * task. h *
 void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );
* * Memory regions are assigned to a restricted task when the task is created by * a call to xTaskCreateRestricted(). These regions can be redefined using * vTaskAllocateMPURegions(). * * @param xTask The handle of the task being updated. * * @param xRegions A pointer to an MemoryRegion_t structure that contains the * new memory region definitions. * * Example usage:
// Define an array of MemoryRegion_t structures that configures an MPU region
// allowing read/write access for 1024 bytes starting at the beginning of the
// ucOneKByte array.  The other two of the maximum 3 definable regions are
// unused so set to zero.
static const MemoryRegion_t xAltRegions[ portNUM_CONFIGURABLE_REGIONS ] =
{
	// Base address		Length		Parameters
	{ ucOneKByte,		1024,		portMPU_REGION_READ_WRITE },
	{ 0,				0,			0 },
	{ 0,				0,			0 }
};

void vATask( void *pvParameters )
{
	// This task was created such that it has access to certain regions of
	// memory as defined by the MPU configuration.  At some point it is
	// desired that these MPU regions are replaced with that defined in the
	// xAltRegions const struct above.  Use a call to vTaskAllocateMPURegions()
	// for this purpose.  NULL is used as the task handle to indicate that this
	// function should modify the MPU regions of the calling task.
	vTaskAllocateMPURegions( NULL, xAltRegions );

	// Now the task can continue its function, but from this point on can only
	// access its stack and the ucOneKByte array (unless any other statically
	// defined or shared regions have been declared elsewhere).
}
   
* \defgroup xTaskCreateRestricted xTaskCreateRestricted * \ingroup Tasks */ void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) ; /** * task. h *
void vTaskDelete( TaskHandle_t xTask );
* * INCLUDE_vTaskDelete must be defined as 1 for this function to be available. * See the configuration section for more information. * * Remove a task from the RTOS real time kernel's management. The task being * deleted will be removed from all ready, blocked, suspended and event lists. * * NOTE: The idle task is responsible for freeing the kernel allocated * memory from tasks that have been deleted. It is therefore important that * the idle task is not starved of microcontroller processing time if your * application makes any calls to vTaskDelete (). Memory allocated by the * task code is not automatically freed, and should be freed before the task * is deleted. * * See the demo application file death.c for sample code that utilises * vTaskDelete (). * * @param xTask The handle of the task to be deleted. Passing NULL will * cause the calling task to be deleted. * * Example usage:
 void vOtherFunction( void )
 {
 TaskHandle_t xHandle;

	 // Create the task, storing the handle.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );

	 // Use the handle to delete the task.
	 vTaskDelete( xHandle );
 }
   
* \defgroup vTaskDelete vTaskDelete * \ingroup Tasks */ void vTaskDelete( TaskHandle_t xTaskToDelete ) ; /*----------------------------------------------------------- * TASK CONTROL API *----------------------------------------------------------*/ /** * task. h *
void vTaskDelay( const TickType_t xTicksToDelay );
* * Delay a task for a given number of ticks. The actual time that the * task remains blocked depends on the tick rate. The constant * portTICK_PERIOD_MS can be used to calculate real time from the tick * rate - with the resolution of one tick period. * * INCLUDE_vTaskDelay must be defined as 1 for this function to be available. * See the configuration section for more information. * * * vTaskDelay() specifies a time at which the task wishes to unblock relative to * the time at which vTaskDelay() is called. For example, specifying a block * period of 100 ticks will cause the task to unblock 100 ticks after * vTaskDelay() is called. vTaskDelay() does not therefore provide a good method * of controlling the frequency of a periodic task as the path taken through the * code, as well as other task and interrupt activity, will effect the frequency * at which vTaskDelay() gets called and therefore the time at which the task * next executes. See vTaskDelayUntil() for an alternative API function designed * to facilitate fixed frequency execution. It does this by specifying an * absolute time (rather than a relative time) at which the calling task should * unblock. * * @param xTicksToDelay The amount of time, in tick periods, that * the calling task should block. * * Example usage: void vTaskFunction( void * pvParameters ) { // Block for 500ms. const TickType_t xDelay = 500 / portTICK_PERIOD_MS; for( ;; ) { // Simply toggle the LED every 500ms, blocking between each toggle. vToggleLED(); vTaskDelay( xDelay ); } } * \defgroup vTaskDelay vTaskDelay * \ingroup TaskCtrl */ void vTaskDelay( const TickType_t xTicksToDelay ) ; /** * task. h *
void vTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
* * INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available. * See the configuration section for more information. * * Delay a task until a specified time. This function can be used by periodic * tasks to ensure a constant execution frequency. * * This function differs from vTaskDelay () in one important aspect: vTaskDelay () will * cause a task to block for the specified number of ticks from the time vTaskDelay () is * called. It is therefore difficult to use vTaskDelay () by itself to generate a fixed * execution frequency as the time between a task starting to execute and that task * calling vTaskDelay () may not be fixed [the task may take a different path though the * code between calls, or may get interrupted or preempted a different number of times * each time it executes]. * * Whereas vTaskDelay () specifies a wake time relative to the time at which the function * is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to * unblock. * * The constant portTICK_PERIOD_MS can be used to calculate real time from the tick * rate - with the resolution of one tick period. * * @param pxPreviousWakeTime Pointer to a variable that holds the time at which the * task was last unblocked. The variable must be initialised with the current time * prior to its first use (see the example below). Following this the variable is * automatically updated within vTaskDelayUntil (). * * @param xTimeIncrement The cycle time period. The task will be unblocked at * time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the * same xTimeIncrement parameter value will cause the task to execute with * a fixed interface period. * * Example usage:
 // Perform an action every 10 ticks.
 void vTaskFunction( void * pvParameters )
 {
 TickType_t xLastWakeTime;
 const TickType_t xFrequency = 10;

	 // Initialise the xLastWakeTime variable with the current time.
	 xLastWakeTime = xTaskGetTickCount ();
	 for( ;; )
	 {
		 // Wait for the next cycle.
		 vTaskDelayUntil( &xLastWakeTime, xFrequency );

		 // Perform action here.
	 }
 }
   
* \defgroup vTaskDelayUntil vTaskDelayUntil * \ingroup TaskCtrl */ void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) ; /** * task. h *
BaseType_t xTaskAbortDelay( TaskHandle_t xTask );
* * INCLUDE_xTaskAbortDelay must be defined as 1 in FreeRTOSConfig.h for this * function to be available. * * A task will enter the Blocked state when it is waiting for an event. The * event it is waiting for can be a temporal event (waiting for a time), such * as when vTaskDelay() is called, or an event on an object, such as when * xQueueReceive() or ulTaskNotifyTake() is called. If the handle of a task * that is in the Blocked state is used in a call to xTaskAbortDelay() then the * task will leave the Blocked state, and return from whichever function call * placed the task into the Blocked state. * * @param xTask The handle of the task to remove from the Blocked state. * * @return If the task referenced by xTask was not in the Blocked state then * pdFAIL is returned. Otherwise pdPASS is returned. * * \defgroup xTaskAbortDelay xTaskAbortDelay * \ingroup TaskCtrl */ BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) ; /** * task. h *
UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask );
* * INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available. * See the configuration section for more information. * * Obtain the priority of any task. * * @param xTask Handle of the task to be queried. Passing a NULL * handle results in the priority of the calling task being returned. * * @return The priority of xTask. * * Example usage:
 void vAFunction( void )
 {
 TaskHandle_t xHandle;

	 // Create a task, storing the handle.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );

	 // ...

	 // Use the handle to obtain the priority of the created task.
	 // It was created with tskIDLE_PRIORITY, but may have changed
	 // it itself.
	 if( uxTaskPriorityGet( xHandle ) != tskIDLE_PRIORITY )
	 {
		 // The task has changed it's priority.
	 }

	 // ...

	 // Is our priority higher than the created task?
	 if( uxTaskPriorityGet( xHandle ) < uxTaskPriorityGet( NULL ) )
	 {
		 // Our priority (obtained using NULL handle) is higher.
	 }
 }
   
* \defgroup uxTaskPriorityGet uxTaskPriorityGet * \ingroup TaskCtrl */ UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask ) ; /** * task. h *
UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask );
* * A version of uxTaskPriorityGet() that can be used from an ISR. */ UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask ) ; /** * task. h *
eTaskState eTaskGetState( TaskHandle_t xTask );
* * INCLUDE_eTaskGetState must be defined as 1 for this function to be available. * See the configuration section for more information. * * Obtain the state of any task. States are encoded by the eTaskState * enumerated type. * * @param xTask Handle of the task to be queried. * * @return The state of xTask at the time the function was called. Note the * state of the task might change between the function being called, and the * functions return value being tested by the calling task. */ eTaskState eTaskGetState( TaskHandle_t xTask ) ; /** * task. h *
void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );
* * configUSE_TRACE_FACILITY must be defined as 1 for this function to be * available. See the configuration section for more information. * * Populates a TaskStatus_t structure with information about a task. * * @param xTask Handle of the task being queried. If xTask is NULL then * information will be returned about the calling task. * * @param pxTaskStatus A pointer to the TaskStatus_t structure that will be * filled with information about the task referenced by the handle passed using * the xTask parameter. * * @xGetFreeStackSpace The TaskStatus_t structure contains a member to report * the stack high water mark of the task being queried. Calculating the stack * high water mark takes a relatively long time, and can make the system * temporarily unresponsive - so the xGetFreeStackSpace parameter is provided to * allow the high water mark checking to be skipped. The high watermark value * will only be written to the TaskStatus_t structure if xGetFreeStackSpace is * not set to pdFALSE; * * @param eState The TaskStatus_t structure contains a member to report the * state of the task being queried. Obtaining the task state is not as fast as * a simple assignment - so the eState parameter is provided to allow the state * information to be omitted from the TaskStatus_t structure. To obtain state * information then set eState to eInvalid - otherwise the value passed in * eState will be reported as the task state in the TaskStatus_t structure. * * Example usage:
 void vAFunction( void )
 {
 TaskHandle_t xHandle;
 TaskStatus_t xTaskDetails;

    // Obtain the handle of a task from its name.
    xHandle = xTaskGetHandle( "Task_Name" );

    // Check the handle is not NULL.
    configASSERT( xHandle );

    // Use the handle to obtain further information about the task.
    vTaskGetInfo( xHandle,
                  &xTaskDetails,
                  pdTRUE, // Include the high water mark in xTaskDetails.
                  eInvalid ); // Include the task state in xTaskDetails.
 }
   
* \defgroup vTaskGetInfo vTaskGetInfo * \ingroup TaskCtrl */ void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState ) ; /** * task. h *
void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );
* * INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. * See the configuration section for more information. * * Set the priority of any task. * * A context switch will occur before the function returns if the priority * being set is higher than the currently executing task. * * @param xTask Handle to the task for which the priority is being set. * Passing a NULL handle results in the priority of the calling task being set. * * @param uxNewPriority The priority to which the task will be set. * * Example usage:
 void vAFunction( void )
 {
 TaskHandle_t xHandle;

	 // Create a task, storing the handle.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );

	 // ...

	 // Use the handle to raise the priority of the created task.
	 vTaskPrioritySet( xHandle, tskIDLE_PRIORITY + 1 );

	 // ...

	 // Use a NULL handle to raise our priority to the same value.
	 vTaskPrioritySet( NULL, tskIDLE_PRIORITY + 1 );
 }
   
* \defgroup vTaskPrioritySet vTaskPrioritySet * \ingroup TaskCtrl */ void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) ; /** * task. h *
void vTaskSuspend( TaskHandle_t xTaskToSuspend );
* * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available. * See the configuration section for more information. * * Suspend any task. When suspended a task will never get any microcontroller * processing time, no matter what its priority. * * Calls to vTaskSuspend are not accumulative - * i.e. calling vTaskSuspend () twice on the same task still only requires one * call to vTaskResume () to ready the suspended task. * * @param xTaskToSuspend Handle to the task being suspended. Passing a NULL * handle will cause the calling task to be suspended. * * Example usage:
 void vAFunction( void )
 {
 TaskHandle_t xHandle;

	 // Create a task, storing the handle.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );

	 // ...

	 // Use the handle to suspend the created task.
	 vTaskSuspend( xHandle );

	 // ...

	 // The created task will not run during this period, unless
	 // another task calls vTaskResume( xHandle ).

	 //...


	 // Suspend ourselves.
	 vTaskSuspend( NULL );

	 // We cannot get here unless another task calls vTaskResume
	 // with our handle as the parameter.
 }
   
* \defgroup vTaskSuspend vTaskSuspend * \ingroup TaskCtrl */ void vTaskSuspend( TaskHandle_t xTaskToSuspend ) ; /** * task. h *
void vTaskResume( TaskHandle_t xTaskToResume );
* * INCLUDE_vTaskSuspend must be defined as 1 for this function to be available. * See the configuration section for more information. * * Resumes a suspended task. * * A task that has been suspended by one or more calls to vTaskSuspend () * will be made available for running again by a single call to * vTaskResume (). * * @param xTaskToResume Handle to the task being readied. * * Example usage:
 void vAFunction( void )
 {
 TaskHandle_t xHandle;

	 // Create a task, storing the handle.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );

	 // ...

	 // Use the handle to suspend the created task.
	 vTaskSuspend( xHandle );

	 // ...

	 // The created task will not run during this period, unless
	 // another task calls vTaskResume( xHandle ).

	 //...


	 // Resume the suspended task ourselves.
	 vTaskResume( xHandle );

	 // The created task will once again get microcontroller processing
	 // time in accordance with its priority within the system.
 }
   
* \defgroup vTaskResume vTaskResume * \ingroup TaskCtrl */ void vTaskResume( TaskHandle_t xTaskToResume ) ; /** * task. h *
void xTaskResumeFromISR( TaskHandle_t xTaskToResume );
* * INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be * available. See the configuration section for more information. * * An implementation of vTaskResume() that can be called from within an ISR. * * A task that has been suspended by one or more calls to vTaskSuspend () * will be made available for running again by a single call to * xTaskResumeFromISR (). * * xTaskResumeFromISR() should not be used to synchronise a task with an * interrupt if there is a chance that the interrupt could arrive prior to the * task being suspended - as this can lead to interrupts being missed. Use of a * semaphore as a synchronisation mechanism would avoid this eventuality. * * @param xTaskToResume Handle to the task being readied. * * @return pdTRUE if resuming the task should result in a context switch, * otherwise pdFALSE. This is used by the ISR to determine if a context switch * may be required following the ISR. * * \defgroup vTaskResumeFromISR vTaskResumeFromISR * \ingroup TaskCtrl */ BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) ; /*----------------------------------------------------------- * SCHEDULER CONTROL *----------------------------------------------------------*/ /** * task. h *
void vTaskStartScheduler( void );
* * Starts the real time kernel tick processing. After calling the kernel * has control over which tasks are executed and when. * * See the demo application file main.c for an example of creating * tasks and starting the kernel. * * Example usage:
 void vAFunction( void )
 {
	 // Create at least one task before starting the kernel.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );

	 // Start the real time kernel with preemption.
	 vTaskStartScheduler ();

	 // Will not get here unless a task calls vTaskEndScheduler ()
 }
   
* * \defgroup vTaskStartScheduler vTaskStartScheduler * \ingroup SchedulerControl */ void vTaskStartScheduler( void ) ; /** * task. h *
void vTaskEndScheduler( void );
* * NOTE: At the time of writing only the x86 real mode port, which runs on a PC * in place of DOS, implements this function. * * Stops the real time kernel tick. All created tasks will be automatically * deleted and multitasking (either preemptive or cooperative) will * stop. Execution then resumes from the point where vTaskStartScheduler () * was called, as if vTaskStartScheduler () had just returned. * * See the demo application file main. c in the demo/PC directory for an * example that uses vTaskEndScheduler (). * * vTaskEndScheduler () requires an exit function to be defined within the * portable layer (see vPortEndScheduler () in port. c for the PC port). This * performs hardware specific operations such as stopping the kernel tick. * * vTaskEndScheduler () will cause all of the resources allocated by the * kernel to be freed - but will not free resources allocated by application * tasks. * * Example usage:
 void vTaskCode( void * pvParameters )
 {
	 for( ;; )
	 {
		 // Task code goes here.

		 // At some point we want to end the real time kernel processing
		 // so call ...
		 vTaskEndScheduler ();
	 }
 }

 void vAFunction( void )
 {
	 // Create at least one task before starting the kernel.
	 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );

	 // Start the real time kernel with preemption.
	 vTaskStartScheduler ();

	 // Will only get here when the vTaskCode () task has called
	 // vTaskEndScheduler ().  When we get here we are back to single task
	 // execution.
 }
   
* * \defgroup vTaskEndScheduler vTaskEndScheduler * \ingroup SchedulerControl */ void vTaskEndScheduler( void ) ; /** * task. h *
void vTaskSuspendAll( void );
* * Suspends the scheduler without disabling interrupts. Context switches will * not occur while the scheduler is suspended. * * After calling vTaskSuspendAll () the calling task will continue to execute * without risk of being swapped out until a call to xTaskResumeAll () has been * made. * * API functions that have the potential to cause a context switch (for example, * vTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler * is suspended. * * Example usage:
 void vTask1( void * pvParameters )
 {
	 for( ;; )
	 {
		 // Task code goes here.

		 // ...

		 // At some point the task wants to perform a long operation during
		 // which it does not want to get swapped out.  It cannot use
		 // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
		 // operation may cause interrupts to be missed - including the
		 // ticks.

		 // Prevent the real time kernel swapping out the task.
		 vTaskSuspendAll ();

		 // Perform the operation here.  There is no need to use critical
		 // sections as we have all the microcontroller processing time.
		 // During this time interrupts will still operate and the kernel
		 // tick count will be maintained.

		 // ...

		 // The operation is complete.  Restart the kernel.
		 xTaskResumeAll ();
	 }
 }
   
* \defgroup vTaskSuspendAll vTaskSuspendAll * \ingroup SchedulerControl */ void vTaskSuspendAll( void ) ; /** * task. h *
BaseType_t xTaskResumeAll( void );
* * Resumes scheduler activity after it was suspended by a call to * vTaskSuspendAll(). * * xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks * that were previously suspended by a call to vTaskSuspend(). * * @return If resuming the scheduler caused a context switch then pdTRUE is * returned, otherwise pdFALSE is returned. * * Example usage:
 void vTask1( void * pvParameters )
 {
	 for( ;; )
	 {
		 // Task code goes here.

		 // ...

		 // At some point the task wants to perform a long operation during
		 // which it does not want to get swapped out.  It cannot use
		 // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
		 // operation may cause interrupts to be missed - including the
		 // ticks.

		 // Prevent the real time kernel swapping out the task.
		 vTaskSuspendAll ();

		 // Perform the operation here.  There is no need to use critical
		 // sections as we have all the microcontroller processing time.
		 // During this time interrupts will still operate and the real
		 // time kernel tick count will be maintained.

		 // ...

		 // The operation is complete.  Restart the kernel.  We want to force
		 // a context switch - but there is no point if resuming the scheduler
		 // caused a context switch already.
		 if( !xTaskResumeAll () )
		 {
			  taskYIELD ();
		 }
	 }
 }
   
* \defgroup xTaskResumeAll xTaskResumeAll * \ingroup SchedulerControl */ BaseType_t xTaskResumeAll( void ) ; /*----------------------------------------------------------- * TASK UTILITIES *----------------------------------------------------------*/ /** * task. h *
TickType_t xTaskGetTickCount( void );
* * @return The count of ticks since vTaskStartScheduler was called. * * \defgroup xTaskGetTickCount xTaskGetTickCount * \ingroup TaskUtils */ TickType_t xTaskGetTickCount( void ) ; /** * task. h *
TickType_t xTaskGetTickCountFromISR( void );
* * @return The count of ticks since vTaskStartScheduler was called. * * This is a version of xTaskGetTickCount() that is safe to be called from an * ISR - provided that TickType_t is the natural word size of the * microcontroller being used or interrupt nesting is either not supported or * not being used. * * \defgroup xTaskGetTickCountFromISR xTaskGetTickCountFromISR * \ingroup TaskUtils */ TickType_t xTaskGetTickCountFromISR( void ) ; /** * task. h *
uint16_t uxTaskGetNumberOfTasks( void );
* * @return The number of tasks that the real time kernel is currently managing. * This includes all ready, blocked and suspended tasks. A task that * has been deleted but not yet freed by the idle task will also be * included in the count. * * \defgroup uxTaskGetNumberOfTasks uxTaskGetNumberOfTasks * \ingroup TaskUtils */ UBaseType_t uxTaskGetNumberOfTasks( void ) ; /** * task. h *
char *pcTaskGetName( TaskHandle_t xTaskToQuery );
* * @return The text (human readable) name of the task referenced by the handle * xTaskToQuery. A task can query its own name by either passing in its own * handle, or by setting xTaskToQuery to NULL. * * \defgroup pcTaskGetName pcTaskGetName * \ingroup TaskUtils */ char *pcTaskGetName( TaskHandle_t xTaskToQuery ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /** * task. h *
TaskHandle_t xTaskGetHandle( const char *pcNameToQuery );
* * NOTE: This function takes a relatively long time to complete and should be * used sparingly. * * @return The handle of the task that has the human readable name pcNameToQuery. * NULL is returned if no matching name is found. INCLUDE_xTaskGetHandle * must be set to 1 in FreeRTOSConfig.h for pcTaskGetHandle() to be available. * * \defgroup pcTaskGetHandle pcTaskGetHandle * \ingroup TaskUtils */ TaskHandle_t xTaskGetHandle( const char *pcNameToQuery ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /** * task.h *
UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
* * INCLUDE_uxTaskGetStackHighWaterMark must be set to 1 in FreeRTOSConfig.h for * this function to be available. * * Returns the high water mark of the stack associated with xTask. That is, * the minimum free stack space there has been (in words, so on a 32 bit machine * a value of 1 means 4 bytes) since the task started. The smaller the returned * number the closer the task has come to overflowing its stack. * * @param xTask Handle of the task associated with the stack to be checked. * Set xTask to NULL to check the stack of the calling task. * * @return The smallest amount of free stack space there has been (in words, so * actual spaces on the stack rather than bytes) since the task referenced by * xTask was created. */ UBaseType_t uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) ; /* When using trace macros it is sometimes necessary to include task.h before FreeRTOS.h. When this is done TaskHookFunction_t will not yet have been defined, so the following two prototypes will cause a compilation error. This can be fixed by simply guarding against the inclusion of these two prototypes unless they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration constant. */ /** * task.h *
BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
* * Calls the hook function associated with xTask. Passing xTask as NULL has * the effect of calling the Running tasks (the calling task) hook function. * * pvParameter is passed to the hook function for the task to interpret as it * wants. The return value is the value returned by the task hook function * registered by the user. */ BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) ; /** * xTaskGetIdleTaskHandle() is only available if * INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h. * * Simply returns the handle of the idle task. It is not valid to call * xTaskGetIdleTaskHandle() before the scheduler has been started. */ TaskHandle_t xTaskGetIdleTaskHandle( void ) ; /** * configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for * uxTaskGetSystemState() to be available. * * uxTaskGetSystemState() populates an TaskStatus_t structure for each task in * the system. TaskStatus_t structures contain, among other things, members * for the task handle, task name, task priority, task state, and total amount * of run time consumed by the task. See the TaskStatus_t structure * definition in this file for the full member list. * * NOTE: This function is intended for debugging use only as its use results in * the scheduler remaining suspended for an extended period. * * @param pxTaskStatusArray A pointer to an array of TaskStatus_t structures. * The array must contain at least one TaskStatus_t structure for each task * that is under the control of the RTOS. The number of tasks under the control * of the RTOS can be determined using the uxTaskGetNumberOfTasks() API function. * * @param uxArraySize The size of the array pointed to by the pxTaskStatusArray * parameter. The size is specified as the number of indexes in the array, or * the number of TaskStatus_t structures contained in the array, not by the * number of bytes in the array. * * @param pulTotalRunTime If configGENERATE_RUN_TIME_STATS is set to 1 in * FreeRTOSConfig.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the * total run time (as defined by the run time stats clock, see * http://www.freertos.org/rtos-run-time-stats.html) since the target booted. * pulTotalRunTime can be set to NULL to omit the total run time information. * * @return The number of TaskStatus_t structures that were populated by * uxTaskGetSystemState(). This should equal the number returned by the * uxTaskGetNumberOfTasks() API function, but will be zero if the value passed * in the uxArraySize parameter was too small. * * Example usage:
    // This example demonstrates how a human readable table of run time stats
	// information is generated from raw data provided by uxTaskGetSystemState().
	// The human readable table is written to pcWriteBuffer
	void vTaskGetRunTimeStats( char *pcWriteBuffer )
	{
	TaskStatus_t *pxTaskStatusArray;
	volatile UBaseType_t uxArraySize, x;
	uint32_t ulTotalRunTime, ulStatsAsPercentage;

		// Make sure the write buffer does not contain a string.
		*pcWriteBuffer = 0x00;

		// Take a snapshot of the number of tasks in case it changes while this
		// function is executing.
		uxArraySize = uxTaskGetNumberOfTasks();

		// Allocate a TaskStatus_t structure for each task.  An array could be
		// allocated statically at compile time.
		pxTaskStatusArray = pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );

		if( pxTaskStatusArray != NULL )
		{
			// Generate raw status information about each task.
			uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalRunTime );

			// For percentage calculations.
			ulTotalRunTime /= 100UL;

			// Avoid divide by zero errors.
			if( ulTotalRunTime > 0 )
			{
				// For each populated position in the pxTaskStatusArray array,
				// format the raw data as human readable ASCII data
				for( x = 0; x < uxArraySize; x++ )
				{
					// What percentage of the total run time has the task used?
					// This will always be rounded down to the nearest integer.
					// ulTotalRunTimeDiv100 has already been divided by 100.
					ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;

					if( ulStatsAsPercentage > 0UL )
					{
						sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
					}
					else
					{
						// If the percentage is zero here then the task has
						// consumed less than 1% of the total run time.
						sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
					}

					pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );
				}
			}

			// The array is no longer needed, free the memory it consumes.
			vPortFree( pxTaskStatusArray );
		}
	}
	
*/ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ) ; /** * task. h *
void vTaskList( char *pcWriteBuffer );
* * configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must * both be defined as 1 for this function to be available. See the * configuration section of the FreeRTOS.org website for more information. * * NOTE 1: This function will disable interrupts for its duration. It is * not intended for normal application runtime use but as a debug aid. * * Lists all the current tasks, along with their current state and stack * usage high water mark. * * Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or * suspended ('S'). * * PLEASE NOTE: * * This function is provided for convenience only, and is used by many of the * demo applications. Do not consider it to be part of the scheduler. * * vTaskList() calls uxTaskGetSystemState(), then formats part of the * uxTaskGetSystemState() output into a human readable table that displays task * names, states and stack usage. * * vTaskList() has a dependency on the sprintf() C library function that might * bloat the code size, use a lot of stack, and provide different results on * different platforms. An alternative, tiny, third party, and limited * functionality implementation of sprintf() is provided in many of the * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note * printf-stdarg.c does not provide a full snprintf() implementation!). * * It is recommended that production systems call uxTaskGetSystemState() * directly to get access to raw stats data, rather than indirectly through a * call to vTaskList(). * * @param pcWriteBuffer A buffer into which the above mentioned details * will be written, in ASCII form. This buffer is assumed to be large * enough to contain the generated report. Approximately 40 bytes per * task should be sufficient. * * \defgroup vTaskList vTaskList * \ingroup TaskUtils */ void vTaskList( char * pcWriteBuffer ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /** * task. h *
void vTaskGetRunTimeStats( char *pcWriteBuffer );
* * configGENERATE_RUN_TIME_STATS and configUSE_STATS_FORMATTING_FUNCTIONS * must both be defined as 1 for this function to be available. The application * must also then provide definitions for * portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE() * to configure a peripheral timer/counter and return the timers current count * value respectively. The counter should be at least 10 times the frequency of * the tick count. * * NOTE 1: This function will disable interrupts for its duration. It is * not intended for normal application runtime use but as a debug aid. * * Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total * accumulated execution time being stored for each task. The resolution * of the accumulated time value depends on the frequency of the timer * configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro. * Calling vTaskGetRunTimeStats() writes the total execution time of each * task into a buffer, both as an absolute count value and as a percentage * of the total system execution time. * * NOTE 2: * * This function is provided for convenience only, and is used by many of the * demo applications. Do not consider it to be part of the scheduler. * * vTaskGetRunTimeStats() calls uxTaskGetSystemState(), then formats part of the * uxTaskGetSystemState() output into a human readable table that displays the * amount of time each task has spent in the Running state in both absolute and * percentage terms. * * vTaskGetRunTimeStats() has a dependency on the sprintf() C library function * that might bloat the code size, use a lot of stack, and provide different * results on different platforms. An alternative, tiny, third party, and * limited functionality implementation of sprintf() is provided in many of the * FreeRTOS/Demo sub-directories in a file called printf-stdarg.c (note * printf-stdarg.c does not provide a full snprintf() implementation!). * * It is recommended that production systems call uxTaskGetSystemState() directly * to get access to raw stats data, rather than indirectly through a call to * vTaskGetRunTimeStats(). * * @param pcWriteBuffer A buffer into which the execution times will be * written, in ASCII form. This buffer is assumed to be large enough to * contain the generated report. Approximately 40 bytes per task should * be sufficient. * * \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats * \ingroup TaskUtils */ void vTaskGetRunTimeStats( char *pcWriteBuffer ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /** * task. h *
BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction );
* * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this * function to be available. * * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private * "notification value", which is a 32-bit unsigned integer (uint32_t). * * Events can be sent to a task using an intermediary object. Examples of such * objects are queues, semaphores, mutexes and event groups. Task notifications * are a method of sending an event directly to a task without the need for such * an intermediary object. * * A notification sent to a task can optionally perform an action, such as * update, overwrite or increment the task's notification value. In that way * task notifications can be used to send data to a task, or be used as light * weight and fast binary or counting semaphores. * * A notification sent to a task will remain pending until it is cleared by the * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was * already in the Blocked state to wait for a notification when the notification * arrives then the task will automatically be removed from the Blocked state * (unblocked) and the notification cleared. * * A task can use xTaskNotifyWait() to [optionally] block to wait for a * notification to be pending, or ulTaskNotifyTake() to [optionally] block * to wait for its notification value to have a non-zero value. The task does * not consume any CPU time while it is in the Blocked state. * * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. * * @param xTaskToNotify The handle of the task being notified. The handle to a * task can be returned from the xTaskCreate() API function used to create the * task, and the handle of the currently running task can be obtained by calling * xTaskGetCurrentTaskHandle(). * * @param ulValue Data that can be sent with the notification. How the data is * used depends on the value of the eAction parameter. * * @param eAction Specifies how the notification updates the task's notification * value, if at all. Valid values for eAction are as follows: * * eSetBits - * The task's notification value is bitwise ORed with ulValue. xTaskNofify() * always returns pdPASS in this case. * * eIncrement - * The task's notification value is incremented. ulValue is not used and * xTaskNotify() always returns pdPASS in this case. * * eSetValueWithOverwrite - * The task's notification value is set to the value of ulValue, even if the * task being notified had not yet processed the previous notification (the * task already had a notification pending). xTaskNotify() always returns * pdPASS in this case. * * eSetValueWithoutOverwrite - * If the task being notified did not already have a notification pending then * the task's notification value is set to ulValue and xTaskNotify() will * return pdPASS. If the task being notified already had a notification * pending then no action is performed and pdFAIL is returned. * * eNoAction - * The task receives a notification without its notification value being * updated. ulValue is not used and xTaskNotify() always returns pdPASS in * this case. * * pulPreviousNotificationValue - * Can be used to pass out the subject task's notification value before any * bits are modified by the notify function. * * @return Dependent on the value of eAction. See the description of the * eAction parameter. * * \defgroup xTaskNotify xTaskNotify * \ingroup TaskNotifications */ BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ) ; /** * task. h *
BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );
* * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this * function to be available. * * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private * "notification value", which is a 32-bit unsigned integer (uint32_t). * * A version of xTaskNotify() that can be used from an interrupt service routine * (ISR). * * Events can be sent to a task using an intermediary object. Examples of such * objects are queues, semaphores, mutexes and event groups. Task notifications * are a method of sending an event directly to a task without the need for such * an intermediary object. * * A notification sent to a task can optionally perform an action, such as * update, overwrite or increment the task's notification value. In that way * task notifications can be used to send data to a task, or be used as light * weight and fast binary or counting semaphores. * * A notification sent to a task will remain pending until it is cleared by the * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was * already in the Blocked state to wait for a notification when the notification * arrives then the task will automatically be removed from the Blocked state * (unblocked) and the notification cleared. * * A task can use xTaskNotifyWait() to [optionally] block to wait for a * notification to be pending, or ulTaskNotifyTake() to [optionally] block * to wait for its notification value to have a non-zero value. The task does * not consume any CPU time while it is in the Blocked state. * * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. * * @param xTaskToNotify The handle of the task being notified. The handle to a * task can be returned from the xTaskCreate() API function used to create the * task, and the handle of the currently running task can be obtained by calling * xTaskGetCurrentTaskHandle(). * * @param ulValue Data that can be sent with the notification. How the data is * used depends on the value of the eAction parameter. * * @param eAction Specifies how the notification updates the task's notification * value, if at all. Valid values for eAction are as follows: * * eSetBits - * The task's notification value is bitwise ORed with ulValue. xTaskNofify() * always returns pdPASS in this case. * * eIncrement - * The task's notification value is incremented. ulValue is not used and * xTaskNotify() always returns pdPASS in this case. * * eSetValueWithOverwrite - * The task's notification value is set to the value of ulValue, even if the * task being notified had not yet processed the previous notification (the * task already had a notification pending). xTaskNotify() always returns * pdPASS in this case. * * eSetValueWithoutOverwrite - * If the task being notified did not already have a notification pending then * the task's notification value is set to ulValue and xTaskNotify() will * return pdPASS. If the task being notified already had a notification * pending then no action is performed and pdFAIL is returned. * * eNoAction - * The task receives a notification without its notification value being * updated. ulValue is not used and xTaskNotify() always returns pdPASS in * this case. * * @param pxHigherPriorityTaskWoken xTaskNotifyFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the * task to which the notification was sent to leave the Blocked state, and the * unblocked task has a priority higher than the currently running task. If * xTaskNotifyFromISR() sets this value to pdTRUE then a context switch should * be requested before the interrupt is exited. How a context switch is * requested from an ISR is dependent on the port - see the documentation page * for the port in use. * * @return Dependent on the value of eAction. See the description of the * eAction parameter. * * \defgroup xTaskNotify xTaskNotify * \ingroup TaskNotifications */ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken ) ; /** * task. h *
BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
* * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this * function to be available. * * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private * "notification value", which is a 32-bit unsigned integer (uint32_t). * * Events can be sent to a task using an intermediary object. Examples of such * objects are queues, semaphores, mutexes and event groups. Task notifications * are a method of sending an event directly to a task without the need for such * an intermediary object. * * A notification sent to a task can optionally perform an action, such as * update, overwrite or increment the task's notification value. In that way * task notifications can be used to send data to a task, or be used as light * weight and fast binary or counting semaphores. * * A notification sent to a task will remain pending until it is cleared by the * task calling xTaskNotifyWait() or ulTaskNotifyTake(). If the task was * already in the Blocked state to wait for a notification when the notification * arrives then the task will automatically be removed from the Blocked state * (unblocked) and the notification cleared. * * A task can use xTaskNotifyWait() to [optionally] block to wait for a * notification to be pending, or ulTaskNotifyTake() to [optionally] block * to wait for its notification value to have a non-zero value. The task does * not consume any CPU time while it is in the Blocked state. * * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. * * @param ulBitsToClearOnEntry Bits that are set in ulBitsToClearOnEntry value * will be cleared in the calling task's notification value before the task * checks to see if any notifications are pending, and optionally blocks if no * notifications are pending. Setting ulBitsToClearOnEntry to ULONG_MAX (if * limits.h is included) or 0xffffffffUL (if limits.h is not included) will have * the effect of resetting the task's notification value to 0. Setting * ulBitsToClearOnEntry to 0 will leave the task's notification value unchanged. * * @param ulBitsToClearOnExit If a notification is pending or received before * the calling task exits the xTaskNotifyWait() function then the task's * notification value (see the xTaskNotify() API function) is passed out using * the pulNotificationValue parameter. Then any bits that are set in * ulBitsToClearOnExit will be cleared in the task's notification value (note * *pulNotificationValue is set before any bits are cleared). Setting * ulBitsToClearOnExit to ULONG_MAX (if limits.h is included) or 0xffffffffUL * (if limits.h is not included) will have the effect of resetting the task's * notification value to 0 before the function exits. Setting * ulBitsToClearOnExit to 0 will leave the task's notification value unchanged * when the function exits (in which case the value passed out in * pulNotificationValue will match the task's notification value). * * @param pulNotificationValue Used to pass the task's notification value out * of the function. Note the value passed out will not be effected by the * clearing of any bits caused by ulBitsToClearOnExit being non-zero. * * @param xTicksToWait The maximum amount of time that the task should wait in * the Blocked state for a notification to be received, should a notification * not already be pending when xTaskNotifyWait() was called. The task * will not consume any processing time while it is in the Blocked state. This * is specified in kernel ticks, the macro pdMS_TO_TICSK( value_in_ms ) can be * used to convert a time specified in milliseconds to a time specified in * ticks. * * @return If a notification was received (including notifications that were * already pending when xTaskNotifyWait was called) then pdPASS is * returned. Otherwise pdFAIL is returned. * * \defgroup xTaskNotifyWait xTaskNotifyWait * \ingroup TaskNotifications */ BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ) ; /** * task. h *
BaseType_t xTaskNotifyGive( TaskHandle_t xTaskToNotify );
* * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro * to be available. * * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private * "notification value", which is a 32-bit unsigned integer (uint32_t). * * Events can be sent to a task using an intermediary object. Examples of such * objects are queues, semaphores, mutexes and event groups. Task notifications * are a method of sending an event directly to a task without the need for such * an intermediary object. * * A notification sent to a task can optionally perform an action, such as * update, overwrite or increment the task's notification value. In that way * task notifications can be used to send data to a task, or be used as light * weight and fast binary or counting semaphores. * * xTaskNotifyGive() is a helper macro intended for use when task notifications * are used as light weight and faster binary or counting semaphore equivalents. * Actual FreeRTOS semaphores are given using the xSemaphoreGive() API function, * the equivalent action that instead uses a task notification is * xTaskNotifyGive(). * * When task notifications are being used as a binary or counting semaphore * equivalent then the task being notified should wait for the notification * using the ulTaskNotificationTake() API function rather than the * xTaskNotifyWait() API function. * * See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details. * * @param xTaskToNotify The handle of the task being notified. The handle to a * task can be returned from the xTaskCreate() API function used to create the * task, and the handle of the currently running task can be obtained by calling * xTaskGetCurrentTaskHandle(). * * @return xTaskNotifyGive() is a macro that calls xTaskNotify() with the * eAction parameter set to eIncrement - so pdPASS is always returned. * * \defgroup xTaskNotifyGive xTaskNotifyGive * \ingroup TaskNotifications */ /** * task. h *
void vTaskNotifyGiveFromISR( TaskHandle_t xTaskHandle, BaseType_t *pxHigherPriorityTaskWoken );
 *
 * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro
 * to be available.
 *
 * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private
 * "notification value", which is a 32-bit unsigned integer (uint32_t).
 *
 * A version of xTaskNotifyGive() that can be called from an interrupt service
 * routine (ISR).
 *
 * Events can be sent to a task using an intermediary object.  Examples of such
 * objects are queues, semaphores, mutexes and event groups.  Task notifications
 * are a method of sending an event directly to a task without the need for such
 * an intermediary object.
 *
 * A notification sent to a task can optionally perform an action, such as
 * update, overwrite or increment the task's notification value.  In that way
 * task notifications can be used to send data to a task, or be used as light
 * weight and fast binary or counting semaphores.
 *
 * vTaskNotifyGiveFromISR() is intended for use when task notifications are
 * used as light weight and faster binary or counting semaphore equivalents.
 * Actual FreeRTOS semaphores are given from an ISR using the
 * xSemaphoreGiveFromISR() API function, the equivalent action that instead uses
 * a task notification is vTaskNotifyGiveFromISR().
 *
 * When task notifications are being used as a binary or counting semaphore
 * equivalent then the task being notified should wait for the notification
 * using the ulTaskNotificationTake() API function rather than the
 * xTaskNotifyWait() API function.
 *
 * See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
 *
 * @param xTaskToNotify The handle of the task being notified.  The handle to a
 * task can be returned from the xTaskCreate() API function used to create the
 * task, and the handle of the currently running task can be obtained by calling
 * xTaskGetCurrentTaskHandle().
 *
 * @param pxHigherPriorityTaskWoken  vTaskNotifyGiveFromISR() will set
 * *pxHigherPriorityTaskWoken to pdTRUE if sending the notification caused the
 * task to which the notification was sent to leave the Blocked state, and the
 * unblocked task has a priority higher than the currently running task.  If
 * vTaskNotifyGiveFromISR() sets this value to pdTRUE then a context switch
 * should be requested before the interrupt is exited.  How a context switch is
 * requested from an ISR is dependent on the port - see the documentation page
 * for the port in use.
 *
 * \defgroup xTaskNotifyWait xTaskNotifyWait
 * \ingroup TaskNotifications
 */
void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken ) ;

/**
 * task. h
 * 
uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
* * configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this * function to be available. * * When configUSE_TASK_NOTIFICATIONS is set to one each task has its own private * "notification value", which is a 32-bit unsigned integer (uint32_t). * * Events can be sent to a task using an intermediary object. Examples of such * objects are queues, semaphores, mutexes and event groups. Task notifications * are a method of sending an event directly to a task without the need for such * an intermediary object. * * A notification sent to a task can optionally perform an action, such as * update, overwrite or increment the task's notification value. In that way * task notifications can be used to send data to a task, or be used as light * weight and fast binary or counting semaphores. * * ulTaskNotifyTake() is intended for use when a task notification is used as a * faster and lighter weight binary or counting semaphore alternative. Actual * FreeRTOS semaphores are taken using the xSemaphoreTake() API function, the * equivalent action that instead uses a task notification is * ulTaskNotifyTake(). * * When a task is using its notification value as a binary or counting semaphore * other tasks should send notifications to it using the xTaskNotifyGive() * macro, or xTaskNotify() function with the eAction parameter set to * eIncrement. * * ulTaskNotifyTake() can either clear the task's notification value to * zero on exit, in which case the notification value acts like a binary * semaphore, or decrement the task's notification value on exit, in which case * the notification value acts like a counting semaphore. * * A task can use ulTaskNotifyTake() to [optionally] block to wait for a * the task's notification value to be non-zero. The task does not consume any * CPU time while it is in the Blocked state. * * Where as xTaskNotifyWait() will return when a notification is pending, * ulTaskNotifyTake() will return when the task's notification value is * not zero. * * See http://www.FreeRTOS.org/RTOS-task-notifications.html for details. * * @param xClearCountOnExit if xClearCountOnExit is pdFALSE then the task's * notification value is decremented when the function exits. In this way the * notification value acts like a counting semaphore. If xClearCountOnExit is * not pdFALSE then the task's notification value is cleared to zero when the * function exits. In this way the notification value acts like a binary * semaphore. * * @param xTicksToWait The maximum amount of time that the task should wait in * the Blocked state for the task's notification value to be greater than zero, * should the count not already be greater than zero when * ulTaskNotifyTake() was called. The task will not consume any processing * time while it is in the Blocked state. This is specified in kernel ticks, * the macro pdMS_TO_TICSK( value_in_ms ) can be used to convert a time * specified in milliseconds to a time specified in ticks. * * @return The task's notification count before it is either cleared to zero or * decremented (see the xClearCountOnExit parameter). * * \defgroup ulTaskNotifyTake ulTaskNotifyTake * \ingroup TaskNotifications */ uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) ; /** * task. h *
BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
* * If the notification state of the task referenced by the handle xTask is * eNotified, then set the task's notification state to eNotWaitingNotification. * The task's notification value is not altered. Set xTask to NULL to clear the * notification state of the calling task. * * @return pdTRUE if the task's notification state was set to * eNotWaitingNotification, otherwise pdFALSE. * \defgroup xTaskNotifyStateClear xTaskNotifyStateClear * \ingroup TaskNotifications */ BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask ); /*----------------------------------------------------------- * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES *----------------------------------------------------------*/ /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. * * Called from the real time kernel tick (either preemptive or cooperative), * this increments the tick count and checks if any tasks that are blocked * for a finite period required removing from a blocked list and placing on * a ready list. If a non-zero value is returned then a context switch is * required because either: * + A task was removed from a blocked list because its timeout had expired, * or * + Time slicing is in use and there is a task of equal priority to the * currently running task. */ BaseType_t xTaskIncrementTick( void ) ; /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. * * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. * * Removes the calling task from the ready list and places it both * on the list of tasks waiting for a particular event, and the * list of delayed tasks. The task will be removed from both lists * and replaced on the ready list should either the event occur (and * there be no higher priority tasks waiting on the same event) or * the delay period expires. * * The 'unordered' version replaces the event list item value with the * xItemValue value, and inserts the list item at the end of the list. * * The 'ordered' version uses the existing event list item value (which is the * owning tasks priority) to insert the list item into the event list is task * priority order. * * @param pxEventList The list containing tasks that are blocked waiting * for the event to occur. * * @param xItemValue The item value to use for the event list item when the * event list is not ordered by task priority. * * @param xTicksToWait The maximum amount of time that the task should wait * for the event to occur. This is specified in kernel ticks,the constant * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time * period. */ void vTaskPlaceOnEventList( List_t * const pxEventList, const TickType_t xTicksToWait ) ; void vTaskPlaceOnUnorderedEventList( List_t * pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait ) ; /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. * * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. * * This function performs nearly the same function as vTaskPlaceOnEventList(). * The difference being that this function does not permit tasks to block * indefinitely, whereas vTaskPlaceOnEventList() does. * */ void vTaskPlaceOnEventListRestricted( List_t * const pxEventList, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) ; /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN * INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. * * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED. * * Removes a task from both the specified event list and the list of blocked * tasks, and places it on a ready queue. * * xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called * if either an event occurs to unblock a task, or the block timeout period * expires. * * xTaskRemoveFromEventList() is used when the event list is in task priority * order. It removes the list item from the head of the event list as that will * have the highest priority owning task of all the tasks on the event list. * xTaskRemoveFromUnorderedEventList() is used when the event list is not * ordered and the event list items hold something other than the owning tasks * priority. In this case the event list item value is updated to the value * passed in the xItemValue parameter. * * @return pdTRUE if the task being removed has a higher priority than the task * making the call, otherwise pdFALSE. */ BaseType_t xTaskRemoveFromEventList( const List_t * const pxEventList ) ; BaseType_t xTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem, const TickType_t xItemValue ) ; /* * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY * INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS * AN INTERFACE WHICH IS FOR THE EXCLUSIVE USE OF THE SCHEDULER. * * Sets the pointer to the current TCB to the TCB of the highest priority task * that is ready to run. */ void vTaskSwitchContext( void ) ; /* * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE. THEY ARE USED BY * THE EVENT BITS MODULE. */ TickType_t uxTaskResetEventItemValue( void ) ; /* * Return the handle of the calling task. */ TaskHandle_t xTaskGetCurrentTaskHandle( void ) ; /* * Capture the current time status for future reference. */ void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) ; /* * Compare the time status now with that previously captured to see if the * timeout has expired. */ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) ; /* * Shortcut used by the queue implementation to prevent unnecessary call to * taskYIELD(); */ void vTaskMissedYield( void ) ; /* * Returns the scheduler state as taskSCHEDULER_RUNNING, * taskSCHEDULER_NOT_STARTED or taskSCHEDULER_SUSPENDED. */ BaseType_t xTaskGetSchedulerState( void ) ; /* * Raises the priority of the mutex holder to that of the calling task should * the mutex holder have a priority less than the calling task. */ void vTaskPriorityInherit( TaskHandle_t const pxMutexHolder ) ; /* * Set the priority of a task back to its proper priority in the case that it * inherited a higher priority while it was holding a semaphore. */ BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder ) ; /* * Get the uxTCBNumber assigned to the task referenced by the xTask parameter. */ UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask ) ; /* * Set the uxTaskNumber of the task referenced by the xTask parameter to * uxHandle. */ void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle ) ; /* * Only available when configUSE_TICKLESS_IDLE is set to 1. * If tickless mode is being used, or a low power mode is implemented, then * the tick interrupt will not execute during idle periods. When this is the * case, the tick count value maintained by the scheduler needs to be kept up * to date with the actual execution time by being skipped forward by a time * equal to the idle period. */ void vTaskStepTick( const TickType_t xTicksToJump ) ; /* * Only avilable when configUSE_TICKLESS_IDLE is set to 1. * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port * specific sleep function to determine if it is ok to proceed with the sleep, * and if it is ok to proceed, if it is ok to sleep indefinitely. * * This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only * called with the scheduler suspended, not from within a critical section. It * is therefore possible for an interrupt to request a context switch between * portSUPPRESS_TICKS_AND_SLEEP() and the low power mode actually being * entered. eTaskConfirmSleepModeStatus() should be called from a short * critical section between the timer being stopped and the sleep mode being * entered to ensure it is ok to proceed into the sleep mode. */ eSleepModeStatus eTaskConfirmSleepModeStatus( void ) ; /* * For internal use only. Increment the mutex held count when a mutex is * taken and return the handle of the task that has taken the mutex. */ void *pvTaskIncrementMutexHeldCount( void ) ; /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /** * Type by which queues are referenced. For example, a call to xQueueCreate() * returns an QueueHandle_t variable that can then be used as a parameter to * xQueueSend(), xQueueReceive(), etc. */ typedef void * QueueHandle_t; /** * Type by which queue sets are referenced. For example, a call to * xQueueCreateSet() returns an xQueueSet variable that can then be used as a * parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc. */ typedef void * QueueSetHandle_t; /** * Queue sets can contain both queues and semaphores, so the * QueueSetMemberHandle_t is defined as a type to be used where a parameter or * return value can be either an QueueHandle_t or an SemaphoreHandle_t. */ typedef void * QueueSetMemberHandle_t; /* For internal use only. */ /* For internal use only. These definitions *must* match those in queue.c. */ /** * queue. h *
 QueueHandle_t xQueueCreate(
							  UBaseType_t uxQueueLength,
							  UBaseType_t uxItemSize
						  );
 * 
* * Creates a new queue instance, and returns a handle by which the new queue * can be referenced. * * Internally, within the FreeRTOS implementation, queues use two blocks of * memory. The first block is used to hold the queue's data structures. The * second block is used to hold items placed into the queue. If a queue is * created using xQueueCreate() then both blocks of memory are automatically * dynamically allocated inside the xQueueCreate() function. (see * http://www.freertos.org/a00111.html). If a queue is created using * xQueueCreateStatic() then the application writer must provide the memory that * will get used by the queue. xQueueCreateStatic() therefore allows a queue to * be created without using any dynamic memory allocation. * * http://www.FreeRTOS.org/Embedded-RTOS-Queues.html * * @param uxQueueLength The maximum number of items that the queue can contain. * * @param uxItemSize The number of bytes each item in the queue will require. * Items are queued by copy, not by reference, so this is the number of bytes * that will be copied for each posted item. Each item on the queue must be * the same size. * * @return If the queue is successfully create then a handle to the newly * created queue is returned. If the queue cannot be created then 0 is * returned. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 };

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1, xQueue2;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
	if( xQueue1 == 0 )
	{
		// Queue was not created and must not be used.
	}

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
	if( xQueue2 == 0 )
	{
		// Queue was not created and must not be used.
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueCreate xQueueCreate * \ingroup QueueManagement */ /** * queue. h *
 QueueHandle_t xQueueCreateStatic(
							  UBaseType_t uxQueueLength,
							  UBaseType_t uxItemSize,
							  uint8_t *pucQueueStorageBuffer,
							  StaticQueue_t *pxQueueBuffer
						  );
 * 
* * Creates a new queue instance, and returns a handle by which the new queue * can be referenced. * * Internally, within the FreeRTOS implementation, queues use two blocks of * memory. The first block is used to hold the queue's data structures. The * second block is used to hold items placed into the queue. If a queue is * created using xQueueCreate() then both blocks of memory are automatically * dynamically allocated inside the xQueueCreate() function. (see * http://www.freertos.org/a00111.html). If a queue is created using * xQueueCreateStatic() then the application writer must provide the memory that * will get used by the queue. xQueueCreateStatic() therefore allows a queue to * be created without using any dynamic memory allocation. * * http://www.FreeRTOS.org/Embedded-RTOS-Queues.html * * @param uxQueueLength The maximum number of items that the queue can contain. * * @param uxItemSize The number of bytes each item in the queue will require. * Items are queued by copy, not by reference, so this is the number of bytes * that will be copied for each posted item. Each item on the queue must be * the same size. * * @param pucQueueStorageBuffer If uxItemSize is not zero then * pucQueueStorageBuffer must point to a uint8_t array that is at least large * enough to hold the maximum number of items that can be in the queue at any * one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is * zero then pucQueueStorageBuffer can be NULL. * * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which * will be used to hold the queue's data structure. * * @return If the queue is created then a handle to the created queue is * returned. If pxQueueBuffer is NULL then NULL is returned. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 };

 #define QUEUE_LENGTH 10
 #define ITEM_SIZE sizeof( uint32_t )

 // xQueueBuffer will hold the queue structure.
 StaticQueue_t xQueueBuffer;

 // ucQueueStorage will hold the items posted to the queue.  Must be at least
 // [(queue length) * ( queue item size)] bytes long.
 uint8_t ucQueueStorage[ QUEUE_LENGTH * ITEM_SIZE ];

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold.
							ITEM_SIZE	  // The size of each item in the queue
							&( ucQueueStorage[ 0 ] ), // The buffer that will hold the items in the queue.
							&xQueueBuffer ); // The buffer that will hold the queue structure.

	// The queue is guaranteed to be created successfully as no dynamic memory
	// allocation is used.  Therefore xQueue1 is now a handle to a valid queue.

	// ... Rest of task code.
 }
 
* \defgroup xQueueCreateStatic xQueueCreateStatic * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueSendToToFront(
								   QueueHandle_t	xQueue,
								   const void		*pvItemToQueue,
								   TickType_t		xTicksToWait
							   );
 * 
* * This is a macro that calls xQueueGenericSend(). * * Post an item to the front of a queue. The item is queued by copy, not by * reference. This function must not be called from an interrupt service * routine. See xQueueSendFromISR () for an alternative which may be used * in an ISR. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param xTicksToWait The maximum amount of time the task should block * waiting for space to become available on the queue, should it already * be full. The call will return immediately if this is set to 0 and the * queue is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 uint32_t ulVar = 10UL;

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1, xQueue2;
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );

	// ...

	if( xQueue1 != 0 )
	{
		// Send an uint32_t.  Wait for 10 ticks for space to become
		// available if necessary.
		if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
		{
			// Failed to post the message, even after 10 ticks.
		}
	}

	if( xQueue2 != 0 )
	{
		// Send a pointer to a struct AMessage object.  Don't block if the
		// queue is already full.
		pxMessage = & xMessage;
		xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueSend xQueueSend * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueSendToBack(
								   QueueHandle_t	xQueue,
								   const void		*pvItemToQueue,
								   TickType_t		xTicksToWait
							   );
 * 
* * This is a macro that calls xQueueGenericSend(). * * Post an item to the back of a queue. The item is queued by copy, not by * reference. This function must not be called from an interrupt service * routine. See xQueueSendFromISR () for an alternative which may be used * in an ISR. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param xTicksToWait The maximum amount of time the task should block * waiting for space to become available on the queue, should it already * be full. The call will return immediately if this is set to 0 and the queue * is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 uint32_t ulVar = 10UL;

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1, xQueue2;
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );

	// ...

	if( xQueue1 != 0 )
	{
		// Send an uint32_t.  Wait for 10 ticks for space to become
		// available if necessary.
		if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
		{
			// Failed to post the message, even after 10 ticks.
		}
	}

	if( xQueue2 != 0 )
	{
		// Send a pointer to a struct AMessage object.  Don't block if the
		// queue is already full.
		pxMessage = & xMessage;
		xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueSend xQueueSend * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueSend(
							  QueueHandle_t xQueue,
							  const void * pvItemToQueue,
							  TickType_t xTicksToWait
						 );
 * 
* * This is a macro that calls xQueueGenericSend(). It is included for * backward compatibility with versions of FreeRTOS.org that did not * include the xQueueSendToFront() and xQueueSendToBack() macros. It is * equivalent to xQueueSendToBack(). * * Post an item on a queue. The item is queued by copy, not by reference. * This function must not be called from an interrupt service routine. * See xQueueSendFromISR () for an alternative which may be used in an ISR. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param xTicksToWait The maximum amount of time the task should block * waiting for space to become available on the queue, should it already * be full. The call will return immediately if this is set to 0 and the * queue is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 uint32_t ulVar = 10UL;

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1, xQueue2;
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );

	// ...

	if( xQueue1 != 0 )
	{
		// Send an uint32_t.  Wait for 10 ticks for space to become
		// available if necessary.
		if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
		{
			// Failed to post the message, even after 10 ticks.
		}
	}

	if( xQueue2 != 0 )
	{
		// Send a pointer to a struct AMessage object.  Don't block if the
		// queue is already full.
		pxMessage = & xMessage;
		xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueSend xQueueSend * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueOverwrite(
							  QueueHandle_t xQueue,
							  const void * pvItemToQueue
						 );
 * 
* * Only for use with queues that have a length of one - so the queue is either * empty or full. * * Post an item on a queue. If the queue is already full then overwrite the * value held in the queue. The item is queued by copy, not by reference. * * This function must not be called from an interrupt service routine. * See xQueueOverwriteFromISR () for an alternative which may be used in an ISR. * * @param xQueue The handle of the queue to which the data is being sent. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @return xQueueOverwrite() is a macro that calls xQueueGenericSend(), and * therefore has the same return values as xQueueSendToFront(). However, pdPASS * is the only value that can be returned because xQueueOverwrite() will write * to the queue even when the queue is already full. * * Example usage:

 void vFunction( void *pvParameters )
 {
 QueueHandle_t xQueue;
 uint32_t ulVarToSend, ulValReceived;

	// Create a queue to hold one uint32_t value.  It is strongly
	// recommended *not* to use xQueueOverwrite() on queues that can
	// contain more than one value, and doing so will trigger an assertion
	// if configASSERT() is defined.
	xQueue = xQueueCreate( 1, sizeof( uint32_t ) );

	// Write the value 10 to the queue using xQueueOverwrite().
	ulVarToSend = 10;
	xQueueOverwrite( xQueue, &ulVarToSend );

	// Peeking the queue should now return 10, but leave the value 10 in
	// the queue.  A block time of zero is used as it is known that the
	// queue holds a value.
	ulValReceived = 0;
	xQueuePeek( xQueue, &ulValReceived, 0 );

	if( ulValReceived != 10 )
	{
		// Error unless the item was removed by a different task.
	}

	// The queue is still full.  Use xQueueOverwrite() to overwrite the
	// value held in the queue with 100.
	ulVarToSend = 100;
	xQueueOverwrite( xQueue, &ulVarToSend );

	// This time read from the queue, leaving the queue empty once more.
	// A block time of 0 is used again.
	xQueueReceive( xQueue, &ulValReceived, 0 );

	// The value read should be the last value written, even though the
	// queue was already full when the value was written.
	if( ulValReceived != 100 )
	{
		// Error!
	}

	// ...
}
 
* \defgroup xQueueOverwrite xQueueOverwrite * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueGenericSend(
									QueueHandle_t xQueue,
									const void * pvItemToQueue,
									TickType_t xTicksToWait
									BaseType_t xCopyPosition
								);
 * 
* * It is preferred that the macros xQueueSend(), xQueueSendToFront() and * xQueueSendToBack() are used in place of calling this function directly. * * Post an item on a queue. The item is queued by copy, not by reference. * This function must not be called from an interrupt service routine. * See xQueueSendFromISR () for an alternative which may be used in an ISR. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param xTicksToWait The maximum amount of time the task should block * waiting for space to become available on the queue, should it already * be full. The call will return immediately if this is set to 0 and the * queue is full. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the * item at the back of the queue, or queueSEND_TO_FRONT to place the item * at the front of the queue (for high priority messages). * * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 uint32_t ulVar = 10UL;

 void vATask( void *pvParameters )
 {
 QueueHandle_t xQueue1, xQueue2;
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 uint32_t values.
	xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );

	// ...

	if( xQueue1 != 0 )
	{
		// Send an uint32_t.  Wait for 10 ticks for space to become
		// available if necessary.
		if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10, queueSEND_TO_BACK ) != pdPASS )
		{
			// Failed to post the message, even after 10 ticks.
		}
	}

	if( xQueue2 != 0 )
	{
		// Send a pointer to a struct AMessage object.  Don't block if the
		// queue is already full.
		pxMessage = & xMessage;
		xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0, queueSEND_TO_BACK );
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueSend xQueueSend * \ingroup QueueManagement */ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition ) ; /** * queue. h *
 BaseType_t xQueuePeek(
							 QueueHandle_t xQueue,
							 void *pvBuffer,
							 TickType_t xTicksToWait
						 );
* * This is a macro that calls the xQueueGenericReceive() function. * * Receive an item from a queue without removing the item from the queue. * The item is received by copy so a buffer of adequate size must be * provided. The number of bytes copied into the buffer was defined when * the queue was created. * * Successfully received items remain on the queue so will be returned again * by the next call, or a call to xQueueReceive(). * * This macro must not be used in an interrupt service routine. See * xQueuePeekFromISR() for an alternative that can be called from an interrupt * service routine. * * @param xQueue The handle to the queue from which the item is to be * received. * * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * * @param xTicksToWait The maximum amount of time the task should block * waiting for an item to receive should the queue be empty at the time * of the call. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * xQueuePeek() will return immediately if xTicksToWait is 0 and the queue * is empty. * * @return pdTRUE if an item was successfully received from the queue, * otherwise pdFALSE. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 QueueHandle_t xQueue;

 // Task to create a queue and post a value.
 void vATask( void *pvParameters )
 {
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
	if( xQueue == 0 )
	{
		// Failed to create the queue.
	}

	// ...

	// Send a pointer to a struct AMessage object.  Don't block if the
	// queue is already full.
	pxMessage = & xMessage;
	xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );

	// ... Rest of task code.
 }

 // Task to peek the data from the queue.
 void vADifferentTask( void *pvParameters )
 {
 struct AMessage *pxRxedMessage;

	if( xQueue != 0 )
	{
		// Peek a message on the created queue.  Block for 10 ticks if a
		// message is not immediately available.
		if( xQueuePeek( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
		{
			// pcRxedMessage now points to the struct AMessage variable posted
			// by vATask, but the item still remains on the queue.
		}
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueReceive xQueueReceive * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueuePeekFromISR(
									QueueHandle_t xQueue,
									void *pvBuffer,
								);
* * A version of xQueuePeek() that can be called from an interrupt service * routine (ISR). * * Receive an item from a queue without removing the item from the queue. * The item is received by copy so a buffer of adequate size must be * provided. The number of bytes copied into the buffer was defined when * the queue was created. * * Successfully received items remain on the queue so will be returned again * by the next call, or a call to xQueueReceive(). * * @param xQueue The handle to the queue from which the item is to be * received. * * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * * @return pdTRUE if an item was successfully received from the queue, * otherwise pdFALSE. * * \defgroup xQueuePeekFromISR xQueuePeekFromISR * \ingroup QueueManagement */ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ) ; /** * queue. h *
 BaseType_t xQueueReceive(
								 QueueHandle_t xQueue,
								 void *pvBuffer,
								 TickType_t xTicksToWait
							);
* * This is a macro that calls the xQueueGenericReceive() function. * * Receive an item from a queue. The item is received by copy so a buffer of * adequate size must be provided. The number of bytes copied into the buffer * was defined when the queue was created. * * Successfully received items are removed from the queue. * * This function must not be used in an interrupt service routine. See * xQueueReceiveFromISR for an alternative that can. * * @param xQueue The handle to the queue from which the item is to be * received. * * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * * @param xTicksToWait The maximum amount of time the task should block * waiting for an item to receive should the queue be empty at the time * of the call. xQueueReceive() will return immediately if xTicksToWait * is zero and the queue is empty. The time is defined in tick periods so the * constant portTICK_PERIOD_MS should be used to convert to real time if this is * required. * * @return pdTRUE if an item was successfully received from the queue, * otherwise pdFALSE. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 QueueHandle_t xQueue;

 // Task to create a queue and post a value.
 void vATask( void *pvParameters )
 {
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
	if( xQueue == 0 )
	{
		// Failed to create the queue.
	}

	// ...

	// Send a pointer to a struct AMessage object.  Don't block if the
	// queue is already full.
	pxMessage = & xMessage;
	xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );

	// ... Rest of task code.
 }

 // Task to receive from the queue.
 void vADifferentTask( void *pvParameters )
 {
 struct AMessage *pxRxedMessage;

	if( xQueue != 0 )
	{
		// Receive a message on the created queue.  Block for 10 ticks if a
		// message is not immediately available.
		if( xQueueReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
		{
			// pcRxedMessage now points to the struct AMessage variable posted
			// by vATask.
		}
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueReceive xQueueReceive * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueGenericReceive(
									   QueueHandle_t	xQueue,
									   void	*pvBuffer,
									   TickType_t	xTicksToWait
									   BaseType_t	xJustPeek
									);
* * It is preferred that the macro xQueueReceive() be used rather than calling * this function directly. * * Receive an item from a queue. The item is received by copy so a buffer of * adequate size must be provided. The number of bytes copied into the buffer * was defined when the queue was created. * * This function must not be used in an interrupt service routine. See * xQueueReceiveFromISR for an alternative that can. * * @param xQueue The handle to the queue from which the item is to be * received. * * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * * @param xTicksToWait The maximum amount of time the task should block * waiting for an item to receive should the queue be empty at the time * of the call. The time is defined in tick periods so the constant * portTICK_PERIOD_MS should be used to convert to real time if this is required. * xQueueGenericReceive() will return immediately if the queue is empty and * xTicksToWait is 0. * * @param xJustPeek When set to true, the item received from the queue is not * actually removed from the queue - meaning a subsequent call to * xQueueReceive() will return the same item. When set to false, the item * being received from the queue is also removed from the queue. * * @return pdTRUE if an item was successfully received from the queue, * otherwise pdFALSE. * * Example usage:
 struct AMessage
 {
	char ucMessageID;
	char ucData[ 20 ];
 } xMessage;

 QueueHandle_t xQueue;

 // Task to create a queue and post a value.
 void vATask( void *pvParameters )
 {
 struct AMessage *pxMessage;

	// Create a queue capable of containing 10 pointers to AMessage structures.
	// These should be passed by pointer as they contain a lot of data.
	xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
	if( xQueue == 0 )
	{
		// Failed to create the queue.
	}

	// ...

	// Send a pointer to a struct AMessage object.  Don't block if the
	// queue is already full.
	pxMessage = & xMessage;
	xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );

	// ... Rest of task code.
 }

 // Task to receive from the queue.
 void vADifferentTask( void *pvParameters )
 {
 struct AMessage *pxRxedMessage;

	if( xQueue != 0 )
	{
		// Receive a message on the created queue.  Block for 10 ticks if a
		// message is not immediately available.
		if( xQueueGenericReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
		{
			// pcRxedMessage now points to the struct AMessage variable posted
			// by vATask.
		}
	}

	// ... Rest of task code.
 }
 
* \defgroup xQueueReceive xQueueReceive * \ingroup QueueManagement */ BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek ) ; /** * queue. h *
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
* * Return the number of messages stored in a queue. * * @param xQueue A handle to the queue being queried. * * @return The number of messages available in the queue. * * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting * \ingroup QueueManagement */ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) ; /** * queue. h *
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
* * Return the number of free spaces available in a queue. This is equal to the * number of items that can be sent to the queue before the queue becomes full * if no items are removed. * * @param xQueue A handle to the queue being queried. * * @return The number of spaces available in the queue. * * \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting * \ingroup QueueManagement */ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) ; /** * queue. h *
void vQueueDelete( QueueHandle_t xQueue );
* * Delete a queue - freeing all the memory allocated for storing of items * placed on the queue. * * @param xQueue A handle to the queue to be deleted. * * \defgroup vQueueDelete vQueueDelete * \ingroup QueueManagement */ void vQueueDelete( QueueHandle_t xQueue ) ; /** * queue. h *
 BaseType_t xQueueSendToFrontFromISR(
										 QueueHandle_t xQueue,
										 const void *pvItemToQueue,
										 BaseType_t *pxHigherPriorityTaskWoken
									  );
 
* * This is a macro that calls xQueueGenericSendFromISR(). * * Post an item to the front of a queue. It is safe to use this macro from * within an interrupt service routine. * * Items are queued by copy not reference so it is preferable to only * queue small items, especially when called from an ISR. In most cases * it would be preferable to store a pointer to the item being queued. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return pdTRUE if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value * per call):
 void vBufferISR( void )
 {
 char cIn;
 BaseType_t xHigherPrioritTaskWoken;

	// We have not woken a task at the start of the ISR.
	xHigherPriorityTaskWoken = pdFALSE;

	// Loop until the buffer is empty.
	do
	{
		// Obtain a byte from the buffer.
		cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );

		// Post the byte.
		xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );

	} while( portINPUT_BYTE( BUFFER_COUNT ) );

	// Now the buffer is empty we can switch context if necessary.
	if( xHigherPriorityTaskWoken )
	{
		taskYIELD ();
	}
 }
 
* * \defgroup xQueueSendFromISR xQueueSendFromISR * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueSendToBackFromISR(
										 QueueHandle_t xQueue,
										 const void *pvItemToQueue,
										 BaseType_t *pxHigherPriorityTaskWoken
									  );
 
* * This is a macro that calls xQueueGenericSendFromISR(). * * Post an item to the back of a queue. It is safe to use this macro from * within an interrupt service routine. * * Items are queued by copy not reference so it is preferable to only * queue small items, especially when called from an ISR. In most cases * it would be preferable to store a pointer to the item being queued. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return pdTRUE if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value * per call):
 void vBufferISR( void )
 {
 char cIn;
 BaseType_t xHigherPriorityTaskWoken;

	// We have not woken a task at the start of the ISR.
	xHigherPriorityTaskWoken = pdFALSE;

	// Loop until the buffer is empty.
	do
	{
		// Obtain a byte from the buffer.
		cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );

		// Post the byte.
		xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );

	} while( portINPUT_BYTE( BUFFER_COUNT ) );

	// Now the buffer is empty we can switch context if necessary.
	if( xHigherPriorityTaskWoken )
	{
		taskYIELD ();
	}
 }
 
* * \defgroup xQueueSendFromISR xQueueSendFromISR * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueOverwriteFromISR(
							  QueueHandle_t xQueue,
							  const void * pvItemToQueue,
							  BaseType_t *pxHigherPriorityTaskWoken
						 );
 * 
* * A version of xQueueOverwrite() that can be used in an interrupt service * routine (ISR). * * Only for use with queues that can hold a single item - so the queue is either * empty or full. * * Post an item on a queue. If the queue is already full then overwrite the * value held in the queue. The item is queued by copy, not by reference. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param pxHigherPriorityTaskWoken xQueueOverwriteFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xQueueOverwriteFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return xQueueOverwriteFromISR() is a macro that calls * xQueueGenericSendFromISR(), and therefore has the same return values as * xQueueSendToFrontFromISR(). However, pdPASS is the only value that can be * returned because xQueueOverwriteFromISR() will write to the queue even when * the queue is already full. * * Example usage:

 QueueHandle_t xQueue;

 void vFunction( void *pvParameters )
 {
 	// Create a queue to hold one uint32_t value.  It is strongly
	// recommended *not* to use xQueueOverwriteFromISR() on queues that can
	// contain more than one value, and doing so will trigger an assertion
	// if configASSERT() is defined.
	xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
}

void vAnInterruptHandler( void )
{
// xHigherPriorityTaskWoken must be set to pdFALSE before it is used.
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
uint32_t ulVarToSend, ulValReceived;

	// Write the value 10 to the queue using xQueueOverwriteFromISR().
	ulVarToSend = 10;
	xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );

	// The queue is full, but calling xQueueOverwriteFromISR() again will still
	// pass because the value held in the queue will be overwritten with the
	// new value.
	ulVarToSend = 100;
	xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );

	// Reading from the queue will now return 100.

	// ...

	if( xHigherPrioritytaskWoken == pdTRUE )
	{
		// Writing to the queue caused a task to unblock and the unblocked task
		// has a priority higher than or equal to the priority of the currently
		// executing task (the task this interrupt interrupted).  Perform a context
		// switch so this interrupt returns directly to the unblocked task.
		portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
	}
}
 
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueSendFromISR(
									 QueueHandle_t xQueue,
									 const void *pvItemToQueue,
									 BaseType_t *pxHigherPriorityTaskWoken
								);
 
* * This is a macro that calls xQueueGenericSendFromISR(). It is included * for backward compatibility with versions of FreeRTOS.org that did not * include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR() * macros. * * Post an item to the back of a queue. It is safe to use this function from * within an interrupt service routine. * * Items are queued by copy not reference so it is preferable to only * queue small items, especially when called from an ISR. In most cases * it would be preferable to store a pointer to the item being queued. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param pxHigherPriorityTaskWoken xQueueSendFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xQueueSendFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return pdTRUE if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value * per call):
 void vBufferISR( void )
 {
 char cIn;
 BaseType_t xHigherPriorityTaskWoken;

	// We have not woken a task at the start of the ISR.
	xHigherPriorityTaskWoken = pdFALSE;

	// Loop until the buffer is empty.
	do
	{
		// Obtain a byte from the buffer.
		cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );

		// Post the byte.
		xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );

	} while( portINPUT_BYTE( BUFFER_COUNT ) );

	// Now the buffer is empty we can switch context if necessary.
	if( xHigherPriorityTaskWoken )
	{
		// Actual macro used here is port specific.
		portYIELD_FROM_ISR ();
	}
 }
 
* * \defgroup xQueueSendFromISR xQueueSendFromISR * \ingroup QueueManagement */ /** * queue. h *
 BaseType_t xQueueGenericSendFromISR(
										   QueueHandle_t		xQueue,
										   const	void	*pvItemToQueue,
										   BaseType_t	*pxHigherPriorityTaskWoken,
										   BaseType_t	xCopyPosition
									   );
 
* * It is preferred that the macros xQueueSendFromISR(), * xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place * of calling this function directly. xQueueGiveFromISR() is an * equivalent for use by semaphores that don't actually copy any data. * * Post an item on a queue. It is safe to use this function from within an * interrupt service routine. * * Items are queued by copy not reference so it is preferable to only * queue small items, especially when called from an ISR. In most cases * it would be preferable to store a pointer to the item being queued. * * @param xQueue The handle to the queue on which the item is to be posted. * * @param pvItemToQueue A pointer to the item that is to be placed on the * queue. The size of the items the queue will hold was defined when the * queue was created, so this many bytes will be copied from pvItemToQueue * into the queue storage area. * * @param pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @param xCopyPosition Can take the value queueSEND_TO_BACK to place the * item at the back of the queue, or queueSEND_TO_FRONT to place the item * at the front of the queue (for high priority messages). * * @return pdTRUE if the data was successfully sent to the queue, otherwise * errQUEUE_FULL. * * Example usage for buffered IO (where the ISR can obtain more than one value * per call):
 void vBufferISR( void )
 {
 char cIn;
 BaseType_t xHigherPriorityTaskWokenByPost;

	// We have not woken a task at the start of the ISR.
	xHigherPriorityTaskWokenByPost = pdFALSE;

	// Loop until the buffer is empty.
	do
	{
		// Obtain a byte from the buffer.
		cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );

		// Post each byte.
		xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK );

	} while( portINPUT_BYTE( BUFFER_COUNT ) );

	// Now the buffer is empty we can switch context if necessary.  Note that the
	// name of the yield function required is port specific.
	if( xHigherPriorityTaskWokenByPost )
	{
		taskYIELD_YIELD_FROM_ISR();
	}
 }
 
* * \defgroup xQueueSendFromISR xQueueSendFromISR * \ingroup QueueManagement */ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition ) ; BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t * const pxHigherPriorityTaskWoken ) ; /** * queue. h *
 BaseType_t xQueueReceiveFromISR(
									   QueueHandle_t	xQueue,
									   void	*pvBuffer,
									   BaseType_t *pxTaskWoken
								   );
 * 
* * Receive an item from a queue. It is safe to use this function from within an * interrupt service routine. * * @param xQueue The handle to the queue from which the item is to be * received. * * @param pvBuffer Pointer to the buffer into which the received item will * be copied. * * @param pxTaskWoken A task may be blocked waiting for space to become * available on the queue. If xQueueReceiveFromISR causes such a task to * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will * remain unchanged. * * @return pdTRUE if an item was successfully received from the queue, * otherwise pdFALSE. * * Example usage:

 QueueHandle_t xQueue;

 // Function to create a queue and post some values.
 void vAFunction( void *pvParameters )
 {
 char cValueToPost;
 const TickType_t xTicksToWait = ( TickType_t )0xff;

	// Create a queue capable of containing 10 characters.
	xQueue = xQueueCreate( 10, sizeof( char ) );
	if( xQueue == 0 )
	{
		// Failed to create the queue.
	}

	// ...

	// Post some characters that will be used within an ISR.  If the queue
	// is full then this task will block for xTicksToWait ticks.
	cValueToPost = 'a';
	xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
	cValueToPost = 'b';
	xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );

	// ... keep posting characters ... this task may block when the queue
	// becomes full.

	cValueToPost = 'c';
	xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
 }

 // ISR that outputs all the characters received on the queue.
 void vISR_Routine( void )
 {
 BaseType_t xTaskWokenByReceive = pdFALSE;
 char cRxedChar;

	while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
	{
		// A character was received.  Output the character now.
		vOutputCharacter( cRxedChar );

		// If removing the character from the queue woke the task that was
		// posting onto the queue cTaskWokenByReceive will have been set to
		// pdTRUE.  No matter how many times this loop iterates only one
		// task will be woken.
	}

	if( cTaskWokenByPost != ( char ) pdFALSE;
	{
		taskYIELD ();
	}
 }
 
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR * \ingroup QueueManagement */ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void * const pvBuffer, BaseType_t * const pxHigherPriorityTaskWoken ) ; /* * Utilities to query queues that are safe to use from an ISR. These utilities * should be used only from witin an ISR, or within a critical section. */ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) ; BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) ; UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) ; /* * The functions defined above are for passing data to and from tasks. The * functions below are the equivalents for passing data to and from * co-routines. * * These functions are called from the co-routine macro implementation and * should not be called directly from application code. Instead use the macro * wrappers defined within croutine.h. */ BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t xCoRoutinePreviouslyWoken ); BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxTaskWoken ); BaseType_t xQueueCRSend( QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait ); BaseType_t xQueueCRReceive( QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait ); /* * For internal use only. Use xSemaphoreCreateMutex(), * xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling * these functions directly. */ QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) ; QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ) ; QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) ; QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) ; void* xQueueGetMutexHolder( QueueHandle_t xSemaphore ) ; /* * For internal use only. Use xSemaphoreTakeMutexRecursive() or * xSemaphoreGiveMutexRecursive() instead of calling these functions directly. */ BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ) ; BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) ; /* * Reset a queue back to its original empty state. The return value is now * obsolete and is always set to pdPASS. */ /* * The registry is provided as a means for kernel aware debuggers to * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add * a queue, semaphore or mutex handle to the registry if you want the handle * to be available to a kernel aware debugger. If you are not using a kernel * aware debugger then this function can be ignored. * * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0 * within FreeRTOSConfig.h for the registry to be available. Its value * does not effect the number of queues, semaphores and mutexes that can be * created - just the number that the registry can hold. * * @param xQueue The handle of the queue being added to the registry. This * is the handle returned by a call to xQueueCreate(). Semaphore and mutex * handles can also be passed in here. * * @param pcName The name to be associated with the handle. This is the * name that the kernel aware debugger will display. The queue registry only * stores a pointer to the string - so the string must be persistent (global or * preferably in ROM/Flash), not on the stack. */ void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /* * The registry is provided as a means for kernel aware debuggers to * locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add * a queue, semaphore or mutex handle to the registry if you want the handle * to be available to a kernel aware debugger, and vQueueUnregisterQueue() to * remove the queue, semaphore or mutex from the register. If you are not using * a kernel aware debugger then this function can be ignored. * * @param xQueue The handle of the queue being removed from the registry. */ void vQueueUnregisterQueue( QueueHandle_t xQueue ) ; /* * The queue registry is provided as a means for kernel aware debuggers to * locate queues, semaphores and mutexes. Call pcQueueGetName() to look * up and return the name of a queue in the queue registry from the queue's * handle. * * @param xQueue The handle of the queue the name of which will be returned. * @return If the queue is in the registry then a pointer to the name of the * queue is returned. If the queue is not in the registry then NULL is * returned. */ const char *pcQueueGetName( QueueHandle_t xQueue ) ; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ /* * Generic version of the function used to creaet a queue using dynamic memory * allocation. This is called by other functions and macros that create other * RTOS objects that use the queue structure as their base. */ QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType ) ; /* * Generic version of the function used to creaet a queue using dynamic memory * allocation. This is called by other functions and macros that create other * RTOS objects that use the queue structure as their base. */ /* * Queue sets provide a mechanism to allow a task to block (pend) on a read * operation from multiple queues or semaphores simultaneously. * * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * * A queue set must be explicitly created using a call to xQueueCreateSet() * before it can be used. Once created, standard FreeRTOS queues and semaphores * can be added to the set using calls to xQueueAddToSet(). * xQueueSelectFromSet() is then used to determine which, if any, of the queues * or semaphores contained in the set is in a state where a queue read or * semaphore take operation would be successful. * * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html * for reasons why queue sets are very rarely needed in practice as there are * simpler methods of blocking on multiple objects. * * Note 2: Blocking on a queue set that contains a mutex will not cause the * mutex holder to inherit the priority of the blocked task. * * Note 3: An additional 4 bytes of RAM is required for each space in a every * queue added to a queue set. Therefore counting semaphores that have a high * maximum count value should not be added to a queue set. * * Note 4: A receive (in the case of a queue) or take (in the case of a * semaphore) operation must not be performed on a member of a queue set unless * a call to xQueueSelectFromSet() has first returned a handle to that set member. * * @param uxEventQueueLength Queue sets store events that occur on * the queues and semaphores contained in the set. uxEventQueueLength specifies * the maximum number of events that can be queued at once. To be absolutely * certain that events are not lost uxEventQueueLength should be set to the * total sum of the length of the queues added to the set, where binary * semaphores and mutexes have a length of 1, and counting semaphores have a * length set by their maximum count value. Examples: * + If a queue set is to hold a queue of length 5, another queue of length 12, * and a binary semaphore, then uxEventQueueLength should be set to * (5 + 12 + 1), or 18. * + If a queue set is to hold three binary semaphores then uxEventQueueLength * should be set to (1 + 1 + 1 ), or 3. * + If a queue set is to hold a counting semaphore that has a maximum count of * 5, and a counting semaphore that has a maximum count of 3, then * uxEventQueueLength should be set to (5 + 3), or 8. * * @return If the queue set is created successfully then a handle to the created * queue set is returned. Otherwise NULL is returned. */ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) ; /* * Adds a queue or semaphore to a queue set that was previously created by a * call to xQueueCreateSet(). * * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * * Note 1: A receive (in the case of a queue) or take (in the case of a * semaphore) operation must not be performed on a member of a queue set unless * a call to xQueueSelectFromSet() has first returned a handle to that set member. * * @param xQueueOrSemaphore The handle of the queue or semaphore being added to * the queue set (cast to an QueueSetMemberHandle_t type). * * @param xQueueSet The handle of the queue set to which the queue or semaphore * is being added. * * @return If the queue or semaphore was successfully added to the queue set * then pdPASS is returned. If the queue could not be successfully added to the * queue set because it is already a member of a different queue set then pdFAIL * is returned. */ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) ; /* * Removes a queue or semaphore from a queue set. A queue or semaphore can only * be removed from a set if the queue or semaphore is empty. * * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * * @param xQueueOrSemaphore The handle of the queue or semaphore being removed * from the queue set (cast to an QueueSetMemberHandle_t type). * * @param xQueueSet The handle of the queue set in which the queue or semaphore * is included. * * @return If the queue or semaphore was successfully removed from the queue set * then pdPASS is returned. If the queue was not in the queue set, or the * queue (or semaphore) was not empty, then pdFAIL is returned. */ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) ; /* * xQueueSelectFromSet() selects from the members of a queue set a queue or * semaphore that either contains data (in the case of a queue) or is available * to take (in the case of a semaphore). xQueueSelectFromSet() effectively * allows a task to block (pend) on a read operation on all the queues and * semaphores in a queue set simultaneously. * * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this * function. * * Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html * for reasons why queue sets are very rarely needed in practice as there are * simpler methods of blocking on multiple objects. * * Note 2: Blocking on a queue set that contains a mutex will not cause the * mutex holder to inherit the priority of the blocked task. * * Note 3: A receive (in the case of a queue) or take (in the case of a * semaphore) operation must not be performed on a member of a queue set unless * a call to xQueueSelectFromSet() has first returned a handle to that set member. * * @param xQueueSet The queue set on which the task will (potentially) block. * * @param xTicksToWait The maximum time, in ticks, that the calling task will * remain in the Blocked state (with other tasks executing) to wait for a member * of the queue set to be ready for a successful queue read or semaphore take * operation. * * @return xQueueSelectFromSet() will return the handle of a queue (cast to * a QueueSetMemberHandle_t type) contained in the queue set that contains data, * or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained * in the queue set that is available, or NULL if no such queue or semaphore * exists before before the specified block time expires. */ QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) ; /* * A version of xQueueSelectFromSet() that can be used from an ISR. */ QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) ; /* Not public API functions. */ void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait, const BaseType_t xWaitIndefinitely ) ; BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ) ; void vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ) ; UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) ; uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) ; /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full license text is available on the following link: http://www.freertos.org/a00114.html *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that is more than just the market leader, it * * is the industry's de facto standard. * * * * Help yourself get started quickly while simultaneously helping * * to support the FreeRTOS project by purchasing a FreeRTOS * * tutorial book, reference manual, or both: * * http://www.FreeRTOS.org/Documentation * * * *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading the FAQ page "My application does not run, what could be wrong?". Have you defined configASSERT()? http://www.FreeRTOS.org/support - In return for receiving this top quality embedded software for free we request you assist our global community by participating in the support forum. http://www.FreeRTOS.org/training - Investing in training allows your team to be as productive as possible as early as possible. Now you can receive FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and commercial middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ typedef QueueHandle_t SemaphoreHandle_t; /** * semphr. h *
vSemaphoreCreateBinary( SemaphoreHandle_t xSemaphore )
* * In many usage scenarios it is faster and more memory efficient to use a * direct to task notification in place of a binary semaphore! * http://www.freertos.org/RTOS-task-notifications.html * * This old vSemaphoreCreateBinary() macro is now deprecated in favour of the * xSemaphoreCreateBinary() function. Note that binary semaphores created using * the vSemaphoreCreateBinary() macro are created in a state such that the * first call to 'take' the semaphore would pass, whereas binary semaphores * created using xSemaphoreCreateBinary() are created in a state such that the * the semaphore must first be 'given' before it can be 'taken'. * * Macro that implements a semaphore by using the existing queue mechanism. * The queue length is 1 as this is a binary semaphore. The data size is 0 * as we don't want to actually store any data - we just want to know if the * queue is empty or full. * * This type of semaphore can be used for pure synchronisation between tasks or * between an interrupt and a task. The semaphore need not be given back once * obtained, so one task/interrupt can continuously 'give' the semaphore while * another continuously 'takes' the semaphore. For this reason this type of * semaphore does not use a priority inheritance mechanism. For an alternative * that does use priority inheritance see xSemaphoreCreateMutex(). * * @param xSemaphore Handle to the created semaphore. Should be of type SemaphoreHandle_t. * * Example usage:
 SemaphoreHandle_t xSemaphore = NULL;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to vSemaphoreCreateBinary ().
    // This is a macro so pass the variable in directly.
    vSemaphoreCreateBinary( xSemaphore );

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.
    }
 }
 
* \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateBinary( void )
* * Creates a new binary semaphore instance, and returns a handle by which the * new semaphore can be referenced. * * In many usage scenarios it is faster and more memory efficient to use a * direct to task notification in place of a binary semaphore! * http://www.freertos.org/RTOS-task-notifications.html * * Internally, within the FreeRTOS implementation, binary semaphores use a block * of memory, in which the semaphore structure is stored. If a binary semaphore * is created using xSemaphoreCreateBinary() then the required memory is * automatically dynamically allocated inside the xSemaphoreCreateBinary() * function. (see http://www.freertos.org/a00111.html). If a binary semaphore * is created using xSemaphoreCreateBinaryStatic() then the application writer * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a * binary semaphore to be created without using any dynamic memory allocation. * * The old vSemaphoreCreateBinary() macro is now deprecated in favour of this * xSemaphoreCreateBinary() function. Note that binary semaphores created using * the vSemaphoreCreateBinary() macro are created in a state such that the * first call to 'take' the semaphore would pass, whereas binary semaphores * created using xSemaphoreCreateBinary() are created in a state such that the * the semaphore must first be 'given' before it can be 'taken'. * * This type of semaphore can be used for pure synchronisation between tasks or * between an interrupt and a task. The semaphore need not be given back once * obtained, so one task/interrupt can continuously 'give' the semaphore while * another continuously 'takes' the semaphore. For this reason this type of * semaphore does not use a priority inheritance mechanism. For an alternative * that does use priority inheritance see xSemaphoreCreateMutex(). * * @return Handle to the created semaphore, or NULL if the memory required to * hold the semaphore's data structures could not be allocated. * * Example usage:
 SemaphoreHandle_t xSemaphore = NULL;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to xSemaphoreCreateBinary().
    // This is a macro so pass the variable in directly.
    xSemaphore = xSemaphoreCreateBinary();

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.
    }
 }
 
* \defgroup xSemaphoreCreateBinary xSemaphoreCreateBinary * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t *pxSemaphoreBuffer )
* * Creates a new binary semaphore instance, and returns a handle by which the * new semaphore can be referenced. * * NOTE: In many usage scenarios it is faster and more memory efficient to use a * direct to task notification in place of a binary semaphore! * http://www.freertos.org/RTOS-task-notifications.html * * Internally, within the FreeRTOS implementation, binary semaphores use a block * of memory, in which the semaphore structure is stored. If a binary semaphore * is created using xSemaphoreCreateBinary() then the required memory is * automatically dynamically allocated inside the xSemaphoreCreateBinary() * function. (see http://www.freertos.org/a00111.html). If a binary semaphore * is created using xSemaphoreCreateBinaryStatic() then the application writer * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a * binary semaphore to be created without using any dynamic memory allocation. * * This type of semaphore can be used for pure synchronisation between tasks or * between an interrupt and a task. The semaphore need not be given back once * obtained, so one task/interrupt can continuously 'give' the semaphore while * another continuously 'takes' the semaphore. For this reason this type of * semaphore does not use a priority inheritance mechanism. For an alternative * that does use priority inheritance see xSemaphoreCreateMutex(). * * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t, * which will then be used to hold the semaphore's data structure, removing the * need for the memory to be allocated dynamically. * * @return If the semaphore is created then a handle to the created semaphore is * returned. If pxSemaphoreBuffer is NULL then NULL is returned. * * Example usage:
 SemaphoreHandle_t xSemaphore = NULL;
 StaticSemaphore_t xSemaphoreBuffer;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to xSemaphoreCreateBinary().
    // The semaphore's data structures will be placed in the xSemaphoreBuffer
    // variable, the address of which is passed into the function.  The
    // function's parameter is not NULL, so the function will not attempt any
    // dynamic memory allocation, and therefore the function will not return
    // return NULL.
    xSemaphore = xSemaphoreCreateBinary( &xSemaphoreBuffer );

    // Rest of task code goes here.
 }
 
* \defgroup xSemaphoreCreateBinaryStatic xSemaphoreCreateBinaryStatic * \ingroup Semaphores */ /** * semphr. h *
xSemaphoreTake(
 *                   SemaphoreHandle_t xSemaphore,
 *                   TickType_t xBlockTime
 *               )
* * Macro to obtain a semaphore. The semaphore must have previously been * created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or * xSemaphoreCreateCounting(). * * @param xSemaphore A handle to the semaphore being taken - obtained when * the semaphore was created. * * @param xBlockTime The time in ticks to wait for the semaphore to become * available. The macro portTICK_PERIOD_MS can be used to convert this to a * real time. A block time of zero can be used to poll the semaphore. A block * time of portMAX_DELAY can be used to block indefinitely (provided * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h). * * @return pdTRUE if the semaphore was obtained. pdFALSE * if xBlockTime expired without the semaphore becoming available. * * Example usage:
 SemaphoreHandle_t xSemaphore = NULL;

 // A task that creates a semaphore.
 void vATask( void * pvParameters )
 {
    // Create the semaphore to guard a shared resource.
    xSemaphore = xSemaphoreCreateBinary();
 }

 // A task that uses the semaphore.
 void vAnotherTask( void * pvParameters )
 {
    // ... Do other things.

    if( xSemaphore != NULL )
    {
        // See if we can obtain the semaphore.  If the semaphore is not available
        // wait 10 ticks to see if it becomes free.
        if( xSemaphoreTake( xSemaphore, ( TickType_t ) 10 ) == pdTRUE )
        {
            // We were able to obtain the semaphore and can now access the
            // shared resource.

            // ...

            // We have finished accessing the shared resource.  Release the
            // semaphore.
            xSemaphoreGive( xSemaphore );
        }
        else
        {
            // We could not obtain the semaphore and can therefore not access
            // the shared resource safely.
        }
    }
 }
 
* \defgroup xSemaphoreTake xSemaphoreTake * \ingroup Semaphores */ /** * semphr. h * xSemaphoreTakeRecursive( * SemaphoreHandle_t xMutex, * TickType_t xBlockTime * ) * * Macro to recursively obtain, or 'take', a mutex type semaphore. * The mutex must have previously been created using a call to * xSemaphoreCreateRecursiveMutex(); * * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this * macro to be available. * * This macro must not be used on mutexes created using xSemaphoreCreateMutex(). * * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex * doesn't become available again until the owner has called * xSemaphoreGiveRecursive() for each successful 'take' request. For example, * if a task successfully 'takes' the same mutex 5 times then the mutex will * not be available to any other task until it has also 'given' the mutex back * exactly five times. * * @param xMutex A handle to the mutex being obtained. This is the * handle returned by xSemaphoreCreateRecursiveMutex(); * * @param xBlockTime The time in ticks to wait for the semaphore to become * available. The macro portTICK_PERIOD_MS can be used to convert this to a * real time. A block time of zero can be used to poll the semaphore. If * the task already owns the semaphore then xSemaphoreTakeRecursive() will * return immediately no matter what the value of xBlockTime. * * @return pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime * expired without the semaphore becoming available. * * Example usage:
 SemaphoreHandle_t xMutex = NULL;

 // A task that creates a mutex.
 void vATask( void * pvParameters )
 {
    // Create the mutex to guard a shared resource.
    xMutex = xSemaphoreCreateRecursiveMutex();
 }

 // A task that uses the mutex.
 void vAnotherTask( void * pvParameters )
 {
    // ... Do other things.

    if( xMutex != NULL )
    {
        // See if we can obtain the mutex.  If the mutex is not available
        // wait 10 ticks to see if it becomes free.
        if( xSemaphoreTakeRecursive( xSemaphore, ( TickType_t ) 10 ) == pdTRUE )
        {
            // We were able to obtain the mutex and can now access the
            // shared resource.

            // ...
            // For some reason due to the nature of the code further calls to
			// xSemaphoreTakeRecursive() are made on the same mutex.  In real
			// code these would not be just sequential calls as this would make
			// no sense.  Instead the calls are likely to be buried inside
			// a more complex call structure.
            xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
            xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );

            // The mutex has now been 'taken' three times, so will not be
			// available to another task until it has also been given back
			// three times.  Again it is unlikely that real code would have
			// these calls sequentially, but instead buried in a more complex
			// call structure.  This is just for illustrative purposes.
            xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );

			// Now the mutex can be taken by other tasks.
        }
        else
        {
            // We could not obtain the mutex and can therefore not access
            // the shared resource safely.
        }
    }
 }
 
* \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive * \ingroup Semaphores */ /** * semphr. h *
xSemaphoreGive( SemaphoreHandle_t xSemaphore )
* * Macro to release a semaphore. The semaphore must have previously been * created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or * xSemaphoreCreateCounting(). and obtained using sSemaphoreTake(). * * This macro must not be used from an ISR. See xSemaphoreGiveFromISR () for * an alternative which can be used from an ISR. * * This macro must also not be used on semaphores created using * xSemaphoreCreateRecursiveMutex(). * * @param xSemaphore A handle to the semaphore being released. This is the * handle returned when the semaphore was created. * * @return pdTRUE if the semaphore was released. pdFALSE if an error occurred. * Semaphores are implemented using queues. An error can occur if there is * no space on the queue to post a message - indicating that the * semaphore was not first obtained correctly. * * Example usage:
 SemaphoreHandle_t xSemaphore = NULL;

 void vATask( void * pvParameters )
 {
    // Create the semaphore to guard a shared resource.
    xSemaphore = vSemaphoreCreateBinary();

    if( xSemaphore != NULL )
    {
        if( xSemaphoreGive( xSemaphore ) != pdTRUE )
        {
            // We would expect this call to fail because we cannot give
            // a semaphore without first "taking" it!
        }

        // Obtain the semaphore - don't block if the semaphore is not
        // immediately available.
        if( xSemaphoreTake( xSemaphore, ( TickType_t ) 0 ) )
        {
            // We now have the semaphore and can access the shared resource.

            // ...

            // We have finished accessing the shared resource so can free the
            // semaphore.
            if( xSemaphoreGive( xSemaphore ) != pdTRUE )
            {
                // We would not expect this call to fail because we must have
                // obtained the semaphore to get here.
            }
        }
    }
 }
 
* \defgroup xSemaphoreGive xSemaphoreGive * \ingroup Semaphores */ /** * semphr. h *
xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex )
* * Macro to recursively release, or 'give', a mutex type semaphore. * The mutex must have previously been created using a call to * xSemaphoreCreateRecursiveMutex(); * * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this * macro to be available. * * This macro must not be used on mutexes created using xSemaphoreCreateMutex(). * * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex * doesn't become available again until the owner has called * xSemaphoreGiveRecursive() for each successful 'take' request. For example, * if a task successfully 'takes' the same mutex 5 times then the mutex will * not be available to any other task until it has also 'given' the mutex back * exactly five times. * * @param xMutex A handle to the mutex being released, or 'given'. This is the * handle returned by xSemaphoreCreateMutex(); * * @return pdTRUE if the semaphore was given. * * Example usage:
 SemaphoreHandle_t xMutex = NULL;

 // A task that creates a mutex.
 void vATask( void * pvParameters )
 {
    // Create the mutex to guard a shared resource.
    xMutex = xSemaphoreCreateRecursiveMutex();
 }

 // A task that uses the mutex.
 void vAnotherTask( void * pvParameters )
 {
    // ... Do other things.

    if( xMutex != NULL )
    {
        // See if we can obtain the mutex.  If the mutex is not available
        // wait 10 ticks to see if it becomes free.
        if( xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 ) == pdTRUE )
        {
            // We were able to obtain the mutex and can now access the
            // shared resource.

            // ...
            // For some reason due to the nature of the code further calls to
			// xSemaphoreTakeRecursive() are made on the same mutex.  In real
			// code these would not be just sequential calls as this would make
			// no sense.  Instead the calls are likely to be buried inside
			// a more complex call structure.
            xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );
            xSemaphoreTakeRecursive( xMutex, ( TickType_t ) 10 );

            // The mutex has now been 'taken' three times, so will not be
			// available to another task until it has also been given back
			// three times.  Again it is unlikely that real code would have
			// these calls sequentially, it would be more likely that the calls
			// to xSemaphoreGiveRecursive() would be called as a call stack
			// unwound.  This is just for demonstrative purposes.
            xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );

			// Now the mutex can be taken by other tasks.
        }
        else
        {
            // We could not obtain the mutex and can therefore not access
            // the shared resource safely.
        }
    }
 }
 
* \defgroup xSemaphoreGiveRecursive xSemaphoreGiveRecursive * \ingroup Semaphores */ /** * semphr. h *
 xSemaphoreGiveFromISR(
                          SemaphoreHandle_t xSemaphore,
                          BaseType_t *pxHigherPriorityTaskWoken
                      )
* * Macro to release a semaphore. The semaphore must have previously been * created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting(). * * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex()) * must not be used with this macro. * * This macro can be used from an ISR. * * @param xSemaphore A handle to the semaphore being released. This is the * handle returned when the semaphore was created. * * @param pxHigherPriorityTaskWoken xSemaphoreGiveFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if giving the semaphore caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xSemaphoreGiveFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return pdTRUE if the semaphore was successfully given, otherwise errQUEUE_FULL. * * Example usage:
 \#define LONG_TIME 0xffff
 \#define TICKS_TO_WAIT	10
 SemaphoreHandle_t xSemaphore = NULL;

 // Repetitive task.
 void vATask( void * pvParameters )
 {
    for( ;; )
    {
        // We want this task to run every 10 ticks of a timer.  The semaphore
        // was created before this task was started.

        // Block waiting for the semaphore to become available.
        if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE )
        {
            // It is time to execute.

            // ...

            // We have finished our task.  Return to the top of the loop where
            // we will block on the semaphore until it is time to execute
            // again.  Note when using the semaphore for synchronisation with an
			// ISR in this manner there is no need to 'give' the semaphore back.
        }
    }
 }

 // Timer ISR
 void vTimerISR( void * pvParameters )
 {
 static uint8_t ucLocalTickCount = 0;
 static BaseType_t xHigherPriorityTaskWoken;

    // A timer tick has occurred.

    // ... Do other time functions.

    // Is it time for vATask () to run?
	xHigherPriorityTaskWoken = pdFALSE;
    ucLocalTickCount++;
    if( ucLocalTickCount >= TICKS_TO_WAIT )
    {
        // Unblock the task by releasing the semaphore.
        xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );

        // Reset the count so we release the semaphore again in 10 ticks time.
        ucLocalTickCount = 0;
    }

    if( xHigherPriorityTaskWoken != pdFALSE )
    {
        // We can force a context switch here.  Context switching from an
        // ISR uses port specific syntax.  Check the demo task for your port
        // to find the syntax required.
    }
 }
 
* \defgroup xSemaphoreGiveFromISR xSemaphoreGiveFromISR * \ingroup Semaphores */ /** * semphr. h *
 xSemaphoreTakeFromISR(
                          SemaphoreHandle_t xSemaphore,
                          BaseType_t *pxHigherPriorityTaskWoken
                      )
* * Macro to take a semaphore from an ISR. The semaphore must have * previously been created with a call to xSemaphoreCreateBinary() or * xSemaphoreCreateCounting(). * * Mutex type semaphores (those created using a call to xSemaphoreCreateMutex()) * must not be used with this macro. * * This macro can be used from an ISR, however taking a semaphore from an ISR * is not a common operation. It is likely to only be useful when taking a * counting semaphore when an interrupt is obtaining an object from a resource * pool (when the semaphore count indicates the number of resources available). * * @param xSemaphore A handle to the semaphore being taken. This is the * handle returned when the semaphore was created. * * @param pxHigherPriorityTaskWoken xSemaphoreTakeFromISR() will set * *pxHigherPriorityTaskWoken to pdTRUE if taking the semaphore caused a task * to unblock, and the unblocked task has a priority higher than the currently * running task. If xSemaphoreTakeFromISR() sets this value to pdTRUE then * a context switch should be requested before the interrupt is exited. * * @return pdTRUE if the semaphore was successfully taken, otherwise * pdFALSE */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateMutex( void )
* * Creates a new mutex type semaphore instance, and returns a handle by which * the new mutex can be referenced. * * Internally, within the FreeRTOS implementation, mutex semaphores use a block * of memory, in which the mutex structure is stored. If a mutex is created * using xSemaphoreCreateMutex() then the required memory is automatically * dynamically allocated inside the xSemaphoreCreateMutex() function. (see * http://www.freertos.org/a00111.html). If a mutex is created using * xSemaphoreCreateMutexStatic() then the application writer must provided the * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created * without using any dynamic memory allocation. * * Mutexes created using this function can be accessed using the xSemaphoreTake() * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and * xSemaphoreGiveRecursive() macros must not be used. * * This type of semaphore uses a priority inheritance mechanism so a task * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the * semaphore it is no longer required. * * Mutex type semaphores cannot be used from within interrupt service routines. * * See xSemaphoreCreateBinary() for an alternative implementation that can be * used for pure synchronisation (where one task or interrupt always 'gives' the * semaphore and another always 'takes' the semaphore) and from within interrupt * service routines. * * @return If the mutex was successfully created then a handle to the created * semaphore is returned. If there was not enough heap to allocate the mutex * data structures then NULL is returned. * * Example usage:
 SemaphoreHandle_t xSemaphore;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to xSemaphoreCreateMutex().
    // This is a macro so pass the variable in directly.
    xSemaphore = xSemaphoreCreateMutex();

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.
    }
 }
 
* \defgroup xSemaphoreCreateMutex xSemaphoreCreateMutex * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateMutexStatic( StaticSemaphore_t *pxMutexBuffer )
* * Creates a new mutex type semaphore instance, and returns a handle by which * the new mutex can be referenced. * * Internally, within the FreeRTOS implementation, mutex semaphores use a block * of memory, in which the mutex structure is stored. If a mutex is created * using xSemaphoreCreateMutex() then the required memory is automatically * dynamically allocated inside the xSemaphoreCreateMutex() function. (see * http://www.freertos.org/a00111.html). If a mutex is created using * xSemaphoreCreateMutexStatic() then the application writer must provided the * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created * without using any dynamic memory allocation. * * Mutexes created using this function can be accessed using the xSemaphoreTake() * and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and * xSemaphoreGiveRecursive() macros must not be used. * * This type of semaphore uses a priority inheritance mechanism so a task * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the * semaphore it is no longer required. * * Mutex type semaphores cannot be used from within interrupt service routines. * * See xSemaphoreCreateBinary() for an alternative implementation that can be * used for pure synchronisation (where one task or interrupt always 'gives' the * semaphore and another always 'takes' the semaphore) and from within interrupt * service routines. * * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t, * which will be used to hold the mutex's data structure, removing the need for * the memory to be allocated dynamically. * * @return If the mutex was successfully created then a handle to the created * mutex is returned. If pxMutexBuffer was NULL then NULL is returned. * * Example usage:
 SemaphoreHandle_t xSemaphore;
 StaticSemaphore_t xMutexBuffer;

 void vATask( void * pvParameters )
 {
    // A mutex cannot be used before it has been created.  xMutexBuffer is
    // into xSemaphoreCreateMutexStatic() so no dynamic memory allocation is
    // attempted.
    xSemaphore = xSemaphoreCreateMutexStatic( &xMutexBuffer );

    // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
    // so there is no need to check it.
 }
 
* \defgroup xSemaphoreCreateMutexStatic xSemaphoreCreateMutexStatic * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void )
* * Creates a new recursive mutex type semaphore instance, and returns a handle * by which the new recursive mutex can be referenced. * * Internally, within the FreeRTOS implementation, recursive mutexs use a block * of memory, in which the mutex structure is stored. If a recursive mutex is * created using xSemaphoreCreateRecursiveMutex() then the required memory is * automatically dynamically allocated inside the * xSemaphoreCreateRecursiveMutex() function. (see * http://www.freertos.org/a00111.html). If a recursive mutex is created using * xSemaphoreCreateRecursiveMutexStatic() then the application writer must * provide the memory that will get used by the mutex. * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to * be created without using any dynamic memory allocation. * * Mutexes created using this macro can be accessed using the * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The * xSemaphoreTake() and xSemaphoreGive() macros must not be used. * * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex * doesn't become available again until the owner has called * xSemaphoreGiveRecursive() for each successful 'take' request. For example, * if a task successfully 'takes' the same mutex 5 times then the mutex will * not be available to any other task until it has also 'given' the mutex back * exactly five times. * * This type of semaphore uses a priority inheritance mechanism so a task * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the * semaphore it is no longer required. * * Mutex type semaphores cannot be used from within interrupt service routines. * * See xSemaphoreCreateBinary() for an alternative implementation that can be * used for pure synchronisation (where one task or interrupt always 'gives' the * semaphore and another always 'takes' the semaphore) and from within interrupt * service routines. * * @return xSemaphore Handle to the created mutex semaphore. Should be of type * SemaphoreHandle_t. * * Example usage:
 SemaphoreHandle_t xSemaphore;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to xSemaphoreCreateMutex().
    // This is a macro so pass the variable in directly.
    xSemaphore = xSemaphoreCreateRecursiveMutex();

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.
    }
 }
 
* \defgroup xSemaphoreCreateRecursiveMutex xSemaphoreCreateRecursiveMutex * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic( StaticSemaphore_t *pxMutexBuffer )
* * Creates a new recursive mutex type semaphore instance, and returns a handle * by which the new recursive mutex can be referenced. * * Internally, within the FreeRTOS implementation, recursive mutexs use a block * of memory, in which the mutex structure is stored. If a recursive mutex is * created using xSemaphoreCreateRecursiveMutex() then the required memory is * automatically dynamically allocated inside the * xSemaphoreCreateRecursiveMutex() function. (see * http://www.freertos.org/a00111.html). If a recursive mutex is created using * xSemaphoreCreateRecursiveMutexStatic() then the application writer must * provide the memory that will get used by the mutex. * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to * be created without using any dynamic memory allocation. * * Mutexes created using this macro can be accessed using the * xSemaphoreTakeRecursive() and xSemaphoreGiveRecursive() macros. The * xSemaphoreTake() and xSemaphoreGive() macros must not be used. * * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex * doesn't become available again until the owner has called * xSemaphoreGiveRecursive() for each successful 'take' request. For example, * if a task successfully 'takes' the same mutex 5 times then the mutex will * not be available to any other task until it has also 'given' the mutex back * exactly five times. * * This type of semaphore uses a priority inheritance mechanism so a task * 'taking' a semaphore MUST ALWAYS 'give' the semaphore back once the * semaphore it is no longer required. * * Mutex type semaphores cannot be used from within interrupt service routines. * * See xSemaphoreCreateBinary() for an alternative implementation that can be * used for pure synchronisation (where one task or interrupt always 'gives' the * semaphore and another always 'takes' the semaphore) and from within interrupt * service routines. * * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t, * which will then be used to hold the recursive mutex's data structure, * removing the need for the memory to be allocated dynamically. * * @return If the recursive mutex was successfully created then a handle to the * created recursive mutex is returned. If pxMutexBuffer was NULL then NULL is * returned. * * Example usage:
 SemaphoreHandle_t xSemaphore;
 StaticSemaphore_t xMutexBuffer;

 void vATask( void * pvParameters )
 {
    // A recursive semaphore cannot be used before it is created.  Here a
    // recursive mutex is created using xSemaphoreCreateRecursiveMutexStatic().
    // The address of xMutexBuffer is passed into the function, and will hold
    // the mutexes data structures - so no dynamic memory allocation will be
    // attempted.
    xSemaphore = xSemaphoreCreateRecursiveMutexStatic( &xMutexBuffer );

    // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
    // so there is no need to check it.
 }
 
* \defgroup xSemaphoreCreateRecursiveMutexStatic xSemaphoreCreateRecursiveMutexStatic * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount )
* * Creates a new counting semaphore instance, and returns a handle by which the * new counting semaphore can be referenced. * * In many usage scenarios it is faster and more memory efficient to use a * direct to task notification in place of a counting semaphore! * http://www.freertos.org/RTOS-task-notifications.html * * Internally, within the FreeRTOS implementation, counting semaphores use a * block of memory, in which the counting semaphore structure is stored. If a * counting semaphore is created using xSemaphoreCreateCounting() then the * required memory is automatically dynamically allocated inside the * xSemaphoreCreateCounting() function. (see * http://www.freertos.org/a00111.html). If a counting semaphore is created * using xSemaphoreCreateCountingStatic() then the application writer can * instead optionally provide the memory that will get used by the counting * semaphore. xSemaphoreCreateCountingStatic() therefore allows a counting * semaphore to be created without using any dynamic memory allocation. * * Counting semaphores are typically used for two things: * * 1) Counting events. * * In this usage scenario an event handler will 'give' a semaphore each time * an event occurs (incrementing the semaphore count value), and a handler * task will 'take' a semaphore each time it processes an event * (decrementing the semaphore count value). The count value is therefore * the difference between the number of events that have occurred and the * number that have been processed. In this case it is desirable for the * initial count value to be zero. * * 2) Resource management. * * In this usage scenario the count value indicates the number of resources * available. To obtain control of a resource a task must first obtain a * semaphore - decrementing the semaphore count value. When the count value * reaches zero there are no free resources. When a task finishes with the * resource it 'gives' the semaphore back - incrementing the semaphore count * value. In this case it is desirable for the initial count value to be * equal to the maximum count value, indicating that all resources are free. * * @param uxMaxCount The maximum count value that can be reached. When the * semaphore reaches this value it can no longer be 'given'. * * @param uxInitialCount The count value assigned to the semaphore when it is * created. * * @return Handle to the created semaphore. Null if the semaphore could not be * created. * * Example usage:
 SemaphoreHandle_t xSemaphore;

 void vATask( void * pvParameters )
 {
 SemaphoreHandle_t xSemaphore = NULL;

    // Semaphore cannot be used before a call to xSemaphoreCreateCounting().
    // The max value to which the semaphore can count should be 10, and the
    // initial value assigned to the count should be 0.
    xSemaphore = xSemaphoreCreateCounting( 10, 0 );

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.
    }
 }
 
* \defgroup xSemaphoreCreateCounting xSemaphoreCreateCounting * \ingroup Semaphores */ /** * semphr. h *
SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer )
* * Creates a new counting semaphore instance, and returns a handle by which the * new counting semaphore can be referenced. * * In many usage scenarios it is faster and more memory efficient to use a * direct to task notification in place of a counting semaphore! * http://www.freertos.org/RTOS-task-notifications.html * * Internally, within the FreeRTOS implementation, counting semaphores use a * block of memory, in which the counting semaphore structure is stored. If a * counting semaphore is created using xSemaphoreCreateCounting() then the * required memory is automatically dynamically allocated inside the * xSemaphoreCreateCounting() function. (see * http://www.freertos.org/a00111.html). If a counting semaphore is created * using xSemaphoreCreateCountingStatic() then the application writer must * provide the memory. xSemaphoreCreateCountingStatic() therefore allows a * counting semaphore to be created without using any dynamic memory allocation. * * Counting semaphores are typically used for two things: * * 1) Counting events. * * In this usage scenario an event handler will 'give' a semaphore each time * an event occurs (incrementing the semaphore count value), and a handler * task will 'take' a semaphore each time it processes an event * (decrementing the semaphore count value). The count value is therefore * the difference between the number of events that have occurred and the * number that have been processed. In this case it is desirable for the * initial count value to be zero. * * 2) Resource management. * * In this usage scenario the count value indicates the number of resources * available. To obtain control of a resource a task must first obtain a * semaphore - decrementing the semaphore count value. When the count value * reaches zero there are no free resources. When a task finishes with the * resource it 'gives' the semaphore back - incrementing the semaphore count * value. In this case it is desirable for the initial count value to be * equal to the maximum count value, indicating that all resources are free. * * @param uxMaxCount The maximum count value that can be reached. When the * semaphore reaches this value it can no longer be 'given'. * * @param uxInitialCount The count value assigned to the semaphore when it is * created. * * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t, * which will then be used to hold the semaphore's data structure, removing the * need for the memory to be allocated dynamically. * * @return If the counting semaphore was successfully created then a handle to * the created counting semaphore is returned. If pxSemaphoreBuffer was NULL * then NULL is returned. * * Example usage:
 SemaphoreHandle_t xSemaphore;
 StaticSemaphore_t xSemaphoreBuffer;

 void vATask( void * pvParameters )
 {
 SemaphoreHandle_t xSemaphore = NULL;

    // Counting semaphore cannot be used before they have been created.  Create
    // a counting semaphore using xSemaphoreCreateCountingStatic().  The max
    // value to which the semaphore can count is 10, and the initial value
    // assigned to the count will be 0.  The address of xSemaphoreBuffer is
    // passed in and will be used to hold the semaphore structure, so no dynamic
    // memory allocation will be used.
    xSemaphore = xSemaphoreCreateCounting( 10, 0, &xSemaphoreBuffer );

    // No memory allocation was attempted so xSemaphore cannot be NULL, so there
    // is no need to check its value.
 }
 
* \defgroup xSemaphoreCreateCountingStatic xSemaphoreCreateCountingStatic * \ingroup Semaphores */ /** * semphr. h *
void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );
* * Delete a semaphore. This function must be used with care. For example, * do not delete a mutex type semaphore if the mutex is held by a task. * * @param xSemaphore A handle to the semaphore to be deleted. * * \defgroup vSemaphoreDelete vSemaphoreDelete * \ingroup Semaphores */ /** * semphr.h *
TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );
* * If xMutex is indeed a mutex type semaphore, return the current mutex holder. * If xMutex is not a mutex type semaphore, or the mutex is available (not held * by a task), return NULL. * * Note: This is a good way of determining if the calling task is the mutex * holder, but not a good way of determining the identity of the mutex holder as * the holder may change between the function exiting and the returned value * being tested. */ /** * semphr.h *
UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );
* * If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns * its current count value. If the semaphore is a binary semaphore then * uxSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the * semaphore is not available. * */ /* handle the states of FSM of the CAN unit */ typedef enum{ CAN_UNINIT, CAN_READY }Can_StateType; /* * this custom structure not included in AUTOSAR STANDARD provide to - * user to able to configure the message object that will be received */ typedef struct { uint32_t mailboxID; // mailboxID is the number of buffer that will revieve the message uint32_t canid; // message ID that will be recieved through CAN uint32_t canlength; // Length of message that will be received through CAN }Cfg_RxMsgObject_t; void Can_Init(Can_t* Config); Std_ReturnType Can_SetBaudrate(int Controller, uint16_t BaudRateConfigID ); void Can_EnableControllerInterrupts(uint8_t Controller); void Can_DisableControllerInterrupts(uint8_t Controller); Can_ReturnType_t Can_SetControllerMode( uint8_t Controller, Can_StateTransitionType_t Transition ); Can_ReturnType_t Can_Write( Can_HwHandleType_t Hth, Can_PduType_t* PduInfo ); void Can_InterruptHandler(uint32_t controllerBase); Can_ReturnType_t handle_RxMsgObject (uint8_t hrh); Can_ReturnType_t Cfg_RxMsgObject (Cfg_RxMsgObject_t* Param); static inline const CanHardwareObject_t* Can_FindRxHoh(Can_HwHandleType_t hrh); static inline const CanHardwareObject_t* Can_FindTxHoh(Can_HwHandleType_t hth); void Can0_InterruptHandler(void); void Can1_InterruptHandler(void); /* * Os.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * CanIf_Cbk.h * * Created on: May 3, 2018 * Author: Ahmed Usama Khalifa */ /* * Header file contains the callback functions that notify the upper layer */ void CanIf_TxConfirmation( PduIdType_t canTxPduId ); void CanIf_RxIndication(const Can_HwType_t* Mailbox, const PduInfoType_t* PduInfoPtr); void CanIf_CancelTxConfirmation( const Can_PduType_t* PduInfoPtr ); void CanIf_ControllerBusOff( uint8_t Controller ); void CanIf_SetWakeupEvent( uint8_t Controller ); /* * PortingHW.h * * Created on: May 5, 2018 * Author: Ahmed Usama Khalifa */ //***************************************************************************** // // hw_can.h - Defines and macros used when accessing the CAN controllers. // // Copyright (c) 2006-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 CAN register offsets. // //***************************************************************************** // Extension //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_STS register. // //***************************************************************************** // Successfully //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_ERR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_BIT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TST register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_BRPE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1CRQ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1CMSK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MSK1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MSK2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1ARB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1ARB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2CRQ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2CMSK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MSK1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MSK2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2ARB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2ARB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TXRQ1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TXRQ2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_NWDA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_NWDA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG1INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG2INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG1VAL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG2VAL register. // //***************************************************************************** //#include "inc/hw_ints.h" //***************************************************************************** // // 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. // //***************************************************************************** //***************************************************************************** // // can.h - Defines and Macros for the CAN controller. // // Copyright (c) 2006-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. // //***************************************************************************** //***************************************************************************** // //! \addtogroup can_api //! @{ // //***************************************************************************** //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // Miscellaneous defines for Message ID Types // //***************************************************************************** //***************************************************************************** // // These are the flags used by the tCANMsgObject.ui32Flags value when calling // the CANMessageSet() and CANMessageGet() functions. // //***************************************************************************** // //! This indicates that transmit interrupts are enabled. // // //! This indicates that receive interrupts are enabled. // // //! This indicates that a message object is using an extended identifier. // // //! This indicates that a message object is using filtering based on the //! object's message identifier. // // //! This indicates that new data was available in the message object. // // //! This indicates that data was lost since this message object was last //! read. // // //! This indicates that a message object uses or is using filtering //! based on the direction of the transfer. If the direction filtering is //! used, then ID filtering must also be enabled. // // //! This indicates that a message object uses or is using message //! identifier filtering based on the extended identifier. If the extended //! identifier filtering is used, then ID filtering must also be enabled. // // //! This indicates that a message object is a remote frame. // // //! This indicates that this message object is part of a FIFO structure and //! not the final message object in a FIFO. // // //! This indicates that a message object has no flags set. // //***************************************************************************** // //! This define is used with the flag values to allow checking only status //! flags and not configuration flags. // //***************************************************************************** //***************************************************************************** // //! The structure used for encapsulating all the items associated with a CAN //! message object in the CAN controller. // //***************************************************************************** typedef struct { // //! The CAN message identifier used for 11 or 29 bit identifiers. // uint32_t ui32MsgID; // //! The message identifier mask used when identifier filtering is enabled. // uint32_t ui32MsgIDMask; // //! This value holds various status flags and settings specified by //! tCANObjFlags. // uint32_t ui32Flags; // //! This value is the number of bytes of data in the message object. // uint32_t ui32MsgLen; // //! This is a pointer to the message object's data. // uint8_t *pui8MsgData; } tCANMsgObject; //***************************************************************************** // //! This structure is used for encapsulating the values associated with setting //! up the bit timing for a CAN controller. The structure is used when calling //! the CANGetBitTiming and CANSetBitTiming functions. // //***************************************************************************** typedef struct { // //! This value holds the sum of the Synchronization, Propagation, and Phase //! Buffer 1 segments, measured in time quanta. The valid values for this //! setting range from 2 to 16. // uint32_t ui32SyncPropPhase1Seg; // //! This value holds the Phase Buffer 2 segment in time quanta. The valid //! values for this setting range from 1 to 8. // uint32_t ui32Phase2Seg; // //! This value holds the Resynchronization Jump Width in time quanta. The //! valid values for this setting range from 1 to 4. // uint32_t ui32SJW; // //! This value holds the CAN_CLK divider used to determine time quanta. //! The valid values for this setting range from 1 to 1023. // uint32_t ui32QuantumPrescaler; } tCANBitClkParms; //***************************************************************************** // //! This data type is used to identify the interrupt status register. This is //! used when calling the CANIntStatus() function. // //***************************************************************************** typedef enum { // //! Read the CAN interrupt status information. // CAN_INT_STS_CAUSE, // //! Read a message object's interrupt status. // CAN_INT_STS_OBJECT } tCANIntStsReg; //***************************************************************************** // //! This data type is used to identify which of several status registers to //! read when calling the CANStatusGet() function. // //***************************************************************************** typedef enum { // //! Read the full CAN controller status. // CAN_STS_CONTROL, // //! Read the full 32-bit mask of message objects with a transmit request //! set. // CAN_STS_TXREQUEST, // //! Read the full 32-bit mask of message objects with new data available. // CAN_STS_NEWDAT, // //! Read the full 32-bit mask of message objects that are enabled. // CAN_STS_MSGVAL } tCANStsReg; //***************************************************************************** // // These definitions are used to specify interrupt sources to CANIntEnable() // and CANIntDisable(). // //***************************************************************************** // //! This flag is used to allow a CAN controller to generate error //! interrupts. // // //! This flag is used to allow a CAN controller to generate status //! interrupts. // // //! This flag is used to allow a CAN controller to generate any CAN //! interrupts. If this is not set, then no interrupts are generated //! by the CAN controller. // //***************************************************************************** // //! This definition is used to determine the type of message object that is //! set up via a call to the CANMessageSet() API. // //***************************************************************************** typedef enum { // //! Transmit message object. // MSG_OBJ_TYPE_TX, // //! Transmit remote request message object // MSG_OBJ_TYPE_TX_REMOTE, // //! Receive message object. // MSG_OBJ_TYPE_RX, // //! Receive remote request message object. // MSG_OBJ_TYPE_RX_REMOTE, // //! Remote frame receive remote, with auto-transmit message object. // MSG_OBJ_TYPE_RXTX_REMOTE } tMsgObjType; //***************************************************************************** // // The following enumeration contains all error or status indicators that can // be returned when calling the CANStatusGet() function. // //***************************************************************************** // //! CAN controller has entered a Bus Off state. // // //! CAN controller error level has reached warning level. // // //! CAN controller error level has reached error passive level. // // //! A message was received successfully since the last read of this status. // // //! A message was transmitted successfully since the last read of this //! status. // // //! This is the mask for the last error code field. // // //! There was no error. // // //! A bit stuffing error has occurred. // // //! A formatting error has occurred. // // //! An acknowledge error has occurred. // // //! The bus remained a bit level of 1 for longer than is allowed. // // //! The bus remained a bit level of 0 for longer than is allowed. // // //! A CRC error has occurred. // // //! This is the mask for the CAN Last Error Code (LEC). // //***************************************************************************** // // Close the Doxygen group. //! @} // //***************************************************************************** //***************************************************************************** // // API Function prototypes // //***************************************************************************** extern void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms); extern void CANBitTimingSet(uint32_t ui32Base, tCANBitClkParms *psClkParms); extern uint32_t CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock, uint32_t ui32BitRate); extern void CANDisable(uint32_t ui32Base); extern void CANEnable(uint32_t ui32Base); extern _Bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount, uint32_t *pui32TxCount); extern void CANInit(uint32_t ui32Base); extern void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr); extern void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags); extern void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags); extern void CANIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)); extern uint32_t CANIntStatus(uint32_t ui32Base, tCANIntStsReg eIntStsReg); extern void CANIntUnregister(uint32_t ui32Base); extern void CANMessageClear(uint32_t ui32Base, uint32_t ui32ObjID); extern void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, _Bool bClrPendingInt); extern void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, tMsgObjType eMsgType); extern _Bool CANRetryGet(uint32_t ui32Base); extern void CANRetrySet(uint32_t ui32Base, _Bool bAutoRetry); extern uint32_t CANStatusGet(uint32_t ui32Base, tCANStsReg eStatusReg); //***************************************************************************** // // 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. // //***************************************************************************** //***************************************************************************** // // 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. // //***************************************************************************** //***************************************************************************** // // 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 // //***************************************************************************** //***************************************************************************** // // 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. // //***************************************************************************** //***************************************************************************** // // 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. // //***************************************************************************** //***************************************************************************** // // uartstdio.h - Prototypes for the UART console functions. // // Copyright (c) 2007-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this software for use solely and // exclusively on TI's microcontroller products. The software is owned by // TI and/or its suppliers, and is protected under applicable copyright // laws. You may not combine this software with "viral" open-source // software in order to form a larger program. // // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL // DAMAGES, FOR ANY REASON WHATSOEVER. // // This is part of revision 2.1.4.178 of the Tiva Utility Library. // //***************************************************************************** /*****************************************************************************/ /* 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$ */ typedef __va_list va_list; #pragma diag_pop //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** //***************************************************************************** // // If built for buffered operation, the following labels define the sizes of // the transmit and receive buffers respectively. // //***************************************************************************** //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern void UARTStdioConfig(uint32_t ui32Port, uint32_t ui32Baud, uint32_t ui32SrcClock); extern int UARTgets(char *pcBuf, uint32_t ui32Len); extern unsigned char UARTgetc(void); extern void UARTprintf(const char *pcString, ...); extern void UARTvprintf(const char *pcString, va_list vaArgP); extern int UARTwrite(const char *pcBuf, uint32_t ui32Len); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** //***************************************************************************** // // tm4c123gh6pm.h - TM4C123GH6PM Register Definitions // // Copyright (c) 2013-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. // //***************************************************************************** //***************************************************************************** // // Interrupt assignments // //***************************************************************************** // Control //***************************************************************************** // // Watchdog Timer registers (WATCHDOG0) // //***************************************************************************** //***************************************************************************** // // Watchdog Timer registers (WATCHDOG1) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTA) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTC) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTD) // //***************************************************************************** //***************************************************************************** // // SSI registers (SSI0) // //***************************************************************************** //***************************************************************************** // // SSI registers (SSI1) // //***************************************************************************** //***************************************************************************** // // SSI registers (SSI2) // //***************************************************************************** //***************************************************************************** // // SSI registers (SSI3) // //***************************************************************************** //***************************************************************************** // // UART registers (UART0) // //***************************************************************************** //***************************************************************************** // // UART registers (UART1) // //***************************************************************************** //***************************************************************************** // // UART registers (UART2) // //***************************************************************************** //***************************************************************************** // // UART registers (UART3) // //***************************************************************************** //***************************************************************************** // // UART registers (UART4) // //***************************************************************************** //***************************************************************************** // // UART registers (UART5) // //***************************************************************************** //***************************************************************************** // // UART registers (UART6) // //***************************************************************************** //***************************************************************************** // // UART registers (UART7) // //***************************************************************************** //***************************************************************************** // // I2C registers (I2C0) // //***************************************************************************** //***************************************************************************** // // I2C registers (I2C1) // //***************************************************************************** //***************************************************************************** // // I2C registers (I2C2) // //***************************************************************************** //***************************************************************************** // // I2C registers (I2C3) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTE) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTF) // //***************************************************************************** //***************************************************************************** // // PWM registers (PWM0) // //***************************************************************************** //***************************************************************************** // // PWM registers (PWM1) // //***************************************************************************** //***************************************************************************** // // QEI registers (QEI0) // //***************************************************************************** //***************************************************************************** // // QEI registers (QEI1) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER0) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER1) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER2) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER3) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER4) // //***************************************************************************** //***************************************************************************** // // Timer registers (TIMER5) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER0) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER1) // //***************************************************************************** //***************************************************************************** // // ADC registers (ADC0) // //***************************************************************************** //***************************************************************************** // // ADC registers (ADC1) // //***************************************************************************** //***************************************************************************** // // Comparator registers (COMP) // //***************************************************************************** //***************************************************************************** // // CAN registers (CAN0) // //***************************************************************************** //***************************************************************************** // // CAN registers (CAN1) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER2) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER3) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER4) // //***************************************************************************** //***************************************************************************** // // Timer registers (WTIMER5) // //***************************************************************************** //***************************************************************************** // // Univeral Serial Bus registers (USB0) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTA AHB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTB AHB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTC AHB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTD AHB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTE AHB) // //***************************************************************************** //***************************************************************************** // // GPIO registers (PORTF AHB) // //***************************************************************************** //***************************************************************************** // // EEPROM registers (EEPROM) // //***************************************************************************** //***************************************************************************** // // System Exception Module registers (SYSEXC) // //***************************************************************************** //***************************************************************************** // // Hibernation module registers (HIB) // //***************************************************************************** //***************************************************************************** // // FLASH registers (FLASH CTRL) // //***************************************************************************** //***************************************************************************** // // System Control registers (SYSCTL) // //***************************************************************************** //***************************************************************************** // // Micro Direct Memory Access registers (UDMA) // //***************************************************************************** //***************************************************************************** // // Micro Direct Memory Access (uDMA) offsets (UDMA) // //***************************************************************************** // Pointer // End Pointer //***************************************************************************** // // NVIC registers (NVIC) // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_VALUE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_ICR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_RIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_MIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_TEST register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the WDT_O_LOCK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_IM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_RIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_O_MIS register. // //***************************************************************************** //***************************************************************************** // // 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_PCTL register for // port A. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_PCTL register for // port B. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_PCTL register for // port C. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_PCTL register for // port D. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_PCTL register for // port E. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the GPIO_PCTL register for // port F. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_CR0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_CR1 register. // //***************************************************************************** // Enable //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_DR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_SR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_CPSR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_IM register. // //***************************************************************************** // Mask // Mask //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_RIS register. // //***************************************************************************** // Status // Status // Interrupt Status // Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_MIS register. // //***************************************************************************** // Interrupt Status // Interrupt Status // Interrupt Status // Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_ICR register. // //***************************************************************************** // Clear // Clear //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_DMACTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SSI_O_CC register. // //***************************************************************************** // source and divisor factor) //***************************************************************************** // // The following are defines for the bit fields in the UART_O_DR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_RSR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_ECR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_FR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_ILPR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_IBRD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_FBRD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_LCRH register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_IFLS register. // //***************************************************************************** // Level Select // Level Select //***************************************************************************** // // The following are defines for the bit fields in the UART_O_IM register. // //***************************************************************************** // Mask // Mask // Mask // Interrupt Mask //***************************************************************************** // // The following are defines for the bit fields in the UART_O_RIS register. // //***************************************************************************** // Status // Status // Status // Status // Interrupt Status // Status // Status // Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the UART_O_MIS register. // //***************************************************************************** // Status // Interrupt Status // Interrupt Status // Interrupt Status // Interrupt Status // Interrupt Status // Status // Status // Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the UART_O_ICR register. // //***************************************************************************** // Interrupt Clear //***************************************************************************** // // The following are defines for the bit fields in the UART_O_DMACTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_9BITADDR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_9BITAMASK // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UART_O_CC register. // //***************************************************************************** // source and divisor factor) //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MSA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MCS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MDR register. // //***************************************************************************** // transferred during a transaction //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MTPR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MIMR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MRIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MMIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MICR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MCR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MCLKOCNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MBMON register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_MCR2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SOAR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SCSR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SDR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SIMR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SRIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SMIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SICR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SOAR2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_SACKCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the I2C_O_PC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_SYNC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_ENABLE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_INVERT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_FAULT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_INTEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_RIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_STATUS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_FAULTVAL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_ENUPD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_INTEN register. // //***************************************************************************** // Down // Down // Down // Up // Down // Up //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_RIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_COUNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_CMPA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_CMPB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_GENA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_GENB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_DBCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_DBRISE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_DBFALL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_FLTSRC0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_FLTSRC1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_MINFLTPER // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_INTEN register. // //***************************************************************************** // Down // Down // Down // Up // Down // Up //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_RIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_COUNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_CMPA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_CMPB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_GENA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_GENB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_DBCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_DBRISE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_DBFALL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_FLTSRC0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_FLTSRC1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_MINFLTPER // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_INTEN register. // //***************************************************************************** // Down // Down // Down // Up // Down // Up //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_RIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_COUNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_CMPA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_CMPB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_GENA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_GENB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_DBCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_DBRISE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_DBFALL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_FLTSRC0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_FLTSRC1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_MINFLTPER // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_INTEN register. // //***************************************************************************** // Down // Down // Down // Up // Down // Up //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_RIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_COUNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_CMPA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_CMPB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_GENA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_GENB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_DBCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_DBRISE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_DBFALL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_FLTSRC0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_FLTSRC1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_MINFLTPER // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_FLTSEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_FLTSTAT0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_0_FLTSTAT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_FLTSEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_FLTSTAT0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_1_FLTSTAT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_FLTSTAT0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_2_FLTSTAT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_FLTSTAT0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_3_FLTSTAT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the PWM_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_STAT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_POS register. // //***************************************************************************** // Value //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_MAXPOS register. // //***************************************************************************** // Value //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_LOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_TIME register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_COUNT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_SPEED register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_INTEN register. // //***************************************************************************** // Enable // Enable //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_RIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the QEI_O_ISC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_CFG register. // //***************************************************************************** // value selects the 32-bit timer // configuration // value selects the 32-bit // real-time clock (RTC) counter // configuration // value selects the 16-bit timer // configuration //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAMR register. // //***************************************************************************** // Operation // Update // Enable // Enable // Select //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBMR register. // //***************************************************************************** // Operation // Update // Enable // Enable // Select //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_CTL register. // //***************************************************************************** // Enable // Enable //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_SYNC register. // //***************************************************************************** // 5 // affected // GPTM 32/64-Bit Timer 5 is // triggered // GPTM 32/64-Bit Timer 5 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 5 is triggered // 4 // affected // GPTM 32/64-Bit Timer 4 is // triggered // GPTM 32/64-Bit Timer 4 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 4 is triggered // 3 // affected // GPTM 32/64-Bit Timer 3 is // triggered // GPTM 32/64-Bit Timer 3 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 3 is triggered // 2 // affected // GPTM 32/64-Bit Timer 2 is // triggered // GPTM 32/64-Bit Timer 2 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 2 is triggered // 1 // affected // GPTM 32/64-Bit Timer 1 is // triggered // GPTM 32/64-Bit Timer 1 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 1 is triggered // 0 // affected // GPTM 32/64-Bit Timer 0 is // triggered // GPTM 32/64-Bit Timer 0 is // triggered // and Timer B of GPTM 32/64-Bit // Timer 0 is triggered // GPTM5 is triggered // GPTM5 is triggered // and Timer B of GPTM5 is // triggered // GPTM4 is triggered // GPTM4 is triggered // and Timer B of GPTM4 is // triggered // GPTM3 is triggered // GPTM3 is triggered // and Timer B of GPTM3 is // triggered // GPTM2 is triggered // GPTM2 is triggered // and Timer B of GPTM2 is // triggered // GPTM1 is triggered // GPTM1 is triggered // and Timer B of GPTM1 is // triggered // GPTM0 is triggered // GPTM0 is triggered // and Timer B of GPTM0 is // triggered //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_IMR register. // //***************************************************************************** // Error Interrupt Mask // Mask // Interrupt Mask // Interrupt Mask // Mask // Mask // Interrupt Mask // Interrupt Mask // Mask //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_RIS register. // //***************************************************************************** // Error Raw Interrupt Status // Raw Interrupt // Raw Interrupt // Interrupt // Raw Interrupt // Raw Interrupt // Interrupt //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_MIS register. // //***************************************************************************** // Error Masked Interrupt Status // Interrupt // Masked Interrupt // Masked Interrupt // Interrupt // Interrupt // Masked Interrupt // Masked Interrupt // Interrupt //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_ICR register. // //***************************************************************************** // Error Interrupt Clear // Clear // Interrupt Clear // Interrupt Clear // Clear // Clear // Interrupt Clear // Interrupt Clear // Interrupt //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAILR register. // //***************************************************************************** // Register //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBILR register. // //***************************************************************************** // Register //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAMATCHR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBMATCHR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAPR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBPR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAPMR register. // //***************************************************************************** // Byte //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBPMR register. // //***************************************************************************** // Byte //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAV register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBV register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_RTCPD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAPS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBPS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TAPV register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_TBPV register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the TIMER_O_PP register. // //***************************************************************************** // 16 bits each with an 8-bit // prescale counter // 32 bits each with a 16-bit // prescale counter //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_ACTSS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_RIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_IM register. // //***************************************************************************** // SS3 // SS2 // SS1 // SS0 //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_ISC register. // //***************************************************************************** // Status on SS3 // Status on SS2 // Status on SS1 // Status on SS0 //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_OSTAT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_EMUX register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_USTAT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_TSSEL register. // //***************************************************************************** // Select // trigger) in PWM module 0 // trigger) in PWM module 1 // Select // trigger) in PWM module 0 // trigger) in PWM module 1 // Select // trigger) in PWM module 0 // trigger) in PWM module 1 // Select // trigger) in PWM module 0 // trigger) in PWM module 1 //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSPRI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SPC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_PSSI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SAC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCISC register. // //***************************************************************************** // Status and Clear // Status and Clear // Status and Clear // Status and Clear // Status and Clear // Status and Clear // Status and Clear // Status and Clear //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_CTL register. // //***************************************************************************** // references //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSMUX0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSCTL0 register. // //***************************************************************************** // Select // Select // Select // Select // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFIFO0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFSTAT0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSOP0 register. // //***************************************************************************** // Operation // Operation // Operation // Operation // Operation // Operation // Operation // Operation //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSDC0 register. // //***************************************************************************** // Select // Select // Select // Select // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSMUX1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSCTL1 register. // //***************************************************************************** // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFIFO1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFSTAT1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSOP1 register. // //***************************************************************************** // Operation // Operation // Operation // Operation //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSDC1 register. // //***************************************************************************** // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSMUX2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSCTL2 register. // //***************************************************************************** // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFIFO2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFSTAT2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSOP2 register. // //***************************************************************************** // Operation // Operation // Operation // Operation //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSDC2 register. // //***************************************************************************** // Select // Select // Select // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSMUX3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSCTL3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFIFO3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSFSTAT3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSOP3 register. // //***************************************************************************** // Operation //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_SSDC3 register. // //***************************************************************************** // Select //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCRIC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCTL7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_DCCMP7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_PC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the ADC_O_CC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACMIS register. // //***************************************************************************** // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACRIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACINTEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACREFCTL // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACSTAT0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACCTL0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACSTAT1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_ACCTL1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the COMP_O_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_CTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_STS register. // //***************************************************************************** // Successfully //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_ERR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_BIT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TST register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_BRPE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1CRQ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1CMSK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MSK1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MSK2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1ARB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1ARB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1MCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF1DB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2CRQ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2CMSK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MSK1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MSK2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2ARB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2ARB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2MCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DB1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_IF2DB2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TXRQ1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_TXRQ2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_NWDA1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_NWDA2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG1INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG2INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG1VAL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the CAN_O_MSG2VAL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FADDR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_POWER register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXIE register. // //***************************************************************************** // Enable //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXIE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_IS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_IE register. // //***************************************************************************** // only) // only) //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FRAME register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_EPIDX register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TEST register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FIFO7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_DEVCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFIFOSZ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFIFOSZ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFIFOADD // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFIFOADD // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_CONTIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_VPLEN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_FSEOF register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_LSEOF register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXFUNCADDR7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBADDR7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXHUBPORT7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXFUNCADDR7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBADDR7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXHUBPORT7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_CSRL0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_CSRH0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_COUNT0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TYPE0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_NAKLMT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXMAXP7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRL7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXCSRH7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXMAXP7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRL7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCSRH7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXCOUNT7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXTYPE7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXINTERVAL7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXTYPE7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXINTERVAL7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT2 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT3 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT4 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT5 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT6 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RQPKTCOUNT7 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_RXDPKTBUFDIS // register. // //***************************************************************************** // Disable // Disable // Disable // Disable // Disable // Disable // Disable //***************************************************************************** // // The following are defines for the bit fields in the USB_O_TXDPKTBUFDIS // register. // //***************************************************************************** // Disable // Disable // Disable // Disable // Disable // Disable // Disable //***************************************************************************** // // The following are defines for the bit fields in the USB_O_EPC register. // //***************************************************************************** // Configuration // (OTG only) // (OTG only) //***************************************************************************** // // The following are defines for the bit fields in the USB_O_EPCRIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_EPCIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_EPCISC register. // //***************************************************************************** // and Clear //***************************************************************************** // // The following are defines for the bit fields in the USB_O_DRRIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_DRIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_DRISC register. // //***************************************************************************** // Clear //***************************************************************************** // // The following are defines for the bit fields in the USB_O_GPCS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_VDC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_VDCRIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_VDCIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_VDCISC register. // //***************************************************************************** // Clear //***************************************************************************** // // The following are defines for the bit fields in the USB_O_IDVRIS register. // //***************************************************************************** // Status //***************************************************************************** // // The following are defines for the bit fields in the USB_O_IDVIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_IDVISC register. // //***************************************************************************** // and Clear //***************************************************************************** // // The following are defines for the bit fields in the USB_O_DMASEL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the USB_O_PP register. // //***************************************************************************** // controller //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EESIZE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEBLOCK register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEOFFSET // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EERDWR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EERDWRINC // register. // //***************************************************************************** // Increment //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEDONE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EESUPP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEUNLOCK // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEPROT register. // //***************************************************************************** // there is no password, the block // is not protected and is readable // and writable // block is readable or writable // only when unlocked // block is readable, not writable //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEPASS0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEPASS1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEPASS2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEINT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEHIDE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_EEDBGME register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the EEPROM_PP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSEXC_RIS register. // //***************************************************************************** // Raw Interrupt Status // Exception Raw Interrupt Status // Exception Raw Interrupt Status // Raw Interrupt Status // Exception Raw Interrupt Status // Exception Raw Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the SYSEXC_IM register. // //***************************************************************************** // Interrupt Mask // Exception Interrupt Mask // Exception Interrupt Mask // Interrupt Mask // Exception Interrupt Mask // Exception Interrupt Mask //***************************************************************************** // // The following are defines for the bit fields in the SYSEXC_MIS register. // //***************************************************************************** // Masked Interrupt Status // Exception Masked Interrupt // Status // Exception Masked Interrupt // Status // Masked Interrupt Status // Exception Masked Interrupt // Status // Exception Masked Interrupt // Status //***************************************************************************** // // The following are defines for the bit fields in the SYSEXC_IC register. // //***************************************************************************** // Interrupt Clear // Exception Interrupt Clear // Exception Interrupt Clear // Interrupt Clear // Exception Interrupt Clear // Exception Interrupt Clear //***************************************************************************** // // The following are defines for the bit fields in the HIB_RTCC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the HIB_RTCM0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the HIB_RTCLD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the HIB_CTL register. // //***************************************************************************** // Comparator //***************************************************************************** // // The following are defines for the bit fields in the HIB_IM register. // //***************************************************************************** // Interrupt Mask // Mask //***************************************************************************** // // The following are defines for the bit fields in the HIB_RIS register. // //***************************************************************************** // Interrupt Status // Status // Interrupt Status //***************************************************************************** // // The following are defines for the bit fields in the HIB_MIS register. // //***************************************************************************** // Interrupt Status // Interrupt Status // Interrupt Status // Status //***************************************************************************** // // The following are defines for the bit fields in the HIB_IC register. // //***************************************************************************** // Clear // Clear // Clear //***************************************************************************** // // The following are defines for the bit fields in the HIB_RTCT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the HIB_RTCSS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the HIB_DATA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FMA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FMD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FMC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FCRIS register. // //***************************************************************************** // Interrupt Status // Status // Status // Status //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FCIM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FCMISC register. // //***************************************************************************** // and Clear // and Clear // Status and Clear // Clear // and Clear // Status and Clear // and Clear //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FMC2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FWBVAL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FWBN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_FSIZE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_SSIZE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_ROMSWMAP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_RMCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_BOOTCFG register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_USERREG0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_USERREG1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_USERREG2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the FLASH_USERREG3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DID0 register. // //***************************************************************************** // register format. // microcontrollers // revision) // revision) // revision update //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DID1 register. // //***************************************************************************** // temperature range (-40C to 85C) // and extended temperature range // (-40C to 105C) devices. See //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC1 register. // //***************************************************************************** // with a PLL divider of 2.5 // with a PLL divider of 4 // with a PLL divider of 5 // PLL divider of 8 // PLL divider of 10 //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC8 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PBORCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRCR0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRCR1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRCR2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RIS register. // //***************************************************************************** // Status // Interrupt Status // Status // Status // Interrupt Status // Status //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_IMC register. // //***************************************************************************** // Interrupt Mask //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_MISC register. // //***************************************************************************** // Status // Status // Status // Status // Interrupt Status // Status //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RESC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_GPIOHBCTL // register. // //***************************************************************************** // Bus // Bus // Bus // Bus // Bus // Bus //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCC2 register. // //***************************************************************************** // MHz //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_MOSCCTL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGC0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGC1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGC2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGC0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGC1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGC2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGC0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGC1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGC2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DSLPCLKCFG // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SYSPROP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PIOSCCAL // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PIOSCSTAT // register. // //***************************************************************************** // attempted // completed to meet 1% accuracy // failed to meet 1% accuracy //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PLLFREQ0 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PLLFREQ1 // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PLLSTAT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SLPPWRCFG // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DSLPPWRCFG // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DC9 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_NVMSTAT register. // //***************************************************************************** // Available //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_LDOSPCTL // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_LDODPCTL // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPWD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPTIMER register. // //***************************************************************************** // 5 Present // 4 Present // 3 Present // 2 Present // 1 Present // 0 Present //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPGPIO register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPDMA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPHIB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPUART register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPSSI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPI2C register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPUSB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPCAN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPADC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPACMP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPPWM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPQEI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPEEPROM // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PPWTIMER // register. // //***************************************************************************** // Timer 5 Present // Timer 4 Present // Timer 3 Present // Timer 2 Present // Timer 1 Present // Timer 0 Present //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRWD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRTIMER register. // //***************************************************************************** // 5 Software Reset // 4 Software Reset // 3 Software Reset // 2 Software Reset // 1 Software Reset // 0 Software Reset //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRGPIO register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRDMA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRHIB register. // //***************************************************************************** // Reset //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRUART register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRSSI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRI2C register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRUSB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRCAN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRADC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRACMP register. // //***************************************************************************** // Software Reset //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRPWM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRQEI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SREEPROM // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SRWTIMER // register. // //***************************************************************************** // Timer 5 Software Reset // Timer 4 Software Reset // Timer 3 Software Reset // Timer 2 Software Reset // Timer 1 Software Reset // Timer 0 Software Reset //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCWD register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCTIMER // register. // //***************************************************************************** // 5 Run Mode Clock Gating Control // 4 Run Mode Clock Gating Control // 3 Run Mode Clock Gating Control // 2 Run Mode Clock Gating Control // 1 Run Mode Clock Gating Control // 0 Run Mode Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCGPIO // register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCDMA register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCHIB register. // //***************************************************************************** // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCUART // register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCSSI register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCI2C register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCUSB register. // //***************************************************************************** // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCCAN register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCADC register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCACMP // register. // //***************************************************************************** // Mode Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCPWM register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCQEI register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCEEPROM // register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_RCGCWTIMER // register. // //***************************************************************************** // Timer 5 Run Mode Clock Gating // Control // Timer 4 Run Mode Clock Gating // Control // Timer 3 Run Mode Clock Gating // Control // Timer 2 Run Mode Clock Gating // Control // Timer 1 Run Mode Clock Gating // Control // Timer 0 Run Mode Clock Gating // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCWD register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCTIMER // register. // //***************************************************************************** // 5 Sleep Mode Clock Gating // Control // 4 Sleep Mode Clock Gating // Control // 3 Sleep Mode Clock Gating // Control // 2 Sleep Mode Clock Gating // Control // 1 Sleep Mode Clock Gating // Control // 0 Sleep Mode Clock Gating // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCGPIO // register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCDMA register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCHIB register. // //***************************************************************************** // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCUART // register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCSSI register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCI2C register. // //***************************************************************************** // Gating Control // Gating Control // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCUSB register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCCAN register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCADC register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCACMP // register. // //***************************************************************************** // Mode Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCPWM register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCQEI register. // //***************************************************************************** // Gating Control // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCEEPROM // register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_SCGCWTIMER // register. // //***************************************************************************** // Timer 5 Sleep Mode Clock Gating // Control // Timer 4 Sleep Mode Clock Gating // Control // Timer 3 Sleep Mode Clock Gating // Control // Timer 2 Sleep Mode Clock Gating // Control // Timer 1 Sleep Mode Clock Gating // Control // Timer 0 Sleep Mode Clock Gating // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCWD register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCTIMER // register. // //***************************************************************************** // 5 Deep-Sleep Mode Clock Gating // Control // 4 Deep-Sleep Mode Clock Gating // Control // 3 Deep-Sleep Mode Clock Gating // Control // 2 Deep-Sleep Mode Clock Gating // Control // 1 Deep-Sleep Mode Clock Gating // Control // 0 Deep-Sleep Mode Clock Gating // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCGPIO // register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCDMA register. // //***************************************************************************** // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCHIB register. // //***************************************************************************** // Mode Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCUART // register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCSSI register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCI2C register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCUSB register. // //***************************************************************************** // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCCAN register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCADC register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCACMP // register. // //***************************************************************************** // Deep-Sleep Mode Clock Gating // Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCPWM register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCQEI register. // //***************************************************************************** // Clock Gating Control // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCEEPROM // register. // //***************************************************************************** // Clock Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_DCGCWTIMER // register. // //***************************************************************************** // Timer 5 Deep-Sleep Mode Clock // Gating Control // Timer 4 Deep-Sleep Mode Clock // Gating Control // Timer 3 Deep-Sleep Mode Clock // Gating Control // Timer 2 Deep-Sleep Mode Clock // Gating Control // Timer 1 Deep-Sleep Mode Clock // Gating Control // Timer 0 Deep-Sleep Mode Clock // Gating Control //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRWD register. // //***************************************************************************** // Ready // Ready //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRTIMER register. // //***************************************************************************** // 5 Peripheral Ready // 4 Peripheral Ready // 3 Peripheral Ready // 2 Peripheral Ready // 1 Peripheral Ready // 0 Peripheral Ready //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRGPIO register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRDMA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRHIB register. // //***************************************************************************** // Ready //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRUART register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRSSI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRI2C register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRUSB register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRCAN register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRADC register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRACMP register. // //***************************************************************************** // Peripheral Ready //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRPWM register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRQEI register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PREEPROM // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the SYSCTL_PRWTIMER // register. // //***************************************************************************** // Timer 5 Peripheral Ready // Timer 4 Peripheral Ready // Timer 3 Peripheral Ready // Timer 2 Peripheral Ready // Timer 1 Peripheral Ready // Timer 0 Peripheral Ready //***************************************************************************** // // The following are defines for the bit fields in the UDMA_STAT register. // //***************************************************************************** // clear //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CFG register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CTLBASE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ALTBASE register. // //***************************************************************************** // Pointer //***************************************************************************** // // The following are defines for the bit fields in the UDMA_WAITSTAT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_SWREQ register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_USEBURSTSET // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_USEBURSTCLR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_REQMASKSET // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_REQMASKCLR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ENASET register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ENACLR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ALTSET register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ALTCLR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_PRIOSET register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_PRIOCLR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_ERRCLR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHASGN register. // //***************************************************************************** // assignment // assignment //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHIS register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHMAP0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHMAP1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHMAP2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_CHMAP3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_O_SRCENDP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_O_DSTENDP register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the UDMA_O_CHCTL register. // //***************************************************************************** // Scatter-Gather //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTLR register. // //***************************************************************************** // Point // Cycle Instructions //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ST_CTRL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ST_RELOAD register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ST_CURRENT // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_EN0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_EN1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_EN2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_EN3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_EN4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DIS0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DIS1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DIS2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DIS3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DIS4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PEND0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PEND1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PEND2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PEND3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PEND4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_UNPEND0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_UNPEND1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_UNPEND2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_UNPEND3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_UNPEND4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTIVE0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTIVE1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTIVE2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTIVE3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_ACTIVE4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI0 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI4 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI5 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI6 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI7 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI8 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI9 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI10 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI11 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI12 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI13 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI14 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI15 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI16 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI17 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI18 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI19 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI20 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI21 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI22 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI23 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI24 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI25 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI26 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI27 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI28 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI29 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI30 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI31 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI32 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI33 register. // //***************************************************************************** // [4n+3] // [4n+2] // [4n+1] // [4n] //***************************************************************************** // // The following are defines for the bit fields in the NVIC_PRI34 register. // //***************************************************************************** // [4n+3] // [4n+2] // [4n+1] // [4n] //***************************************************************************** // // The following are defines for the bit fields in the NVIC_CPUID register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_INT_CTRL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_VTABLE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_APINT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SYS_CTRL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_CFG_CTRL register. // //***************************************************************************** // Entry // Fault //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SYS_PRI1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SYS_PRI2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SYS_PRI3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SYS_HND_CTRL // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_FAULT_STAT // register. // //***************************************************************************** // Fault // State Preservation // Register Valid // Floating-Point Lazy State // Preservation //***************************************************************************** // // The following are defines for the bit fields in the NVIC_HFAULT_STAT // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DEBUG_STAT // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MM_ADDR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_FAULT_ADDR // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_CPAC register. // //***************************************************************************** // Privilege // Privilege //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_TYPE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_CTRL register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_NUMBER // register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_BASE register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_ATTR register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_BASE1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_ATTR1 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_BASE2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_ATTR2 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_BASE3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_MPU_ATTR3 register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DBG_CTRL register. // //***************************************************************************** // since last read //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DBG_XFER register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DBG_DATA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_DBG_INT register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_SW_TRIG register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_FPCC register. // //***************************************************************************** // Enable //***************************************************************************** // // The following are defines for the bit fields in the NVIC_FPCA register. // //***************************************************************************** //***************************************************************************** // // The following are defines for the bit fields in the NVIC_FPDSC register. // //***************************************************************************** // mode // (RM) mode //***************************************************************************** // // The following definitions are deprecated. // //***************************************************************************** // microcontrollers #pragma diag_pop /* * Global binary semaphore that communicated between ISR " Can_InterruptHandler " and " vRxtask " task */ SemaphoreHandle_t xSemaphore ; /* * Set Mutex handler that used in " vTxtask " to product the share resources when transmit the message - * through CAN . * */ SemaphoreHandle_t xSemaphore1 ; /* * Static Global variable to save the current of DSM state of the CAN unit * and it's functionality uses in " Can_Init () " function */ static Can_StateType CanUnitState = CAN_UNINIT ; /* * Static Global array it's elements used to save the count of times that disable interrupt controller * and it's functionality uses in "Can_DisableControllerInterrupts () " function. */ static uint32_t IntDisableCount[2]={0}; /* * @ Global_MsgObJID : used to save the MailboxID that caused interrupt when the message received * and using this parameter in Searching algorithm in " vRxtask " function */ uint8_t Global_MsgObJID ; /* Static Global array it's elements used to save the Base of clock of target CAN controller * and it's functionality uses in "Can_Init () " function. * * Notes : * " Mcu_PerClockConfigType " is structure implemented in " Mcu_Cfg.h " by using SWS " Autosar_McuDriver " file . */ Mcu_PerClockConfigType McuPerClockConfigData [2]= { {. AHBClocksEnable = 0xf0003400, . APB1ClocksEnable = 0, . APB2ClocksEnable = 0 }, {. AHBClocksEnable = 0xf0003401, . APB1ClocksEnable = 0, . APB2ClocksEnable = 0 } };; /* Base addresses, clock references and initial baudRate configurations * BaudRate Configurations : this includes IDs for every BR configuration and the BR itself * @UserCANCFG : Macro identifier created for user configuration in file " Static_Can_Cfg.h" */ Can_t CanContainer = {. CanConfigSet . CanController = { { . CanControllerId = 0, . CanControllerBaseAddress = 0x40040000, . CanCpuClockRef . McuClockReferencePointFrequency = 16000000, . CanControllerDefaultBaudrate . CanControllerBaudRate = 500000, . CanControllerBaudrateConfig . CanControllerBaudRateConfigID = 1, . CanControllerBaudrateConfig . CanControllerBaudRate = 500000 }, { . CanControllerId = 1, . CanControllerBaseAddress = 0x40041000, . CanCpuClockRef . McuClockReferencePointFrequency = 16000000, . CanControllerDefaultBaudrate . CanControllerBaudRate = 500000, . CanControllerBaudrateConfig . CanControllerBaudRateConfigID = 1, . CanControllerBaudrateConfig . CanControllerBaudRate = 500000 } }};; /* * configuration structure to map HtH to buffer Mailbox * @hthMap : Macro identifier created for user configuration in file " Static_Can_Cfg.h" */ Can_t MailboxHTHCfg_MAP = {. CanConfigSet . CanHardwareObject = { { . CanObjectId = 1, . CanHandleType =FULL, . CanObjectType = TRANSMIT, . CanControllerRef = &CanContainer . CanConfigSet . CanController[0] }, { . CanObjectId = 2, . CanHandleType =FULL, . CanObjectType = TRANSMIT, . CanControllerRef = &CanContainer . CanConfigSet . CanController[0] } }}; ; /* * configuration structure to map HrH to buffer Mailbox * @hrhMap : Macro identifier created for user configuration in file " Static_Can_Cfg.h" */ Can_t MailboxHRHCfg_MAP = {. CanConfigSet . CanHardwareObject = { { . CanObjectId = 1, . CanHandleType =FULL, . CanObjectType = RECEIVE, . CanControllerRef = &CanContainer . CanConfigSet . CanController[0], . CanHwFilter . CanHwFilterMask = 0x7FF }, { . CanObjectId = 2, . CanHandleType =BASIC, . CanObjectType = RECEIVE, . CanControllerRef = &CanContainer . CanConfigSet . CanController[0], . CanHwFilter . CanHwFilterMask = 0x1FFFFFFF } }}; ; /* * Custom function making searching about information of buffer " Mailbox " that will save the * coming message by matching the mailboxID with mailboxID " CanObjectId " that saved into * configurable Map " MailboxHRHCfg_MAP " */ static inline const CanHardwareObject_t * Can_FindRxHoh(Can_HwHandleType_t mailboxID) { CanHardwareObject_t *MAP; uint8_t index ; for (index = 0U; index < 4U ; index++) { if (mailboxID == MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[index].CanObjectId) { MAP = &MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[index]; break; } } if (MAP->CanObjectType == RECEIVE) { return MAP; } else { return 0 ; } } /* * Custom function making searching about information of buffer " Mailbox " that will send the * CAN TX message by matching the hth coming from upper layer CANIF with hth that saved into * configurable Map " MailboxHTHCfg_MAP " */ static inline const CanHardwareObject_t* Can_FindTxHoh(Can_HwHandleType_t hth) { CanHardwareObject_t *MAP; MAP = &MailboxHTHCfg_MAP.CanConfigSet.CanHardwareObject[hth]; if (MAP->CanObjectType == TRANSMIT) { return MAP; } else { return 0 ; } } /* * Custom function using to configure the expected CAN message that will receiving through CAN * and passing Object to custom structure filled by user contains * ( mailboxID - canid - canlength ). */ Can_ReturnType_t Cfg_RxMsgObject (Cfg_RxMsgObject_t* Param ) { /* * " tCANMsgObject " is structure provide in TIVA_WARE library , * we use it because we are calling function name " CANMessageSet () " * implemented in TIVA_WARE and having parameter it's" tCANMsgObject " type. */ tCANMsgObject sCANMessage; /* * " Can_FindRxHoh " is a custom function is used to search about target * mailboxID that receiving coming message through CAN and return specification * of the coming message from " MailboxHOHCfg_MAP ". * */ const CanHardwareObject_t *hohobj = Can_FindRxHoh(Param->mailboxID); /* * if hohobj equal NULL that mean the searching is not successful * */ if (hohobj == 0) { /* * end the function and return " CAN_NOT_OK " */ return CAN_NOT_OK; } else { /* * from file " CAN_CFG.h " the user provide the expected Range ID Type * either " STANDARD " or " EXTENDED " */ sCANMessage.ui32Flags = (0x00000002 | 0x00000008 | 0x00000004); /* * Transfer between custom object " Param " to TIVA_WARE object " sCANMessage " * */ sCANMessage.ui32MsgID = Param->canid; sCANMessage.ui32MsgLen = Param->canlength; sCANMessage.ui32MsgIDMask = hohobj->CanHwFilter.CanHwFilterMask; /* * Calling " CANMessageSet " which implemented in TIVA_WARE library * and we gone use it to configure the Target receiving message and passing * @param1 : CAN Controller Base address * @param2 : Mailbox ID * @param3 : Object of configure message * @param4 : flag to indicate RX TYPE */ CANMessageSet(hohobj->CanControllerRef->CanControllerBaseAddress, hohobj->CanObjectId, &sCANMessage, MSG_OBJ_TYPE_RX); /* * After successful configuration of message object we return CAN_OK */ return CAN_OK; } } /* * Using this to get data by calling TIVA_WARE API " CANMessageGet () " and passing it * to upper layer by calling AUTOSAR API " CanIf_RxIndication () " */ Can_ReturnType_t handle_RxMsgObject (uint8_t hrh) { /* * create Objects from AUTOSAR standard type */ Can_HwType_t Mailbox; PduInfoType_t PduInfoPtr; /* * Create object from TIVA_WARE library */ tCANMsgObject sCANMessage; /* * Index for debugging */ uint32_t uIdx; /* * Init Data buffer from " sCANMessage " Object that received data through CAN */ uint8_t pui8MsgData[8] = {0}; sCANMessage.pui8MsgData = pui8MsgData; /* * @param1 : Passing Base address of CAN controller caused the interrupt * @param2 : Passing MailBoxID of CAN controller caused the interrupt * @param3 : Passing address of object that will save the CAN message into it * @param4 : Passing Zero to indicate not clear bending interrupt, but we are already * clear in ISR handler so don't need to clear it again */ CANMessageGet(MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[hrh].CanControllerRef->CanControllerBaseAddress, MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[hrh].CanObjectId, &sCANMessage, 0); uint32_t data = 0U ; for(uIdx = 0U; uIdx < sCANMessage.ui32MsgLen; uIdx++){ data |= (uint8_t)( sCANMessage.pui8MsgData[uIdx] << (uIdx*4U)); } UARTprintf("MessageObject:%u ID:0x%05X length:%u data: %08x\n", MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[hrh].CanObjectId, sCANMessage.ui32MsgID, sCANMessage.ui32MsgLen, data); /* * Transform between TIVA_WARE object " sCANMessage " to AUTOSAR object " Mailbox " to send the information of * the received CAN message to upper layer. */ Mailbox.hoh = hrh ; Mailbox.id = sCANMessage.ui32MsgID ; Mailbox.ctrlId = MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[hrh].CanControllerRef->CanControllerId; PduInfoPtr.SduLength = sCANMessage.ui32MsgLen; PduInfoPtr.SduDataptr = sCANMessage.pui8MsgData; /* * This Call back function implemented in upper layer " CanIf.c " and prototype of this function * exist in shared file between two layer " CAN layer and CANIF layer " called " CanIf_Cbk.h ". */ CanIf_RxIndication(&Mailbox ,&PduInfoPtr) ; /* * After Sending to upper layer return " CAN_OK " */ return CAN_OK; } void Can_Init(Can_t* Config) { if(CanUnitState == CAN_UNINIT) { uint8_t i, j ; for (i = 0; i<2; i++) { SysCtlPeripheralEnable(McuPerClockConfigData[i].AHBClocksEnable); while(!SysCtlPeripheralReady(McuPerClockConfigData[i].AHBClocksEnable)); CANInit(Config->CanConfigSet.CanController[i].CanControllerBaseAddress); CANBitRateSet(Config->CanConfigSet.CanController[i].CanControllerBaseAddress, SysCtlClockGet(), Config->CanConfigSet.CanController[i].CanControllerDefaultBaudrate.CanControllerBaudRate); } CanUnitState = CAN_READY ; for(j = 0; j<2; j++) { Can_SetControllerMode(j, CAN_T_STOP); } } else { /* ERROR DETECTION NOT SUPPORTED */ } } /* Note: this function should loop on the array of BaudRateConfiguration to detect * the matched ID with the input BaudRateConfigID and then it should set the controller BaudRate value * since we will use only one ID in out case.. the loop and the array of BR configuration has been cancelled. * * Sarea */ Std_ReturnType Can_SetBaudrate(int Controller, uint16_t BaudRateConfigID ) { if((CanUnitState == CAN_READY) && (Controller >= 0) && (Controller <= (2 -1))) { /* Disable the controller during the changes*/ CANDisable(CanContainer.CanConfigSet.CanController[Controller].CanControllerBaseAddress); /* if this the ID .. set the BaudRate */ CANBitRateSet((CanContainer.CanConfigSet.CanController[Controller].CanControllerBaseAddress), SysCtlClockGet(), CanContainer.CanConfigSet.CanController[Controller].CanControllerBaudrateConfig.CanControllerBaudRate); /* Enable the controller after the changes*/ CANEnable(CanContainer.CanConfigSet.CanController[Controller].CanControllerBaseAddress); return E_OK ; } else { return E_NOT_OK ; } } void Can_DisableControllerInterrupts(uint8_t Controller) { if((CanUnitState == CAN_UNINIT)|| (Controller >= 2)) { return; } else { /* MISRA RULE */ } if(IntDisableCount[Controller] == 0) { if(Controller == 0) { /* Reset interrupt enable, status interrupt enable, error interrupt enable to disable interrupts."*/ (*((volatile uint32_t *)0x40040000)) &= ~(0x00000002 |0x00000004 |0x00000008); IntDisable(55); } else if(Controller == 1) { /* Reset interrupt enable, status interrupt enable, error interrupt enable to disable interrupts."*/ (*((volatile uint32_t *)0x40041000)) &= ~(0x00000002 |0x00000004 |0x00000008); IntDisable(55); } else { /* MISRA RULE */ } } else { /* MISRA RULE */ } // increment the counter IntDisableCount[Controller]++; } void Can_EnableControllerInterrupts(uint8_t Controller) { if((CanUnitState == CAN_UNINIT)|| (Controller >= 2)) { return; } else { /* MISRA RULE */ } if(IntDisableCount[Controller] == 1) { if(Controller == 0) { /* set interrupt enable, status interrupt enable, error interrupt enable to disable interrupts."*/ (*((volatile uint32_t *)0x40040000)) |= (0x00000002 |0x00000004 |0x00000008); IntEnable(55); } else if(Controller == 1) { /* set interrupt enable, status interrupt enable, error interrupt enable to disable interrupts."*/ (*((volatile uint32_t *)0x40041000)) |= (0x00000002 |0x00000004 |0x00000008); IntEnable(56); } //Decrement the counter IntDisableCount[Controller]--; } else if(IntDisableCount[Controller] > 1) { //Decrement the counter IntDisableCount[Controller]--; } else { /* MISRA RULE */ } } Can_ReturnType_t Can_SetControllerMode( uint8_t Controller, Can_StateTransitionType_t Transition ) { /* * Static array it's elements used to save the current mode of the controller * and it's functionality provide in "Can_SetControllerMode () " function. */ static Can_ControllerStateType Can_ControllerMode [2]; /* * The CAN controller is not initialized. * All registers belonging to the CAN module are in reset state, * CAN interrupts are disabled. * The CAN Controller is not participating on the CAN bus. */ if( (CanUnitState == CAN_UNINIT)|| (Controller >= 2)) { return CAN_NOT_OK; } else { /* MISRA RULE */ } if( (Transition == CAN_T_START) && (Can_ControllerMode[Controller] != CAN_CS_STOPPED)|| (Transition == CAN_T_SLEEP) && (Can_ControllerMode[Controller] != CAN_CS_SLEEP)|| (Transition == CAN_T_WAKEUP) && (Can_ControllerMode[Controller] != CAN_CS_SLEEP)) { return CAN_NOT_OK; } switch(Transition){ case CAN_T_START : /* the registers, control register reset bit no. 0 for normal operation * status register: reset bit 0,1,2 for NO ERROR, resetting bit 3,4 for TXOK and RXOK */ if(Controller == 0) { (*((volatile uint32_t *)0x40040000)) &= ~ 0x00000001; (*((volatile uint32_t *)0x40040004)) &= ~ (0x00000007 | 0x00000008 | 0x00000010) ; } else if(Controller == 1) { (*((volatile uint32_t *)0x40041000)) &= ~ 0x00000001; (*((volatile uint32_t *)0x40041004)) &= ~ (0x00000007 | 0x00000008 | 0x00000010) ; } else { /* MISRA */ } // setting the new mode to STARTED Can_ControllerMode[Controller] = CAN_CS_STARTED; // Enable controller Interrupts Can_EnableControllerInterrupts(Controller); break; case CAN_T_STOP : if(Controller == 0){ /* setting control register bit 0 "initialization started"*/ (*((volatile uint32_t *)0x40040000)) |= 0x00000001; } else if(Controller == 1){ (*((volatile uint32_t *)0x40041000)) |= 0x00000001;; } //setting the new mode to STOPPED Can_ControllerMode[Controller] = CAN_CS_STOPPED; //Disable controller interrupts as the controller new mode is STOPPED Can_DisableControllerInterrupts(Controller); break; } return CAN_OK; } Can_ReturnType_t Can_Write( Can_HwHandleType_t Hth, Can_PduType_t* PduInfo ) { UARTprintf("check 6"); const CanHardwareObject_t *hohobj = Can_FindTxHoh(Hth); UARTprintf("check 7"); if(PduInfo == 0 || PduInfo->sdu == 0 || Hth > 16 || PduInfo->length > 8 || hohobj == 0) { return CAN_NOT_OK; } else { xSemaphore1 = xQueueGenericCreate( ( UBaseType_t ) 1, ( ( uint8_t ) 0U ), ( ( uint8_t ) 3U ) ); tCANMsgObject sCANMessage; uint8_t uIdx; sCANMessage.ui32MsgID = PduInfo->id; sCANMessage.ui32MsgLen = PduInfo->length; sCANMessage.pui8MsgData = PduInfo->sdu; sCANMessage.ui32MsgIDMask = 0; sCANMessage.ui32Flags = 0x00000001; xQueueGenericReceive( ( QueueHandle_t ) ( xSemaphore1 ), 0, ( 0 ), ( ( BaseType_t ) 0 ) ); CANMessageSet(hohobj->CanControllerRef->CanControllerBaseAddress, hohobj->CanObjectId, &sCANMessage, MSG_OBJ_TYPE_TX); /* * For dispalying sent data */ UARTprintf("Msg Obj=%u ID=0x%05X len=%u data=0x", MailboxHRHCfg_MAP.CanConfigSet.CanHardwareObject[Hth].CanObjectId, sCANMessage.ui32MsgID, sCANMessage.ui32MsgLen); for(uIdx = 0; uIdx < sCANMessage.ui32MsgLen; uIdx++) { UARTprintf("%02X ", sCANMessage.pui8MsgData[uIdx]); } /* * give semaphore */ xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore1 ), 0, ( ( TickType_t ) 0U ), ( ( BaseType_t ) 0 ) ); return CAN_OK; } } void Can_InterruptHandler(uint32_t controllerBase) { uint32_t ui32Status; uint32_t status_register_reading; BaseType_t xHigherPriorityTaskWoken = ( ( BaseType_t ) 0 ); // // Read the CAN interrupt status to find the cause of the interrupt // ui32Status = CANIntStatus(controllerBase, CAN_INT_STS_CAUSE); // // If the cause is a controller status interrupt, then get the status // if(ui32Status == 0x00008000) { //Just return the global CAN status register status_register_reading = CANStatusGet(controllerBase, CAN_STS_CONTROL); //Switch case to define the type of error and display it on terminal switch (status_register_reading){ //! CAN controller has entered a Bus Off state. case 0x00000080: UARTprintf("CAN_STATUS_BUS_OFF"); break; //! CAN controller error level has reached warning level. case 0x00000040: UARTprintf("CAN_STATUS_EWARN"); break; //! CAN controller error level has reached error passive level. case 0x00000020: UARTprintf("CAN_STATUS_EPASS"); break; //! This is the mask for the last error code field. case 0x00000007: UARTprintf("CAN_STATUS_LEC_MSK") ; break; //! There was no error. case 0x00000000: UARTprintf("CAN_STATUS_LEC_NONE") ; break; //! A bit stuffing error has occurred. case 0x00000001: UARTprintf("CAN_STATUS_LEC_STUFF") ; break; //! A formatting error has occurred. case 0x00000002: UARTprintf("CAN_STATUS_LEC_FORM") ; break; //! An acknowledge error has occurred. case 0x00000003: UARTprintf("CAN_STATUS_LEC_ACK") ; break; //! The bus remained a bit level of 1 for longer than is allowed. case 0x00000004: UARTprintf("CAN_STATUS_LEC_BIT1") ; break; //! The bus remained a bit level of 0 for longer than is allowed. case 0x00000005: UARTprintf("CAN_STATUS_LEC_BIT0") ; break; //! A CRC error has occurred. case 0x00000006: UARTprintf("CAN_STATUS_LEC_CRC") ; break; default: break; } } // // Check if the cause is message object 1, which what we are using for // receiving messages. // else if(ui32Status>= 0x01 && ui32Status<= 0x20) { // Created " Global_MsgObJID " that's Global variable - // is saving the object number buffer that cause the interrupt // and giving this parameter as an input to RX task. Global_MsgObJID = ui32Status ; //UARTprintf("MessageObject: %u",ui32Status); //UARTprintf("Inside Interrupt\n"); // Clear Interrupt CANIntClear(controllerBase, ui32Status); // give the Semaphore to periodic RX task xQueueGiveFromISR( ( QueueHandle_t ) ( xSemaphore ), ( &xHigherPriorityTaskWoken ) ); //UARTprintf("SemaphoreGive, Inside interrupt\n"); // wake up the task from blocking state if (xHigherPriorityTaskWoken == ( ( BaseType_t ) 1 )) { { ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) = ( 1UL << 28UL ); __asm( " dsb" ); __asm( " isb" ); }; } else { /* Do nothing */ } } else if (ui32Status == 0x00000000) { UARTprintf("No interrupt pending"); } else { /* Do nothing */ } } void Can0_InterruptHandler(void) { Can_InterruptHandler(CanContainer.CanConfigSet.CanController[0].CanControllerBaseAddress); } void Can1_InterruptHandler(void) { Can_InterruptHandler(CanContainer.CanConfigSet.CanController[1].CanControllerBaseAddress); }