summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 199cad6)
raw | patch | inline | side by side (parent: 199cad6)
author | Borja Martinez <borja.martinez@gmail.com> | |
Fri, 16 Dec 2016 19:44:39 +0000 (20:44 +0100) | ||
committer | Borja Martinez <borja.martinez@gmail.com> | |
Fri, 16 Dec 2016 19:44:39 +0000 (20:44 +0100) |
58 files changed:
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/Board.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/Board.h
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef __BOARD_H
+#define __BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "MSP432P401R_I3M.h"
+
+#define Board_initADC MSP_I3MSP432P401R_initADC
+#define Board_initGeneral MSP_I3MSP432P401R_initGeneral
+#define Board_initGPIO MSP_I3MSP432P401R_initGPIO
+#define Board_initI2C MSP_I3MSP432P401R_initI2C
+#define Board_initPWM MSP_I3MSP432P401R_initPWM
+#define Board_initSDSPI MSP_I3MSP432P401R_initSDSPI
+#define Board_initSPI MSP_I3MSP432P401R_initSPI
+#define Board_initUART MSP_I3MSP432P401R_initUART
+#define Board_initWatchdog MSP_I3MSP432P401R_initWatchdog
+#define Board_initWiFi MSP_I3MSP432P401R_initWiFi
+
+#define Board_ADC0 MSP_I3MSP432P401R_ADC0
+#define Board_ADC1 MSP_I3MSP432P401R_ADC1
+
+#define Board_LED_ON MSP_I3MSP432P401R_LED_ON
+#define Board_LED_OFF MSP_I3MSP432P401R_LED_OFF
+
+#define Board_BUTTON0 MSP_I3MSP432P401R_S1
+#define Board_BUTTON1 MSP_I3MSP432P401R_S2
+#define Board_LED0 MSP_I3MSP432P401R_LED_GREEN
+#define Board_LED1 MSP_I3MSP432P401R_LED_RED
+
+
+#define Board_SPI0_CS MSP_I3MSP432P401R_SPIB0_CS
+#define Board_SPI1_CS MSP_I3MSP432P401R_SPIA1_CS
+#define Board_SPI2_CS MSP_I3MSP432P401R_SPIA2_CS
+
+#define Board_SPI0_IRQ MSP_I3MSP432P401R_SPIB0_IRQ
+#define Board_SPI1_IRQ MSP_I3MSP432P401R_SPIA1_IRQ
+#define Board_SPI2_IRQ MSP_I3MSP432P401R_SPIA2_IRQ
+
+
+
+/*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+
+
+#define Board_I2C0 MSP_I3MSP432P401R_I2CB2
+
+//#define Board_PWM0 MSP_I3MSP432P401R_PWM_TA1_1
+//#define Board_PWM1 MSP_I3MSP432P401R_PWM_TA1_2
+
+//#define Board_SDSPI0 MSP_I3MSP432P401R_SDSPIB0
+
+//#define SPI1_SLAVE_MODE
+#define SPI1_MASTER_MODE
+
+#define Board_SPI0 MSP_I3MSP432P401R_SPIB0
+#define Board_SPI1 MSP_I3MSP432P401R_SPIA1
+#define Board_SPI2 MSP_I3MSP432P401R_SPIA2
+
+#define Board_UART MSP_I3MSP432P401R_UARTA0
+//#define Board_UART0 MSP_I3MSP432P401R_UARTA0
+//#define Board_UART1 MSP_I3MSP432P401R_UARTA2
+
+#define Board_WATCHDOG0 MSP_I3MSP432P401R_WATCHDOG
+
+//#define Board_WIFI MSP_I3MSP432P401R_WIFI
+//#define Board_WIFI_SPI MSP_I3MSP432P401R_SPIB0
+
+/* Board specific I2C addresses */
+#define EEPROM_SLAVE_ADDRESS (0x50)
+
+/* Sensors */
+#define Board_INA219_ADDR (0x41)
+#define Board_HDC1000_ADDR (0x43)
+#define Board_HDC1080_ADDR (0x40)
+#define Board_TMP007_ADDR (0x44)
+#define Board_OPT3001_ADDR (0x45)
+#define Board_MPU9250_ADDR (0x68)
+#define Board_BMP280_ADDR (0x77)
+#define Board_LISHH12_ADDR (0x1E)
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARD_H */
+
+
+
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/I3MSP432P401R.cmd b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/I3MSP432P401R.cmd
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+/*
+ * ======== MSP_EXP432P401R.cmd ========
+ * Define the memory block start/length for the MSP_EXP432P401R M4
+ */
+
+MEMORY
+{
+ MAIN (RX) : origin = 0x00000000, length = 0x00040000
+ INFO (RX) : origin = 0x00200000, length = 0x00004000
+ SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
+ SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
+}
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .text : > MAIN
+ .const : > MAIN
+ .cinit : > MAIN
+ .pinit : > MAIN
+
+#ifdef __TI_COMPILER_VERSION__
+#if __TI_COMPILER_VERSION__ >= 15009000
+ .TI.ramfunc : {} load=MAIN, run=SRAM_CODE, table(BINIT)
+#endif
+#endif
+ .data : > SRAM_DATA
+ .bss : > SRAM_DATA
+ .sysmem : > SRAM_DATA
+ .stack : > SRAM_DATA (HIGH)
+}
+
+/* Symbolic definition of the WDTCTL register for RTS */
+WDTCTL_SYM = 0x4000480C;
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/I3MSP432rtos.cfg b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/I3MSP432rtos.cfg
--- /dev/null
@@ -0,0 +1,543 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+
+
+/* ================ Clock configuration ================ */
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+/*
+ * Default value is family dependent. For example, Linux systems often only
+ * support a minimum period of 10000 us and multiples of 10000 us.
+ * TI platforms have a default of 1000 us.
+ */
+Clock.tickPeriod = 1000;
+
+
+
+/* ================ Defaults (module) configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+/*
+ * A flag to allow module names to be loaded on the target. Module name
+ * strings are placed in the .const section for debugging purposes.
+ *
+ * Pick one:
+ * - true (default)
+ * Setting this parameter to true will include name strings in the .const
+ * section so that Errors and Asserts are easier to debug.
+ * - false
+ * Setting this parameter to false will reduce footprint in the .const
+ * section. As a result, Error and Assert messages will contain an
+ * "unknown module" prefix instead of the actual module name.
+ */
+Defaults.common$.namedModule = true;
+//Defaults.common$.namedModule = false;
+
+
+
+/* ================ Error configuration ================ */
+var Error = xdc.useModule('xdc.runtime.Error');
+/*
+ * This function is called to handle all raised errors, but unlike
+ * Error.raiseHook, this function is responsible for completely handling the
+ * error with an appropriately initialized Error_Block.
+ *
+ * Pick one:
+ * - Error.policyDefault (default)
+ * Calls Error.raiseHook with an initialized Error_Block structure and logs
+ * the error using the module's logger.
+ * - Error.policySpin
+ * Simple alternative that traps on a while(1) loop for minimized target
+ * footprint.
+ * Using Error.policySpin, the Error.raiseHook will NOT called.
+ */
+Error.policyFxn = Error.policyDefault;
+//Error.policyFxn = Error.policySpin;
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this function is called
+ * whenever an error is raised by the Error module.
+ *
+ * Pick one:
+ * - Error.print (default)
+ * Errors are formatted and output via System_printf() for easier
+ * debugging.
+ * - null
+ * Errors are not formatted or logged. This option reduces code footprint.
+ * - non-null function
+ * Errors invoke custom user function. See the Error module documentation
+ * for more details.
+ */
+Error.raiseHook = Error.print;
+//Error.raiseHook = null;
+//Error.raiseHook = "&myErrorFxn";
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this option applies to the
+ * maximum number of times the Error.raiseHook function can be recursively
+ * invoked. This option limits the possibility of an infinite recursion that
+ * could lead to a stack overflow.
+ * The default value is 16.
+ */
+Error.maxDepth = 2;
+
+
+
+/* ================ Hwi configuration ================ */
+var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
+/*
+ * Checks for Hwi (system) stack overruns while in the Idle loop.
+ *
+ * Pick one:
+ * - true (default)
+ * Checks the top word for system stack overflows during the idle loop and
+ * raises an Error if one is detected.
+ * - false
+ * Disabling the runtime check improves runtime performance and yields a
+ * reduced flash footprint.
+ */
+halHwi.checkStackFlag = true;
+//halHwi.checkStackFlag = false;
+
+/*
+ * The following options alter the system's behavior when a hardware exception
+ * is detected.
+ *
+ * Pick one:
+ * - Hwi.enableException = true
+ * This option causes the default m3Hwi.excHandlerFunc function to fully
+ * decode an exception and dump the registers to the system console.
+ * This option raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.enableException = false
+ * This option reduces code footprint by not decoding or printing the
+ * exception to the system console.
+ * It however still raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.excHandlerFunc = null
+ * This is the most aggressive option for code footprint savings; but it
+ * can difficult to debug exceptions. It reduces flash footprint by
+ * plugging in a default while(1) trap when exception occur. This option
+ * does not raise an error with the Error module.
+ */
+m3Hwi.enableException = true;
+//m3Hwi.enableException = false;
+//m3Hwi.excHandlerFunc = null;
+
+/*
+ * Enable hardware exception generation when dividing by zero.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions when dividing by zero
+ * - 1
+ * Enables hardware exceptions when dividing by zero
+ */
+m3Hwi.nvicCCR.DIV_0_TRP = 0;
+//m3Hwi.nvicCCR.DIV_0_TRP = 1;
+
+/*
+ * Enable hardware exception generation for invalid data alignment.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions for data alignment
+ * - 1
+ * Enables hardware exceptions for data alignment
+ */
+m3Hwi.nvicCCR.UNALIGN_TRP = 0;
+//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
+
+
+
+/* ================ Idle configuration ================ */
+var Idle = xdc.useModule('ti.sysbios.knl.Idle');
+/*
+ * The Idle module is used to specify a list of functions to be called when no
+ * other tasks are running in the system.
+ *
+ * Functions added here will be run continuously within the idle task.
+ *
+ * Function signature:
+ * Void func(Void);
+ */
+//Idle.addFunc("&myIdleFunc");
+Idle.addFunc('&uartPrintf_flush'); // BMH flushing function.
+
+
+/* ================ Kernel (SYS/BIOS) configuration ================ */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Enable asserts in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables asserts for debugging purposes.
+ * - false
+ * Disables asserts for a reduced code footprint and better performance.
+ */
+BIOS.assertsEnabled = true;
+//BIOS.assertsEnabled = false;
+
+/*
+ * Specify default heap size for BIOS.
+ */
+BIOS.heapSize = 1024;
+
+/*
+ * A flag to determine if xdc.runtime sources are to be included in a custom
+ * built BIOS library.
+ *
+ * Pick one:
+ * - false (default)
+ * The pre-built xdc.runtime library is provided by the respective target
+ * used to build the application.
+ * - true
+ * xdc.runtime library sources are to be included in the custom BIOS
+ * library. This option yields the most efficient library in both code
+ * footprint and runtime performance.
+ */
+BIOS.includeXdcRuntime = false;
+//BIOS.includeXdcRuntime = true;
+
+/*
+ * The SYS/BIOS runtime is provided in the form of a library that is linked
+ * with the application. Several forms of this library are provided with the
+ * SYS/BIOS product.
+ *
+ * Pick one:
+ * - BIOS.LibType_Custom
+ * Custom built library that is highly optimized for code footprint and
+ * runtime performance.
+ * - BIOS.LibType_Debug
+ * Custom built library that is non-optimized that can be used to
+ * single-step through APIs with a debugger.
+ *
+ */
+BIOS.libType = BIOS.LibType_Custom;
+//BIOS.libType = BIOS.LibType_Debug;
+
+/*
+ * Runtime instance creation enable flag.
+ *
+ * Pick one:
+ * - true (default)
+ * Allows Mod_create() and Mod_delete() to be called at runtime which
+ * requires a default heap for dynamic memory allocation.
+ * - false
+ * Reduces code footprint by disallowing Mod_create() and Mod_delete() to
+ * be called at runtime. Object instances are constructed via
+ * Mod_construct() and destructed via Mod_destruct().
+ */
+BIOS.runtimeCreatesEnabled = true;
+//BIOS.runtimeCreatesEnabled = false;
+
+/*
+ * Enable logs in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables logs for debugging purposes.
+ * - false
+ * Disables logging for reduced code footprint and improved runtime
+ * performance.
+ */
+//BIOS.logsEnabled = true;
+BIOS.logsEnabled = false;
+
+
+
+/* ================ Memory configuration ================ */
+var Memory = xdc.useModule('xdc.runtime.Memory');
+/*
+ * The Memory module itself simply provides a common interface for any
+ * variety of system and application specific memory management policies
+ * implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
+ */
+
+
+
+/* ================ Program configuration ================ */
+/*
+ * Program.stack is ignored with IAR. Use the project options in
+ * IAR Embedded Workbench to alter the system stack size.
+ */
+if (!Program.build.target.$name.match(/iar/)) {
+ /*
+ * Reducing the system stack size (used by ISRs and Swis) to reduce
+ * RAM usage.
+ */
+ Program.stack = 768;
+}
+
+
+
+/*
+ * Uncomment to enable Semihosting for GNU targets to print to the CCS console.
+ * Please read the following TIRTOS Wiki page for more information on Semihosting:
+ * http://processors.wiki.ti.com/index.php/TI-RTOS_Examples_SemiHosting
+ */
+
+if (Program.build.target.$name.match(/gnu/)) {
+ //var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+}
+/* ================ Semaphore configuration ================ */
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+/*
+ * Enables global support for Task priority pend queuing.
+ *
+ * Pick one:
+ * - true (default)
+ * This allows pending tasks to be serviced based on their task priority.
+ * - false
+ * Pending tasks are services based on first in, first out basis.
+ *
+ * When using BIOS in ROM:
+ * This option must be set to false.
+ */
+//Semaphore.supportsPriority = true;
+Semaphore.supportsPriority = false;
+
+/*
+ * Allows for the implicit posting of events through the semaphore,
+ * disable for additional code saving.
+ *
+ * Pick one:
+ * - true
+ * This allows the Semaphore module to post semaphores and events
+ * simultaneously.
+ * - false (default)
+ * Events must be explicitly posted to unblock tasks.
+ *
+ */
+Semaphore.supportsEvents = true;
+//Semaphore.supportsEvents = false;
+
+
+
+/* ================ Swi configuration ================ */
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+/*
+ * A software interrupt is an object that encapsulates a function to be
+ * executed and a priority. Software interrupts are prioritized, preempt tasks
+ * and are preempted by hardware interrupt service routines.
+ *
+ * This module is included to allow Swi's in a users' application.
+ */
+
+
+
+/* ================ System configuration ================ */
+var System = xdc.useModule('xdc.runtime.System');
+/*
+ * The Abort handler is called when the system exits abnormally.
+ *
+ * Pick one:
+ * - System.abortStd (default)
+ * Call the ANSI C Standard 'abort()' to terminate the application.
+ * - System.abortSpin
+ * A lightweight abort function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom abort handler
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.abortFxn = System.abortStd;
+//System.abortFxn = System.abortSpin;
+//System.abortFxn = "&myAbortSystem";
+
+/*
+ * The Exit handler is called when the system exits normally.
+ *
+ * Pick one:
+ * - System.exitStd (default)
+ * Call the ANSI C Standard 'exit()' to terminate the application.
+ * - System.exitSpin
+ * A lightweight exit function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom exit function
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.exitFxn = System.exitStd;
+//System.exitFxn = System.exitSpin;
+//System.exitFxn = "&myExitSystem";
+
+/*
+ * Minimize exit handler array in the System module. The System module includes
+ * an array of functions that are registered with System_atexit() which is
+ * called by System_exit(). The default value is 8.
+ */
+System.maxAtexitHandlers = 2;
+
+/*
+ * The System.SupportProxy defines a low-level implementation of System
+ * functions such as System_printf(), System_flush(), etc.
+ *
+ * Pick one pair:
+ * - SysMin
+ * This module maintains an internal configurable circular buffer that
+ * stores the output until System_flush() is called.
+ * The size of the circular buffer is set via SysMin.bufSize.
+ * - SysCallback
+ * SysCallback allows for user-defined implementations for System APIs.
+ * The SysCallback support proxy has a smaller code footprint and can be
+ * used to supply custom System_printf services.
+ * The default SysCallback functions point to stub functions. See the
+ * SysCallback module's documentation.
+ */
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+SysMin.bufSize = 128;
+// BMH System.SupportProxy = SysMin;
+var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
+System.SupportProxy = SysCallback;
+//SysCallback.abortFxn = "&myUserAbort";
+//SysCallback.exitFxn = "&myUserExit";
+//SysCallback.flushFxn = "&myUserFlush";
+//SysCallback.putchFxn = "&myUserPutch";
+SysCallback.putchFxn = "&uartPrintf_putch"; // BMH Modified
+//SysCallback.readyFxn = "&myUserReady";
+
+
+
+
+/* ================ Task configuration ================ */
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+/*
+ * Check task stacks for overflow conditions.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables runtime checks for task stack overflow conditions during
+ * context switching ("from" and "to")
+ * - false
+ * Disables runtime checks for task stack overflow conditions.
+ */
+Task.checkStackFlag = true;
+//Task.checkStackFlag = false;
+
+/*
+ * Set the default task stack size when creating tasks.
+ *
+ * The default is dependent on the device being used. Reducing the default stack
+ * size yields greater memory savings.
+ */
+Task.defaultStackSize = 512;
+
+/*
+ * Enables the idle task.
+ *
+ * Pick one:
+ * - true (default)
+ * Creates a task with priority of 0 which calls idle hook functions. This
+ * option must be set to true to gain power savings provided by the Power
+ * module.
+ * - false
+ * No idle task is created. This option consumes less memory as no
+ * additional default task stack is needed.
+ * To gain power savings by the Power module without having the idle task,
+ * add Idle.run as the Task.allBlockedFunc.
+ */
+Task.enableIdleTask = true;
+//Task.enableIdleTask = false;
+//Task.allBlockedFunc = Idle.run;
+
+/*
+ * If Task.enableIdleTask is set to true, this option sets the idle task's
+ * stack size.
+ *
+ * Reducing the idle stack size yields greater memory savings.
+ */
+Task.idleTaskStackSize = 512;
+
+/*
+ * Reduce the number of task priorities.
+ * The default is 16.
+ * Decreasing the number of task priorities yield memory savings.
+ */
+Task.numPriorities = 16;
+
+
+
+/* ================ Text configuration ================ */
+var Text = xdc.useModule('xdc.runtime.Text');
+/*
+ * These strings are placed in the .const section. Setting this parameter to
+ * false will save space in the .const section. Error, Assert and Log messages
+ * will print raw ids and args instead of a formatted message.
+ *
+ * Pick one:
+ * - true (default)
+ * This option loads test string into the .const for easier debugging.
+ * - false
+ * This option reduces the .const footprint.
+ */
+Text.isLoaded = true;
+//Text.isLoaded = false;
+
+
+
+/* ================ Types configuration ================ */
+var Types = xdc.useModule('xdc.runtime.Types');
+/*
+ * This module defines basic constants and types used throughout the
+ * xdc.runtime package.
+ */
+
+
+
+/* ================ TI-RTOS middleware configuration ================ */
+var mwConfig = xdc.useModule('ti.mw.Config');
+/*
+ * Include TI-RTOS middleware libraries
+ */
+
+
+
+/* ================ TI-RTOS drivers' configuration ================ */
+var driversConfig = xdc.useModule('ti.drivers.Config');
+/*
+ * Include TI-RTOS drivers
+ *
+ * Pick one:
+ * - driversConfig.LibType_NonInstrumented (default)
+ * Use TI-RTOS drivers library optimized for footprint and performance
+ * without asserts or logs.
+ * - driversConfig.LibType_Instrumented
+ * Use TI-RTOS drivers library for debugging with asserts and logs enabled.
+ */
+driversConfig.libType = driversConfig.LibType_NonInstrumented;
+//driversConfig.libType = driversConfig.LibType_Instrumented;
+
+
+
+/* ================ Application Specific Instances ================ */
\ No newline at end of file
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/MSP432P401R_I3M.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/MSP432P401R_I3M.c
--- /dev/null
@@ -0,0 +1,758 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * ======== MSP_I3MSP432P401R.c ========
+ * This file is responsible for setting up the board specific items for the
+ * MSP_I3MSP432P401R board.
+ */
+
+#include <stdbool.h>
+
+#include <ti/drivers/Power.h>
+#include <ti/drivers/power/PowerMSP432.h>
+
+#include <msp.h>
+#include <rom.h>
+#include <rom_map.h>
+#include <dma.h>
+#include <gpio.h>
+#include <i2c.h>
+#include <pmap.h>
+#include <spi.h>
+#include <timer_a.h>
+#include <uart.h>
+#include <wdt_a.h>
+#include <adc14.h>
+#include <ref_a.h>
+#include <interrupt.h>
+
+#include <MSP432P401R_I3M.h>
+
+/*
+ * =============================== ADC ===============================
+ */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(ADC_config, ".const:ADC_config")
+#pragma DATA_SECTION(adcMSP432HWAttrs, ".const:adcMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/ADC.h>
+#include <ti/drivers/adc/ADCMSP432.h>
+
+/* ADC objects */
+ADCMSP432_Object adcMSP432Objects[MSP_I3MSP432P401R_ADCCOUNT];
+
+/* ADC configuration structure */
+const ADCMSP432_HWAttrs adcMSP432HWAttrs[MSP_I3MSP432P401R_ADCCOUNT] = {
+ {
+ .channel = ADC_INPUT_A0,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN5,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF2_5V,
+ .resolution = ADC_14BIT
+ },
+ {
+ .channel = ADC_INPUT_A1,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN4,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF1_45V,
+ .resolution = ADC_8BIT
+ }
+};
+
+const ADC_Config ADC_config[] = {
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[0],
+ .hwAttrs = &adcMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[1],
+ .hwAttrs = &adcMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+void MSP_I3MSP432P401R_initADC(void)
+{
+ ADC_init();
+}
+
+/*
+ * =============================== DMA ===============================
+ */
+
+#include <ti/drivers/dma/UDMAMSP432.h>
+
+
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_ALIGN(dmaControlTable, 256)
+#elif defined(__IAR_SYSTEMS_ICC__)
+#pragma data_alignment=256
+#elif defined(__GNUC__)
+__attribute__ ((aligned (256)))
+#endif
+static DMA_ControlTable dmaControlTable[8];
+
+/*
+ * ======== dmaErrorHwi ========
+ * This is the handler for the uDMA error interrupt.
+ */
+static void dmaErrorHwi(uintptr_t arg)
+{
+ int status = MAP_DMA_getErrorStatus();
+ MAP_DMA_clearErrorStatus();
+
+ /* Suppress unused variable warning */
+ (void)status;
+
+ while (1);
+}
+
+UDMAMSP432_Object udmaMSP432Object;
+
+const UDMAMSP432_HWAttrs udmaMSP432HWAttrs = {
+ .controlBaseAddr = (void *)dmaControlTable,
+ .dmaErrorFxn = (UDMAMSP432_ErrorFxn)dmaErrorHwi,
+ .intNum = INT_DMA_ERR,
+ .intPriority = (~0)
+};
+
+const UDMAMSP432_Config UDMAMSP432_config = {
+ .object = &udmaMSP432Object,
+ .hwAttrs = &udmaMSP432HWAttrs
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGeneral ========
+ */
+void MSP_I3MSP432P401R_initGeneral(void)
+{
+ Power_init();
+}
+
+/*
+ * =============================== GPIO ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(GPIOMSP432_config, ".const:GPIOMSP432_config")
+#endif
+
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/gpio/GPIOMSP432.h>
+
+/*
+ * Array of Pin configurations
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts should be placed at the end of the
+ * array. Callback entries can be omitted from callbacks array to
+ * reduce memory usage.
+ */
+GPIO_PinConfig gpioPinConfigs[] = {
+ /* Input pins */
+ /* MSP_I3MSP432P401R_S1 */
+ GPIOMSP432_P6_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+
+ /* Output pins */
+ /* MSP_I3MSP432P401R_SPI1_IRQ */
+ GPIOMSP432_P4_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI1_CS */
+ GPIOMSP432_P2_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI2_CS */
+ GPIOMSP432_P3_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ /* MSP_I3MSP432P401R_LED_GREEN */
+ GPIOMSP432_P6_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_LED_RED */
+ GPIOMSP432_P6_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
+
+};
+
+/*
+ * Array of callback function pointers
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts can be omitted from callbacks array to
+ * reduce memory usage (if placed at end of gpioPinConfigs array).
+ */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+ /* MSP_I3MSP432P401R_S1 */
+ NULL,
+ /* MSP_I3MSP432P401R_S2 */
+ NULL
+};
+
+const GPIOMSP432_Config GPIOMSP432_config = {
+ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
+ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
+ .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
+ .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
+ .intPriority = (~0)
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGPIO ========
+ */
+void MSP_I3MSP432P401R_initGPIO(void)
+{
+ /* Initialize peripheral and pins */
+ GPIO_init();
+}
+
+/*
+ * =============================== I2C ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
+#pragma DATA_SECTION(i2cMSP432HWAttrs, ".const:i2cMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/i2c/I2CMSP432.h>
+
+I2CMSP432_Object i2cMSP432Objects[MSP_I3MSP432P401R_I2CCOUNT];
+
+const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_I3MSP432P401R_I2CCOUNT] = {
+ {
+ .baseAddr = EUSCI_B2_BASE,
+ .intNum = INT_EUSCIB2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK
+ }
+};
+
+const I2C_Config I2C_config[] = {
+ {
+ .fxnTablePtr = &I2CMSP432_fxnTable,
+ .object = &i2cMSP432Objects[0],
+ .hwAttrs = &i2cMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initI2C ========
+ */
+void MSP_I3MSP432P401R_initI2C(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+ /* Configure Pins 1.6 & 1.7 as SDA & SCL, respectively. */
+ // BMH MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ // BMH GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+ /* Initialize the I2C driver */
+ I2C_init();
+}
+
+/*
+ * =============================== Power ===============================
+ */
+const PowerMSP432_ConfigV1 PowerMSP432_config = {
+ .policyInitFxn = &PowerMSP432_initPolicy,
+ .policyFxn = &PowerMSP432_sleepPolicy,
+ .initialPerfLevel = 2,
+ .enablePolicy = true,
+ .enablePerf = true,
+ .enableParking = true
+};
+
+/*
+ * =============================== PWM ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
+#pragma DATA_SECTION(pwmTimerMSP432HWAttrs, ".const:pwmTimerMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/PWM.h>
+#include <ti/drivers/pwm/PWMTimerMSP432.h>
+
+PWMTimerMSP432_Object pwmTimerMSP432Objects[MSP_I3MSP432P401R_PWMCOUNT];
+
+const PWMTimerMSP432_HWAttrsV1 pwmTimerMSP432HWAttrs[MSP_I3MSP432P401R_PWMCOUNT] = {
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN1,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ },
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN2,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ }
+};
+
+const PWM_Config PWM_config[] = {
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[0],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[1],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initPWM ========
+ */
+void MSP_I3MSP432P401R_initPWM(void)
+{
+ /* Use Port Map on Port2 get Timer outputs on pins with LEDs (2.1, 2.2) */
+ const uint8_t portMap [] = {
+ PM_NONE, PM_TA1CCR1A, PM_TA1CCR2A, PM_NONE,
+ PM_NONE, PM_NONE, PM_NONE, PM_NONE
+ };
+
+ /* Mapping capture compare registers to Port 2 */
+ MAP_PMAP_configurePorts((const uint8_t *) portMap, PMAP_P2MAP, 1,
+ PMAP_DISABLE_RECONFIGURATION);
+
+ PWM_init();
+}
+
+/*
+ * =============================== SDSPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if 0
+ #if defined(__TI_COMPILER_VERSION__)
+ #pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
+ #pragma DATA_SECTION(sdspiMSP432HWAttrs, ".const:sdspiMSP432HWAttrs")
+ #endif
+
+ #include <ti/drivers/SDSPI.h>
+ #include <ti/drivers/sdspi/SDSPIMSP432.h>
+
+ SDSPIMSP432_Object sdspiMSP432Objects[MSP_I3MSP432P401R_SDSPICOUNT];
+
+ const SDSPIMSP432_HWAttrs sdspiMSP432HWAttrs[MSP_I3MSP432P401R_SDSPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ /* CLK, MOSI & MISO ports & pins */
+ .portSCK = GPIO_PORT_P1,
+ .pinSCK = GPIO_PIN5,
+ .sckMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMISO = GPIO_PORT_P1,
+ .pinMISO = GPIO_PIN7,
+ .misoMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMOSI = GPIO_PORT_P1,
+ .pinMOSI = GPIO_PIN6,
+ .mosiMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ /* Chip select port & pin */
+ .portCS = GPIO_PORT_P4,
+ .pinCS = GPIO_PIN6
+ }
+ };
+
+ const SDSPI_Config SDSPI_config[] = {
+ {
+ .fxnTablePtr = &SDSPIMSP432_fxnTable,
+ .object = &sdspiMSP432Objects[0],
+ .hwAttrs = &sdspiMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+ };
+#endif
+
+/*
+ * ======== MSP_I3MSP432P401R_initSDSPI ========
+ */
+#if 0
+
+ void MSP_I3MSP432P401R_initSDSPI(void)
+ {
+ SDSPI_init();
+ }
+
+#endif
+
+/*
+ * =============================== SPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
+#pragma DATA_SECTION(spiMSP432DMAHWAttrs, ".const:spiMSP432DMAHWAttrs")
+#endif
+
+#include <ti/drivers/SPI.h>
+#include <ti/drivers/spi/SPIMSP432DMA.h>
+
+SPIMSP432DMA_Object spiMSP432DMAObjects[MSP_I3MSP432P401R_SPICOUNT];
+
+const SPIMSP432DMA_HWAttrs spiMSP432DMAHWAttrs[MSP_I3MSP432P401R_SPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT0,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH1_EUSCIB0RX0,
+ .txDMAChannelIndex = DMA_CH0_EUSCIB0TX0
+ },
+ {
+ .baseAddr = EUSCI_A1_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT1,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH3_EUSCIA1RX,
+ .txDMAChannelIndex = DMA_CH2_EUSCIA1TX
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT2,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH5_EUSCIA2RX,
+ .txDMAChannelIndex = DMA_CH4_EUSCIA2TX
+ }
+
+};
+
+const SPI_Config SPI_config[] = {
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[0],
+ .hwAttrs = &spiMSP432DMAHWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[1],
+ .hwAttrs = &spiMSP432DMAHWAttrs[1]
+ },
+
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[2],
+ .hwAttrs = &spiMSP432DMAHWAttrs[2]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initSPI ========
+ */
+void MSP_I3MSP432P401R_initSPI(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+/* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A1)*/
+#if 0
+ #warning SPI_SLAVE_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2,
+ GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+#if 1
+ #warning SPI_MASTER_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A2) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ SPI_init();
+}
+
+/*
+ * =============================== UART ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(UART_config, ".const:UART_config")
+#pragma DATA_SECTION(uartMSP432HWAttrs, ".const:uartMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/UART.h>
+#include <ti/drivers/uart/UARTMSP432.h>
+
+UARTMSP432_Object uartMSP432Objects[MSP_I3MSP432P401R_UARTCOUNT];
+unsigned char uartMSP432RingBuffer[MSP_I3MSP432P401R_UARTCOUNT][32];
+
+/*
+ * The baudrate dividers were determined by using the MSP430 baudrate
+ * calculator
+ * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
+ */
+const UARTMSP432_BaudrateConfig uartMSP432Baudrates[] = {
+ /* {baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling} */
+ {
+ .outputBaudrate = 115200,
+ .inputClockFreq = 12000000,
+ .prescalar = 6,
+ .hwRegUCBRFx = 8,
+ .hwRegUCBRSx = 32,
+ .oversampling = 1
+ },
+ {115200, 6000000, 3, 4, 2, 1},
+ {115200, 3000000, 1, 10, 0, 1},
+ {9600, 12000000, 78, 2, 0, 1},
+ {9600, 6000000, 39, 1, 0, 1},
+ {9600, 3000000, 19, 8, 85, 1},
+ {9600, 32768, 3, 0, 146, 0}
+};
+
+const UARTMSP432_HWAttrs uartMSP432HWAttrs[MSP_I3MSP432P401R_UARTCOUNT] = {
+ {
+ .baseAddr = EUSCI_A0_BASE,
+ .intNum = INT_EUSCIA0,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[0],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[0])
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .intNum = INT_EUSCIA2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[1],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[1])
+ }
+};
+
+const UART_Config UART_config[] = {
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[0],
+ .hwAttrs = &uartMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[1],
+ .hwAttrs = &uartMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initUART ========
+ */
+void MSP_I3MSP432P401R_initUART(void)
+{
+ /* Set P1.2 & P1.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Set P3.2 & P3.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Initialize the UART driver */
+ UART_init();
+}
+
+/*
+ * =============================== Watchdog ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
+#pragma DATA_SECTION(watchdogMSP432HWAttrs, ".const:watchdogMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/Watchdog.h>
+#include <ti/drivers/watchdog/WatchdogMSP432.h>
+
+WatchdogMSP432_Object watchdogMSP432Objects[MSP_I3MSP432P401R_WATCHDOGCOUNT];
+
+const WatchdogMSP432_HWAttrs
+ watchdogMSP432HWAttrs[MSP_I3MSP432P401R_WATCHDOGCOUNT] = {
+ {
+ .baseAddr = WDT_A_BASE,
+ .intNum = INT_WDT_A,
+ .intPriority = (~0),
+ .clockSource = WDT_A_CLOCKSOURCE_SMCLK,
+ .clockDivider = WDT_A_CLOCKDIVIDER_8192K
+ },
+};
+
+const Watchdog_Config Watchdog_config[] = {
+ {
+ .fxnTablePtr = &WatchdogMSP432_fxnTable,
+ .object = &watchdogMSP432Objects[0],
+ .hwAttrs = &watchdogMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWatchdog ========
+ */
+void MSP_I3MSP432P401R_initWatchdog(void)
+{
+ /* Initialize the Watchdog driver */
+ Watchdog_init();
+}
+
+/*
+ * =============================== WiFi ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
+#pragma DATA_SECTION(wiFiCC3100HWAttrs, ".const:wiFiCC3100HWAttrs")
+#endif
+
+#include <ti/drivers/WiFi.h>
+#include <ti/drivers/wifi/WiFiCC3100.h>
+
+WiFiCC3100_Object wiFiCC3100Objects[MSP_I3MSP432P401R_WIFICOUNT];
+
+const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[MSP_I3MSP432P401R_WIFICOUNT] = {
+ {
+ .irqPort = GPIO_PORT_P2,
+ .irqPin = GPIO_PIN5,
+ .irqIntNum = INT_PORT2,
+
+ .csPort = GPIO_PORT_P3,
+ .csPin = GPIO_PIN0,
+
+ .enPort = GPIO_PORT_P4,
+ .enPin = GPIO_PIN1
+ }
+};
+
+const WiFi_Config WiFi_config[] = {
+ {
+ .fxnTablePtr = &WiFiCC3100_fxnTable,
+ .object = &wiFiCC3100Objects[0],
+ .hwAttrs = &wiFiCC3100HWAttrs[0]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWiFi ========
+ */
+void MSP_I3MSP432P401R_initWiFi(void)
+{
+ /* Configure EN & CS pins to disable CC3100 */
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P4, GPIO_PIN1);
+ MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN1);
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Configure IRQ pin */
+ MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P2, GPIO_PIN5);
+ MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P2, GPIO_PIN5,
+ GPIO_LOW_TO_HIGH_TRANSITION);
+
+ /* Initialize SPI and WiFi drivers */
+ SPI_init();
+ WiFi_init();
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/MSP432P401R_I3M.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/MSP432P401R_I3M.h
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** ============================================================================
+ * @file MSP_I3MSP432P401R.h
+ *
+ * @brief MSP_I3MSP432P401R Board Specific APIs
+ *
+ * The MSP_I3MSP432P401R header file should be included in an application as
+ * follows:
+ * @code
+ * #include <MSP_I3MSP432P401R.h>
+ * @endcode
+ *
+ * ============================================================================
+ */
+#ifndef __MSP_I3MSP432P401R_H
+#define __MSP_I3MSP432P401R_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LEDs on MSP_I3MSP432P401R are active high. */
+#define MSP_I3MSP432P401R_LED_OFF (0)
+#define MSP_I3MSP432P401R_LED_ON (1)
+
+/*!
+ * @def MSP_I3MSP432P401R_ADCName
+ * @brief Enum of ADC channels on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_ADCName {
+ MSP_I3MSP432P401R_ADC0 = 0,
+ MSP_I3MSP432P401R_ADC1,
+ MSP_I3MSP432P401R_ADCCOUNT
+}MSP_I3MSP432P401R_ADCName;
+
+/*!
+ * @def MSP_I3MSP432P401R_GPIOName
+ * @brief Enum of GPIO names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_GPIOName {
+ MSP_I3MSP432P401R_S1 = 0,
+ MSP_I3MSP432P401R_SPIA1_IRQ,
+ MSP_I3MSP432P401R_SPIA1_CS,
+ MSP_I3MSP432P401R_SPIA2_CS,
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ MSP_I3MSP432P401R_LED_GREEN,
+ MSP_I3MSP432P401R_LED_RED,
+
+ MSP_I3MSP432P401R_GPIOCOUNT
+} MSP_I3MSP432P401R_GPIOName;
+
+/*!
+ * @def MSP_I3MSP432P401R_I2CName
+ * @brief Enum of I2C names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_I2CName {
+ MSP_I3MSP432P401R_I2CB2 = 0,
+ MSP_I3MSP432P401R_I2CCOUNT
+} MSP_I3MSP432P401R_I2CName;
+
+/*!
+ * @def MSP_I3MSP432P401R_PWMName
+ * @brief Enum of PWM names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_PWMName {
+ MSP_I3MSP432P401R_PWM_TA1_1 = 0,
+ MSP_I3MSP432P401R_PWM_TA1_2,
+
+ MSP_I3MSP432P401R_PWMCOUNT
+} MSP_I3MSP432P401R_PWMName;
+
+/*!
+ * @def MSP_I3MSP432P401R_SDSPIName
+ * @brief Enum of SDSPI names on the MSP_I3MSP432P401R dev board
+
+typedef enum MSP_I3MSP432P401R_SDSPIName {
+ MSP_I3MSP432P401R_SDSPIB0 = 0,
+
+ MSP_I3MSP432P401R_SDSPICOUNT
+} EMSP_I3MSP432P401R_SDSPIName;
+*/
+
+/*!
+ * @def MSP_I3MSP432P401R_SPIName
+ * @brief Enum of SPI names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_SPIName {
+ MSP_I3MSP432P401R_SPIB0 = 0,
+ MSP_I3MSP432P401R_SPIA1,
+ MSP_I3MSP432P401R_SPIA2,
+
+ MSP_I3MSP432P401R_SPICOUNT
+} MSP_I3MSP432P401R_SPIName;
+
+/*!
+ * @def MSP_I3MSP432P401R_UARTName
+ * @brief Enum of UART names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_UARTName {
+ MSP_I3MSP432P401R_UARTA0 = 0,
+ MSP_I3MSP432P401R_UARTA2,
+
+ MSP_I3MSP432P401R_UARTCOUNT
+} MSP_I3MSP432P401R_UARTName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WatchdogName
+ * @brief Enum of Watchdog names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WatchdogName {
+ MSP_I3MSP432P401R_WATCHDOG = 0,
+
+ MSP_I3MSP432P401R_WATCHDOGCOUNT
+} MSP_I3MSP432P401R_WatchdogName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WiFiName
+ * @brief Enum of WiFi names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WiFiName {
+ MSP_I3MSP432P401R_WIFI = 0,
+
+ MSP_I3MSP432P401R_WIFICOUNT
+} MSP_I3MSP432P401R_WiFiName;
+
+/*!
+ * @brief Initialize board specific ADC settings
+ *
+ * This function initializes the board specific ADC settings and then calls
+ * the ADC_init API to initialize the ADC module.
+ *
+ * The ADC peripherals controlled by the ADC module are determined by the
+ * ADC_config variable.
+ */
+extern void MSP_I3MSP432P401R_initADC(void);
+
+/*!
+ * @brief Initialize the general board specific settings
+ *
+ * This function initializes the general board specific settings.
+ */
+extern void MSP_I3MSP432P401R_initGeneral(void);
+
+/*!
+ * @brief Initialize board specific GPIO settings
+ *
+ * This function initializes the board specific GPIO settings and
+ * then calls the GPIO_init API to initialize the GPIO module.
+ *
+ * The GPIOs controlled by the GPIO module are determined by the GPIO_PinConfig
+ * variable.
+ */
+extern void MSP_I3MSP432P401R_initGPIO(void);
+
+/*!
+ * @brief Initialize board specific I2C settings
+ *
+ * This function initializes the board specific I2C settings and then calls
+ * the I2C_init API to initialize the I2C module.
+ *
+ * The I2C peripherals controlled by the I2C module are determined by the
+ * I2C_config variable.
+ */
+extern void MSP_I3MSP432P401R_initI2C(void);
+
+/*!
+ * @brief Initialize board specific PWM settings
+ *
+ * This function initializes the board specific PWM settings and then calls
+ * the PWM_init API to initialize the PWM module.
+ *
+ * The PWM peripherals controlled by the PWM module are determined by the
+ * PWM_config variable.
+ */
+extern void MSP_I3MSP432P401R_initPWM(void);
+
+/*!
+ * @brief Initialize board specific SDSPI settings
+ *
+ * This function initializes the board specific SDSPI settings and then calls
+ * the SDSPI_init API to initialize the SDSPI module.
+ *
+ * The SDSPI peripherals controlled by the SDSPI module are determined by the
+ * SDSPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSDSPI(void);
+
+/*!
+ * @brief Initialize board specific SPI settings
+ *
+ * This function initializes the board specific SPI settings and then calls
+ * the SPI_init API to initialize the SPI module.
+ *
+ * The SPI peripherals controlled by the SPI module are determined by the
+ * SPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSPI(void);
+
+/*!
+ * @brief Initialize board specific UART settings
+ *
+ * This function initializes the board specific UART settings and then calls
+ * the UART_init API to initialize the UART module.
+ *
+ * The UART peripherals controlled by the UART module are determined by the
+ * UART_config variable.
+ */
+extern void MSP_I3MSP432P401R_initUART(void);
+
+/*!
+ * @brief Initialize board specific Watchdog settings
+ *
+ * This function initializes the board specific Watchdog settings and then
+ * calls the Watchdog_init API to initialize the Watchdog module.
+ *
+ * The Watchdog peripherals controlled by the Watchdog module are determined
+ * by the Watchdog_config variable.
+ */
+extern void MSP_I3MSP432P401R_initWatchdog(void);
+
+/*!
+ * @brief Initialize board specific WiFi settings
+ *
+ * This function initializes the board specific WiFi settings and then calls
+ * the WiFi_init API to initialize the WiFi module.
+ *
+ * The hardware resources controlled by the WiFi module are determined by the
+ * WiFi_config variable.
+ *
+ * A SimpleLink CC3100 device or module is required and must be connected to
+ * use the WiFi driver.
+ */
+extern void MSP_I3MSP432P401R_initWiFi(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MSP_I3MSP432P401R_H */
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * ======== empty_min.c ========
+ */
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/runtime/System.h>
+#include <xdc/runtime/Error.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/knl/Clock.h>
+#include <ti/sysbios/knl/Semaphore.h>
+#include <ti/sysbios/knl/Event.h>
+
+/* TI-RTOS Header files */
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/PIN.h>
+ #include <ti/drivers/SPI.h>
+#include <ti/drivers/UART.h>
+// #include <ti/drivers/Watchdog.h>
+
+/* Board Header files */
+#include "Board.h"
+
+#include "uart_printf.h"
+
+#define TASKSTACKSIZE (1024)
+
+Task_Struct task0Struct;
+Char task0Stack[TASKSTACKSIZE];
+
+Task_Struct task1Struct;
+Char task1Stack[TASKSTACKSIZE];
+
+Task_Struct task2Struct;
+Char task2Stack[TASKSTACKSIZE];
+
+#define OPT3001
+#define HDC1080
+#define BMP280
+#define TMP007
+
+#undef MPU9250
+#undef LISHH12
+
+
+/* Semaphore */
+Semaphore_Struct semStruct;
+Semaphore_Handle semHandle;
+
+
+Event_Handle myEvent;
+Error_Block eb;
+
+
+
+void buttonCallbackFxn(unsigned int pinId) {
+
+ Semaphore_post(semHandle);
+
+}
+
+
+Void uartFxn(UArg arg0, UArg arg1)
+{
+ char input;
+
+ while (1) {
+ // Blocking Read
+ input=uart_getch();
+ if(input=='g')
+ Semaphore_post(semHandle);
+
+ Task_sleep((UInt)arg0);
+ }
+
+}
+
+const uint8_t m25p40_id[5]={0x00,0x20,0x71,0x15,0x10};
+
+Void taskFxn(UArg arg0, UArg arg1)
+{
+
+ int i;
+
+ uint8_t rxBufferPointer[4];
+ uint8_t txBufferPointer[4];
+
+ SPI_Handle spi;
+ SPI_Params spiParams;
+ SPI_Transaction spiTransaction;
+
+ SPI_Params_init(&spiParams);
+ // Slave mode
+ spiParams.mode = SPI_MASTER;
+ spiParams.bitRate = 500000;
+
+ spiParams.frameFormat = SPI_POL1_PHA1;
+
+ int flagerr=0;
+
+ spi=SPI_open(Board_SPI2,&spiParams);
+ if(!spi){
+ System_printf("SPI did not open");
+ }
+ System_printf("SPI Init Done\r\n");
+
+ GPIO_write(Board_LED0, 1);
+ GPIO_write(Board_LED1, 1);
+
+ System_printf("Press button:\r\n");
+ Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
+
+ /* Start test */
+ GPIO_write(Board_LED0, 0);
+ GPIO_write(Board_LED1, 0);
+
+ GPIO_write(Board_SPI2_CS, 0);
+
+ /* M25P40 Read Id Command */
+ txBufferPointer[0]=0x9E;
+
+ spiTransaction.rxBuf = rxBufferPointer;
+ spiTransaction.txBuf = txBufferPointer;
+ spiTransaction.count = 5;
+
+ /* Write Transaction */
+ if (SPI_transfer(spi,&spiTransaction)) {
+ System_printf("M25P40-RegID:");
+ for(i=1;i<5;i++){
+ System_printf(" %x",rxBufferPointer[i]);
+ if(m25p40_id[i]!=rxBufferPointer[i]){
+ Event_post(myEvent, Event_Id_00);
+ flagerr=1;
+ }
+ }
+ System_printf("\r\n");
+ }
+ else{
+ System_printf("SPI Transaction Failed\r\n");
+ Event_post(myEvent, Event_Id_00);
+ flagerr=1;
+ }
+ Task_sleep(10);
+
+ GPIO_write(Board_SPI2_CS, 1);
+
+ /* OK! */
+ if(flagerr==0){
+ Event_post(myEvent, Event_Id_01);
+ System_printf("***\r\n");
+ System_flush();
+ }else{
+ System_printf("KO!\r\n");
+ System_flush();
+ }
+
+ Task_sleep((UInt)arg0);
+
+ /* Deinitialized I2C */
+ SPI_close(spi);
+}
+
+/*
+ * ======== heartBeatFxn ========
+ * Toggle the Board_LED0. The Task_sleep is determined by arg0 which
+ * is configured for the heartBeat Task instance.
+ */
+Void heartBeatFxn(UArg arg0, UArg arg1)
+{
+
+ UInt events;
+
+ events=Event_pend(myEvent,Event_Id_NONE,Event_Id_00+Event_Id_01,BIOS_WAIT_FOREVER);
+
+ if(events & Event_Id_00){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED0);
+ }
+ }
+
+ if(events & Event_Id_01){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED1);
+ }
+ }
+}
+
+
+
+/*
+ * ======== main ========
+ */
+
+
+int main(void)
+{
+ Task_Params taskParams;
+
+ Semaphore_Params semParams;
+
+
+ /* Call board init functions */
+ Board_initGPIO();
+ Board_initGeneral();
+ //Board_initI2C();
+ Board_initSPI();
+ Board_initUART();
+ // Board_initWatchdog();
+
+ /* Default instance configuration params */
+ Error_init(&eb);
+ myEvent = Event_create(NULL,&eb);
+ if (myEvent == NULL) {
+ System_abort("Event create failed");
+ }
+
+
+ UART_Params uartParams;
+ UART_Params_init(&uartParams);
+ uartParams.baudRate = 115200;
+ uartParams.readEcho = UART_ECHO_OFF;
+ UartPrintf_init(UART_open(Board_UART, &uartParams));
+
+ /* Construct Test Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task1Stack;
+ Task_construct(&task1Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);
+
+
+ /* Construct heartBeat Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task0Stack;
+ Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
+
+ /* Construct Uart Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task2Stack;
+ Task_construct(&task2Struct, (Task_FuncPtr)uartFxn, &taskParams, NULL);
+
+
+ /* Construct Semaphore and Obtain instance handle */
+ Semaphore_Params_init(&semParams);
+ Semaphore_construct(&semStruct,0, &semParams);
+ semHandle = Semaphore_handle(&semStruct);
+
+
+ /* Setup callback for button pins */
+ GPIO_setCallback(Board_BUTTON0,buttonCallbackFxn);
+ GPIO_enableInt(Board_BUTTON0);
+
+ /* Setup callback for button pins */
+ GPIO_write(Board_LED0, 0);
+ GPIO_write(Board_LED1, 0);
+ GPIO_write(Board_SPI1_CS, 1);
+
+ /* Start BIOS */
+ BIOS_start();
+
+ return (0);
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/uart_printf.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/uart_printf.c
--- /dev/null
@@ -0,0 +1,189 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <Board.h>\r
+#include <ti/drivers/UART.h>\r
+//#include <ti/drivers/uart/UARTCC26XX.h>\r
+#include <stdint.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+#define UART_PRINTF_BUF_LEN 1024\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * LOCAL VARIABLES\r
+ */\r
+static uint8_t uartPrintf_outArray[UART_PRINTF_BUF_LEN];\r
+static uint16_t uartPrintf_head = 0;\r
+static uint16_t uartPrintf_tail = 0;\r
+static UART_Handle hUart = NULL;\r
+\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle)\r
+{\r
+ hUart = handle;\r
+}\r
+\r
+/*********************************************************************\r
+ * SYSTEM HOOK FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_putch\r
+ *\r
+ * @brief User supplied PutChar function.\r
+ * typedef Void (*SysCallback_PutchFxn)(Char);\r
+ *\r
+ * This function is called whenever the System module needs\r
+ * to output a character.\r
+ *\r
+ * This implementation fills a very basic ring-buffer, and relies\r
+ * on another function to flush this buffer out to UART.\r
+ *\r
+ * Requires SysCallback to be the system provider module.\r
+ * Initialized via SysCallback.putchFxn = "&uartPrintf_putch"; in the\r
+ * TI-RTOS configuration script.\r
+ *\r
+ * @param ch - Character\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_head is incremented by one with wrap at UART_PRINTF_BUF_LEN\r
+ * if there is room.\r
+ */\r
+void uartPrintf_putch(char ch)\r
+{\r
+ // uartPrintf_tail should never catch up with uartPrintf_head. Discard in-between bytes.\r
+ if ( (uartPrintf_head + 1) % UART_PRINTF_BUF_LEN == uartPrintf_tail )\r
+ return;\r
+\r
+ uartPrintf_outArray[uartPrintf_head] = ch;\r
+ uartPrintf_head++;\r
+\r
+ if (uartPrintf_head >= UART_PRINTF_BUF_LEN)\r
+ uartPrintf_head = 0;\r
+}\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_flush\r
+ *\r
+ * @brief Printf-buffer flush function\r
+ *\r
+ * In this implementation it is intended to be called by the\r
+ * Idle task when nothing else is running.\r
+ *\r
+ * This is achieved by setting up the Idle task in the TI-RTOS\r
+ * configuration script like so:\r
+ *\r
+ * var Idle = xdc.useModule('ti.sysbios.knl.Idle');\r
+ * Idle.addFunc('&uartPrintf_flush');\r
+ *\r
+ * @param None. Relies on global state.\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_tail is incremented to where uartPrintf_head\r
+ * was at the time the function was called.\r
+ */\r
+void uartPrintf_flush()\r
+{\r
+ // Abort in case UART hasn't been initialized.\r
+ if (NULL == hUart)\r
+ return;\r
+\r
+ // Lock head position to avoid race conditions\r
+ uint16_t curHead = uartPrintf_head;\r
+\r
+ // Find out how much data must be output, and how to output it.\r
+ int needWrap = curHead < uartPrintf_tail;\r
+\r
+ uint16_t outLen = needWrap?(UART_PRINTF_BUF_LEN-uartPrintf_tail+curHead):(curHead-uartPrintf_tail);\r
+\r
+ if (outLen)\r
+ {\r
+ if (needWrap)\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], UART_PRINTF_BUF_LEN - uartPrintf_tail);\r
+ UART_write(hUart, uartPrintf_outArray, curHead);\r
+ }\r
+ else\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], outLen);\r
+ }\r
+ }\r
+\r
+ uartPrintf_tail = curHead;\r
+}\r
+\r
+\r
+char uart_getch()\r
+{\r
+ char input;\r
+\r
+ if (NULL == hUart)\r
+ return 0;\r
+\r
+ // Blocking Read\r
+ UART_read(hUart,&input,1);\r
+ return input;\r
+}\r
+\r
+\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/uart_printf.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/uart_printf.h
--- /dev/null
@@ -0,0 +1,82 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+#ifndef UART_PRINTF_H\r
+#define UART_PRINTF_H\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <ti/drivers/UART.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle);\r
+\r
+char uart_getch();\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif // UART_PRINTF_H\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/Board.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/Board.h
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef __BOARD_H
+#define __BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "MSP432P401R_I3M.h"
+
+#define Board_initADC MSP_I3MSP432P401R_initADC
+#define Board_initGeneral MSP_I3MSP432P401R_initGeneral
+#define Board_initGPIO MSP_I3MSP432P401R_initGPIO
+#define Board_initI2C MSP_I3MSP432P401R_initI2C
+#define Board_initPWM MSP_I3MSP432P401R_initPWM
+#define Board_initSDSPI MSP_I3MSP432P401R_initSDSPI
+#define Board_initSPI MSP_I3MSP432P401R_initSPI
+#define Board_initUART MSP_I3MSP432P401R_initUART
+#define Board_initWatchdog MSP_I3MSP432P401R_initWatchdog
+#define Board_initWiFi MSP_I3MSP432P401R_initWiFi
+
+#define Board_ADC0 MSP_I3MSP432P401R_ADC0
+#define Board_ADC1 MSP_I3MSP432P401R_ADC1
+
+#define Board_LED_ON MSP_I3MSP432P401R_LED_ON
+#define Board_LED_OFF MSP_I3MSP432P401R_LED_OFF
+
+#define Board_BUTTON0 MSP_I3MSP432P401R_S1
+#define Board_BUTTON1 MSP_I3MSP432P401R_S2
+#define Board_LED0 MSP_I3MSP432P401R_LED_GREEN
+#define Board_LED1 MSP_I3MSP432P401R_LED_RED
+
+
+#define Board_SPI0_CS MSP_I3MSP432P401R_SPIB0_CS
+#define Board_SPI1_CS MSP_I3MSP432P401R_SPIA1_CS
+#define Board_SPI2_CS MSP_I3MSP432P401R_SPIA2_CS
+
+#define Board_SPI0_IRQ MSP_I3MSP432P401R_SPIB0_IRQ
+#define Board_SPI1_IRQ MSP_I3MSP432P401R_SPIA1_IRQ
+#define Board_SPI2_IRQ MSP_I3MSP432P401R_SPIA2_IRQ
+
+
+
+/*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+
+
+#define Board_I2C0 MSP_I3MSP432P401R_I2CB2
+
+//#define Board_PWM0 MSP_I3MSP432P401R_PWM_TA1_1
+//#define Board_PWM1 MSP_I3MSP432P401R_PWM_TA1_2
+
+//#define Board_SDSPI0 MSP_I3MSP432P401R_SDSPIB0
+
+//#define SPI1_SLAVE_MODE
+#define SPI1_MASTER_MODE
+
+#define Board_SPI0 MSP_I3MSP432P401R_SPIB0
+#define Board_SPI1 MSP_I3MSP432P401R_SPIA1
+#define Board_SPI2 MSP_I3MSP432P401R_SPIA2
+
+#define Board_UART MSP_I3MSP432P401R_UARTA0
+//#define Board_UART0 MSP_I3MSP432P401R_UARTA0
+//#define Board_UART1 MSP_I3MSP432P401R_UARTA2
+
+#define Board_WATCHDOG0 MSP_I3MSP432P401R_WATCHDOG
+
+//#define Board_WIFI MSP_I3MSP432P401R_WIFI
+//#define Board_WIFI_SPI MSP_I3MSP432P401R_SPIB0
+
+/* Board specific I2C addresses */
+#define EEPROM_SLAVE_ADDRESS (0x50)
+
+/* Sensors */
+#define Board_INA219_ADDR (0x41)
+#define Board_HDC1000_ADDR (0x43)
+#define Board_HDC1080_ADDR (0x40)
+#define Board_TMP007_ADDR (0x44)
+#define Board_OPT3001_ADDR (0x45)
+#define Board_MPU9250_ADDR (0x68)
+#define Board_BMP280_ADDR (0x77)
+#define Board_LISHH12_ADDR (0x1E)
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARD_H */
+
+
+
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/I3MSP432P401R.cmd b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/I3MSP432P401R.cmd
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+/*
+ * ======== MSP_EXP432P401R.cmd ========
+ * Define the memory block start/length for the MSP_EXP432P401R M4
+ */
+
+MEMORY
+{
+ MAIN (RX) : origin = 0x00000000, length = 0x00040000
+ INFO (RX) : origin = 0x00200000, length = 0x00004000
+ SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
+ SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
+}
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .text : > MAIN
+ .const : > MAIN
+ .cinit : > MAIN
+ .pinit : > MAIN
+
+#ifdef __TI_COMPILER_VERSION__
+#if __TI_COMPILER_VERSION__ >= 15009000
+ .TI.ramfunc : {} load=MAIN, run=SRAM_CODE, table(BINIT)
+#endif
+#endif
+ .data : > SRAM_DATA
+ .bss : > SRAM_DATA
+ .sysmem : > SRAM_DATA
+ .stack : > SRAM_DATA (HIGH)
+}
+
+/* Symbolic definition of the WDTCTL register for RTS */
+WDTCTL_SYM = 0x4000480C;
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/I3MSP432rtos.cfg b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/I3MSP432rtos.cfg
--- /dev/null
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+
+
+/* ================ Clock configuration ================ */
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+/*
+ * Default value is family dependent. For example, Linux systems often only
+ * support a minimum period of 10000 us and multiples of 10000 us.
+ * TI platforms have a default of 1000 us.
+ */
+Clock.tickPeriod = 1000;
+
+
+
+/* ================ Defaults (module) configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+/*
+ * A flag to allow module names to be loaded on the target. Module name
+ * strings are placed in the .const section for debugging purposes.
+ *
+ * Pick one:
+ * - true (default)
+ * Setting this parameter to true will include name strings in the .const
+ * section so that Errors and Asserts are easier to debug.
+ * - false
+ * Setting this parameter to false will reduce footprint in the .const
+ * section. As a result, Error and Assert messages will contain an
+ * "unknown module" prefix instead of the actual module name.
+ */
+Defaults.common$.namedModule = true;
+//Defaults.common$.namedModule = false;
+
+
+
+/* ================ Error configuration ================ */
+var Error = xdc.useModule('xdc.runtime.Error');
+/*
+ * This function is called to handle all raised errors, but unlike
+ * Error.raiseHook, this function is responsible for completely handling the
+ * error with an appropriately initialized Error_Block.
+ *
+ * Pick one:
+ * - Error.policyDefault (default)
+ * Calls Error.raiseHook with an initialized Error_Block structure and logs
+ * the error using the module's logger.
+ * - Error.policySpin
+ * Simple alternative that traps on a while(1) loop for minimized target
+ * footprint.
+ * Using Error.policySpin, the Error.raiseHook will NOT called.
+ */
+Error.policyFxn = Error.policyDefault;
+//Error.policyFxn = Error.policySpin;
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this function is called
+ * whenever an error is raised by the Error module.
+ *
+ * Pick one:
+ * - Error.print (default)
+ * Errors are formatted and output via System_printf() for easier
+ * debugging.
+ * - null
+ * Errors are not formatted or logged. This option reduces code footprint.
+ * - non-null function
+ * Errors invoke custom user function. See the Error module documentation
+ * for more details.
+ */
+Error.raiseHook = Error.print;
+//Error.raiseHook = null;
+//Error.raiseHook = "&myErrorFxn";
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this option applies to the
+ * maximum number of times the Error.raiseHook function can be recursively
+ * invoked. This option limits the possibility of an infinite recursion that
+ * could lead to a stack overflow.
+ * The default value is 16.
+ */
+Error.maxDepth = 2;
+
+
+
+/* ================ Hwi configuration ================ */
+var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
+/*
+ * Checks for Hwi (system) stack overruns while in the Idle loop.
+ *
+ * Pick one:
+ * - true (default)
+ * Checks the top word for system stack overflows during the idle loop and
+ * raises an Error if one is detected.
+ * - false
+ * Disabling the runtime check improves runtime performance and yields a
+ * reduced flash footprint.
+ */
+halHwi.checkStackFlag = true;
+//halHwi.checkStackFlag = false;
+
+/*
+ * The following options alter the system's behavior when a hardware exception
+ * is detected.
+ *
+ * Pick one:
+ * - Hwi.enableException = true
+ * This option causes the default m3Hwi.excHandlerFunc function to fully
+ * decode an exception and dump the registers to the system console.
+ * This option raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.enableException = false
+ * This option reduces code footprint by not decoding or printing the
+ * exception to the system console.
+ * It however still raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.excHandlerFunc = null
+ * This is the most aggressive option for code footprint savings; but it
+ * can difficult to debug exceptions. It reduces flash footprint by
+ * plugging in a default while(1) trap when exception occur. This option
+ * does not raise an error with the Error module.
+ */
+m3Hwi.enableException = true;
+//m3Hwi.enableException = false;
+//m3Hwi.excHandlerFunc = null;
+
+/*
+ * Enable hardware exception generation when dividing by zero.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions when dividing by zero
+ * - 1
+ * Enables hardware exceptions when dividing by zero
+ */
+m3Hwi.nvicCCR.DIV_0_TRP = 0;
+//m3Hwi.nvicCCR.DIV_0_TRP = 1;
+
+/*
+ * Enable hardware exception generation for invalid data alignment.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions for data alignment
+ * - 1
+ * Enables hardware exceptions for data alignment
+ */
+m3Hwi.nvicCCR.UNALIGN_TRP = 0;
+//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
+
+
+
+/* ================ Idle configuration ================ */
+var Idle = xdc.useModule('ti.sysbios.knl.Idle');
+/*
+ * The Idle module is used to specify a list of functions to be called when no
+ * other tasks are running in the system.
+ *
+ * Functions added here will be run continuously within the idle task.
+ *
+ * Function signature:
+ * Void func(Void);
+ */
+//Idle.addFunc("&myIdleFunc");
+Idle.addFunc('&uartPrintf_flush'); // BMH flushing function.
+
+
+/* ================ Kernel (SYS/BIOS) configuration ================ */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Enable asserts in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables asserts for debugging purposes.
+ * - false
+ * Disables asserts for a reduced code footprint and better performance.
+ */
+BIOS.assertsEnabled = true;
+//BIOS.assertsEnabled = false;
+
+/*
+ * Specify default heap size for BIOS.
+ */
+BIOS.heapSize = 1024;
+
+/*
+ * A flag to determine if xdc.runtime sources are to be included in a custom
+ * built BIOS library.
+ *
+ * Pick one:
+ * - false (default)
+ * The pre-built xdc.runtime library is provided by the respective target
+ * used to build the application.
+ * - true
+ * xdc.runtime library sources are to be included in the custom BIOS
+ * library. This option yields the most efficient library in both code
+ * footprint and runtime performance.
+ */
+BIOS.includeXdcRuntime = false;
+//BIOS.includeXdcRuntime = true;
+
+/*
+ * The SYS/BIOS runtime is provided in the form of a library that is linked
+ * with the application. Several forms of this library are provided with the
+ * SYS/BIOS product.
+ *
+ * Pick one:
+ * - BIOS.LibType_Custom
+ * Custom built library that is highly optimized for code footprint and
+ * runtime performance.
+ * - BIOS.LibType_Debug
+ * Custom built library that is non-optimized that can be used to
+ * single-step through APIs with a debugger.
+ *
+ */
+BIOS.libType = BIOS.LibType_Custom;
+//BIOS.libType = BIOS.LibType_Debug;
+
+/*
+ * Runtime instance creation enable flag.
+ *
+ * Pick one:
+ * - true (default)
+ * Allows Mod_create() and Mod_delete() to be called at runtime which
+ * requires a default heap for dynamic memory allocation.
+ * - false
+ * Reduces code footprint by disallowing Mod_create() and Mod_delete() to
+ * be called at runtime. Object instances are constructed via
+ * Mod_construct() and destructed via Mod_destruct().
+ */
+BIOS.runtimeCreatesEnabled = true;
+//BIOS.runtimeCreatesEnabled = false;
+
+/*
+ * Enable logs in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables logs for debugging purposes.
+ * - false
+ * Disables logging for reduced code footprint and improved runtime
+ * performance.
+ */
+//BIOS.logsEnabled = true;
+BIOS.logsEnabled = false;
+
+
+
+/* ================ Memory configuration ================ */
+var Memory = xdc.useModule('xdc.runtime.Memory');
+/*
+ * The Memory module itself simply provides a common interface for any
+ * variety of system and application specific memory management policies
+ * implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
+ */
+
+
+
+/* ================ Program configuration ================ */
+/*
+ * Program.stack is ignored with IAR. Use the project options in
+ * IAR Embedded Workbench to alter the system stack size.
+ */
+if (!Program.build.target.$name.match(/iar/)) {
+ /*
+ * Reducing the system stack size (used by ISRs and Swis) to reduce
+ * RAM usage.
+ */
+ Program.stack = 768;
+}
+
+
+
+/*
+ * Uncomment to enable Semihosting for GNU targets to print to the CCS console.
+ * Please read the following TIRTOS Wiki page for more information on Semihosting:
+ * http://processors.wiki.ti.com/index.php/TI-RTOS_Examples_SemiHosting
+ */
+
+if (Program.build.target.$name.match(/gnu/)) {
+ //var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+}
+/* ================ Semaphore configuration ================ */
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+/*
+ * Enables global support for Task priority pend queuing.
+ *
+ * Pick one:
+ * - true (default)
+ * This allows pending tasks to be serviced based on their task priority.
+ * - false
+ * Pending tasks are services based on first in, first out basis.
+ *
+ * When using BIOS in ROM:
+ * This option must be set to false.
+ */
+//Semaphore.supportsPriority = true;
+Semaphore.supportsPriority = false;
+
+/*
+ * Allows for the implicit posting of events through the semaphore,
+ * disable for additional code saving.
+ *
+ * Pick one:
+ * - true
+ * This allows the Semaphore module to post semaphores and events
+ * simultaneously.
+ * - false (default)
+ * Events must be explicitly posted to unblock tasks.
+ *
+ */
+Semaphore.supportsEvents = true;
+//Semaphore.supportsEvents = false;
+
+
+
+/* ================ Swi configuration ================ */
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+/*
+ * A software interrupt is an object that encapsulates a function to be
+ * executed and a priority. Software interrupts are prioritized, preempt tasks
+ * and are preempted by hardware interrupt service routines.
+ *
+ * This module is included to allow Swi's in a users' application.
+ */
+
+
+
+/* ================ System configuration ================ */
+var System = xdc.useModule('xdc.runtime.System');
+/*
+ * The Abort handler is called when the system exits abnormally.
+ *
+ * Pick one:
+ * - System.abortStd (default)
+ * Call the ANSI C Standard 'abort()' to terminate the application.
+ * - System.abortSpin
+ * A lightweight abort function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom abort handler
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.abortFxn = System.abortStd;
+//System.abortFxn = System.abortSpin;
+//System.abortFxn = "&myAbortSystem";
+
+/*
+ * The Exit handler is called when the system exits normally.
+ *
+ * Pick one:
+ * - System.exitStd (default)
+ * Call the ANSI C Standard 'exit()' to terminate the application.
+ * - System.exitSpin
+ * A lightweight exit function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom exit function
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.exitFxn = System.exitStd;
+//System.exitFxn = System.exitSpin;
+//System.exitFxn = "&myExitSystem";
+
+/*
+ * Minimize exit handler array in the System module. The System module includes
+ * an array of functions that are registered with System_atexit() which is
+ * called by System_exit(). The default value is 8.
+ */
+System.maxAtexitHandlers = 2;
+
+/*
+ * The System.SupportProxy defines a low-level implementation of System
+ * functions such as System_printf(), System_flush(), etc.
+ *
+ * Pick one pair:
+ * - SysMin
+ * This module maintains an internal configurable circular buffer that
+ * stores the output until System_flush() is called.
+ * The size of the circular buffer is set via SysMin.bufSize.
+ * - SysCallback
+ * SysCallback allows for user-defined implementations for System APIs.
+ * The SysCallback support proxy has a smaller code footprint and can be
+ * used to supply custom System_printf services.
+ * The default SysCallback functions point to stub functions. See the
+ * SysCallback module's documentation.
+ */
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+SysMin.bufSize = 128;
+
+// BMH System.SupportProxy = SysMin;
+
+var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
+System.SupportProxy = SysCallback;
+SysCallback.putchFxn = "&uartPrintf_putch"; // BMH Modified
+
+//SysCallback.abortFxn = "&myUserAbort";
+//SysCallback.exitFxn = "&myUserExit";
+//SysCallback.flushFxn = "&myUserFlush";
+//SysCallback.readyFxn = "&myUserReady";
+
+
+
+
+/* ================ Task configuration ================ */
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+/*
+ * Check task stacks for overflow conditions.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables runtime checks for task stack overflow conditions during
+ * context switching ("from" and "to")
+ * - false
+ * Disables runtime checks for task stack overflow conditions.
+ */
+Task.checkStackFlag = true;
+//Task.checkStackFlag = false;
+
+/*
+ * Set the default task stack size when creating tasks.
+ *
+ * The default is dependent on the device being used. Reducing the default stack
+ * size yields greater memory savings.
+ */
+Task.defaultStackSize = 512;
+
+/*
+ * Enables the idle task.
+ *
+ * Pick one:
+ * - true (default)
+ * Creates a task with priority of 0 which calls idle hook functions. This
+ * option must be set to true to gain power savings provided by the Power
+ * module.
+ * - false
+ * No idle task is created. This option consumes less memory as no
+ * additional default task stack is needed.
+ * To gain power savings by the Power module without having the idle task,
+ * add Idle.run as the Task.allBlockedFunc.
+ */
+Task.enableIdleTask = true;
+//Task.enableIdleTask = false;
+//Task.allBlockedFunc = Idle.run;
+
+/*
+ * If Task.enableIdleTask is set to true, this option sets the idle task's
+ * stack size.
+ *
+ * Reducing the idle stack size yields greater memory savings.
+ */
+Task.idleTaskStackSize = 512;
+
+/*
+ * Reduce the number of task priorities.
+ * The default is 16.
+ * Decreasing the number of task priorities yield memory savings.
+ */
+Task.numPriorities = 16;
+
+
+
+/* ================ Text configuration ================ */
+var Text = xdc.useModule('xdc.runtime.Text');
+/*
+ * These strings are placed in the .const section. Setting this parameter to
+ * false will save space in the .const section. Error, Assert and Log messages
+ * will print raw ids and args instead of a formatted message.
+ *
+ * Pick one:
+ * - true (default)
+ * This option loads test string into the .const for easier debugging.
+ * - false
+ * This option reduces the .const footprint.
+ */
+Text.isLoaded = true;
+//Text.isLoaded = false;
+
+
+
+/* ================ Types configuration ================ */
+var Types = xdc.useModule('xdc.runtime.Types');
+/*
+ * This module defines basic constants and types used throughout the
+ * xdc.runtime package.
+ */
+
+
+
+/* ================ TI-RTOS middleware configuration ================ */
+var mwConfig = xdc.useModule('ti.mw.Config');
+/*
+ * Include TI-RTOS middleware libraries
+ */
+
+
+
+/* ================ TI-RTOS drivers' configuration ================ */
+var driversConfig = xdc.useModule('ti.drivers.Config');
+/*
+ * Include TI-RTOS drivers
+ *
+ * Pick one:
+ * - driversConfig.LibType_NonInstrumented (default)
+ * Use TI-RTOS drivers library optimized for footprint and performance
+ * without asserts or logs.
+ * - driversConfig.LibType_Instrumented
+ * Use TI-RTOS drivers library for debugging with asserts and logs enabled.
+ */
+driversConfig.libType = driversConfig.LibType_NonInstrumented;
+//driversConfig.libType = driversConfig.LibType_Instrumented;
+
+
+
+/* ================ Application Specific Instances ================ */
\ No newline at end of file
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/MSP432P401R_I3M.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/MSP432P401R_I3M.c
--- /dev/null
@@ -0,0 +1,758 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * ======== MSP_I3MSP432P401R.c ========
+ * This file is responsible for setting up the board specific items for the
+ * MSP_I3MSP432P401R board.
+ */
+
+#include <stdbool.h>
+
+#include <ti/drivers/Power.h>
+#include <ti/drivers/power/PowerMSP432.h>
+
+#include <msp.h>
+#include <rom.h>
+#include <rom_map.h>
+#include <dma.h>
+#include <gpio.h>
+#include <i2c.h>
+#include <pmap.h>
+#include <spi.h>
+#include <timer_a.h>
+#include <uart.h>
+#include <wdt_a.h>
+#include <adc14.h>
+#include <ref_a.h>
+#include <interrupt.h>
+
+#include <MSP432P401R_I3M.h>
+
+/*
+ * =============================== ADC ===============================
+ */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(ADC_config, ".const:ADC_config")
+#pragma DATA_SECTION(adcMSP432HWAttrs, ".const:adcMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/ADC.h>
+#include <ti/drivers/adc/ADCMSP432.h>
+
+/* ADC objects */
+ADCMSP432_Object adcMSP432Objects[MSP_I3MSP432P401R_ADCCOUNT];
+
+/* ADC configuration structure */
+const ADCMSP432_HWAttrs adcMSP432HWAttrs[MSP_I3MSP432P401R_ADCCOUNT] = {
+ {
+ .channel = ADC_INPUT_A0,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN5,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF2_5V,
+ .resolution = ADC_14BIT
+ },
+ {
+ .channel = ADC_INPUT_A1,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN4,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF1_45V,
+ .resolution = ADC_8BIT
+ }
+};
+
+const ADC_Config ADC_config[] = {
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[0],
+ .hwAttrs = &adcMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[1],
+ .hwAttrs = &adcMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+void MSP_I3MSP432P401R_initADC(void)
+{
+ ADC_init();
+}
+
+/*
+ * =============================== DMA ===============================
+ */
+
+#include <ti/drivers/dma/UDMAMSP432.h>
+
+
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_ALIGN(dmaControlTable, 256)
+#elif defined(__IAR_SYSTEMS_ICC__)
+#pragma data_alignment=256
+#elif defined(__GNUC__)
+__attribute__ ((aligned (256)))
+#endif
+static DMA_ControlTable dmaControlTable[8];
+
+/*
+ * ======== dmaErrorHwi ========
+ * This is the handler for the uDMA error interrupt.
+ */
+static void dmaErrorHwi(uintptr_t arg)
+{
+ int status = MAP_DMA_getErrorStatus();
+ MAP_DMA_clearErrorStatus();
+
+ /* Suppress unused variable warning */
+ (void)status;
+
+ while (1);
+}
+
+UDMAMSP432_Object udmaMSP432Object;
+
+const UDMAMSP432_HWAttrs udmaMSP432HWAttrs = {
+ .controlBaseAddr = (void *)dmaControlTable,
+ .dmaErrorFxn = (UDMAMSP432_ErrorFxn)dmaErrorHwi,
+ .intNum = INT_DMA_ERR,
+ .intPriority = (~0)
+};
+
+const UDMAMSP432_Config UDMAMSP432_config = {
+ .object = &udmaMSP432Object,
+ .hwAttrs = &udmaMSP432HWAttrs
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGeneral ========
+ */
+void MSP_I3MSP432P401R_initGeneral(void)
+{
+ Power_init();
+}
+
+/*
+ * =============================== GPIO ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(GPIOMSP432_config, ".const:GPIOMSP432_config")
+#endif
+
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/gpio/GPIOMSP432.h>
+
+/*
+ * Array of Pin configurations
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts should be placed at the end of the
+ * array. Callback entries can be omitted from callbacks array to
+ * reduce memory usage.
+ */
+GPIO_PinConfig gpioPinConfigs[] = {
+ /* Input pins */
+ /* MSP_I3MSP432P401R_S1 */
+ GPIOMSP432_P6_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+
+ /* Output pins */
+ /* MSP_I3MSP432P401R_SPI1_IRQ */
+ GPIOMSP432_P4_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI1_CS */
+ GPIOMSP432_P2_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI2_CS */
+ GPIOMSP432_P3_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ /* MSP_I3MSP432P401R_LED_GREEN */
+ GPIOMSP432_P6_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_LED_RED */
+ GPIOMSP432_P6_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
+
+};
+
+/*
+ * Array of callback function pointers
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts can be omitted from callbacks array to
+ * reduce memory usage (if placed at end of gpioPinConfigs array).
+ */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+ /* MSP_I3MSP432P401R_S1 */
+ NULL,
+ /* MSP_I3MSP432P401R_S2 */
+ NULL
+};
+
+const GPIOMSP432_Config GPIOMSP432_config = {
+ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
+ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
+ .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
+ .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
+ .intPriority = (~0)
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGPIO ========
+ */
+void MSP_I3MSP432P401R_initGPIO(void)
+{
+ /* Initialize peripheral and pins */
+ GPIO_init();
+}
+
+/*
+ * =============================== I2C ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
+#pragma DATA_SECTION(i2cMSP432HWAttrs, ".const:i2cMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/i2c/I2CMSP432.h>
+
+I2CMSP432_Object i2cMSP432Objects[MSP_I3MSP432P401R_I2CCOUNT];
+
+const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_I3MSP432P401R_I2CCOUNT] = {
+ {
+ .baseAddr = EUSCI_B2_BASE,
+ .intNum = INT_EUSCIB2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK
+ }
+};
+
+const I2C_Config I2C_config[] = {
+ {
+ .fxnTablePtr = &I2CMSP432_fxnTable,
+ .object = &i2cMSP432Objects[0],
+ .hwAttrs = &i2cMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initI2C ========
+ */
+void MSP_I3MSP432P401R_initI2C(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+ /* Configure Pins 1.6 & 1.7 as SDA & SCL, respectively. */
+ // BMH MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ // BMH GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+ /* Initialize the I2C driver */
+ I2C_init();
+}
+
+/*
+ * =============================== Power ===============================
+ */
+const PowerMSP432_ConfigV1 PowerMSP432_config = {
+ .policyInitFxn = &PowerMSP432_initPolicy,
+ .policyFxn = &PowerMSP432_sleepPolicy,
+ .initialPerfLevel = 2,
+ .enablePolicy = true,
+ .enablePerf = true,
+ .enableParking = true
+};
+
+/*
+ * =============================== PWM ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
+#pragma DATA_SECTION(pwmTimerMSP432HWAttrs, ".const:pwmTimerMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/PWM.h>
+#include <ti/drivers/pwm/PWMTimerMSP432.h>
+
+PWMTimerMSP432_Object pwmTimerMSP432Objects[MSP_I3MSP432P401R_PWMCOUNT];
+
+const PWMTimerMSP432_HWAttrsV1 pwmTimerMSP432HWAttrs[MSP_I3MSP432P401R_PWMCOUNT] = {
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN1,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ },
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN2,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ }
+};
+
+const PWM_Config PWM_config[] = {
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[0],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[1],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initPWM ========
+ */
+void MSP_I3MSP432P401R_initPWM(void)
+{
+ /* Use Port Map on Port2 get Timer outputs on pins with LEDs (2.1, 2.2) */
+ const uint8_t portMap [] = {
+ PM_NONE, PM_TA1CCR1A, PM_TA1CCR2A, PM_NONE,
+ PM_NONE, PM_NONE, PM_NONE, PM_NONE
+ };
+
+ /* Mapping capture compare registers to Port 2 */
+ MAP_PMAP_configurePorts((const uint8_t *) portMap, PMAP_P2MAP, 1,
+ PMAP_DISABLE_RECONFIGURATION);
+
+ PWM_init();
+}
+
+/*
+ * =============================== SDSPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if 0
+ #if defined(__TI_COMPILER_VERSION__)
+ #pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
+ #pragma DATA_SECTION(sdspiMSP432HWAttrs, ".const:sdspiMSP432HWAttrs")
+ #endif
+
+ #include <ti/drivers/SDSPI.h>
+ #include <ti/drivers/sdspi/SDSPIMSP432.h>
+
+ SDSPIMSP432_Object sdspiMSP432Objects[MSP_I3MSP432P401R_SDSPICOUNT];
+
+ const SDSPIMSP432_HWAttrs sdspiMSP432HWAttrs[MSP_I3MSP432P401R_SDSPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ /* CLK, MOSI & MISO ports & pins */
+ .portSCK = GPIO_PORT_P1,
+ .pinSCK = GPIO_PIN5,
+ .sckMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMISO = GPIO_PORT_P1,
+ .pinMISO = GPIO_PIN7,
+ .misoMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMOSI = GPIO_PORT_P1,
+ .pinMOSI = GPIO_PIN6,
+ .mosiMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ /* Chip select port & pin */
+ .portCS = GPIO_PORT_P4,
+ .pinCS = GPIO_PIN6
+ }
+ };
+
+ const SDSPI_Config SDSPI_config[] = {
+ {
+ .fxnTablePtr = &SDSPIMSP432_fxnTable,
+ .object = &sdspiMSP432Objects[0],
+ .hwAttrs = &sdspiMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+ };
+#endif
+
+/*
+ * ======== MSP_I3MSP432P401R_initSDSPI ========
+ */
+#if 0
+
+ void MSP_I3MSP432P401R_initSDSPI(void)
+ {
+ SDSPI_init();
+ }
+
+#endif
+
+/*
+ * =============================== SPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
+#pragma DATA_SECTION(spiMSP432DMAHWAttrs, ".const:spiMSP432DMAHWAttrs")
+#endif
+
+#include <ti/drivers/SPI.h>
+#include <ti/drivers/spi/SPIMSP432DMA.h>
+
+SPIMSP432DMA_Object spiMSP432DMAObjects[MSP_I3MSP432P401R_SPICOUNT];
+
+const SPIMSP432DMA_HWAttrs spiMSP432DMAHWAttrs[MSP_I3MSP432P401R_SPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT0,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH1_EUSCIB0RX0,
+ .txDMAChannelIndex = DMA_CH0_EUSCIB0TX0
+ },
+ {
+ .baseAddr = EUSCI_A1_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT1,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH3_EUSCIA1RX,
+ .txDMAChannelIndex = DMA_CH2_EUSCIA1TX
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT2,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH5_EUSCIA2RX,
+ .txDMAChannelIndex = DMA_CH4_EUSCIA2TX
+ }
+
+};
+
+const SPI_Config SPI_config[] = {
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[0],
+ .hwAttrs = &spiMSP432DMAHWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[1],
+ .hwAttrs = &spiMSP432DMAHWAttrs[1]
+ },
+
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[2],
+ .hwAttrs = &spiMSP432DMAHWAttrs[2]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initSPI ========
+ */
+void MSP_I3MSP432P401R_initSPI(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+/* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A1)*/
+#if 0
+ #warning SPI_SLAVE_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2,
+ GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+#if 1
+ #warning SPI_MASTER_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A2) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ SPI_init();
+}
+
+/*
+ * =============================== UART ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(UART_config, ".const:UART_config")
+#pragma DATA_SECTION(uartMSP432HWAttrs, ".const:uartMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/UART.h>
+#include <ti/drivers/uart/UARTMSP432.h>
+
+UARTMSP432_Object uartMSP432Objects[MSP_I3MSP432P401R_UARTCOUNT];
+unsigned char uartMSP432RingBuffer[MSP_I3MSP432P401R_UARTCOUNT][32];
+
+/*
+ * The baudrate dividers were determined by using the MSP430 baudrate
+ * calculator
+ * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
+ */
+const UARTMSP432_BaudrateConfig uartMSP432Baudrates[] = {
+ /* {baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling} */
+ {
+ .outputBaudrate = 115200,
+ .inputClockFreq = 12000000,
+ .prescalar = 6,
+ .hwRegUCBRFx = 8,
+ .hwRegUCBRSx = 32,
+ .oversampling = 1
+ },
+ {115200, 6000000, 3, 4, 2, 1},
+ {115200, 3000000, 1, 10, 0, 1},
+ {9600, 12000000, 78, 2, 0, 1},
+ {9600, 6000000, 39, 1, 0, 1},
+ {9600, 3000000, 19, 8, 85, 1},
+ {9600, 32768, 3, 0, 146, 0}
+};
+
+const UARTMSP432_HWAttrs uartMSP432HWAttrs[MSP_I3MSP432P401R_UARTCOUNT] = {
+ {
+ .baseAddr = EUSCI_A0_BASE,
+ .intNum = INT_EUSCIA0,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[0],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[0])
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .intNum = INT_EUSCIA2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[1],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[1])
+ }
+};
+
+const UART_Config UART_config[] = {
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[0],
+ .hwAttrs = &uartMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[1],
+ .hwAttrs = &uartMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initUART ========
+ */
+void MSP_I3MSP432P401R_initUART(void)
+{
+ /* Set P1.2 & P1.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Set P3.2 & P3.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Initialize the UART driver */
+ UART_init();
+}
+
+/*
+ * =============================== Watchdog ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
+#pragma DATA_SECTION(watchdogMSP432HWAttrs, ".const:watchdogMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/Watchdog.h>
+#include <ti/drivers/watchdog/WatchdogMSP432.h>
+
+WatchdogMSP432_Object watchdogMSP432Objects[MSP_I3MSP432P401R_WATCHDOGCOUNT];
+
+const WatchdogMSP432_HWAttrs
+ watchdogMSP432HWAttrs[MSP_I3MSP432P401R_WATCHDOGCOUNT] = {
+ {
+ .baseAddr = WDT_A_BASE,
+ .intNum = INT_WDT_A,
+ .intPriority = (~0),
+ .clockSource = WDT_A_CLOCKSOURCE_SMCLK,
+ .clockDivider = WDT_A_CLOCKDIVIDER_8192K
+ },
+};
+
+const Watchdog_Config Watchdog_config[] = {
+ {
+ .fxnTablePtr = &WatchdogMSP432_fxnTable,
+ .object = &watchdogMSP432Objects[0],
+ .hwAttrs = &watchdogMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWatchdog ========
+ */
+void MSP_I3MSP432P401R_initWatchdog(void)
+{
+ /* Initialize the Watchdog driver */
+ Watchdog_init();
+}
+
+/*
+ * =============================== WiFi ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
+#pragma DATA_SECTION(wiFiCC3100HWAttrs, ".const:wiFiCC3100HWAttrs")
+#endif
+
+#include <ti/drivers/WiFi.h>
+#include <ti/drivers/wifi/WiFiCC3100.h>
+
+WiFiCC3100_Object wiFiCC3100Objects[MSP_I3MSP432P401R_WIFICOUNT];
+
+const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[MSP_I3MSP432P401R_WIFICOUNT] = {
+ {
+ .irqPort = GPIO_PORT_P2,
+ .irqPin = GPIO_PIN5,
+ .irqIntNum = INT_PORT2,
+
+ .csPort = GPIO_PORT_P3,
+ .csPin = GPIO_PIN0,
+
+ .enPort = GPIO_PORT_P4,
+ .enPin = GPIO_PIN1
+ }
+};
+
+const WiFi_Config WiFi_config[] = {
+ {
+ .fxnTablePtr = &WiFiCC3100_fxnTable,
+ .object = &wiFiCC3100Objects[0],
+ .hwAttrs = &wiFiCC3100HWAttrs[0]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWiFi ========
+ */
+void MSP_I3MSP432P401R_initWiFi(void)
+{
+ /* Configure EN & CS pins to disable CC3100 */
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P4, GPIO_PIN1);
+ MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN1);
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Configure IRQ pin */
+ MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P2, GPIO_PIN5);
+ MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P2, GPIO_PIN5,
+ GPIO_LOW_TO_HIGH_TRANSITION);
+
+ /* Initialize SPI and WiFi drivers */
+ SPI_init();
+ WiFi_init();
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/MSP432P401R_I3M.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/MSP432P401R_I3M.h
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** ============================================================================
+ * @file MSP_I3MSP432P401R.h
+ *
+ * @brief MSP_I3MSP432P401R Board Specific APIs
+ *
+ * The MSP_I3MSP432P401R header file should be included in an application as
+ * follows:
+ * @code
+ * #include <MSP_I3MSP432P401R.h>
+ * @endcode
+ *
+ * ============================================================================
+ */
+#ifndef __MSP_I3MSP432P401R_H
+#define __MSP_I3MSP432P401R_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LEDs on MSP_I3MSP432P401R are active high. */
+#define MSP_I3MSP432P401R_LED_OFF (0)
+#define MSP_I3MSP432P401R_LED_ON (1)
+
+/*!
+ * @def MSP_I3MSP432P401R_ADCName
+ * @brief Enum of ADC channels on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_ADCName {
+ MSP_I3MSP432P401R_ADC0 = 0,
+ MSP_I3MSP432P401R_ADC1,
+ MSP_I3MSP432P401R_ADCCOUNT
+}MSP_I3MSP432P401R_ADCName;
+
+/*!
+ * @def MSP_I3MSP432P401R_GPIOName
+ * @brief Enum of GPIO names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_GPIOName {
+ MSP_I3MSP432P401R_S1 = 0,
+ MSP_I3MSP432P401R_SPIA1_IRQ,
+ MSP_I3MSP432P401R_SPIA1_CS,
+ MSP_I3MSP432P401R_SPIA2_CS,
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ MSP_I3MSP432P401R_LED_GREEN,
+ MSP_I3MSP432P401R_LED_RED,
+
+ MSP_I3MSP432P401R_GPIOCOUNT
+} MSP_I3MSP432P401R_GPIOName;
+
+/*!
+ * @def MSP_I3MSP432P401R_I2CName
+ * @brief Enum of I2C names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_I2CName {
+ MSP_I3MSP432P401R_I2CB2 = 0,
+ MSP_I3MSP432P401R_I2CCOUNT
+} MSP_I3MSP432P401R_I2CName;
+
+/*!
+ * @def MSP_I3MSP432P401R_PWMName
+ * @brief Enum of PWM names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_PWMName {
+ MSP_I3MSP432P401R_PWM_TA1_1 = 0,
+ MSP_I3MSP432P401R_PWM_TA1_2,
+
+ MSP_I3MSP432P401R_PWMCOUNT
+} MSP_I3MSP432P401R_PWMName;
+
+/*!
+ * @def MSP_I3MSP432P401R_SDSPIName
+ * @brief Enum of SDSPI names on the MSP_I3MSP432P401R dev board
+
+typedef enum MSP_I3MSP432P401R_SDSPIName {
+ MSP_I3MSP432P401R_SDSPIB0 = 0,
+
+ MSP_I3MSP432P401R_SDSPICOUNT
+} EMSP_I3MSP432P401R_SDSPIName;
+*/
+
+/*!
+ * @def MSP_I3MSP432P401R_SPIName
+ * @brief Enum of SPI names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_SPIName {
+ MSP_I3MSP432P401R_SPIB0 = 0,
+ MSP_I3MSP432P401R_SPIA1,
+ MSP_I3MSP432P401R_SPIA2,
+
+ MSP_I3MSP432P401R_SPICOUNT
+} MSP_I3MSP432P401R_SPIName;
+
+/*!
+ * @def MSP_I3MSP432P401R_UARTName
+ * @brief Enum of UART names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_UARTName {
+ MSP_I3MSP432P401R_UARTA0 = 0,
+ MSP_I3MSP432P401R_UARTA2,
+
+ MSP_I3MSP432P401R_UARTCOUNT
+} MSP_I3MSP432P401R_UARTName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WatchdogName
+ * @brief Enum of Watchdog names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WatchdogName {
+ MSP_I3MSP432P401R_WATCHDOG = 0,
+
+ MSP_I3MSP432P401R_WATCHDOGCOUNT
+} MSP_I3MSP432P401R_WatchdogName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WiFiName
+ * @brief Enum of WiFi names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WiFiName {
+ MSP_I3MSP432P401R_WIFI = 0,
+
+ MSP_I3MSP432P401R_WIFICOUNT
+} MSP_I3MSP432P401R_WiFiName;
+
+/*!
+ * @brief Initialize board specific ADC settings
+ *
+ * This function initializes the board specific ADC settings and then calls
+ * the ADC_init API to initialize the ADC module.
+ *
+ * The ADC peripherals controlled by the ADC module are determined by the
+ * ADC_config variable.
+ */
+extern void MSP_I3MSP432P401R_initADC(void);
+
+/*!
+ * @brief Initialize the general board specific settings
+ *
+ * This function initializes the general board specific settings.
+ */
+extern void MSP_I3MSP432P401R_initGeneral(void);
+
+/*!
+ * @brief Initialize board specific GPIO settings
+ *
+ * This function initializes the board specific GPIO settings and
+ * then calls the GPIO_init API to initialize the GPIO module.
+ *
+ * The GPIOs controlled by the GPIO module are determined by the GPIO_PinConfig
+ * variable.
+ */
+extern void MSP_I3MSP432P401R_initGPIO(void);
+
+/*!
+ * @brief Initialize board specific I2C settings
+ *
+ * This function initializes the board specific I2C settings and then calls
+ * the I2C_init API to initialize the I2C module.
+ *
+ * The I2C peripherals controlled by the I2C module are determined by the
+ * I2C_config variable.
+ */
+extern void MSP_I3MSP432P401R_initI2C(void);
+
+/*!
+ * @brief Initialize board specific PWM settings
+ *
+ * This function initializes the board specific PWM settings and then calls
+ * the PWM_init API to initialize the PWM module.
+ *
+ * The PWM peripherals controlled by the PWM module are determined by the
+ * PWM_config variable.
+ */
+extern void MSP_I3MSP432P401R_initPWM(void);
+
+/*!
+ * @brief Initialize board specific SDSPI settings
+ *
+ * This function initializes the board specific SDSPI settings and then calls
+ * the SDSPI_init API to initialize the SDSPI module.
+ *
+ * The SDSPI peripherals controlled by the SDSPI module are determined by the
+ * SDSPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSDSPI(void);
+
+/*!
+ * @brief Initialize board specific SPI settings
+ *
+ * This function initializes the board specific SPI settings and then calls
+ * the SPI_init API to initialize the SPI module.
+ *
+ * The SPI peripherals controlled by the SPI module are determined by the
+ * SPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSPI(void);
+
+/*!
+ * @brief Initialize board specific UART settings
+ *
+ * This function initializes the board specific UART settings and then calls
+ * the UART_init API to initialize the UART module.
+ *
+ * The UART peripherals controlled by the UART module are determined by the
+ * UART_config variable.
+ */
+extern void MSP_I3MSP432P401R_initUART(void);
+
+/*!
+ * @brief Initialize board specific Watchdog settings
+ *
+ * This function initializes the board specific Watchdog settings and then
+ * calls the Watchdog_init API to initialize the Watchdog module.
+ *
+ * The Watchdog peripherals controlled by the Watchdog module are determined
+ * by the Watchdog_config variable.
+ */
+extern void MSP_I3MSP432P401R_initWatchdog(void);
+
+/*!
+ * @brief Initialize board specific WiFi settings
+ *
+ * This function initializes the board specific WiFi settings and then calls
+ * the WiFi_init API to initialize the WiFi module.
+ *
+ * The hardware resources controlled by the WiFi module are determined by the
+ * WiFi_config variable.
+ *
+ * A SimpleLink CC3100 device or module is required and must be connected to
+ * use the WiFi driver.
+ */
+extern void MSP_I3MSP432P401R_initWiFi(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MSP_I3MSP432P401R_H */
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/main.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/main.c
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * ======== empty_min.c ========
+ */
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/runtime/System.h>
+#include <xdc/runtime/Error.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/knl/Clock.h>
+#include <ti/sysbios/knl/Semaphore.h>
+#include <ti/sysbios/knl/Event.h>
+
+/* TI-RTOS Header files */
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/PIN.h>
+ #include <ti/drivers/SPI.h>
+#include <ti/drivers/UART.h>
+// #include <ti/drivers/Watchdog.h>
+
+/* Board Header files */
+#include "Board.h"
+
+#include "uart_printf.h"
+
+#define TASKSTACKSIZE (1024)
+
+Task_Struct task0Struct;
+Char task0Stack[TASKSTACKSIZE];
+
+Task_Struct task1Struct;
+Char task1Stack[TASKSTACKSIZE];
+
+Task_Struct task2Struct;
+Char task2Stack[TASKSTACKSIZE];
+
+#define OPT3001
+#define HDC1080
+#define BMP280
+#define TMP007
+
+#undef MPU9250
+#undef LISHH12
+
+
+/* Semaphore */
+Semaphore_Struct semStruct;
+Semaphore_Handle semHandle;
+
+
+Event_Handle myEvent;
+Error_Block eb;
+
+
+
+void buttonCallbackFxn(unsigned int pinId) {
+
+}
+
+
+uint8_t input;
+
+Void uartFxn(UArg arg0, UArg arg1)
+{
+ while (1) {
+ // Blocking Read
+ input=uart_getch();
+ Semaphore_post(semHandle);
+ Task_sleep((UInt)arg0);
+ }
+}
+
+
+Void taskFxn(UArg arg0, UArg arg1)
+{
+
+ int i;
+
+ uint8_t rxBufferPointer[4];
+ uint8_t txBufferPointer[4];
+
+ SPI_Handle spi;
+ SPI_Params spiParams;
+ SPI_Transaction spiTransaction;
+
+ SPI_Params_init(&spiParams);
+
+ // Master mode
+ spiParams.mode = SPI_MASTER;
+ spiParams.bitRate = 500000;
+ spiParams.frameFormat = SPI_POL1_PHA1;
+
+ spi=SPI_open(Board_SPI1,&spiParams);
+ if(!spi){
+ System_printf("SPI did not open");
+ }
+ System_printf("SPI-Master Open\r\n");
+
+ GPIO_write(Board_LED0, 1);
+ GPIO_write(Board_LED1, 1);
+
+ //System_printf("Press button:\r\n");
+ //Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
+
+ /* Start test */
+ GPIO_write(Board_LED0, 0);
+ GPIO_write(Board_LED1, 0);
+
+ while(1)
+ {
+
+ Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
+
+ txBufferPointer[0]=input;
+
+ spiTransaction.rxBuf = rxBufferPointer;
+ spiTransaction.txBuf = txBufferPointer;
+ spiTransaction.count = 1;
+
+ GPIO_write(Board_SPI1_CS, 0);
+
+ /* Write Transaction */
+ if (SPI_transfer(spi,&spiTransaction)) {
+ //System_printf("TxData: %x\r\n",txBufferPointer[0]);
+ }
+ else{
+ System_printf("SPI Transaction Failed\r\n");
+ Event_post(myEvent, Event_Id_00);
+ }
+ GPIO_write(Board_SPI1_CS, 1);
+ System_flush();
+ Task_sleep(10);
+
+ /* Read Back */
+ GPIO_write(Board_SPI1_CS, 0);
+ Task_sleep(10);
+
+ if (SPI_transfer(spi,&spiTransaction)) {
+ //System_printf("RxData: %x\r\n",rxBufferPointer[0]);
+
+ uartPrintf_putch(rxBufferPointer[0]);
+ if(rxBufferPointer[0]!=txBufferPointer[0]){
+ System_printf("Failed %x %x,\r\n",
+ input,rxBufferPointer[0]);
+ Event_post(myEvent, Event_Id_00);
+ }
+ }
+ else{
+ System_printf("SPI Transaction Failed\r\n");
+ Event_post(myEvent, Event_Id_00);
+ }
+
+ GPIO_write(Board_SPI1_CS, 1);
+ System_flush();
+ Task_sleep(10);
+
+ }
+
+ /* Deinitialized I2C */
+ SPI_close(spi);
+}
+
+/*
+ * ======== heartBeatFxn ========
+ * Toggle the Board_LED0. The Task_sleep is determined by arg0 which
+ * is configured for the heartBeat Task instance.
+ */
+Void heartBeatFxn(UArg arg0, UArg arg1)
+{
+
+ UInt events;
+
+ events=Event_pend(myEvent,Event_Id_NONE,Event_Id_00+Event_Id_01,BIOS_WAIT_FOREVER);
+
+ if(events & Event_Id_00){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED0);
+ }
+ }
+
+ if(events & Event_Id_01){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED1);
+ }
+ }
+}
+
+
+
+/*
+ * ======== main ========
+ */
+
+
+int main(void)
+{
+ Task_Params taskParams;
+
+ Semaphore_Params semParams;
+
+
+ /* Call board init functions */
+ Board_initGPIO();
+ Board_initGeneral();
+ //Board_initI2C();
+ Board_initSPI();
+ Board_initUART();
+ // Board_initWatchdog();
+
+ /* Default instance configuration params */
+ Error_init(&eb);
+ myEvent = Event_create(NULL,&eb);
+ if (myEvent == NULL) {
+ System_abort("Event create failed");
+ }
+
+
+ UART_Params uartParams;
+ UART_Params_init(&uartParams);
+ uartParams.baudRate = 115200;
+ uartParams.readEcho = UART_ECHO_OFF;
+ UartPrintf_init(UART_open(Board_UART, &uartParams));
+
+ /* Construct Test Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task1Stack;
+ Task_construct(&task1Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);
+
+
+ /* Construct heartBeat Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task0Stack;
+ Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
+
+ /* Construct Uart Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task2Stack;
+ Task_construct(&task2Struct, (Task_FuncPtr)uartFxn, &taskParams, NULL);
+
+
+ /* Construct Semaphore and Obtain instance handle */
+ Semaphore_Params_init(&semParams);
+ Semaphore_construct(&semStruct,0, &semParams);
+ semHandle = Semaphore_handle(&semStruct);
+
+
+ /* Setup callback for button pins */
+ GPIO_setCallback(Board_BUTTON0,buttonCallbackFxn);
+ GPIO_enableInt(Board_BUTTON0);
+
+ /* Setup callback for button pins */
+ GPIO_write(Board_LED0, 0);
+ GPIO_write(Board_LED1, 0);
+ GPIO_write(Board_SPI1_CS, 1);
+
+
+ /* Start BIOS */
+ BIOS_start();
+
+ return (0);
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/uart_printf.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/uart_printf.c
--- /dev/null
@@ -0,0 +1,189 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <Board.h>\r
+#include <ti/drivers/UART.h>\r
+//#include <ti/drivers/uart/UARTCC26XX.h>\r
+#include <stdint.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+#define UART_PRINTF_BUF_LEN 1024\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * LOCAL VARIABLES\r
+ */\r
+static uint8_t uartPrintf_outArray[UART_PRINTF_BUF_LEN];\r
+static uint16_t uartPrintf_head = 0;\r
+static uint16_t uartPrintf_tail = 0;\r
+static UART_Handle hUart = NULL;\r
+\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle)\r
+{\r
+ hUart = handle;\r
+}\r
+\r
+/*********************************************************************\r
+ * SYSTEM HOOK FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_putch\r
+ *\r
+ * @brief User supplied PutChar function.\r
+ * typedef Void (*SysCallback_PutchFxn)(Char);\r
+ *\r
+ * This function is called whenever the System module needs\r
+ * to output a character.\r
+ *\r
+ * This implementation fills a very basic ring-buffer, and relies\r
+ * on another function to flush this buffer out to UART.\r
+ *\r
+ * Requires SysCallback to be the system provider module.\r
+ * Initialized via SysCallback.putchFxn = "&uartPrintf_putch"; in the\r
+ * TI-RTOS configuration script.\r
+ *\r
+ * @param ch - Character\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_head is incremented by one with wrap at UART_PRINTF_BUF_LEN\r
+ * if there is room.\r
+ */\r
+void uartPrintf_putch(char ch)\r
+{\r
+ // uartPrintf_tail should never catch up with uartPrintf_head. Discard in-between bytes.\r
+ if ( (uartPrintf_head + 1) % UART_PRINTF_BUF_LEN == uartPrintf_tail )\r
+ return;\r
+\r
+ uartPrintf_outArray[uartPrintf_head] = ch;\r
+ uartPrintf_head++;\r
+\r
+ if (uartPrintf_head >= UART_PRINTF_BUF_LEN)\r
+ uartPrintf_head = 0;\r
+}\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_flush\r
+ *\r
+ * @brief Printf-buffer flush function\r
+ *\r
+ * In this implementation it is intended to be called by the\r
+ * Idle task when nothing else is running.\r
+ *\r
+ * This is achieved by setting up the Idle task in the TI-RTOS\r
+ * configuration script like so:\r
+ *\r
+ * var Idle = xdc.useModule('ti.sysbios.knl.Idle');\r
+ * Idle.addFunc('&uartPrintf_flush');\r
+ *\r
+ * @param None. Relies on global state.\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_tail is incremented to where uartPrintf_head\r
+ * was at the time the function was called.\r
+ */\r
+void uartPrintf_flush()\r
+{\r
+ // Abort in case UART hasn't been initialized.\r
+ if (NULL == hUart)\r
+ return;\r
+\r
+ // Lock head position to avoid race conditions\r
+ uint16_t curHead = uartPrintf_head;\r
+\r
+ // Find out how much data must be output, and how to output it.\r
+ int needWrap = curHead < uartPrintf_tail;\r
+\r
+ uint16_t outLen = needWrap?(UART_PRINTF_BUF_LEN-uartPrintf_tail+curHead):(curHead-uartPrintf_tail);\r
+\r
+ if (outLen)\r
+ {\r
+ if (needWrap)\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], UART_PRINTF_BUF_LEN - uartPrintf_tail);\r
+ UART_write(hUart, uartPrintf_outArray, curHead);\r
+ }\r
+ else\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], outLen);\r
+ }\r
+ }\r
+\r
+ uartPrintf_tail = curHead;\r
+}\r
+\r
+\r
+char uart_getch()\r
+{\r
+ char input;\r
+\r
+ if (NULL == hUart)\r
+ return 0;\r
+\r
+ // Blocking Read\r
+ UART_read(hUart,&input,1);\r
+ return input;\r
+}\r
+\r
+\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/uart_printf.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_Master_CC2650_Slave/uart_printf.h
--- /dev/null
@@ -0,0 +1,84 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+#ifndef UART_PRINTF_H\r
+#define UART_PRINTF_H\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <ti/drivers/UART.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle);\r
+\r
+char uart_getch();\r
+void uartPrintf_putch(char);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif // UART_PRINTF_H\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/Board.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/Board.h
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef __BOARD_H
+#define __BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "MSP432P401R_I3M.h"
+
+#define Board_initADC MSP_I3MSP432P401R_initADC
+#define Board_initGeneral MSP_I3MSP432P401R_initGeneral
+#define Board_initGPIO MSP_I3MSP432P401R_initGPIO
+#define Board_initI2C MSP_I3MSP432P401R_initI2C
+#define Board_initPWM MSP_I3MSP432P401R_initPWM
+#define Board_initSDSPI MSP_I3MSP432P401R_initSDSPI
+#define Board_initSPI MSP_I3MSP432P401R_initSPI
+#define Board_initUART MSP_I3MSP432P401R_initUART
+#define Board_initWatchdog MSP_I3MSP432P401R_initWatchdog
+#define Board_initWiFi MSP_I3MSP432P401R_initWiFi
+
+#define Board_ADC0 MSP_I3MSP432P401R_ADC0
+#define Board_ADC1 MSP_I3MSP432P401R_ADC1
+
+#define Board_LED_ON MSP_I3MSP432P401R_LED_ON
+#define Board_LED_OFF MSP_I3MSP432P401R_LED_OFF
+
+#define Board_BUTTON0 MSP_I3MSP432P401R_S1
+#define Board_BUTTON1 MSP_I3MSP432P401R_S2
+#define Board_LED0 MSP_I3MSP432P401R_LED_GREEN
+#define Board_LED1 MSP_I3MSP432P401R_LED_RED
+
+
+#define Board_SPI0_CS MSP_I3MSP432P401R_SPIB0_CS
+#define Board_SPI1_CS MSP_I3MSP432P401R_SPIA1_CS
+#define Board_SPI2_CS MSP_I3MSP432P401R_SPIA2_CS
+
+#define Board_SPI0_IRQ MSP_I3MSP432P401R_SPIB0_IRQ
+#define Board_SPI1_IRQ MSP_I3MSP432P401R_SPIA1_IRQ
+#define Board_SPI2_IRQ MSP_I3MSP432P401R_SPIA2_IRQ
+
+
+
+/*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+
+
+#define Board_I2C0 MSP_I3MSP432P401R_I2CB2
+
+//#define Board_PWM0 MSP_I3MSP432P401R_PWM_TA1_1
+//#define Board_PWM1 MSP_I3MSP432P401R_PWM_TA1_2
+
+//#define Board_SDSPI0 MSP_I3MSP432P401R_SDSPIB0
+
+#define Board_SPI0 MSP_I3MSP432P401R_SPIB0
+#define Board_SPI1 MSP_I3MSP432P401R_SPIA1
+#define Board_SPI2 MSP_I3MSP432P401R_SPIA2
+
+#define Board_UART MSP_I3MSP432P401R_UARTA0
+//#define Board_UART0 MSP_I3MSP432P401R_UARTA0
+//#define Board_UART1 MSP_I3MSP432P401R_UARTA2
+
+#define Board_WATCHDOG0 MSP_I3MSP432P401R_WATCHDOG
+
+//#define Board_WIFI MSP_I3MSP432P401R_WIFI
+//#define Board_WIFI_SPI MSP_I3MSP432P401R_SPIB0
+
+/* Board specific I2C addresses */
+
+#define EEPROM_SLAVE_ADDRESS (0x50)
+
+/* Sensors */
+#define Board_INA219_ADDR (0x41)
+#define Board_HDC1000_ADDR (0x43)
+#define Board_HDC1080_ADDR (0x40)
+#define Board_TMP007_ADDR (0x44)
+#define Board_OPT3001_ADDR (0x45)
+#define Board_MPU9250_ADDR (0x68)
+#define Board_BMP280_ADDR (0x77)
+#define Board_LISHH12_ADDR (0x1E)
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARD_H */
+
+
+
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/I3MSP432P401R.cmd b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/I3MSP432P401R.cmd
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+/*
+ * ======== MSP_EXP432P401R.cmd ========
+ * Define the memory block start/length for the MSP_EXP432P401R M4
+ */
+
+MEMORY
+{
+ MAIN (RX) : origin = 0x00000000, length = 0x00040000
+ INFO (RX) : origin = 0x00200000, length = 0x00004000
+ SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
+ SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
+}
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .text : > MAIN
+ .const : > MAIN
+ .cinit : > MAIN
+ .pinit : > MAIN
+
+#ifdef __TI_COMPILER_VERSION__
+#if __TI_COMPILER_VERSION__ >= 15009000
+ .TI.ramfunc : {} load=MAIN, run=SRAM_CODE, table(BINIT)
+#endif
+#endif
+ .data : > SRAM_DATA
+ .bss : > SRAM_DATA
+ .sysmem : > SRAM_DATA
+ .stack : > SRAM_DATA (HIGH)
+}
+
+/* Symbolic definition of the WDTCTL register for RTS */
+WDTCTL_SYM = 0x4000480C;
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/I3MSP432rtos.cfg b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/I3MSP432rtos.cfg
--- /dev/null
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+
+
+/* ================ Clock configuration ================ */
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+/*
+ * Default value is family dependent. For example, Linux systems often only
+ * support a minimum period of 10000 us and multiples of 10000 us.
+ * TI platforms have a default of 1000 us.
+ */
+Clock.tickPeriod = 1000;
+
+
+
+/* ================ Defaults (module) configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+/*
+ * A flag to allow module names to be loaded on the target. Module name
+ * strings are placed in the .const section for debugging purposes.
+ *
+ * Pick one:
+ * - true (default)
+ * Setting this parameter to true will include name strings in the .const
+ * section so that Errors and Asserts are easier to debug.
+ * - false
+ * Setting this parameter to false will reduce footprint in the .const
+ * section. As a result, Error and Assert messages will contain an
+ * "unknown module" prefix instead of the actual module name.
+ */
+Defaults.common$.namedModule = true;
+//Defaults.common$.namedModule = false;
+
+
+
+/* ================ Error configuration ================ */
+var Error = xdc.useModule('xdc.runtime.Error');
+/*
+ * This function is called to handle all raised errors, but unlike
+ * Error.raiseHook, this function is responsible for completely handling the
+ * error with an appropriately initialized Error_Block.
+ *
+ * Pick one:
+ * - Error.policyDefault (default)
+ * Calls Error.raiseHook with an initialized Error_Block structure and logs
+ * the error using the module's logger.
+ * - Error.policySpin
+ * Simple alternative that traps on a while(1) loop for minimized target
+ * footprint.
+ * Using Error.policySpin, the Error.raiseHook will NOT called.
+ */
+Error.policyFxn = Error.policyDefault;
+//Error.policyFxn = Error.policySpin;
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this function is called
+ * whenever an error is raised by the Error module.
+ *
+ * Pick one:
+ * - Error.print (default)
+ * Errors are formatted and output via System_printf() for easier
+ * debugging.
+ * - null
+ * Errors are not formatted or logged. This option reduces code footprint.
+ * - non-null function
+ * Errors invoke custom user function. See the Error module documentation
+ * for more details.
+ */
+Error.raiseHook = Error.print;
+//Error.raiseHook = null;
+//Error.raiseHook = "&myErrorFxn";
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this option applies to the
+ * maximum number of times the Error.raiseHook function can be recursively
+ * invoked. This option limits the possibility of an infinite recursion that
+ * could lead to a stack overflow.
+ * The default value is 16.
+ */
+Error.maxDepth = 2;
+
+
+
+/* ================ Hwi configuration ================ */
+var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
+/*
+ * Checks for Hwi (system) stack overruns while in the Idle loop.
+ *
+ * Pick one:
+ * - true (default)
+ * Checks the top word for system stack overflows during the idle loop and
+ * raises an Error if one is detected.
+ * - false
+ * Disabling the runtime check improves runtime performance and yields a
+ * reduced flash footprint.
+ */
+halHwi.checkStackFlag = true;
+//halHwi.checkStackFlag = false;
+
+/*
+ * The following options alter the system's behavior when a hardware exception
+ * is detected.
+ *
+ * Pick one:
+ * - Hwi.enableException = true
+ * This option causes the default m3Hwi.excHandlerFunc function to fully
+ * decode an exception and dump the registers to the system console.
+ * This option raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.enableException = false
+ * This option reduces code footprint by not decoding or printing the
+ * exception to the system console.
+ * It however still raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.excHandlerFunc = null
+ * This is the most aggressive option for code footprint savings; but it
+ * can difficult to debug exceptions. It reduces flash footprint by
+ * plugging in a default while(1) trap when exception occur. This option
+ * does not raise an error with the Error module.
+ */
+m3Hwi.enableException = true;
+//m3Hwi.enableException = false;
+//m3Hwi.excHandlerFunc = null;
+
+/*
+ * Enable hardware exception generation when dividing by zero.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions when dividing by zero
+ * - 1
+ * Enables hardware exceptions when dividing by zero
+ */
+m3Hwi.nvicCCR.DIV_0_TRP = 0;
+//m3Hwi.nvicCCR.DIV_0_TRP = 1;
+
+/*
+ * Enable hardware exception generation for invalid data alignment.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions for data alignment
+ * - 1
+ * Enables hardware exceptions for data alignment
+ */
+m3Hwi.nvicCCR.UNALIGN_TRP = 0;
+//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
+
+
+
+/* ================ Idle configuration ================ */
+var Idle = xdc.useModule('ti.sysbios.knl.Idle');
+/*
+ * The Idle module is used to specify a list of functions to be called when no
+ * other tasks are running in the system.
+ *
+ * Functions added here will be run continuously within the idle task.
+ *
+ * Function signature:
+ * Void func(Void);
+ */
+//Idle.addFunc("&myIdleFunc");
+Idle.addFunc('&uartPrintf_flush'); // BMH flushing function.
+
+
+/* ================ Kernel (SYS/BIOS) configuration ================ */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Enable asserts in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables asserts for debugging purposes.
+ * - false
+ * Disables asserts for a reduced code footprint and better performance.
+ */
+BIOS.assertsEnabled = true;
+//BIOS.assertsEnabled = false;
+
+/*
+ * Specify default heap size for BIOS.
+ */
+BIOS.heapSize = 1024;
+
+/*
+ * A flag to determine if xdc.runtime sources are to be included in a custom
+ * built BIOS library.
+ *
+ * Pick one:
+ * - false (default)
+ * The pre-built xdc.runtime library is provided by the respective target
+ * used to build the application.
+ * - true
+ * xdc.runtime library sources are to be included in the custom BIOS
+ * library. This option yields the most efficient library in both code
+ * footprint and runtime performance.
+ */
+BIOS.includeXdcRuntime = false;
+//BIOS.includeXdcRuntime = true;
+
+/*
+ * The SYS/BIOS runtime is provided in the form of a library that is linked
+ * with the application. Several forms of this library are provided with the
+ * SYS/BIOS product.
+ *
+ * Pick one:
+ * - BIOS.LibType_Custom
+ * Custom built library that is highly optimized for code footprint and
+ * runtime performance.
+ * - BIOS.LibType_Debug
+ * Custom built library that is non-optimized that can be used to
+ * single-step through APIs with a debugger.
+ *
+ */
+BIOS.libType = BIOS.LibType_Custom;
+//BIOS.libType = BIOS.LibType_Debug;
+
+/*
+ * Runtime instance creation enable flag.
+ *
+ * Pick one:
+ * - true (default)
+ * Allows Mod_create() and Mod_delete() to be called at runtime which
+ * requires a default heap for dynamic memory allocation.
+ * - false
+ * Reduces code footprint by disallowing Mod_create() and Mod_delete() to
+ * be called at runtime. Object instances are constructed via
+ * Mod_construct() and destructed via Mod_destruct().
+ */
+BIOS.runtimeCreatesEnabled = true;
+//BIOS.runtimeCreatesEnabled = false;
+
+/*
+ * Enable logs in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables logs for debugging purposes.
+ * - false
+ * Disables logging for reduced code footprint and improved runtime
+ * performance.
+ */
+//BIOS.logsEnabled = true;
+BIOS.logsEnabled = false;
+
+
+
+/* ================ Memory configuration ================ */
+var Memory = xdc.useModule('xdc.runtime.Memory');
+/*
+ * The Memory module itself simply provides a common interface for any
+ * variety of system and application specific memory management policies
+ * implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
+ */
+
+
+
+/* ================ Program configuration ================ */
+/*
+ * Program.stack is ignored with IAR. Use the project options in
+ * IAR Embedded Workbench to alter the system stack size.
+ */
+if (!Program.build.target.$name.match(/iar/)) {
+ /*
+ * Reducing the system stack size (used by ISRs and Swis) to reduce
+ * RAM usage.
+ */
+ Program.stack = 768;
+}
+
+
+
+/*
+ * Uncomment to enable Semihosting for GNU targets to print to the CCS console.
+ * Please read the following TIRTOS Wiki page for more information on Semihosting:
+ * http://processors.wiki.ti.com/index.php/TI-RTOS_Examples_SemiHosting
+ */
+
+if (Program.build.target.$name.match(/gnu/)) {
+ //var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+}
+/* ================ Semaphore configuration ================ */
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+/*
+ * Enables global support for Task priority pend queuing.
+ *
+ * Pick one:
+ * - true (default)
+ * This allows pending tasks to be serviced based on their task priority.
+ * - false
+ * Pending tasks are services based on first in, first out basis.
+ *
+ * When using BIOS in ROM:
+ * This option must be set to false.
+ */
+//Semaphore.supportsPriority = true;
+Semaphore.supportsPriority = false;
+
+/*
+ * Allows for the implicit posting of events through the semaphore,
+ * disable for additional code saving.
+ *
+ * Pick one:
+ * - true
+ * This allows the Semaphore module to post semaphores and events
+ * simultaneously.
+ * - false (default)
+ * Events must be explicitly posted to unblock tasks.
+ *
+ */
+Semaphore.supportsEvents = true;
+//Semaphore.supportsEvents = false;
+
+
+
+/* ================ Swi configuration ================ */
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+/*
+ * A software interrupt is an object that encapsulates a function to be
+ * executed and a priority. Software interrupts are prioritized, preempt tasks
+ * and are preempted by hardware interrupt service routines.
+ *
+ * This module is included to allow Swi's in a users' application.
+ */
+
+
+
+/* ================ System configuration ================ */
+var System = xdc.useModule('xdc.runtime.System');
+/*
+ * The Abort handler is called when the system exits abnormally.
+ *
+ * Pick one:
+ * - System.abortStd (default)
+ * Call the ANSI C Standard 'abort()' to terminate the application.
+ * - System.abortSpin
+ * A lightweight abort function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom abort handler
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.abortFxn = System.abortStd;
+//System.abortFxn = System.abortSpin;
+//System.abortFxn = "&myAbortSystem";
+
+/*
+ * The Exit handler is called when the system exits normally.
+ *
+ * Pick one:
+ * - System.exitStd (default)
+ * Call the ANSI C Standard 'exit()' to terminate the application.
+ * - System.exitSpin
+ * A lightweight exit function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom exit function
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.exitFxn = System.exitStd;
+//System.exitFxn = System.exitSpin;
+//System.exitFxn = "&myExitSystem";
+
+/*
+ * Minimize exit handler array in the System module. The System module includes
+ * an array of functions that are registered with System_atexit() which is
+ * called by System_exit(). The default value is 8.
+ */
+System.maxAtexitHandlers = 2;
+
+/*
+ * The System.SupportProxy defines a low-level implementation of System
+ * functions such as System_printf(), System_flush(), etc.
+ *
+ * Pick one pair:
+ * - SysMin
+ * This module maintains an internal configurable circular buffer that
+ * stores the output until System_flush() is called.
+ * The size of the circular buffer is set via SysMin.bufSize.
+ * - SysCallback
+ * SysCallback allows for user-defined implementations for System APIs.
+ * The SysCallback support proxy has a smaller code footprint and can be
+ * used to supply custom System_printf services.
+ * The default SysCallback functions point to stub functions. See the
+ * SysCallback module's documentation.
+ */
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+SysMin.bufSize = 128;
+
+// BMH System.SupportProxy = SysMin;
+
+var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
+System.SupportProxy = SysCallback;
+SysCallback.putchFxn = "&uartPrintf_putch"; // BMH Modified
+
+//SysCallback.abortFxn = "&myUserAbort";
+//SysCallback.exitFxn = "&myUserExit";
+//SysCallback.flushFxn = "&myUserFlush";
+//SysCallback.readyFxn = "&myUserReady";
+
+
+
+
+/* ================ Task configuration ================ */
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+/*
+ * Check task stacks for overflow conditions.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables runtime checks for task stack overflow conditions during
+ * context switching ("from" and "to")
+ * - false
+ * Disables runtime checks for task stack overflow conditions.
+ */
+Task.checkStackFlag = true;
+//Task.checkStackFlag = false;
+
+/*
+ * Set the default task stack size when creating tasks.
+ *
+ * The default is dependent on the device being used. Reducing the default stack
+ * size yields greater memory savings.
+ */
+Task.defaultStackSize = 512;
+
+/*
+ * Enables the idle task.
+ *
+ * Pick one:
+ * - true (default)
+ * Creates a task with priority of 0 which calls idle hook functions. This
+ * option must be set to true to gain power savings provided by the Power
+ * module.
+ * - false
+ * No idle task is created. This option consumes less memory as no
+ * additional default task stack is needed.
+ * To gain power savings by the Power module without having the idle task,
+ * add Idle.run as the Task.allBlockedFunc.
+ */
+Task.enableIdleTask = true;
+//Task.enableIdleTask = false;
+//Task.allBlockedFunc = Idle.run;
+
+/*
+ * If Task.enableIdleTask is set to true, this option sets the idle task's
+ * stack size.
+ *
+ * Reducing the idle stack size yields greater memory savings.
+ */
+Task.idleTaskStackSize = 512;
+
+/*
+ * Reduce the number of task priorities.
+ * The default is 16.
+ * Decreasing the number of task priorities yield memory savings.
+ */
+Task.numPriorities = 16;
+
+
+
+/* ================ Text configuration ================ */
+var Text = xdc.useModule('xdc.runtime.Text');
+/*
+ * These strings are placed in the .const section. Setting this parameter to
+ * false will save space in the .const section. Error, Assert and Log messages
+ * will print raw ids and args instead of a formatted message.
+ *
+ * Pick one:
+ * - true (default)
+ * This option loads test string into the .const for easier debugging.
+ * - false
+ * This option reduces the .const footprint.
+ */
+Text.isLoaded = true;
+//Text.isLoaded = false;
+
+
+
+/* ================ Types configuration ================ */
+var Types = xdc.useModule('xdc.runtime.Types');
+/*
+ * This module defines basic constants and types used throughout the
+ * xdc.runtime package.
+ */
+
+
+
+/* ================ TI-RTOS middleware configuration ================ */
+var mwConfig = xdc.useModule('ti.mw.Config');
+/*
+ * Include TI-RTOS middleware libraries
+ */
+
+
+
+/* ================ TI-RTOS drivers' configuration ================ */
+var driversConfig = xdc.useModule('ti.drivers.Config');
+/*
+ * Include TI-RTOS drivers
+ *
+ * Pick one:
+ * - driversConfig.LibType_NonInstrumented (default)
+ * Use TI-RTOS drivers library optimized for footprint and performance
+ * without asserts or logs.
+ * - driversConfig.LibType_Instrumented
+ * Use TI-RTOS drivers library for debugging with asserts and logs enabled.
+ */
+driversConfig.libType = driversConfig.LibType_NonInstrumented;
+//driversConfig.libType = driversConfig.LibType_Instrumented;
+
+
+
+/* ================ Application Specific Instances ================ */
\ No newline at end of file
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/MSP432P401R_I3M.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/MSP432P401R_I3M.c
--- /dev/null
@@ -0,0 +1,758 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * ======== MSP_I3MSP432P401R.c ========
+ * This file is responsible for setting up the board specific items for the
+ * MSP_I3MSP432P401R board.
+ */
+
+#include <stdbool.h>
+
+#include <ti/drivers/Power.h>
+#include <ti/drivers/power/PowerMSP432.h>
+
+#include <msp.h>
+#include <rom.h>
+#include <rom_map.h>
+#include <dma.h>
+#include <gpio.h>
+#include <i2c.h>
+#include <pmap.h>
+#include <spi.h>
+#include <timer_a.h>
+#include <uart.h>
+#include <wdt_a.h>
+#include <adc14.h>
+#include <ref_a.h>
+#include <interrupt.h>
+
+#include <MSP432P401R_I3M.h>
+
+/*
+ * =============================== ADC ===============================
+ */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(ADC_config, ".const:ADC_config")
+#pragma DATA_SECTION(adcMSP432HWAttrs, ".const:adcMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/ADC.h>
+#include <ti/drivers/adc/ADCMSP432.h>
+
+/* ADC objects */
+ADCMSP432_Object adcMSP432Objects[MSP_I3MSP432P401R_ADCCOUNT];
+
+/* ADC configuration structure */
+const ADCMSP432_HWAttrs adcMSP432HWAttrs[MSP_I3MSP432P401R_ADCCOUNT] = {
+ {
+ .channel = ADC_INPUT_A0,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN5,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF2_5V,
+ .resolution = ADC_14BIT
+ },
+ {
+ .channel = ADC_INPUT_A1,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN4,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF1_45V,
+ .resolution = ADC_8BIT
+ }
+};
+
+const ADC_Config ADC_config[] = {
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[0],
+ .hwAttrs = &adcMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[1],
+ .hwAttrs = &adcMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+void MSP_I3MSP432P401R_initADC(void)
+{
+ ADC_init();
+}
+
+/*
+ * =============================== DMA ===============================
+ */
+
+#include <ti/drivers/dma/UDMAMSP432.h>
+
+
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_ALIGN(dmaControlTable, 256)
+#elif defined(__IAR_SYSTEMS_ICC__)
+#pragma data_alignment=256
+#elif defined(__GNUC__)
+__attribute__ ((aligned (256)))
+#endif
+static DMA_ControlTable dmaControlTable[8];
+
+/*
+ * ======== dmaErrorHwi ========
+ * This is the handler for the uDMA error interrupt.
+ */
+static void dmaErrorHwi(uintptr_t arg)
+{
+ int status = MAP_DMA_getErrorStatus();
+ MAP_DMA_clearErrorStatus();
+
+ /* Suppress unused variable warning */
+ (void)status;
+
+ while (1);
+}
+
+UDMAMSP432_Object udmaMSP432Object;
+
+const UDMAMSP432_HWAttrs udmaMSP432HWAttrs = {
+ .controlBaseAddr = (void *)dmaControlTable,
+ .dmaErrorFxn = (UDMAMSP432_ErrorFxn)dmaErrorHwi,
+ .intNum = INT_DMA_ERR,
+ .intPriority = (~0)
+};
+
+const UDMAMSP432_Config UDMAMSP432_config = {
+ .object = &udmaMSP432Object,
+ .hwAttrs = &udmaMSP432HWAttrs
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGeneral ========
+ */
+void MSP_I3MSP432P401R_initGeneral(void)
+{
+ Power_init();
+}
+
+/*
+ * =============================== GPIO ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(GPIOMSP432_config, ".const:GPIOMSP432_config")
+#endif
+
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/gpio/GPIOMSP432.h>
+
+/*
+ * Array of Pin configurations
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts should be placed at the end of the
+ * array. Callback entries can be omitted from callbacks array to
+ * reduce memory usage.
+ */
+GPIO_PinConfig gpioPinConfigs[] = {
+ /* Input pins */
+ /* MSP_I3MSP432P401R_S1 */
+ GPIOMSP432_P6_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+
+ /* Output pins */
+ /* MSP_I3MSP432P401R_SPI1_IRQ */
+ GPIOMSP432_P4_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI1_CS */
+ GPIOMSP432_P2_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI2_CS */
+ GPIOMSP432_P3_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ /* MSP_I3MSP432P401R_LED_GREEN */
+ GPIOMSP432_P6_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_LED_RED */
+ GPIOMSP432_P6_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
+
+};
+
+/*
+ * Array of callback function pointers
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts can be omitted from callbacks array to
+ * reduce memory usage (if placed at end of gpioPinConfigs array).
+ */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+ /* MSP_I3MSP432P401R_S1 */
+ NULL,
+ /* MSP_I3MSP432P401R_S2 */
+ NULL
+};
+
+const GPIOMSP432_Config GPIOMSP432_config = {
+ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
+ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
+ .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
+ .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
+ .intPriority = (~0)
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGPIO ========
+ */
+void MSP_I3MSP432P401R_initGPIO(void)
+{
+ /* Initialize peripheral and pins */
+ GPIO_init();
+}
+
+/*
+ * =============================== I2C ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
+#pragma DATA_SECTION(i2cMSP432HWAttrs, ".const:i2cMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/i2c/I2CMSP432.h>
+
+I2CMSP432_Object i2cMSP432Objects[MSP_I3MSP432P401R_I2CCOUNT];
+
+const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_I3MSP432P401R_I2CCOUNT] = {
+ {
+ .baseAddr = EUSCI_B2_BASE,
+ .intNum = INT_EUSCIB2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK
+ }
+};
+
+const I2C_Config I2C_config[] = {
+ {
+ .fxnTablePtr = &I2CMSP432_fxnTable,
+ .object = &i2cMSP432Objects[0],
+ .hwAttrs = &i2cMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initI2C ========
+ */
+void MSP_I3MSP432P401R_initI2C(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+ /* Configure Pins 1.6 & 1.7 as SDA & SCL, respectively. */
+ // BMH MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ // BMH GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+ /* Initialize the I2C driver */
+ I2C_init();
+}
+
+/*
+ * =============================== Power ===============================
+ */
+const PowerMSP432_ConfigV1 PowerMSP432_config = {
+ .policyInitFxn = &PowerMSP432_initPolicy,
+ .policyFxn = &PowerMSP432_sleepPolicy,
+ .initialPerfLevel = 2,
+ .enablePolicy = true,
+ .enablePerf = true,
+ .enableParking = true
+};
+
+/*
+ * =============================== PWM ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
+#pragma DATA_SECTION(pwmTimerMSP432HWAttrs, ".const:pwmTimerMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/PWM.h>
+#include <ti/drivers/pwm/PWMTimerMSP432.h>
+
+PWMTimerMSP432_Object pwmTimerMSP432Objects[MSP_I3MSP432P401R_PWMCOUNT];
+
+const PWMTimerMSP432_HWAttrsV1 pwmTimerMSP432HWAttrs[MSP_I3MSP432P401R_PWMCOUNT] = {
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN1,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ },
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN2,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ }
+};
+
+const PWM_Config PWM_config[] = {
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[0],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[1],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initPWM ========
+ */
+void MSP_I3MSP432P401R_initPWM(void)
+{
+ /* Use Port Map on Port2 get Timer outputs on pins with LEDs (2.1, 2.2) */
+ const uint8_t portMap [] = {
+ PM_NONE, PM_TA1CCR1A, PM_TA1CCR2A, PM_NONE,
+ PM_NONE, PM_NONE, PM_NONE, PM_NONE
+ };
+
+ /* Mapping capture compare registers to Port 2 */
+ MAP_PMAP_configurePorts((const uint8_t *) portMap, PMAP_P2MAP, 1,
+ PMAP_DISABLE_RECONFIGURATION);
+
+ PWM_init();
+}
+
+/*
+ * =============================== SDSPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if 0
+ #if defined(__TI_COMPILER_VERSION__)
+ #pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
+ #pragma DATA_SECTION(sdspiMSP432HWAttrs, ".const:sdspiMSP432HWAttrs")
+ #endif
+
+ #include <ti/drivers/SDSPI.h>
+ #include <ti/drivers/sdspi/SDSPIMSP432.h>
+
+ SDSPIMSP432_Object sdspiMSP432Objects[MSP_I3MSP432P401R_SDSPICOUNT];
+
+ const SDSPIMSP432_HWAttrs sdspiMSP432HWAttrs[MSP_I3MSP432P401R_SDSPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ /* CLK, MOSI & MISO ports & pins */
+ .portSCK = GPIO_PORT_P1,
+ .pinSCK = GPIO_PIN5,
+ .sckMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMISO = GPIO_PORT_P1,
+ .pinMISO = GPIO_PIN7,
+ .misoMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMOSI = GPIO_PORT_P1,
+ .pinMOSI = GPIO_PIN6,
+ .mosiMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ /* Chip select port & pin */
+ .portCS = GPIO_PORT_P4,
+ .pinCS = GPIO_PIN6
+ }
+ };
+
+ const SDSPI_Config SDSPI_config[] = {
+ {
+ .fxnTablePtr = &SDSPIMSP432_fxnTable,
+ .object = &sdspiMSP432Objects[0],
+ .hwAttrs = &sdspiMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+ };
+#endif
+
+/*
+ * ======== MSP_I3MSP432P401R_initSDSPI ========
+ */
+#if 0
+
+ void MSP_I3MSP432P401R_initSDSPI(void)
+ {
+ SDSPI_init();
+ }
+
+#endif
+
+/*
+ * =============================== SPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
+#pragma DATA_SECTION(spiMSP432DMAHWAttrs, ".const:spiMSP432DMAHWAttrs")
+#endif
+
+#include <ti/drivers/SPI.h>
+#include <ti/drivers/spi/SPIMSP432DMA.h>
+
+SPIMSP432DMA_Object spiMSP432DMAObjects[MSP_I3MSP432P401R_SPICOUNT];
+
+const SPIMSP432DMA_HWAttrs spiMSP432DMAHWAttrs[MSP_I3MSP432P401R_SPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT0,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH1_EUSCIB0RX0,
+ .txDMAChannelIndex = DMA_CH0_EUSCIB0TX0
+ },
+ {
+ .baseAddr = EUSCI_A1_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT1,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH3_EUSCIA1RX,
+ .txDMAChannelIndex = DMA_CH2_EUSCIA1TX
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT2,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH5_EUSCIA2RX,
+ .txDMAChannelIndex = DMA_CH4_EUSCIA2TX
+ }
+
+};
+
+const SPI_Config SPI_config[] = {
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[0],
+ .hwAttrs = &spiMSP432DMAHWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[1],
+ .hwAttrs = &spiMSP432DMAHWAttrs[1]
+ },
+
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[2],
+ .hwAttrs = &spiMSP432DMAHWAttrs[2]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initSPI ========
+ */
+void MSP_I3MSP432P401R_initSPI(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+/* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A1)*/
+#if 1
+ #warning SPI_SLAVE_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2,
+ GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+#if 0
+ #warning SPI_MASTER_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A2) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ SPI_init();
+}
+
+/*
+ * =============================== UART ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(UART_config, ".const:UART_config")
+#pragma DATA_SECTION(uartMSP432HWAttrs, ".const:uartMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/UART.h>
+#include <ti/drivers/uart/UARTMSP432.h>
+
+UARTMSP432_Object uartMSP432Objects[MSP_I3MSP432P401R_UARTCOUNT];
+unsigned char uartMSP432RingBuffer[MSP_I3MSP432P401R_UARTCOUNT][32];
+
+/*
+ * The baudrate dividers were determined by using the MSP430 baudrate
+ * calculator
+ * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
+ */
+const UARTMSP432_BaudrateConfig uartMSP432Baudrates[] = {
+ /* {baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling} */
+ {
+ .outputBaudrate = 115200,
+ .inputClockFreq = 12000000,
+ .prescalar = 6,
+ .hwRegUCBRFx = 8,
+ .hwRegUCBRSx = 32,
+ .oversampling = 1
+ },
+ {115200, 6000000, 3, 4, 2, 1},
+ {115200, 3000000, 1, 10, 0, 1},
+ {9600, 12000000, 78, 2, 0, 1},
+ {9600, 6000000, 39, 1, 0, 1},
+ {9600, 3000000, 19, 8, 85, 1},
+ {9600, 32768, 3, 0, 146, 0}
+};
+
+const UARTMSP432_HWAttrs uartMSP432HWAttrs[MSP_I3MSP432P401R_UARTCOUNT] = {
+ {
+ .baseAddr = EUSCI_A0_BASE,
+ .intNum = INT_EUSCIA0,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[0],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[0])
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .intNum = INT_EUSCIA2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[1],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[1])
+ }
+};
+
+const UART_Config UART_config[] = {
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[0],
+ .hwAttrs = &uartMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[1],
+ .hwAttrs = &uartMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initUART ========
+ */
+void MSP_I3MSP432P401R_initUART(void)
+{
+ /* Set P1.2 & P1.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Set P3.2 & P3.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Initialize the UART driver */
+ UART_init();
+}
+
+/*
+ * =============================== Watchdog ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
+#pragma DATA_SECTION(watchdogMSP432HWAttrs, ".const:watchdogMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/Watchdog.h>
+#include <ti/drivers/watchdog/WatchdogMSP432.h>
+
+WatchdogMSP432_Object watchdogMSP432Objects[MSP_I3MSP432P401R_WATCHDOGCOUNT];
+
+const WatchdogMSP432_HWAttrs
+ watchdogMSP432HWAttrs[MSP_I3MSP432P401R_WATCHDOGCOUNT] = {
+ {
+ .baseAddr = WDT_A_BASE,
+ .intNum = INT_WDT_A,
+ .intPriority = (~0),
+ .clockSource = WDT_A_CLOCKSOURCE_SMCLK,
+ .clockDivider = WDT_A_CLOCKDIVIDER_8192K
+ },
+};
+
+const Watchdog_Config Watchdog_config[] = {
+ {
+ .fxnTablePtr = &WatchdogMSP432_fxnTable,
+ .object = &watchdogMSP432Objects[0],
+ .hwAttrs = &watchdogMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWatchdog ========
+ */
+void MSP_I3MSP432P401R_initWatchdog(void)
+{
+ /* Initialize the Watchdog driver */
+ Watchdog_init();
+}
+
+/*
+ * =============================== WiFi ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
+#pragma DATA_SECTION(wiFiCC3100HWAttrs, ".const:wiFiCC3100HWAttrs")
+#endif
+
+#include <ti/drivers/WiFi.h>
+#include <ti/drivers/wifi/WiFiCC3100.h>
+
+WiFiCC3100_Object wiFiCC3100Objects[MSP_I3MSP432P401R_WIFICOUNT];
+
+const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[MSP_I3MSP432P401R_WIFICOUNT] = {
+ {
+ .irqPort = GPIO_PORT_P2,
+ .irqPin = GPIO_PIN5,
+ .irqIntNum = INT_PORT2,
+
+ .csPort = GPIO_PORT_P3,
+ .csPin = GPIO_PIN0,
+
+ .enPort = GPIO_PORT_P4,
+ .enPin = GPIO_PIN1
+ }
+};
+
+const WiFi_Config WiFi_config[] = {
+ {
+ .fxnTablePtr = &WiFiCC3100_fxnTable,
+ .object = &wiFiCC3100Objects[0],
+ .hwAttrs = &wiFiCC3100HWAttrs[0]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWiFi ========
+ */
+void MSP_I3MSP432P401R_initWiFi(void)
+{
+ /* Configure EN & CS pins to disable CC3100 */
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P4, GPIO_PIN1);
+ MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN1);
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Configure IRQ pin */
+ MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P2, GPIO_PIN5);
+ MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P2, GPIO_PIN5,
+ GPIO_LOW_TO_HIGH_TRANSITION);
+
+ /* Initialize SPI and WiFi drivers */
+ SPI_init();
+ WiFi_init();
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/MSP432P401R_I3M.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/MSP432P401R_I3M.h
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** ============================================================================
+ * @file MSP_I3MSP432P401R.h
+ *
+ * @brief MSP_I3MSP432P401R Board Specific APIs
+ *
+ * The MSP_I3MSP432P401R header file should be included in an application as
+ * follows:
+ * @code
+ * #include <MSP_I3MSP432P401R.h>
+ * @endcode
+ *
+ * ============================================================================
+ */
+#ifndef __MSP_I3MSP432P401R_H
+#define __MSP_I3MSP432P401R_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LEDs on MSP_I3MSP432P401R are active high. */
+#define MSP_I3MSP432P401R_LED_OFF (0)
+#define MSP_I3MSP432P401R_LED_ON (1)
+
+/*!
+ * @def MSP_I3MSP432P401R_ADCName
+ * @brief Enum of ADC channels on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_ADCName {
+ MSP_I3MSP432P401R_ADC0 = 0,
+ MSP_I3MSP432P401R_ADC1,
+ MSP_I3MSP432P401R_ADCCOUNT
+}MSP_I3MSP432P401R_ADCName;
+
+/*!
+ * @def MSP_I3MSP432P401R_GPIOName
+ * @brief Enum of GPIO names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_GPIOName {
+ MSP_I3MSP432P401R_S1 = 0,
+ MSP_I3MSP432P401R_SPIA1_IRQ,
+ MSP_I3MSP432P401R_SPIA1_CS,
+ MSP_I3MSP432P401R_SPIA2_CS,
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ MSP_I3MSP432P401R_LED_GREEN,
+ MSP_I3MSP432P401R_LED_RED,
+
+ MSP_I3MSP432P401R_GPIOCOUNT
+} MSP_I3MSP432P401R_GPIOName;
+
+/*!
+ * @def MSP_I3MSP432P401R_I2CName
+ * @brief Enum of I2C names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_I2CName {
+ MSP_I3MSP432P401R_I2CB2 = 0,
+ MSP_I3MSP432P401R_I2CCOUNT
+} MSP_I3MSP432P401R_I2CName;
+
+/*!
+ * @def MSP_I3MSP432P401R_PWMName
+ * @brief Enum of PWM names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_PWMName {
+ MSP_I3MSP432P401R_PWM_TA1_1 = 0,
+ MSP_I3MSP432P401R_PWM_TA1_2,
+
+ MSP_I3MSP432P401R_PWMCOUNT
+} MSP_I3MSP432P401R_PWMName;
+
+/*!
+ * @def MSP_I3MSP432P401R_SDSPIName
+ * @brief Enum of SDSPI names on the MSP_I3MSP432P401R dev board
+
+typedef enum MSP_I3MSP432P401R_SDSPIName {
+ MSP_I3MSP432P401R_SDSPIB0 = 0,
+
+ MSP_I3MSP432P401R_SDSPICOUNT
+} EMSP_I3MSP432P401R_SDSPIName;
+*/
+
+/*!
+ * @def MSP_I3MSP432P401R_SPIName
+ * @brief Enum of SPI names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_SPIName {
+ MSP_I3MSP432P401R_SPIB0 = 0,
+ MSP_I3MSP432P401R_SPIA1,
+ MSP_I3MSP432P401R_SPIA2,
+
+ MSP_I3MSP432P401R_SPICOUNT
+} MSP_I3MSP432P401R_SPIName;
+
+/*!
+ * @def MSP_I3MSP432P401R_UARTName
+ * @brief Enum of UART names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_UARTName {
+ MSP_I3MSP432P401R_UARTA0 = 0,
+ MSP_I3MSP432P401R_UARTA2,
+
+ MSP_I3MSP432P401R_UARTCOUNT
+} MSP_I3MSP432P401R_UARTName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WatchdogName
+ * @brief Enum of Watchdog names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WatchdogName {
+ MSP_I3MSP432P401R_WATCHDOG = 0,
+
+ MSP_I3MSP432P401R_WATCHDOGCOUNT
+} MSP_I3MSP432P401R_WatchdogName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WiFiName
+ * @brief Enum of WiFi names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WiFiName {
+ MSP_I3MSP432P401R_WIFI = 0,
+
+ MSP_I3MSP432P401R_WIFICOUNT
+} MSP_I3MSP432P401R_WiFiName;
+
+/*!
+ * @brief Initialize board specific ADC settings
+ *
+ * This function initializes the board specific ADC settings and then calls
+ * the ADC_init API to initialize the ADC module.
+ *
+ * The ADC peripherals controlled by the ADC module are determined by the
+ * ADC_config variable.
+ */
+extern void MSP_I3MSP432P401R_initADC(void);
+
+/*!
+ * @brief Initialize the general board specific settings
+ *
+ * This function initializes the general board specific settings.
+ */
+extern void MSP_I3MSP432P401R_initGeneral(void);
+
+/*!
+ * @brief Initialize board specific GPIO settings
+ *
+ * This function initializes the board specific GPIO settings and
+ * then calls the GPIO_init API to initialize the GPIO module.
+ *
+ * The GPIOs controlled by the GPIO module are determined by the GPIO_PinConfig
+ * variable.
+ */
+extern void MSP_I3MSP432P401R_initGPIO(void);
+
+/*!
+ * @brief Initialize board specific I2C settings
+ *
+ * This function initializes the board specific I2C settings and then calls
+ * the I2C_init API to initialize the I2C module.
+ *
+ * The I2C peripherals controlled by the I2C module are determined by the
+ * I2C_config variable.
+ */
+extern void MSP_I3MSP432P401R_initI2C(void);
+
+/*!
+ * @brief Initialize board specific PWM settings
+ *
+ * This function initializes the board specific PWM settings and then calls
+ * the PWM_init API to initialize the PWM module.
+ *
+ * The PWM peripherals controlled by the PWM module are determined by the
+ * PWM_config variable.
+ */
+extern void MSP_I3MSP432P401R_initPWM(void);
+
+/*!
+ * @brief Initialize board specific SDSPI settings
+ *
+ * This function initializes the board specific SDSPI settings and then calls
+ * the SDSPI_init API to initialize the SDSPI module.
+ *
+ * The SDSPI peripherals controlled by the SDSPI module are determined by the
+ * SDSPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSDSPI(void);
+
+/*!
+ * @brief Initialize board specific SPI settings
+ *
+ * This function initializes the board specific SPI settings and then calls
+ * the SPI_init API to initialize the SPI module.
+ *
+ * The SPI peripherals controlled by the SPI module are determined by the
+ * SPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSPI(void);
+
+/*!
+ * @brief Initialize board specific UART settings
+ *
+ * This function initializes the board specific UART settings and then calls
+ * the UART_init API to initialize the UART module.
+ *
+ * The UART peripherals controlled by the UART module are determined by the
+ * UART_config variable.
+ */
+extern void MSP_I3MSP432P401R_initUART(void);
+
+/*!
+ * @brief Initialize board specific Watchdog settings
+ *
+ * This function initializes the board specific Watchdog settings and then
+ * calls the Watchdog_init API to initialize the Watchdog module.
+ *
+ * The Watchdog peripherals controlled by the Watchdog module are determined
+ * by the Watchdog_config variable.
+ */
+extern void MSP_I3MSP432P401R_initWatchdog(void);
+
+/*!
+ * @brief Initialize board specific WiFi settings
+ *
+ * This function initializes the board specific WiFi settings and then calls
+ * the WiFi_init API to initialize the WiFi module.
+ *
+ * The hardware resources controlled by the WiFi module are determined by the
+ * WiFi_config variable.
+ *
+ * A SimpleLink CC3100 device or module is required and must be connected to
+ * use the WiFi driver.
+ */
+extern void MSP_I3MSP432P401R_initWiFi(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MSP_I3MSP432P401R_H */
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * ======== empty_min.c ========
+ */
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/runtime/System.h>
+#include <xdc/runtime/Error.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/knl/Clock.h>
+#include <ti/sysbios/knl/Semaphore.h>
+#include <ti/sysbios/knl/Event.h>
+
+/* TI-RTOS Header files */
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/PIN.h>
+ #include <ti/drivers/SPI.h>
+#include <ti/drivers/UART.h>
+// #include <ti/drivers/Watchdog.h>
+
+/* Board Header files */
+#include "Board.h"
+
+#include "uart_printf.h"
+
+#define TASKSTACKSIZE (1024)
+
+Task_Struct task0Struct;
+Char task0Stack[TASKSTACKSIZE];
+
+Task_Struct task1Struct;
+Char task1Stack[TASKSTACKSIZE];
+
+Task_Struct task2Struct;
+Char task2Stack[TASKSTACKSIZE];
+
+/* Semaphore */
+Semaphore_Struct semStruct;
+Semaphore_Handle semHandle;
+
+/* Event */
+Event_Handle myEvent;
+Error_Block eb;
+
+
+
+void buttonCallbackFxn(unsigned int pinId) {
+
+ //Semaphore_post(semHandle);
+}
+
+
+uint8_t input;
+
+Void uartFxn(UArg arg0, UArg arg1)
+{
+ while (1) {
+ // Blocking Read
+ input=uart_getch();
+ Semaphore_post(semHandle);
+ Task_sleep((UInt)arg0);
+ }
+}
+
+
+Void taskFxn(UArg arg0, UArg arg1)
+{
+
+ uint8_t rxBufferPointer[4];
+ uint8_t txBufferPointer[4];
+
+ SPI_Handle spi;
+ SPI_Params spiParams;
+ SPI_Transaction spiTransaction;
+
+ SPI_Params_init(&spiParams);
+
+ // Master mode
+ spiParams.mode = SPI_SLAVE;
+ spiParams.bitRate = 500000;
+ spiParams.frameFormat = SPI_POL1_PHA1;
+
+ spi=SPI_open(Board_SPI1,&spiParams);
+ if(!spi){
+ System_printf("SPI did not open");
+ }
+ System_printf("SPI-Slave Open\r\n");
+
+ //GPIO_write(Board_LED0, 1);
+
+ while(1)
+ {
+
+ GPIO_write(Board_LED1, 0);
+ Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
+ GPIO_write(Board_LED1, 1);
+
+ txBufferPointer[0]=input;
+
+ spiTransaction.rxBuf = rxBufferPointer;
+ spiTransaction.txBuf = txBufferPointer;
+ spiTransaction.count = 1;
+
+ GPIO_write(Board_SPI1_IRQ, 0);
+ GPIO_write(Board_SPI1_IRQ, 1);
+
+ /* Step1: Slave Read from Master */
+ if (SPI_transfer(spi,&spiTransaction)) {
+ //System_printf("TxData: %x\r\n",txBufferPointer[0]);
+ }
+ else{
+ System_printf("SPI Transaction Failed\r\n");
+ Event_post(myEvent, Event_Id_00);
+ }
+
+ /* Step2: Generate Interrupt */
+ Task_sleep(1);
+ GPIO_write(Board_SPI1_IRQ, 0);
+ GPIO_write(Board_SPI1_IRQ, 1);
+
+ /* Step3: Slave Read from Master */
+ if (SPI_transfer(spi,&spiTransaction)) {
+ //System_printf("TxData: %x\r\n",txBufferPointer[0]);
+ }
+ else{
+ System_printf("SPI Transaction Failed\r\n");
+ Event_post(myEvent, Event_Id_00);
+ }
+
+ uartPrintf_putch(rxBufferPointer[0]);
+
+ System_flush();
+ Task_sleep(1);
+
+ }
+
+ /* Deinitialized I2C */
+ SPI_close(spi);
+}
+
+/*
+ * ======== heartBeatFxn ========
+ * Toggle the Board_LED0. The Task_sleep is determined by arg0 which
+ * is configured for the heartBeat Task instance.
+ */
+Void heartBeatFxn(UArg arg0, UArg arg1)
+{
+
+ UInt events;
+
+ events=Event_pend(myEvent,Event_Id_NONE,Event_Id_00+Event_Id_01,BIOS_WAIT_FOREVER);
+
+ if(events & Event_Id_00){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED0);
+ }
+ }
+
+ if(events & Event_Id_01){
+ while (1)
+ {
+ Task_sleep((UInt)arg0);
+ GPIO_toggle(Board_LED1);
+ }
+ }
+}
+
+
+
+/*
+ * ======== main ========
+ */
+
+
+int main(void)
+{
+ Task_Params taskParams;
+
+ Semaphore_Params semParams;
+
+
+ /* Call board init functions */
+ Board_initGPIO();
+ Board_initGeneral();
+ //Board_initI2C();
+ Board_initSPI();
+ Board_initUART();
+ // Board_initWatchdog();
+
+ /* Default instance configuration params */
+ Error_init(&eb);
+ myEvent = Event_create(NULL,&eb);
+ if (myEvent == NULL) {
+ System_abort("Event create failed");
+ }
+
+
+ UART_Params uartParams;
+ UART_Params_init(&uartParams);
+ uartParams.baudRate = 115200;
+ uartParams.readEcho = UART_ECHO_OFF;
+ UartPrintf_init(UART_open(Board_UART, &uartParams));
+
+ /* Construct Test Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task1Stack;
+ Task_construct(&task1Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);
+
+
+ /* Construct heartBeat Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task0Stack;
+ Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
+
+ /* Construct Uart Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 100000 / Clock_tickPeriod;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task2Stack;
+ Task_construct(&task2Struct, (Task_FuncPtr)uartFxn, &taskParams, NULL);
+
+
+ /* Construct Semaphore and Obtain instance handle */
+ Semaphore_Params_init(&semParams);
+ Semaphore_construct(&semStruct,0, &semParams);
+ semHandle = Semaphore_handle(&semStruct);
+
+
+ /* Setup callback for button pins */
+ GPIO_setCallback(Board_BUTTON0,buttonCallbackFxn);
+ GPIO_enableInt(Board_BUTTON0);
+
+ /* Setup callback for button pins */
+ GPIO_write(Board_LED0, 0);
+ GPIO_write(Board_LED1, 0);
+ GPIO_write(Board_SPI1_IRQ, 1);
+
+
+ /* Start BIOS */
+ BIOS_start();
+
+ return (0);
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/uart_printf.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/uart_printf.c
--- /dev/null
@@ -0,0 +1,189 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <Board.h>\r
+#include <ti/drivers/UART.h>\r
+//#include <ti/drivers/uart/UARTCC26XX.h>\r
+#include <stdint.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+#define UART_PRINTF_BUF_LEN 1024\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * LOCAL VARIABLES\r
+ */\r
+static uint8_t uartPrintf_outArray[UART_PRINTF_BUF_LEN];\r
+static uint16_t uartPrintf_head = 0;\r
+static uint16_t uartPrintf_tail = 0;\r
+static UART_Handle hUart = NULL;\r
+\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle)\r
+{\r
+ hUart = handle;\r
+}\r
+\r
+/*********************************************************************\r
+ * SYSTEM HOOK FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_putch\r
+ *\r
+ * @brief User supplied PutChar function.\r
+ * typedef Void (*SysCallback_PutchFxn)(Char);\r
+ *\r
+ * This function is called whenever the System module needs\r
+ * to output a character.\r
+ *\r
+ * This implementation fills a very basic ring-buffer, and relies\r
+ * on another function to flush this buffer out to UART.\r
+ *\r
+ * Requires SysCallback to be the system provider module.\r
+ * Initialized via SysCallback.putchFxn = "&uartPrintf_putch"; in the\r
+ * TI-RTOS configuration script.\r
+ *\r
+ * @param ch - Character\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_head is incremented by one with wrap at UART_PRINTF_BUF_LEN\r
+ * if there is room.\r
+ */\r
+void uartPrintf_putch(char ch)\r
+{\r
+ // uartPrintf_tail should never catch up with uartPrintf_head. Discard in-between bytes.\r
+ if ( (uartPrintf_head + 1) % UART_PRINTF_BUF_LEN == uartPrintf_tail )\r
+ return;\r
+\r
+ uartPrintf_outArray[uartPrintf_head] = ch;\r
+ uartPrintf_head++;\r
+\r
+ if (uartPrintf_head >= UART_PRINTF_BUF_LEN)\r
+ uartPrintf_head = 0;\r
+}\r
+\r
+/*********************************************************************\r
+ * @fn uartPrintf_flush\r
+ *\r
+ * @brief Printf-buffer flush function\r
+ *\r
+ * In this implementation it is intended to be called by the\r
+ * Idle task when nothing else is running.\r
+ *\r
+ * This is achieved by setting up the Idle task in the TI-RTOS\r
+ * configuration script like so:\r
+ *\r
+ * var Idle = xdc.useModule('ti.sysbios.knl.Idle');\r
+ * Idle.addFunc('&uartPrintf_flush');\r
+ *\r
+ * @param None. Relies on global state.\r
+ *\r
+ * @return None.\r
+ *\r
+ * @post ::uartPrintf_tail is incremented to where uartPrintf_head\r
+ * was at the time the function was called.\r
+ */\r
+void uartPrintf_flush()\r
+{\r
+ // Abort in case UART hasn't been initialized.\r
+ if (NULL == hUart)\r
+ return;\r
+\r
+ // Lock head position to avoid race conditions\r
+ uint16_t curHead = uartPrintf_head;\r
+\r
+ // Find out how much data must be output, and how to output it.\r
+ int needWrap = curHead < uartPrintf_tail;\r
+\r
+ uint16_t outLen = needWrap?(UART_PRINTF_BUF_LEN-uartPrintf_tail+curHead):(curHead-uartPrintf_tail);\r
+\r
+ if (outLen)\r
+ {\r
+ if (needWrap)\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], UART_PRINTF_BUF_LEN - uartPrintf_tail);\r
+ UART_write(hUart, uartPrintf_outArray, curHead);\r
+ }\r
+ else\r
+ {\r
+ UART_write(hUart, &uartPrintf_outArray[uartPrintf_tail], outLen);\r
+ }\r
+ }\r
+\r
+ uartPrintf_tail = curHead;\r
+}\r
+\r
+\r
+char uart_getch()\r
+{\r
+ char input;\r
+\r
+ if (NULL == hUart)\r
+ return 0;\r
+\r
+ // Blocking Read\r
+ UART_read(hUart,&input,1);\r
+ return input;\r
+}\r
+\r
+\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/uart_printf.h b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/uart_printf.h
--- /dev/null
@@ -0,0 +1,83 @@
+/**************************************************************************************************\r
+ Filename: uart_printf.c\r
+\r
+ Description: This file contains the TI-RTOS hooks for printing to UART via\r
+ System_printf(..).\r
+\r
+ This is a very basic implementation made for the purposes of\r
+ terminal feedback in workshops, trainings and debug.\r
+\r
+ Copyright 2015 Texas Instruments Incorporated. All rights reserved.\r
+\r
+ IMPORTANT: Your use of this Software is limited to those specific rights\r
+ granted under the terms of a software license agreement between the user\r
+ who downloaded the software, his/her employer (which must be your employer)\r
+ and Texas Instruments Incorporated (the "License"). You may not use this\r
+ Software unless you agree to abide by the terms of the License. The License\r
+ limits your use, and you acknowledge, that the Software may not be modified,\r
+ copied or distributed unless embedded on a Texas Instruments microcontroller\r
+ or used solely and exclusively in conjunction with a Texas Instruments radio\r
+ frequency transceiver, which is integrated into your product. Other than for\r
+ the foregoing purpose, you may not use, reproduce, copy, prepare derivative\r
+ works of, modify, distribute, perform, display or sell this Software and/or\r
+ its documentation for any purpose.\r
+\r
+ YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE\r
+ PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,\r
+ INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,\r
+ NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL\r
+ TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,\r
+ NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER\r
+ LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES\r
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE\r
+ OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT\r
+ OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES\r
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.\r
+\r
+ Should you have any questions regarding your right to use this Software,\r
+ contact Texas Instruments Incorporated at www.TI.com.\r
+**************************************************************************************************/\r
+\r
+#ifndef UART_PRINTF_H\r
+#define UART_PRINTF_H\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+/*********************************************************************\r
+ * INCLUDES\r
+ */\r
+#include <ti/drivers/UART.h>\r
+\r
+/*********************************************************************\r
+ * CONSTANTS\r
+ */\r
+\r
+/*********************************************************************\r
+ * TYPEDEFS\r
+ */\r
+\r
+/*********************************************************************\r
+ * PUBLIC FUNCTIONS\r
+ */\r
+\r
+/*********************************************************************\r
+ * @fn UartPrintf_init\r
+ *\r
+ * @brief Initializes the putchar hooks with the handle to the UART.\r
+ *\r
+ * @param handle - UART driver handle to an initialized and opened UART.\r
+ *\r
+ * @return None.\r
+ */\r
+void UartPrintf_init(UART_Handle handle);\r
+\r
+char uart_getch();\r
+void uartPrintf_putch(char);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif // UART_PRINTF_H\r
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/Board.h b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/Board.h
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef __BOARD_H
+#define __BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "MSP432P401R_I3M.h"
+
+#define Board_initADC MSP_I3MSP432P401R_initADC
+#define Board_initGeneral MSP_I3MSP432P401R_initGeneral
+#define Board_initGPIO MSP_I3MSP432P401R_initGPIO
+#define Board_initI2C MSP_I3MSP432P401R_initI2C
+#define Board_initPWM MSP_I3MSP432P401R_initPWM
+#define Board_initSDSPI MSP_I3MSP432P401R_initSDSPI
+#define Board_initSPI MSP_I3MSP432P401R_initSPI
+#define Board_initUART MSP_I3MSP432P401R_initUART
+#define Board_initWatchdog MSP_I3MSP432P401R_initWatchdog
+#define Board_initWiFi MSP_I3MSP432P401R_initWiFi
+
+#define Board_ADC0 MSP_I3MSP432P401R_ADC0
+#define Board_ADC1 MSP_I3MSP432P401R_ADC1
+
+#define Board_LED_ON MSP_I3MSP432P401R_LED_ON
+#define Board_LED_OFF MSP_I3MSP432P401R_LED_OFF
+
+#define Board_BUTTON0 MSP_I3MSP432P401R_S1
+#define Board_BUTTON1 MSP_I3MSP432P401R_S2
+#define Board_LED0 MSP_I3MSP432P401R_LED_GREEN
+#define Board_LED1 MSP_I3MSP432P401R_LED_RED
+
+
+#define Board_SPI0_CS MSP_I3MSP432P401R_SPIB0_CS
+#define Board_SPI1_CS MSP_I3MSP432P401R_SPIA1_CS
+#define Board_SPI2_CS MSP_I3MSP432P401R_SPIA2_CS
+
+#define Board_SPI0_IRQ MSP_I3MSP432P401R_SPIB0_IRQ
+#define Board_SPI1_IRQ MSP_I3MSP432P401R_SPIA1_IRQ
+#define Board_SPI2_IRQ MSP_I3MSP432P401R_SPIA2_IRQ
+
+
+
+/*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+
+
+#define Board_I2C0 MSP_I3MSP432P401R_I2CB2
+
+//#define Board_PWM0 MSP_I3MSP432P401R_PWM_TA1_1
+//#define Board_PWM1 MSP_I3MSP432P401R_PWM_TA1_2
+
+//#define Board_SDSPI0 MSP_I3MSP432P401R_SDSPIB0
+
+#define Board_SPI0 MSP_I3MSP432P401R_SPIB0
+#define Board_SPI1 MSP_I3MSP432P401R_SPIA1
+#define Board_SPI2 MSP_I3MSP432P401R_SPIA2
+
+#define Board_UART MSP_I3MSP432P401R_UARTA0
+//#define Board_UART0 MSP_I3MSP432P401R_UARTA0
+//#define Board_UART1 MSP_I3MSP432P401R_UARTA2
+
+#define Board_WATCHDOG0 MSP_I3MSP432P401R_WATCHDOG
+
+//#define Board_WIFI MSP_I3MSP432P401R_WIFI
+//#define Board_WIFI_SPI MSP_I3MSP432P401R_SPIB0
+
+/* Board specific I2C addresses */
+
+#define EEPROM_SLAVE_ADDRESS (0x50)
+
+/* Sensors */
+#define Board_INA219_ADDR (0x41)
+#define Board_HDC1000_ADDR (0x43)
+#define Board_HDC1080_ADDR (0x40)
+#define Board_TMP007_ADDR (0x44)
+#define Board_OPT3001_ADDR (0x45)
+#define Board_MPU9250_ADDR (0x68)
+#define Board_BMP280_ADDR (0x77)
+#define Board_LISHH12_ADDR (0x1E)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARD_H */
+
+
+
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/I3MSP432P401R.cmd b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/I3MSP432P401R.cmd
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+/*
+ * ======== MSP_EXP432P401R.cmd ========
+ * Define the memory block start/length for the MSP_EXP432P401R M4
+ */
+
+MEMORY
+{
+ MAIN (RX) : origin = 0x00000000, length = 0x00040000
+ INFO (RX) : origin = 0x00200000, length = 0x00004000
+ SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
+ SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
+}
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .text : > MAIN
+ .const : > MAIN
+ .cinit : > MAIN
+ .pinit : > MAIN
+
+#ifdef __TI_COMPILER_VERSION__
+#if __TI_COMPILER_VERSION__ >= 15009000
+ .TI.ramfunc : {} load=MAIN, run=SRAM_CODE, table(BINIT)
+#endif
+#endif
+ .data : > SRAM_DATA
+ .bss : > SRAM_DATA
+ .sysmem : > SRAM_DATA
+ .stack : > SRAM_DATA (HIGH)
+}
+
+/* Symbolic definition of the WDTCTL register for RTS */
+WDTCTL_SYM = 0x4000480C;
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/I3MSP432rtos.cfg b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/I3MSP432rtos.cfg
--- /dev/null
@@ -0,0 +1,542 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+
+
+/* ================ Clock configuration ================ */
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+/*
+ * Default value is family dependent. For example, Linux systems often only
+ * support a minimum period of 10000 us and multiples of 10000 us.
+ * TI platforms have a default of 1000 us.
+ */
+Clock.tickPeriod = 1000;
+
+
+
+/* ================ Defaults (module) configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+/*
+ * A flag to allow module names to be loaded on the target. Module name
+ * strings are placed in the .const section for debugging purposes.
+ *
+ * Pick one:
+ * - true (default)
+ * Setting this parameter to true will include name strings in the .const
+ * section so that Errors and Asserts are easier to debug.
+ * - false
+ * Setting this parameter to false will reduce footprint in the .const
+ * section. As a result, Error and Assert messages will contain an
+ * "unknown module" prefix instead of the actual module name.
+ */
+Defaults.common$.namedModule = true;
+//Defaults.common$.namedModule = false;
+
+
+
+/* ================ Error configuration ================ */
+var Error = xdc.useModule('xdc.runtime.Error');
+/*
+ * This function is called to handle all raised errors, but unlike
+ * Error.raiseHook, this function is responsible for completely handling the
+ * error with an appropriately initialized Error_Block.
+ *
+ * Pick one:
+ * - Error.policyDefault (default)
+ * Calls Error.raiseHook with an initialized Error_Block structure and logs
+ * the error using the module's logger.
+ * - Error.policySpin
+ * Simple alternative that traps on a while(1) loop for minimized target
+ * footprint.
+ * Using Error.policySpin, the Error.raiseHook will NOT called.
+ */
+Error.policyFxn = Error.policyDefault;
+//Error.policyFxn = Error.policySpin;
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this function is called
+ * whenever an error is raised by the Error module.
+ *
+ * Pick one:
+ * - Error.print (default)
+ * Errors are formatted and output via System_printf() for easier
+ * debugging.
+ * - null
+ * Errors are not formatted or logged. This option reduces code footprint.
+ * - non-null function
+ * Errors invoke custom user function. See the Error module documentation
+ * for more details.
+ */
+Error.raiseHook = Error.print;
+//Error.raiseHook = null;
+//Error.raiseHook = "&myErrorFxn";
+
+/*
+ * If Error.policyFxn is set to Error.policyDefault, this option applies to the
+ * maximum number of times the Error.raiseHook function can be recursively
+ * invoked. This option limits the possibility of an infinite recursion that
+ * could lead to a stack overflow.
+ * The default value is 16.
+ */
+Error.maxDepth = 2;
+
+
+
+/* ================ Hwi configuration ================ */
+var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
+/*
+ * Checks for Hwi (system) stack overruns while in the Idle loop.
+ *
+ * Pick one:
+ * - true (default)
+ * Checks the top word for system stack overflows during the idle loop and
+ * raises an Error if one is detected.
+ * - false
+ * Disabling the runtime check improves runtime performance and yields a
+ * reduced flash footprint.
+ */
+halHwi.checkStackFlag = true;
+//halHwi.checkStackFlag = false;
+
+/*
+ * The following options alter the system's behavior when a hardware exception
+ * is detected.
+ *
+ * Pick one:
+ * - Hwi.enableException = true
+ * This option causes the default m3Hwi.excHandlerFunc function to fully
+ * decode an exception and dump the registers to the system console.
+ * This option raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.enableException = false
+ * This option reduces code footprint by not decoding or printing the
+ * exception to the system console.
+ * It however still raises errors in the Error module and displays the
+ * exception in ROV.
+ * - Hwi.excHandlerFunc = null
+ * This is the most aggressive option for code footprint savings; but it
+ * can difficult to debug exceptions. It reduces flash footprint by
+ * plugging in a default while(1) trap when exception occur. This option
+ * does not raise an error with the Error module.
+ */
+m3Hwi.enableException = true;
+//m3Hwi.enableException = false;
+//m3Hwi.excHandlerFunc = null;
+
+/*
+ * Enable hardware exception generation when dividing by zero.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions when dividing by zero
+ * - 1
+ * Enables hardware exceptions when dividing by zero
+ */
+m3Hwi.nvicCCR.DIV_0_TRP = 0;
+//m3Hwi.nvicCCR.DIV_0_TRP = 1;
+
+/*
+ * Enable hardware exception generation for invalid data alignment.
+ *
+ * Pick one:
+ * - 0 (default)
+ * Disables hardware exceptions for data alignment
+ * - 1
+ * Enables hardware exceptions for data alignment
+ */
+m3Hwi.nvicCCR.UNALIGN_TRP = 0;
+//m3Hwi.nvicCCR.UNALIGN_TRP = 1;
+
+
+
+/* ================ Idle configuration ================ */
+var Idle = xdc.useModule('ti.sysbios.knl.Idle');
+/*
+ * The Idle module is used to specify a list of functions to be called when no
+ * other tasks are running in the system.
+ *
+ * Functions added here will be run continuously within the idle task.
+ *
+ * Function signature:
+ * Void func(Void);
+ */
+//Idle.addFunc("&myIdleFunc");
+
+
+
+/* ================ Kernel (SYS/BIOS) configuration ================ */
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Enable asserts in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables asserts for debugging purposes.
+ * - false
+ * Disables asserts for a reduced code footprint and better performance.
+ */
+BIOS.assertsEnabled = true;
+//BIOS.assertsEnabled = false;
+
+/*
+ * Specify default heap size for BIOS.
+ */
+BIOS.heapSize = 1024;
+
+/*
+ * A flag to determine if xdc.runtime sources are to be included in a custom
+ * built BIOS library.
+ *
+ * Pick one:
+ * - false (default)
+ * The pre-built xdc.runtime library is provided by the respective target
+ * used to build the application.
+ * - true
+ * xdc.runtime library sources are to be included in the custom BIOS
+ * library. This option yields the most efficient library in both code
+ * footprint and runtime performance.
+ */
+BIOS.includeXdcRuntime = false;
+//BIOS.includeXdcRuntime = true;
+
+/*
+ * The SYS/BIOS runtime is provided in the form of a library that is linked
+ * with the application. Several forms of this library are provided with the
+ * SYS/BIOS product.
+ *
+ * Pick one:
+ * - BIOS.LibType_Custom
+ * Custom built library that is highly optimized for code footprint and
+ * runtime performance.
+ * - BIOS.LibType_Debug
+ * Custom built library that is non-optimized that can be used to
+ * single-step through APIs with a debugger.
+ *
+ */
+BIOS.libType = BIOS.LibType_Custom;
+//BIOS.libType = BIOS.LibType_Debug;
+
+/*
+ * Runtime instance creation enable flag.
+ *
+ * Pick one:
+ * - true (default)
+ * Allows Mod_create() and Mod_delete() to be called at runtime which
+ * requires a default heap for dynamic memory allocation.
+ * - false
+ * Reduces code footprint by disallowing Mod_create() and Mod_delete() to
+ * be called at runtime. Object instances are constructed via
+ * Mod_construct() and destructed via Mod_destruct().
+ */
+BIOS.runtimeCreatesEnabled = true;
+//BIOS.runtimeCreatesEnabled = false;
+
+/*
+ * Enable logs in the BIOS library.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables logs for debugging purposes.
+ * - false
+ * Disables logging for reduced code footprint and improved runtime
+ * performance.
+ */
+//BIOS.logsEnabled = true;
+BIOS.logsEnabled = false;
+
+
+
+/* ================ Memory configuration ================ */
+var Memory = xdc.useModule('xdc.runtime.Memory');
+/*
+ * The Memory module itself simply provides a common interface for any
+ * variety of system and application specific memory management policies
+ * implemented by the IHeap modules(Ex. HeapMem, HeapBuf).
+ */
+
+
+
+/* ================ Program configuration ================ */
+/*
+ * Program.stack is ignored with IAR. Use the project options in
+ * IAR Embedded Workbench to alter the system stack size.
+ */
+if (!Program.build.target.$name.match(/iar/)) {
+ /*
+ * Reducing the system stack size (used by ISRs and Swis) to reduce
+ * RAM usage.
+ */
+ Program.stack = 768;
+}
+
+
+
+/*
+ * Uncomment to enable Semihosting for GNU targets to print to the CCS console.
+ * Please read the following TIRTOS Wiki page for more information on Semihosting:
+ * http://processors.wiki.ti.com/index.php/TI-RTOS_Examples_SemiHosting
+ */
+
+if (Program.build.target.$name.match(/gnu/)) {
+ //var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+}
+/* ================ Semaphore configuration ================ */
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+/*
+ * Enables global support for Task priority pend queuing.
+ *
+ * Pick one:
+ * - true (default)
+ * This allows pending tasks to be serviced based on their task priority.
+ * - false
+ * Pending tasks are services based on first in, first out basis.
+ *
+ * When using BIOS in ROM:
+ * This option must be set to false.
+ */
+//Semaphore.supportsPriority = true;
+Semaphore.supportsPriority = false;
+
+/*
+ * Allows for the implicit posting of events through the semaphore,
+ * disable for additional code saving.
+ *
+ * Pick one:
+ * - true
+ * This allows the Semaphore module to post semaphores and events
+ * simultaneously.
+ * - false (default)
+ * Events must be explicitly posted to unblock tasks.
+ *
+ */
+//Semaphore.supportsEvents = true;
+Semaphore.supportsEvents = false;
+
+
+
+/* ================ Swi configuration ================ */
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+/*
+ * A software interrupt is an object that encapsulates a function to be
+ * executed and a priority. Software interrupts are prioritized, preempt tasks
+ * and are preempted by hardware interrupt service routines.
+ *
+ * This module is included to allow Swi's in a users' application.
+ */
+
+
+
+/* ================ System configuration ================ */
+var System = xdc.useModule('xdc.runtime.System');
+/*
+ * The Abort handler is called when the system exits abnormally.
+ *
+ * Pick one:
+ * - System.abortStd (default)
+ * Call the ANSI C Standard 'abort()' to terminate the application.
+ * - System.abortSpin
+ * A lightweight abort function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom abort handler
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.abortFxn = System.abortStd;
+//System.abortFxn = System.abortSpin;
+//System.abortFxn = "&myAbortSystem";
+
+/*
+ * The Exit handler is called when the system exits normally.
+ *
+ * Pick one:
+ * - System.exitStd (default)
+ * Call the ANSI C Standard 'exit()' to terminate the application.
+ * - System.exitSpin
+ * A lightweight exit function that loops indefinitely in a while(1) trap
+ * function.
+ * - A custom exit function
+ * A user-defined function. See the System module documentation for
+ * details.
+ */
+System.exitFxn = System.exitStd;
+//System.exitFxn = System.exitSpin;
+//System.exitFxn = "&myExitSystem";
+
+/*
+ * Minimize exit handler array in the System module. The System module includes
+ * an array of functions that are registered with System_atexit() which is
+ * called by System_exit(). The default value is 8.
+ */
+System.maxAtexitHandlers = 2;
+
+/*
+ * The System.SupportProxy defines a low-level implementation of System
+ * functions such as System_printf(), System_flush(), etc.
+ *
+ * Pick one pair:
+ * - SysMin
+ * This module maintains an internal configurable circular buffer that
+ * stores the output until System_flush() is called.
+ * The size of the circular buffer is set via SysMin.bufSize.
+ * - SysCallback
+ * SysCallback allows for user-defined implementations for System APIs.
+ * The SysCallback support proxy has a smaller code footprint and can be
+ * used to supply custom System_printf services.
+ * The default SysCallback functions point to stub functions. See the
+ * SysCallback module's documentation.
+ */
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+SysMin.bufSize = 128;
+System.SupportProxy = SysMin;
+//var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
+//System.SupportProxy = SysCallback;
+//SysCallback.abortFxn = "&myUserAbort";
+//SysCallback.exitFxn = "&myUserExit";
+//SysCallback.flushFxn = "&myUserFlush";
+//SysCallback.putchFxn = "&myUserPutch";
+//SysCallback.readyFxn = "&myUserReady";
+
+
+
+
+/* ================ Task configuration ================ */
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+/*
+ * Check task stacks for overflow conditions.
+ *
+ * Pick one:
+ * - true (default)
+ * Enables runtime checks for task stack overflow conditions during
+ * context switching ("from" and "to")
+ * - false
+ * Disables runtime checks for task stack overflow conditions.
+ */
+Task.checkStackFlag = true;
+//Task.checkStackFlag = false;
+
+/*
+ * Set the default task stack size when creating tasks.
+ *
+ * The default is dependent on the device being used. Reducing the default stack
+ * size yields greater memory savings.
+ */
+Task.defaultStackSize = 512;
+
+/*
+ * Enables the idle task.
+ *
+ * Pick one:
+ * - true (default)
+ * Creates a task with priority of 0 which calls idle hook functions. This
+ * option must be set to true to gain power savings provided by the Power
+ * module.
+ * - false
+ * No idle task is created. This option consumes less memory as no
+ * additional default task stack is needed.
+ * To gain power savings by the Power module without having the idle task,
+ * add Idle.run as the Task.allBlockedFunc.
+ */
+Task.enableIdleTask = true;
+//Task.enableIdleTask = false;
+//Task.allBlockedFunc = Idle.run;
+
+/*
+ * If Task.enableIdleTask is set to true, this option sets the idle task's
+ * stack size.
+ *
+ * Reducing the idle stack size yields greater memory savings.
+ */
+Task.idleTaskStackSize = 512;
+
+/*
+ * Reduce the number of task priorities.
+ * The default is 16.
+ * Decreasing the number of task priorities yield memory savings.
+ */
+Task.numPriorities = 16;
+
+
+
+/* ================ Text configuration ================ */
+var Text = xdc.useModule('xdc.runtime.Text');
+/*
+ * These strings are placed in the .const section. Setting this parameter to
+ * false will save space in the .const section. Error, Assert and Log messages
+ * will print raw ids and args instead of a formatted message.
+ *
+ * Pick one:
+ * - true (default)
+ * This option loads test string into the .const for easier debugging.
+ * - false
+ * This option reduces the .const footprint.
+ */
+Text.isLoaded = true;
+//Text.isLoaded = false;
+
+
+
+/* ================ Types configuration ================ */
+var Types = xdc.useModule('xdc.runtime.Types');
+/*
+ * This module defines basic constants and types used throughout the
+ * xdc.runtime package.
+ */
+
+
+
+/* ================ TI-RTOS middleware configuration ================ */
+var mwConfig = xdc.useModule('ti.mw.Config');
+/*
+ * Include TI-RTOS middleware libraries
+ */
+
+
+
+/* ================ TI-RTOS drivers' configuration ================ */
+var driversConfig = xdc.useModule('ti.drivers.Config');
+/*
+ * Include TI-RTOS drivers
+ *
+ * Pick one:
+ * - driversConfig.LibType_NonInstrumented (default)
+ * Use TI-RTOS drivers library optimized for footprint and performance
+ * without asserts or logs.
+ * - driversConfig.LibType_Instrumented
+ * Use TI-RTOS drivers library for debugging with asserts and logs enabled.
+ */
+driversConfig.libType = driversConfig.LibType_NonInstrumented;
+//driversConfig.libType = driversConfig.LibType_Instrumented;
+
+
+
+/* ================ Application Specific Instances ================ */
\ No newline at end of file
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/MSP432P401R_I3M.c b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/MSP432P401R_I3M.c
--- /dev/null
@@ -0,0 +1,758 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * ======== MSP_I3MSP432P401R.c ========
+ * This file is responsible for setting up the board specific items for the
+ * MSP_I3MSP432P401R board.
+ */
+
+#include <stdbool.h>
+
+#include <ti/drivers/Power.h>
+#include <ti/drivers/power/PowerMSP432.h>
+
+#include <msp.h>
+#include <rom.h>
+#include <rom_map.h>
+#include <dma.h>
+#include <gpio.h>
+#include <i2c.h>
+#include <pmap.h>
+#include <spi.h>
+#include <timer_a.h>
+#include <uart.h>
+#include <wdt_a.h>
+#include <adc14.h>
+#include <ref_a.h>
+#include <interrupt.h>
+
+#include <MSP432P401R_I3M.h>
+
+/*
+ * =============================== ADC ===============================
+ */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(ADC_config, ".const:ADC_config")
+#pragma DATA_SECTION(adcMSP432HWAttrs, ".const:adcMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/ADC.h>
+#include <ti/drivers/adc/ADCMSP432.h>
+
+/* ADC objects */
+ADCMSP432_Object adcMSP432Objects[MSP_I3MSP432P401R_ADCCOUNT];
+
+/* ADC configuration structure */
+const ADCMSP432_HWAttrs adcMSP432HWAttrs[MSP_I3MSP432P401R_ADCCOUNT] = {
+ {
+ .channel = ADC_INPUT_A0,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN5,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF2_5V,
+ .resolution = ADC_14BIT
+ },
+ {
+ .channel = ADC_INPUT_A1,
+ .gpioPort = GPIO_PORT_P5,
+ .gpioPin = GPIO_PIN4,
+ .gpioMode = GPIO_TERTIARY_MODULE_FUNCTION,
+ .refVoltage = REF_A_VREF1_45V,
+ .resolution = ADC_8BIT
+ }
+};
+
+const ADC_Config ADC_config[] = {
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[0],
+ .hwAttrs = &adcMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &ADCMSP432_fxnTable,
+ .object = &adcMSP432Objects[1],
+ .hwAttrs = &adcMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+void MSP_I3MSP432P401R_initADC(void)
+{
+ ADC_init();
+}
+
+/*
+ * =============================== DMA ===============================
+ */
+
+#include <ti/drivers/dma/UDMAMSP432.h>
+
+
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_ALIGN(dmaControlTable, 256)
+#elif defined(__IAR_SYSTEMS_ICC__)
+#pragma data_alignment=256
+#elif defined(__GNUC__)
+__attribute__ ((aligned (256)))
+#endif
+static DMA_ControlTable dmaControlTable[8];
+
+/*
+ * ======== dmaErrorHwi ========
+ * This is the handler for the uDMA error interrupt.
+ */
+static void dmaErrorHwi(uintptr_t arg)
+{
+ int status = MAP_DMA_getErrorStatus();
+ MAP_DMA_clearErrorStatus();
+
+ /* Suppress unused variable warning */
+ (void)status;
+
+ while (1);
+}
+
+UDMAMSP432_Object udmaMSP432Object;
+
+const UDMAMSP432_HWAttrs udmaMSP432HWAttrs = {
+ .controlBaseAddr = (void *)dmaControlTable,
+ .dmaErrorFxn = (UDMAMSP432_ErrorFxn)dmaErrorHwi,
+ .intNum = INT_DMA_ERR,
+ .intPriority = (~0)
+};
+
+const UDMAMSP432_Config UDMAMSP432_config = {
+ .object = &udmaMSP432Object,
+ .hwAttrs = &udmaMSP432HWAttrs
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGeneral ========
+ */
+void MSP_I3MSP432P401R_initGeneral(void)
+{
+ Power_init();
+}
+
+/*
+ * =============================== GPIO ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(GPIOMSP432_config, ".const:GPIOMSP432_config")
+#endif
+
+#include <ti/drivers/GPIO.h>
+#include <ti/drivers/gpio/GPIOMSP432.h>
+
+/*
+ * Array of Pin configurations
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts should be placed at the end of the
+ * array. Callback entries can be omitted from callbacks array to
+ * reduce memory usage.
+ */
+GPIO_PinConfig gpioPinConfigs[] = {
+ /* Input pins */
+ /* MSP_I3MSP432P401R_S1 */
+ GPIOMSP432_P6_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+
+ /* Output pins */
+ /* MSP_I3MSP432P401R_SPI1_IRQ */
+ GPIOMSP432_P4_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI1_CS */
+ GPIOMSP432_P2_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_SPI2_CS */
+ GPIOMSP432_P3_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ /* MSP_I3MSP432P401R_LED_GREEN */
+ GPIOMSP432_P6_2 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /* MSP_I3MSP432P401R_LED_RED */
+ GPIOMSP432_P6_3 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW
+
+};
+
+/*
+ * Array of callback function pointers
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_I3MSP432P401R.h
+ * NOTE: Pins not used for interrupts can be omitted from callbacks array to
+ * reduce memory usage (if placed at end of gpioPinConfigs array).
+ */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+ /* MSP_I3MSP432P401R_S1 */
+ NULL,
+ /* MSP_I3MSP432P401R_S2 */
+ NULL
+};
+
+const GPIOMSP432_Config GPIOMSP432_config = {
+ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
+ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
+ .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
+ .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
+ .intPriority = (~0)
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initGPIO ========
+ */
+void MSP_I3MSP432P401R_initGPIO(void)
+{
+ /* Initialize peripheral and pins */
+ GPIO_init();
+}
+
+/*
+ * =============================== I2C ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
+#pragma DATA_SECTION(i2cMSP432HWAttrs, ".const:i2cMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/I2C.h>
+#include <ti/drivers/i2c/I2CMSP432.h>
+
+I2CMSP432_Object i2cMSP432Objects[MSP_I3MSP432P401R_I2CCOUNT];
+
+const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_I3MSP432P401R_I2CCOUNT] = {
+ {
+ .baseAddr = EUSCI_B2_BASE,
+ .intNum = INT_EUSCIB2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK
+ }
+};
+
+const I2C_Config I2C_config[] = {
+ {
+ .fxnTablePtr = &I2CMSP432_fxnTable,
+ .object = &i2cMSP432Objects[0],
+ .hwAttrs = &i2cMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initI2C ========
+ */
+void MSP_I3MSP432P401R_initI2C(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+ /* Configure Pins 1.6 & 1.7 as SDA & SCL, respectively. */
+ // BMH MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ // BMH GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+ /* Initialize the I2C driver */
+ I2C_init();
+}
+
+/*
+ * =============================== Power ===============================
+ */
+const PowerMSP432_ConfigV1 PowerMSP432_config = {
+ .policyInitFxn = &PowerMSP432_initPolicy,
+ .policyFxn = &PowerMSP432_sleepPolicy,
+ .initialPerfLevel = 2,
+ .enablePolicy = true,
+ .enablePerf = true,
+ .enableParking = true
+};
+
+/*
+ * =============================== PWM ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
+#pragma DATA_SECTION(pwmTimerMSP432HWAttrs, ".const:pwmTimerMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/PWM.h>
+#include <ti/drivers/pwm/PWMTimerMSP432.h>
+
+PWMTimerMSP432_Object pwmTimerMSP432Objects[MSP_I3MSP432P401R_PWMCOUNT];
+
+const PWMTimerMSP432_HWAttrsV1 pwmTimerMSP432HWAttrs[MSP_I3MSP432P401R_PWMCOUNT] = {
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN1,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ },
+ {
+ .timerBaseAddr = TIMER_A1_BASE,
+ .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2,
+ .gpioPort = GPIO_PORT_P2,
+ .gpioPinIndex = GPIO_PIN2,
+ .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
+ }
+};
+
+const PWM_Config PWM_config[] = {
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[0],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &PWMTimerMSP432_fxnTable,
+ .object = &pwmTimerMSP432Objects[1],
+ .hwAttrs = &pwmTimerMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initPWM ========
+ */
+void MSP_I3MSP432P401R_initPWM(void)
+{
+ /* Use Port Map on Port2 get Timer outputs on pins with LEDs (2.1, 2.2) */
+ const uint8_t portMap [] = {
+ PM_NONE, PM_TA1CCR1A, PM_TA1CCR2A, PM_NONE,
+ PM_NONE, PM_NONE, PM_NONE, PM_NONE
+ };
+
+ /* Mapping capture compare registers to Port 2 */
+ MAP_PMAP_configurePorts((const uint8_t *) portMap, PMAP_P2MAP, 1,
+ PMAP_DISABLE_RECONFIGURATION);
+
+ PWM_init();
+}
+
+/*
+ * =============================== SDSPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if 0
+ #if defined(__TI_COMPILER_VERSION__)
+ #pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
+ #pragma DATA_SECTION(sdspiMSP432HWAttrs, ".const:sdspiMSP432HWAttrs")
+ #endif
+
+ #include <ti/drivers/SDSPI.h>
+ #include <ti/drivers/sdspi/SDSPIMSP432.h>
+
+ SDSPIMSP432_Object sdspiMSP432Objects[MSP_I3MSP432P401R_SDSPICOUNT];
+
+ const SDSPIMSP432_HWAttrs sdspiMSP432HWAttrs[MSP_I3MSP432P401R_SDSPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ /* CLK, MOSI & MISO ports & pins */
+ .portSCK = GPIO_PORT_P1,
+ .pinSCK = GPIO_PIN5,
+ .sckMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMISO = GPIO_PORT_P1,
+ .pinMISO = GPIO_PIN7,
+ .misoMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ .portMOSI = GPIO_PORT_P1,
+ .pinMOSI = GPIO_PIN6,
+ .mosiMode = GPIO_PRIMARY_MODULE_FUNCTION,
+
+ /* Chip select port & pin */
+ .portCS = GPIO_PORT_P4,
+ .pinCS = GPIO_PIN6
+ }
+ };
+
+ const SDSPI_Config SDSPI_config[] = {
+ {
+ .fxnTablePtr = &SDSPIMSP432_fxnTable,
+ .object = &sdspiMSP432Objects[0],
+ .hwAttrs = &sdspiMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+ };
+#endif
+
+/*
+ * ======== MSP_I3MSP432P401R_initSDSPI ========
+ */
+#if 0
+
+ void MSP_I3MSP432P401R_initSDSPI(void)
+ {
+ SDSPI_init();
+ }
+
+#endif
+
+/*
+ * =============================== SPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
+#pragma DATA_SECTION(spiMSP432DMAHWAttrs, ".const:spiMSP432DMAHWAttrs")
+#endif
+
+#include <ti/drivers/SPI.h>
+#include <ti/drivers/spi/SPIMSP432DMA.h>
+
+SPIMSP432DMA_Object spiMSP432DMAObjects[MSP_I3MSP432P401R_SPICOUNT];
+
+const SPIMSP432DMA_HWAttrs spiMSP432DMAHWAttrs[MSP_I3MSP432P401R_SPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT0,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH1_EUSCIB0RX0,
+ .txDMAChannelIndex = DMA_CH0_EUSCIB0TX0
+ },
+ {
+ .baseAddr = EUSCI_A1_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT1,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH3_EUSCIA1RX,
+ .txDMAChannelIndex = DMA_CH2_EUSCIA1TX
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .bitOrder = EUSCI_A_SPI_MSB_FIRST,
+ .clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT2,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH5_EUSCIA2RX,
+ .txDMAChannelIndex = DMA_CH4_EUSCIA2TX
+ }
+
+};
+
+const SPI_Config SPI_config[] = {
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[0],
+ .hwAttrs = &spiMSP432DMAHWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[1],
+ .hwAttrs = &spiMSP432DMAHWAttrs[1]
+ },
+
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[2],
+ .hwAttrs = &spiMSP432DMAHWAttrs[2]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initSPI ========
+ */
+void MSP_I3MSP432P401R_initSPI(void)
+{
+ /*
+ * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C. Thus,
+ * a conflict occurs when the I2C & SPI drivers are used simultaneously in
+ * an application. Modify the pin mux settings in this file and resolve the
+ * conflict before running your the application.
+ */
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+
+/* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A1)*/
+#if 0
+ #warning SPI_SLAVE_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2,
+ GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+#if 1
+ #warning SPI_MASTER_MODE
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+#endif
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_A2) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,
+ GPIO_PIN1 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN2,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ SPI_init();
+}
+
+/*
+ * =============================== UART ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(UART_config, ".const:UART_config")
+#pragma DATA_SECTION(uartMSP432HWAttrs, ".const:uartMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/UART.h>
+#include <ti/drivers/uart/UARTMSP432.h>
+
+UARTMSP432_Object uartMSP432Objects[MSP_I3MSP432P401R_UARTCOUNT];
+unsigned char uartMSP432RingBuffer[MSP_I3MSP432P401R_UARTCOUNT][32];
+
+/*
+ * The baudrate dividers were determined by using the MSP430 baudrate
+ * calculator
+ * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
+ */
+const UARTMSP432_BaudrateConfig uartMSP432Baudrates[] = {
+ /* {baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling} */
+ {
+ .outputBaudrate = 115200,
+ .inputClockFreq = 12000000,
+ .prescalar = 6,
+ .hwRegUCBRFx = 8,
+ .hwRegUCBRSx = 32,
+ .oversampling = 1
+ },
+ {115200, 6000000, 3, 4, 2, 1},
+ {115200, 3000000, 1, 10, 0, 1},
+ {9600, 12000000, 78, 2, 0, 1},
+ {9600, 6000000, 39, 1, 0, 1},
+ {9600, 3000000, 19, 8, 85, 1},
+ {9600, 32768, 3, 0, 146, 0}
+};
+
+const UARTMSP432_HWAttrs uartMSP432HWAttrs[MSP_I3MSP432P401R_UARTCOUNT] = {
+ {
+ .baseAddr = EUSCI_A0_BASE,
+ .intNum = INT_EUSCIA0,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[0],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[0])
+ },
+ {
+ .baseAddr = EUSCI_A2_BASE,
+ .intNum = INT_EUSCIA2,
+ .intPriority = (~0),
+ .clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
+ .bitOrder = EUSCI_A_UART_LSB_FIRST,
+ .numBaudrateEntries = sizeof(uartMSP432Baudrates) /
+ sizeof(UARTMSP432_BaudrateConfig),
+ .baudrateLUT = uartMSP432Baudrates,
+ .ringBufPtr = uartMSP432RingBuffer[1],
+ .ringBufSize = sizeof(uartMSP432RingBuffer[1])
+ }
+};
+
+const UART_Config UART_config[] = {
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[0],
+ .hwAttrs = &uartMSP432HWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &UARTMSP432_fxnTable,
+ .object = &uartMSP432Objects[1],
+ .hwAttrs = &uartMSP432HWAttrs[1]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initUART ========
+ */
+void MSP_I3MSP432P401R_initUART(void)
+{
+ /* Set P1.2 & P1.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Set P3.2 & P3.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3,
+ GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Initialize the UART driver */
+ UART_init();
+}
+
+/*
+ * =============================== Watchdog ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
+#pragma DATA_SECTION(watchdogMSP432HWAttrs, ".const:watchdogMSP432HWAttrs")
+#endif
+
+#include <ti/drivers/Watchdog.h>
+#include <ti/drivers/watchdog/WatchdogMSP432.h>
+
+WatchdogMSP432_Object watchdogMSP432Objects[MSP_I3MSP432P401R_WATCHDOGCOUNT];
+
+const WatchdogMSP432_HWAttrs
+ watchdogMSP432HWAttrs[MSP_I3MSP432P401R_WATCHDOGCOUNT] = {
+ {
+ .baseAddr = WDT_A_BASE,
+ .intNum = INT_WDT_A,
+ .intPriority = (~0),
+ .clockSource = WDT_A_CLOCKSOURCE_SMCLK,
+ .clockDivider = WDT_A_CLOCKDIVIDER_8192K
+ },
+};
+
+const Watchdog_Config Watchdog_config[] = {
+ {
+ .fxnTablePtr = &WatchdogMSP432_fxnTable,
+ .object = &watchdogMSP432Objects[0],
+ .hwAttrs = &watchdogMSP432HWAttrs[0]
+ },
+ {NULL, NULL, NULL}
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWatchdog ========
+ */
+void MSP_I3MSP432P401R_initWatchdog(void)
+{
+ /* Initialize the Watchdog driver */
+ Watchdog_init();
+}
+
+/*
+ * =============================== WiFi ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
+#pragma DATA_SECTION(wiFiCC3100HWAttrs, ".const:wiFiCC3100HWAttrs")
+#endif
+
+#include <ti/drivers/WiFi.h>
+#include <ti/drivers/wifi/WiFiCC3100.h>
+
+WiFiCC3100_Object wiFiCC3100Objects[MSP_I3MSP432P401R_WIFICOUNT];
+
+const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[MSP_I3MSP432P401R_WIFICOUNT] = {
+ {
+ .irqPort = GPIO_PORT_P2,
+ .irqPin = GPIO_PIN5,
+ .irqIntNum = INT_PORT2,
+
+ .csPort = GPIO_PORT_P3,
+ .csPin = GPIO_PIN0,
+
+ .enPort = GPIO_PORT_P4,
+ .enPin = GPIO_PIN1
+ }
+};
+
+const WiFi_Config WiFi_config[] = {
+ {
+ .fxnTablePtr = &WiFiCC3100_fxnTable,
+ .object = &wiFiCC3100Objects[0],
+ .hwAttrs = &wiFiCC3100HWAttrs[0]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_I3MSP432P401R_initWiFi ========
+ */
+void MSP_I3MSP432P401R_initWiFi(void)
+{
+ /* Configure EN & CS pins to disable CC3100 */
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setAsOutputPin(GPIO_PORT_P4, GPIO_PIN1);
+ MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN0);
+ MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN1);
+
+ /* Configure CLK, MOSI & MISO for SPI0 (EUSCI_B0) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Configure IRQ pin */
+ MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P2, GPIO_PIN5);
+ MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P2, GPIO_PIN5,
+ GPIO_LOW_TO_HIGH_TRANSITION);
+
+ /* Initialize SPI and WiFi drivers */
+ SPI_init();
+ WiFi_init();
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/MSP432P401R_I3M.h b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/MSP432P401R_I3M.h
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2015-2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** ============================================================================
+ * @file MSP_I3MSP432P401R.h
+ *
+ * @brief MSP_I3MSP432P401R Board Specific APIs
+ *
+ * The MSP_I3MSP432P401R header file should be included in an application as
+ * follows:
+ * @code
+ * #include <MSP_I3MSP432P401R.h>
+ * @endcode
+ *
+ * ============================================================================
+ */
+#ifndef __MSP_I3MSP432P401R_H
+#define __MSP_I3MSP432P401R_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LEDs on MSP_I3MSP432P401R are active high. */
+#define MSP_I3MSP432P401R_LED_OFF (0)
+#define MSP_I3MSP432P401R_LED_ON (1)
+
+/*!
+ * @def MSP_I3MSP432P401R_ADCName
+ * @brief Enum of ADC channels on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_ADCName {
+ MSP_I3MSP432P401R_ADC0 = 0,
+ MSP_I3MSP432P401R_ADC1,
+ MSP_I3MSP432P401R_ADCCOUNT
+}MSP_I3MSP432P401R_ADCName;
+
+/*!
+ * @def MSP_I3MSP432P401R_GPIOName
+ * @brief Enum of GPIO names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_GPIOName {
+ MSP_I3MSP432P401R_S1 = 0,
+ MSP_I3MSP432P401R_SPIA1_IRQ,
+ MSP_I3MSP432P401R_SPIA1_CS,
+ MSP_I3MSP432P401R_SPIA2_CS,
+ /*
+ * MSP_I3MSP432P401R_LED_GREEN & MSP_I3MSP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ MSP_I3MSP432P401R_LED_GREEN,
+ MSP_I3MSP432P401R_LED_RED,
+
+ MSP_I3MSP432P401R_GPIOCOUNT
+} MSP_I3MSP432P401R_GPIOName;
+
+/*!
+ * @def MSP_I3MSP432P401R_I2CName
+ * @brief Enum of I2C names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_I2CName {
+ MSP_I3MSP432P401R_I2CB2 = 0,
+ MSP_I3MSP432P401R_I2CCOUNT
+} MSP_I3MSP432P401R_I2CName;
+
+/*!
+ * @def MSP_I3MSP432P401R_PWMName
+ * @brief Enum of PWM names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_PWMName {
+ MSP_I3MSP432P401R_PWM_TA1_1 = 0,
+ MSP_I3MSP432P401R_PWM_TA1_2,
+
+ MSP_I3MSP432P401R_PWMCOUNT
+} MSP_I3MSP432P401R_PWMName;
+
+/*!
+ * @def MSP_I3MSP432P401R_SDSPIName
+ * @brief Enum of SDSPI names on the MSP_I3MSP432P401R dev board
+
+typedef enum MSP_I3MSP432P401R_SDSPIName {
+ MSP_I3MSP432P401R_SDSPIB0 = 0,
+
+ MSP_I3MSP432P401R_SDSPICOUNT
+} EMSP_I3MSP432P401R_SDSPIName;
+*/
+
+/*!
+ * @def MSP_I3MSP432P401R_SPIName
+ * @brief Enum of SPI names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_SPIName {
+ MSP_I3MSP432P401R_SPIB0 = 0,
+ MSP_I3MSP432P401R_SPIA1,
+ MSP_I3MSP432P401R_SPIA2,
+
+ MSP_I3MSP432P401R_SPICOUNT
+} MSP_I3MSP432P401R_SPIName;
+
+/*!
+ * @def MSP_I3MSP432P401R_UARTName
+ * @brief Enum of UART names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_UARTName {
+ MSP_I3MSP432P401R_UARTA0 = 0,
+ MSP_I3MSP432P401R_UARTA2,
+
+ MSP_I3MSP432P401R_UARTCOUNT
+} MSP_I3MSP432P401R_UARTName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WatchdogName
+ * @brief Enum of Watchdog names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WatchdogName {
+ MSP_I3MSP432P401R_WATCHDOG = 0,
+
+ MSP_I3MSP432P401R_WATCHDOGCOUNT
+} MSP_I3MSP432P401R_WatchdogName;
+
+/*!
+ * @def MSP_I3MSP432P401R_WiFiName
+ * @brief Enum of WiFi names on the MSP_I3MSP432P401R dev board
+ */
+typedef enum MSP_I3MSP432P401R_WiFiName {
+ MSP_I3MSP432P401R_WIFI = 0,
+
+ MSP_I3MSP432P401R_WIFICOUNT
+} MSP_I3MSP432P401R_WiFiName;
+
+/*!
+ * @brief Initialize board specific ADC settings
+ *
+ * This function initializes the board specific ADC settings and then calls
+ * the ADC_init API to initialize the ADC module.
+ *
+ * The ADC peripherals controlled by the ADC module are determined by the
+ * ADC_config variable.
+ */
+extern void MSP_I3MSP432P401R_initADC(void);
+
+/*!
+ * @brief Initialize the general board specific settings
+ *
+ * This function initializes the general board specific settings.
+ */
+extern void MSP_I3MSP432P401R_initGeneral(void);
+
+/*!
+ * @brief Initialize board specific GPIO settings
+ *
+ * This function initializes the board specific GPIO settings and
+ * then calls the GPIO_init API to initialize the GPIO module.
+ *
+ * The GPIOs controlled by the GPIO module are determined by the GPIO_PinConfig
+ * variable.
+ */
+extern void MSP_I3MSP432P401R_initGPIO(void);
+
+/*!
+ * @brief Initialize board specific I2C settings
+ *
+ * This function initializes the board specific I2C settings and then calls
+ * the I2C_init API to initialize the I2C module.
+ *
+ * The I2C peripherals controlled by the I2C module are determined by the
+ * I2C_config variable.
+ */
+extern void MSP_I3MSP432P401R_initI2C(void);
+
+/*!
+ * @brief Initialize board specific PWM settings
+ *
+ * This function initializes the board specific PWM settings and then calls
+ * the PWM_init API to initialize the PWM module.
+ *
+ * The PWM peripherals controlled by the PWM module are determined by the
+ * PWM_config variable.
+ */
+extern void MSP_I3MSP432P401R_initPWM(void);
+
+/*!
+ * @brief Initialize board specific SDSPI settings
+ *
+ * This function initializes the board specific SDSPI settings and then calls
+ * the SDSPI_init API to initialize the SDSPI module.
+ *
+ * The SDSPI peripherals controlled by the SDSPI module are determined by the
+ * SDSPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSDSPI(void);
+
+/*!
+ * @brief Initialize board specific SPI settings
+ *
+ * This function initializes the board specific SPI settings and then calls
+ * the SPI_init API to initialize the SPI module.
+ *
+ * The SPI peripherals controlled by the SPI module are determined by the
+ * SPI_config variable.
+ */
+extern void MSP_I3MSP432P401R_initSPI(void);
+
+/*!
+ * @brief Initialize board specific UART settings
+ *
+ * This function initializes the board specific UART settings and then calls
+ * the UART_init API to initialize the UART module.
+ *
+ * The UART peripherals controlled by the UART module are determined by the
+ * UART_config variable.
+ */
+extern void MSP_I3MSP432P401R_initUART(void);
+
+/*!
+ * @brief Initialize board specific Watchdog settings
+ *
+ * This function initializes the board specific Watchdog settings and then
+ * calls the Watchdog_init API to initialize the Watchdog module.
+ *
+ * The Watchdog peripherals controlled by the Watchdog module are determined
+ * by the Watchdog_config variable.
+ */
+extern void MSP_I3MSP432P401R_initWatchdog(void);
+
+/*!
+ * @brief Initialize board specific WiFi settings
+ *
+ * This function initializes the board specific WiFi settings and then calls
+ * the WiFi_init API to initialize the WiFi module.
+ *
+ * The hardware resources controlled by the WiFi module are determined by the
+ * WiFi_config variable.
+ *
+ * A SimpleLink CC3100 device or module is required and must be connected to
+ * use the WiFi driver.
+ */
+extern void MSP_I3MSP432P401R_initWiFi(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MSP_I3MSP432P401R_H */
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/main.c b/Basic-Test-Package/MSP432/Test_MSP432_Blink_Tirtos/main.c
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2015, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+/*
+ * ======== empty.c ========
+ */
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/runtime/System.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Task.h>
+
+/* TI-RTOS Header files */
+#include <ti/drivers/GPIO.h>
+// #include <ti/drivers/I2C.h>
+// #include <ti/drivers/SDSPI.h>
+// #include <ti/drivers/SPI.h>
+// #include <ti/drivers/UART.h>
+// #include <ti/drivers/Watchdog.h>
+// #include <ti/drivers/WiFi.h>
+
+/* Board Header file */
+#include "Board.h"
+
+#define TASKSTACKSIZE 512
+
+Task_Struct task0Struct;
+Char task0Stack[TASKSTACKSIZE];
+
+/*
+ * ======== heartBeatFxn ========
+ * Toggle the Board_LED0. The Task_sleep is determined by arg0 which
+ * is configured for the heartBeat Task instance.
+ */
+Void heartBeatFxn(UArg arg0, UArg arg1)
+{
+ while (1) {
+ GPIO_write(Board_LED0, Board_LED_ON);
+ GPIO_write(Board_LED1, Board_LED_ON);
+ Task_sleep(10);
+ GPIO_write(Board_LED0, Board_LED_OFF);
+ GPIO_write(Board_LED1, Board_LED_OFF);
+ Task_sleep((UInt)arg0-10);
+ }
+}
+
+/*
+ * ======== main ========
+ */
+int main(void)
+{
+ Task_Params taskParams;
+
+ /* Call board init functions */
+ Board_initGeneral();
+ Board_initGPIO();
+ // Board_initI2C();
+ // Board_initSDSPI();
+ // Board_initSPI();
+ // Board_initUART();
+ // Board_initWatchdog();
+ // Board_initWiFi();
+
+ /* Construct heartBeat Task thread */
+ Task_Params_init(&taskParams);
+ taskParams.arg0 = 1000;
+ taskParams.stackSize = TASKSTACKSIZE;
+ taskParams.stack = &task0Stack;
+ Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);
+
+ /* Turn off user LED */
+ GPIO_write(Board_LED0, Board_LED_ON);
+ System_printf("Starting the example\nSystem provider is set to SysMin. "
+ "Halt the target to view any SysMin contents in ROV.\n");
+ GPIO_write(Board_LED0, Board_LED_OFF);
+
+
+ /* SysMin will only print to the console when you call flush or exit */
+ System_flush();
+
+ /* Start BIOS */
+ BIOS_start();
+
+ return (0);
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c
--- /dev/null
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * MSP432 Clock System - HFXT Startup
+ *
+ * Description:
+ *
+ * HFXTAL:
+ * Starts the 48MHz crystal attached to HFXTIN/HFXTOUT
+ * Sources MCLK from the crystal
+ *
+ * LFXTL:
+ * Starts the 32khz crystal attached to LFXTIN/LFXTOUT
+ * Sources AMCLK from crystal
+ *
+ * Internal DCO:
+ * Starts the DCO
+ * Sources SMCLK from DCO
+ *
+ * Blinks LEDs using SysTick (which is sourced from MCLK).
+ *
+ *
+ *
+ * MSP432P401
+ * ------------------
+ * /|\| |
+ * | | |
+ * --|RST P8.5 |---> LED
+ * | |
+ * | PJ.3 HFXTIN |<--------
+ * | | < 48Mhz xTal >
+ * | PJ.2 HFXTOUT |<--------
+ * | |
+ * | PJ.0 LFXIN |<--------
+ * | | < 32khz xTal >
+ * | PJ.1 LFXOUT |<--------
+ * | |
+ * | P4.2 |--> ACLK - 32.768 KHz
+ * | P4.3 |--> MCLK - 12.000 MHz
+ * | P4.4 |--> HSMCLK - 6.000 MHz
+ * | P7.0 |--> SMCLK
+ * | |
+ *
+ * Author: Timothy Logan
+ * Rev: B.Martinez
+ ******************************************************************************/
+#include <MSP432_I3M_driverlib.h>
+
+/* DriverLib Includes */
+#include "driverlib.h"
+
+/* Standard Includes */
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#define DEBUG_UART
+
+#ifdef UART_BAUD_9600
+ const eUSCI_UART_Config uartConfig =
+ {
+ EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
+ 78, // BRDIV = 78
+ 2, // UCxBRF = 2
+ 0, // UCxBRS = 0
+ EUSCI_A_UART_NO_PARITY, // No Parity
+ EUSCI_A_UART_LSB_FIRST, // LSB First
+ EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
+ EUSCI_A_UART_MODE, // UART mode
+ EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling
+ };
+#endif
+
+#ifdef UART_BAUD_115200
+ const eUSCI_UART_Config uartConfig =
+ {
+ EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
+ 6, // BRDIV = 78
+ 8, // UCxBRF = 2
+ 0, // UCxBRS = 0
+ EUSCI_A_UART_NO_PARITY, // No Parity
+ EUSCI_A_UART_LSB_FIRST, // LSB First
+ EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
+ EUSCI_A_UART_MODE, // UART mode
+ EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling
+ };
+#endif
+
+
+
+/*
+ * Timer_A0 (Fast)
+ * UpMode Configuration Parameter
+ */
+const Timer_A_UpModeConfig upConfigA0 =
+{
+ TIMER_A_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
+ TIMER_A_CLOCKSOURCE_DIVIDER_1, // SMCLK/1 = 3MHz
+ 6000-1, // 6000000/12000 > 1ms tick period
+ TIMER_A_TAIE_INTERRUPT_DISABLE, // Disable Timer interrupt
+ TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE , // Enable CCR0 interrupt
+ TIMER_A_DO_CLEAR // Clear value
+};
+
+
+/*
+ * Timer_A (Slow)
+ * UpMode Configuration Parameter
+ */
+const Timer_A_UpModeConfig upConfigA1 =
+{
+ TIMER_A_CLOCKSOURCE_ACLK, // ACLK Clock Source
+ TIMER_A_CLOCKSOURCE_DIVIDER_1, // ACLK/1 = 3MHz
+ 32768-1,
+ //32-1, // 32768/32=1024 tick period
+ TIMER_A_TAIE_INTERRUPT_DISABLE, // Disable Timer interrupt
+ TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE , // Enable CCR0 interrupt
+ TIMER_A_DO_CLEAR // Clear value
+};
+
+
+uint16_t count;
+uint16_t count_tmp;
+
+#define MAXLEN 32
+char tmp[MAXLEN];
+
+int main(void)
+{
+
+ int i=0;
+
+ /* Halting the Watchdog */
+ MAP_WDT_A_holdTimer();
+
+ /* Configuring pins for peripheral/crystal usage*/
+ /* LFXTAL */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(LFXTAL_PORT,
+ LFXTAL_PINS, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* HFXTL */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(HFXTAL_PORT,
+ HFXTAL_PINS, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Clocks Output */
+ GPIO_setAsPeripheralModuleFunctionOutputPin(ACLK_OUT_PORT,
+ ACLK_OUT_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
+ GPIO_setAsPeripheralModuleFunctionOutputPin(MCLK_OUT_PORT,
+ MCLK_OUT_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
+ GPIO_setAsPeripheralModuleFunctionOutputPin(HSMCLK_OUT_PORT,
+ HSMCLK_OUT_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
+ GPIO_setAsPeripheralModuleFunctionOutputPin(SMCLK_OUT_PORT,
+ SMCLK_OUT_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* LEDs */
+ MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR);
+ MAP_GPIO_setOutputHighOnPin(HID_PORT,LEDG|LEDR);
+
+ /* Setting the external clock frequency. This API is optional */
+ CS_setExternalClockSourceFrequency(32768,12000000);
+
+ /* Starting HFXT in non-bypass mode without a timeout. Before we start
+ * we have to change VCORE to 1 to support the 48MHz frequency */
+ MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
+ MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
+ MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);
+ CS_startHFXT(false);
+
+
+ /* Initializes other Clocks with DCO */
+ MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);
+
+ /* Initializing MCLK DCO/4 = 12 */
+ MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_4);
+
+ /* Initializing SMCLK to HFXT (effectively 48/8=6 MHz) */
+ MAP_CS_initClockSignal(CS_SMCLK,CS_HFXTCLK_SELECT,CS_CLOCK_DIVIDER_8);
+
+ /* Initializing ACLK to LFXT */
+ CS_startLFXT(false);
+ MAP_CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
+
+ /* HSMCLK DCO/16 = 3 */
+ MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_16);
+
+
+
+#ifdef DEBUG_UART
+
+ /* Selecting P1.2 and P1.3 in UART mode */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(UART_PORT,UART_RX_PIN | UART_TX_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
+ /* Configuring UART Module */
+ MAP_UART_initModule(EUSCI_A0_BASE, &uartConfig);
+ /* Enable UART module */
+ MAP_UART_enableModule(EUSCI_A0_BASE);
+
+ /* Enabling UART interrupts
+ * MAP_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
+ * MAP_Interrupt_enableInterrupt(INT_EUSCIA0);
+ */
+#endif
+
+#ifdef DEBUG_UART
+
+ /* Set Clock to DCO */
+ MAP_CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_4);
+
+ /* Launch test */
+ while(MAP_UART_receiveData(EUSCI_A0_BASE)!='g');
+ MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG);
+ MAP_GPIO_setOutputHighOnPin(HID_PORT,LEDR);
+
+
+ /* Set SMCLK to test HFXTAL from Timer */
+ MAP_CS_initClockSignal(CS_SMCLK,CS_HFXTCLK_SELECT,CS_CLOCK_DIVIDER_8);
+
+#endif
+
+ /*
+ * Configuring SysTick to trigger at 12000000
+ * MCLK is 12MHz so this will make it toggle every 1s
+ *
+ MAP_SysTick_enableModule();
+ MAP_SysTick_setPeriod(12000000);
+ MAP_SysTick_enableInterrupt();
+ */
+
+ /* Configuring Timer_A0 for Up Mode, with SMCLK (HFXTAL) */
+ MAP_Timer_A_configureUpMode(TIMER_A0_BASE, &upConfigA0);
+ /* Enabling interrupts and starting the timer */
+ MAP_Interrupt_enableInterrupt(INT_TA0_0);
+ MAP_Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_UP_MODE);
+
+ /* Configuring Timer_A1 for Up Mode with ACLK (LFXTAL) */
+ MAP_Timer_A_configureUpMode(TIMER_A1_BASE, &upConfigA1);
+ /* Enabling interrupts and starting the timer */
+ MAP_Interrupt_enableInterrupt(INT_TA1_0);
+ MAP_Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);
+
+ MAP_Interrupt_enableSleepOnIsrExit();
+ MAP_Interrupt_enableMaster();
+ MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG);
+
+ MAP_PCM_gotoLPM0();
+
+ /* Restore DCLK for UART */
+ MAP_CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_4);
+ sprintf(tmp,"Timer-A Ticks: %d\r\n",count_tmp);
+ while(tmp[i]!='\0'){
+ MAP_UART_transmitData(EUSCI_A0_BASE,tmp[i]);
+ i++;
+ }
+
+ /* Do Nothing */
+ while(1){
+ MAP_PCM_gotoLPM0();
+ MAP_GPIO_toggleOutputOnPin(HID_PORT,LEDR);
+ }
+
+}
+
+
+void SysTick_Handler(void)
+{
+ //MAP_UART_transmitData(EUSCI_A0_BASE, (count_tmp>>8)&0xFF);
+ //MAP_UART_transmitData(EUSCI_A0_BASE, (count_tmp)&0xFF);
+}
+
+//******************************************************************************
+// TIMER
+//******************************************************************************
+void TA0_0_IRQHandler(void)
+{
+ MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_0);
+ MAP_GPIO_toggleOutputOnPin(HID_PORT, LEDR);
+ count++;
+}
+
+void TA1_0_IRQHandler(void)
+{
+ MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_0);
+ MAP_GPIO_toggleOutputOnPin(HID_PORT,LEDG);
+
+ count_tmp=count;
+ count=0;
+
+ /* Disable Ints */
+ MAP_Interrupt_disableInterrupt(INT_TA1_0);
+ MAP_Interrupt_disableInterrupt(INT_TA0_0);
+ /* Return Control to Main Program */
+ MAP_Interrupt_disableSleepOnIsrExit();
+
+}
+
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/msp432p401r.cmd b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/msp432p401r.cmd
--- /dev/null
@@ -0,0 +1,84 @@
+/******************************************************************************
+*
+* Copyright (C) 2012 - 2015 Texas Instruments Incorporated - http://www.ti.com/
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+* Default linker command file for Texas Instruments MSP432P401R
+*
+* File creation date: 2015-09-03
+*
+*****************************************************************************/
+
+--retain=flashMailbox
+
+MEMORY
+{
+ MAIN (RX) : origin = 0x00000000, length = 0x00040000
+ INFO (RX) : origin = 0x00200000, length = 0x00004000
+ SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
+ SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
+}
+
+/* The following command line options are set as part of the CCS project. */
+/* If you are building using the command line, or for some reason want to */
+/* define them here, you can uncomment and modify these lines as needed. */
+/* If you are using CCS for building, it is probably better to make any such */
+/* modifications in your CCS project and leave this file alone. */
+/* */
+/* A heap size of 1024 bytes is recommended when you plan to use printf() */
+/* for debug output to the console window. */
+/* */
+/* --heap_size=1024 */
+/* --stack_size=512 */
+/* --library=rtsv7M4_T_le_eabi.lib */
+
+/* Section allocation in memory */
+
+SECTIONS
+{
+ .intvecs: > 0x00000000
+ .text : > MAIN
+ .const : > MAIN
+ .cinit : > MAIN
+ .pinit : > MAIN
+ .init_array : > MAIN
+
+ .flashMailbox : > 0x00200000
+
+ .vtable : > 0x20000000
+ .data : > SRAM_DATA
+ .bss : > SRAM_DATA
+ .sysmem : > SRAM_DATA
+ .stack : > SRAM_DATA (HIGH)
+}
+
+/* Symbolic definition of the WDTCTL register for RTS */
+WDTCTL_SYM = 0x4000480C;
+
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/startup_msp432p401r_ccs.c b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/startup_msp432p401r_ccs.c
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * -------------------------------------------
+ * MSP432 DriverLib - v3_10_00_09
+ * -------------------------------------------
+ *
+ * --COPYRIGHT--,BSD,BSD
+ * Copyright (c) 2014, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ * --/COPYRIGHT--*/
+//*****************************************************************************
+//
+// Copyright (C) 2012 - 2015 Texas Instruments Incorporated - http://www.ti.com/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of Texas Instruments Incorporated nor the names of
+// its contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// MSP432 Family Interrupt Vector Table for CGT
+//
+//****************************************************************************
+
+#include <stdint.h>
+
+/* Forward declaration of the default fault handlers. */
+static void resetISR(void);
+static void nmiISR(void);
+static void faultISR(void);
+static void defaultISR(void);
+
+
+/* External declaration for the reset handler that is to be called when the */
+/* processor is started */
+extern void _c_int00(void);
+
+/* External declaration for system initialization function */
+extern void SystemInit(void);
+
+/* Linker variable that marks the top of the stack. */
+extern unsigned long __STACK_END;
+
+
+/* External declarations for the interrupt handlers used by the application. */
+extern void SysTick_Handler(void);
+extern void TA0_0_IRQHandler(void);
+extern void TA1_0_IRQHandler(void);
+
+
+
+/* Interrupt vector table. Note that the proper constructs must be placed on this to */
+/* ensure that it ends up at physical address 0x0000.0000 or at the start of */
+/* the program if located at a start address other than 0. */
+#pragma RETAIN(interruptVectors)
+#pragma DATA_SECTION(interruptVectors, ".intvecs")
+void (* const interruptVectors[])(void) =
+{
+ (void (*)(void))((uint32_t)&__STACK_END),
+ /* The initial stack pointer */
+ resetISR, /* The reset handler */
+ nmiISR, /* The NMI handler */
+ faultISR, /* The hard fault handler */
+ defaultISR, /* The MPU fault handler */
+ defaultISR, /* The bus fault handler */
+ defaultISR, /* The usage fault handler */
+ 0, /* Reserved */
+ 0, /* Reserved */
+ 0, /* Reserved */
+ 0, /* Reserved */
+ defaultISR, /* SVCall handler */
+ defaultISR, /* Debug monitor handler */
+ 0, /* Reserved */
+ defaultISR, /* The PendSV handler */
+ SysTick_Handler, /* The SysTick handler */
+ defaultISR, /* PSS ISR */
+ defaultISR, /* CS ISR */
+ defaultISR, /* PCM ISR */
+ defaultISR, /* WDT ISR */
+ defaultISR, /* FPU ISR */
+ defaultISR, /* FLCTL ISR */
+ defaultISR, /* COMP0 ISR */
+ defaultISR, /* COMP1 ISR */
+ TA0_0_IRQHandler, /* TA0_0 ISR */
+ defaultISR, /* TA0_N ISR */
+ TA1_0_IRQHandler, /* TA1_0 ISR */
+ defaultISR, /* TA1_N ISR */
+ defaultISR, /* TA2_0 ISR */
+ defaultISR, /* TA2_N ISR */
+ defaultISR, /* TA3_0 ISR */
+ defaultISR, /* TA3_N ISR */
+ defaultISR, /* EUSCIA0 ISR */
+ defaultISR, /* EUSCIA1 ISR */
+ defaultISR, /* EUSCIA2 ISR */
+ defaultISR, /* EUSCIA3 ISR */
+ defaultISR, /* EUSCIB0 ISR */
+ defaultISR, /* EUSCIB1 ISR */
+ defaultISR, /* EUSCIB2 ISR */
+ defaultISR, /* EUSCIB3 ISR */
+ defaultISR, /* ADC14 ISR */
+ defaultISR, /* T32_INT1 ISR */
+ defaultISR, /* T32_INT2 ISR */
+ defaultISR, /* T32_INTC ISR */
+ defaultISR, /* AES ISR */
+ defaultISR, /* RTC ISR */
+ defaultISR, /* DMA_ERR ISR */
+ defaultISR, /* DMA_INT3 ISR */
+ defaultISR, /* DMA_INT2 ISR */
+ defaultISR, /* DMA_INT1 ISR */
+ defaultISR, /* DMA_INT0 ISR */
+ defaultISR, /* PORT1 ISR */
+ defaultISR, /* PORT2 ISR */
+ defaultISR, /* PORT3 ISR */
+ defaultISR, /* PORT4 ISR */
+ defaultISR, /* PORT5 ISR */
+ defaultISR, /* PORT6 ISR */
+ defaultISR, /* Reserved 41 */
+ defaultISR, /* Reserved 42 */
+ defaultISR, /* Reserved 43 */
+ defaultISR, /* Reserved 44 */
+ defaultISR, /* Reserved 45 */
+ defaultISR, /* Reserved 46 */
+ defaultISR, /* Reserved 47 */
+ defaultISR, /* Reserved 48 */
+ defaultISR, /* Reserved 49 */
+ defaultISR, /* Reserved 50 */
+ defaultISR, /* Reserved 51 */
+ defaultISR, /* Reserved 52 */
+ defaultISR, /* Reserved 53 */
+ defaultISR, /* Reserved 54 */
+ defaultISR, /* Reserved 55 */
+ defaultISR, /* Reserved 56 */
+ defaultISR, /* Reserved 57 */
+ defaultISR, /* Reserved 58 */
+ defaultISR, /* Reserved 59 */
+ defaultISR, /* Reserved 60 */
+ defaultISR, /* Reserved 61 */
+ defaultISR, /* Reserved 62 */
+ defaultISR /* Reserved 63 */
+};
+
+
+/* This is the code that gets called when the processor first starts execution */
+/* following a reset event. Only the absolutely necessary set is performed, */
+/* after which the application supplied entry() routine is called. Any fancy */
+/* actions (such as making decisions based on the reset cause register, and */
+/* resetting the bits in that register) are left solely in the hands of the */
+/* application. */
+void resetISR(void)
+{
+ SystemInit();
+
+ /* Jump to the CCS C Initialization Routine. */
+ __asm(" .global _c_int00\n"
+ " b.w _c_int00");
+}
+
+/* This is the code that gets called when the processor receives a NMI. This */
+/* simply enters an infinite loop, preserving the system state for examination */
+/* by a debugger. */
+static void nmiISR(void)
+{
+ /* Fault trap exempt from ULP advisor */
+ #pragma diag_push
+ #pragma CHECK_ULP("-2.1")
+
+ /* Enter an infinite loop. */
+ while(1)
+ {
+ }
+
+ #pragma diag_pop
+}
+
+
+/* This is the code that gets called when the processor receives a fault */
+/* interrupt. This simply enters an infinite loop, preserving the system state */
+/* for examination by a debugger. */
+static void faultISR(void)
+{
+ /* Fault trap exempt from ULP advisor */
+ #pragma diag_push
+ #pragma CHECK_ULP("-2.1")
+
+ /* Enter an infinite loop. */
+ while(1)
+ {
+ }
+
+ #pragma diag_pop
+}
+
+
+/* This is the code that gets called when the processor receives an unexpected */
+/* interrupt. This simply enters an infinite loop, preserving the system state */
+/* for examination by a debugger. */
+static void defaultISR(void)
+{
+ /* Fault trap exempt from ULP advisor */
+ #pragma diag_push
+ #pragma CHECK_ULP("-2.1")
+
+ /* Enter an infinite loop. */
+ while(1)
+ {
+ }
+
+ #pragma diag_pop
+}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/system_msp432p401r.c b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/system_msp432p401r.c
--- /dev/null
@@ -0,0 +1,434 @@
+/*
+ * -------------------------------------------
+ * MSP432 DriverLib - v3_10_00_09
+ * -------------------------------------------
+ *
+ * --COPYRIGHT--,BSD,BSD
+ * Copyright (c) 2014, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * 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.
+ * --/COPYRIGHT--*/
+/**************************************************************************//**
+* @file system_msp432p401r.c
+* @brief CMSIS Cortex-M4F Device Peripheral Access Layer Source File for
+* MSP432P401R
+* @version V1.00
+* @date 20-Oct-2015
+*
+* @note View configuration instructions embedded in comments
+*
+******************************************************************************/
+//*****************************************************************************
+//
+// Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of Texas Instruments Incorporated nor the names of
+// its contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+//*****************************************************************************
+
+#include <stdint.h>
+#include "msp.h"
+
+/*--------------------- Configuration Instructions ----------------------------
+ 1. If you prefer to halt the Watchdog Timer, set __HALT_WDT to 1:
+ #define __HALT_WDT 1
+ 2. Insert your desired CPU frequency in Hz at:
+ #define __SYSTEM_CLOCK 3000000
+ 3. If you prefer the DC-DC power regulator (more efficient at higher
+ frequencies), set the __REGULATOR to 1:
+ #define __REGULATOR 1
+ *---------------------------------------------------------------------------*/
+
+/*--------------------- Watchdog Timer Configuration ------------------------*/
+// Halt the Watchdog Timer
+// <0> Do not halt the WDT
+// <1> Halt the WDT
+#define __HALT_WDT 1
+
+/*--------------------- CPU Frequency Configuration -------------------------*/
+// CPU Frequency
+// <1500000> 1.5 MHz
+// <3000000> 3 MHz
+// <12000000> 12 MHz
+// <24000000> 24 MHz
+// <48000000> 48 MHz
+#define __SYSTEM_CLOCK 12000000
+
+/*--------------------- Power Regulator Configuration -----------------------*/
+// Power Regulator Mode
+// <0> LDO
+// <1> DC-DC
+#define __REGULATOR 1
+
+/*----------------------------------------------------------------------------
+ Define clocks, used for SystemCoreClockUpdate()
+ *---------------------------------------------------------------------------*/
+#define __VLOCLK 10000
+#define __MODCLK 24000000
+#define __LFXT 32768
+#define __HFXT 48000000
+
+/*----------------------------------------------------------------------------
+ Clock Variable definitions
+ *---------------------------------------------------------------------------*/
+uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/
+
+/**
+ * Update SystemCoreClock variable
+ *
+ * @param none
+ * @return none
+ *
+ * @brief Updates the SystemCoreClock with current core Clock
+ * retrieved from cpu registers.
+ */
+void SystemCoreClockUpdate(void)
+{
+ uint32_t source, divider;
+ uint8_t dividerValue;
+
+ float dcoConst;
+ int32_t calVal;
+ uint32_t centeredFreq;
+ int16_t dcoTune;
+
+ divider = (CS->CTL1 & CS_CTL1_DIVM_MASK) >> CS_CTL1_DIVM_OFS;
+ dividerValue = 1 << divider;
+ source = CS->CTL1 & CS_CTL1_SELM_MASK;
+
+ switch(source)
+ {
+ case CS_CTL1_SELM__LFXTCLK:
+ if(BITBAND_PERI(CS->IFG, CS_IFG_LFXTIFG_OFS))
+ {
+ // Clear interrupt flag
+ CS->KEY = CS_KEY_VAL;
+ CS->CLRIFG |= CS_CLRIFG_CLR_LFXTIFG;
+ CS->KEY = 1;
+
+ if(BITBAND_PERI(CS->IFG, CS_IFG_LFXTIFG_OFS))
+ {
+ if(BITBAND_PERI(CS->CLKEN, CS_CLKEN_REFOFSEL_OFS))
+ {
+ SystemCoreClock = (128000 / dividerValue);
+ }
+ else
+ {
+ SystemCoreClock = (32000 / dividerValue);
+ }
+ }
+ else
+ {
+ SystemCoreClock = __LFXT / dividerValue;
+ }
+ }
+ else
+ {
+ SystemCoreClock = __LFXT / dividerValue;
+ }
+ break;
+ case CS_CTL1_SELM__VLOCLK:
+ SystemCoreClock = __VLOCLK / dividerValue;
+ break;
+ case CS_CTL1_SELM__REFOCLK:
+ if (BITBAND_PERI(CS->CLKEN, CS_CLKEN_REFOFSEL_OFS))
+ {
+ SystemCoreClock = (128000 / dividerValue);
+ }
+ else
+ {
+ SystemCoreClock = (32000 / dividerValue);
+ }
+ break;
+ case CS_CTL1_SELM__DCOCLK:
+ dcoTune = (CS->CTL0 & CS_CTL0_DCOTUNE_MASK) >> CS_CTL0_DCOTUNE_OFS;
+
+ switch(CS->CTL0 & CS_CTL0_DCORSEL_MASK)
+ {
+ case CS_CTL0_DCORSEL_0:
+ centeredFreq = 1500000;
+ break;
+ case CS_CTL0_DCORSEL_1:
+ centeredFreq = 3000000;
+ break;
+ case CS_CTL0_DCORSEL_2:
+ centeredFreq = 6000000;
+ break;
+ case CS_CTL0_DCORSEL_3:
+ centeredFreq = 12000000;
+ break;
+ case CS_CTL0_DCORSEL_4:
+ centeredFreq = 24000000;
+ break;
+ case CS_CTL0_DCORSEL_5:
+ centeredFreq = 48000000;
+ break;
+ }
+
+ if(dcoTune == 0)
+ {
+ SystemCoreClock = centeredFreq;
+ }
+ else
+ {
+
+ if(dcoTune & 0x1000)
+ {
+ dcoTune = dcoTune | 0xF000;
+ }
+
+ if (BITBAND_PERI(CS->CTL0, CS_CTL0_DCORES_OFS))
+ {
+ dcoConst = *((float *) &TLV->DCOER_CONSTK_RSEL04);
+ calVal = TLV->DCOER_FCAL_RSEL04;
+ }
+ /* Internal Resistor */
+ else
+ {
+ dcoConst = *((float *) &TLV->DCOIR_CONSTK_RSEL04);
+ calVal = TLV->DCOIR_FCAL_RSEL04;
+ }
+
+ SystemCoreClock = (uint32_t) ((centeredFreq)
+ / (1
+ - ((dcoConst * dcoTune)
+ / (8 * (1 + dcoConst * (768 - calVal))))));
+ }
+ break;
+ case CS_CTL1_SELM__MODOSC:
+ SystemCoreClock = __MODCLK / dividerValue;
+ break;
+ case CS_CTL1_SELM__HFXTCLK:
+ if(BITBAND_PERI(CS->IFG, CS_IFG_HFXTIFG_OFS))
+ {
+ // Clear interrupt flag
+ CS->KEY = CS_KEY_VAL;
+ CS->CLRIFG |= CS_CLRIFG_CLR_HFXTIFG;
+ CS->KEY = 1;
+
+ if(BITBAND_PERI(CS->IFG, CS_IFG_HFXTIFG_OFS))
+ {
+ if(BITBAND_PERI(CS->CLKEN, CS_CLKEN_REFOFSEL_OFS))
+ {
+ SystemCoreClock = (128000 / dividerValue);
+ }
+ else
+ {
+ SystemCoreClock = (32000 / dividerValue);
+ }
+ }
+ else
+ {
+ SystemCoreClock = __HFXT / dividerValue;
+ }
+ }
+ else
+ {
+ SystemCoreClock = __HFXT / dividerValue;
+ }
+ break;
+ }
+}
+
+/**
+ * Initialize the system
+ *
+ * @param none
+ * @return none
+ *
+ * @brief Setup the microcontroller system.
+ *
+ * Performs the following initialization steps:
+ * 1. Enables the FPU
+ * 2. Halts the WDT if requested
+ * 3. Enables all SRAM banks
+ * 4. Sets up power regulator and VCORE
+ * 5. Enable Flash wait states if needed
+ * 6. Change MCLK to desired frequency
+ * 7. Enable Flash read buffering
+ */
+void SystemInit(void)
+{
+ // Enable FPU if used
+ #if (__FPU_USED == 1) /* __FPU_USED is defined in core_cm4.h */
+ SCB->CPACR |= ((3UL << 10 * 2) | /* Set CP10 Full Access */
+ (3UL << 11 * 2)); /* Set CP11 Full Access */
+ #endif
+
+ #if (__HALT_WDT == 1)
+ WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // Halt the WDT
+ #endif
+
+ SYSCTL->SRAM_BANKEN = SYSCTL_SRAM_BANKEN_BNK7_EN; // Enable all SRAM banks
+
+ #if (__SYSTEM_CLOCK == 1500000) // 1.5 MHz
+ // Default VCORE is LDO VCORE0 so no change necessary
+
+ // Switches LDO VCORE0 to DCDC VCORE0 if requested
+ #if __REGULATOR
+ while((PCM->CTL1 & PCM_CTL1_PMR_BUSY));
+ PCM->CTL0 = PCM_CTL0_KEY_VAL | PCM_CTL0_AMR_4;
+ while((PCM->CTL1 & PCM_CTL1_PMR_BUSY));
+ #endif
+
+ // No flash wait states necessary
+
+ // DCO = 1.5 MHz; MCLK = source
+ CS->KEY = CS_KEY_VAL; // Unlock CS module for register access
+ CS->CTL0 = CS_CTL0_DCORSEL_0; // Set DCO to 1.5MHz
+ CS->CTL1 &= ~(CS_CTL1_SELM_MASK | CS_CTL1_DIVM_MASK) | CS_CTL1_SELM__DCOCLK; // Select MCLK as DCO source
+ CS->KEY = 0;
+
+ // Set Flash Bank read buffering
+ FLCTL->BANK0_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+ FLCTL->BANK1_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+
+ #elif (__SYSTEM_CLOCK == 3000000) // 3 MHz
+ // Default VCORE is LDO VCORE0 so no change necessary
+
+ // Switches LDO VCORE0 to DCDC VCORE0 if requested
+ #if __REGULATOR
+ while(PCM->CTL1 & PCM_CTL1_PMR_BUSY);
+ PCM->CTL0 = PCM_CTL0_KEY_VAL | PCM_CTL0_AMR_4;
+ while(PCM->CTL1 & PCM_CTL1_PMR_BUSY);
+ #endif
+
+ // No flash wait states necessary
+
+ // DCO = 3 MHz; MCLK = source
+ CS->KEY = CS_KEY_VAL; // Unlock CS module for register access
+ CS->CTL0 = CS_CTL0_DCORSEL_1; // Set DCO to 1.5MHz
+ CS->CTL1 &= ~(CS_CTL1_SELM_MASK | CS_CTL1_DIVM_MASK) | CS_CTL1_SELM__DCOCLK; // Select MCLK as DCO source
+ CS->KEY = 0;
+
+ // Set Flash Bank read buffering
+ FLCTL->BANK0_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+ FLCTL->BANK1_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+
+ #elif (__SYSTEM_CLOCK == 12000000) // 12 MHz
+ // Default VCORE is LDO VCORE0 so no change necessary
+
+ // Switches LDO VCORE0 to DCDC VCORE0 if requested
+ #if __REGULATOR
+ while((PCM->CTL1 & PCM_CTL1_PMR_BUSY));
+ PCM->CTL0 = PCM_CTL0_KEY_VAL | PCM_CTL0_AMR_4;
+ while((PCM->CTL1 & PCM_CTL1_PMR_BUSY));
+ #endif
+
+ // No flash wait states necessary
+
+ // DCO = 12 MHz; MCLK = source
+ CS->KEY = CS_KEY_VAL; // Unlock CS module for register access
+ CS->CTL0 = CS_CTL0_DCORSEL_3; // Set DCO to 12MHz
+ CS->CTL1 &= ~(CS_CTL1_SELM_MASK | CS_CTL1_DIVM_MASK) | CS_CTL1_SELM__DCOCLK; // Select MCLK as DCO source
+ CS->KEY = 0;
+
+ // Set Flash Bank read buffering
+ FLCTL->BANK0_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+ FLCTL->BANK1_RDCTL &= ~(FLCTL_BANK0_RDCTL_BUFD | FLCTL_BANK0_RDCTL_BUFI);
+
+ #elif (__SYSTEM_CLOCK == 24000000) // 24 MHz
+ // Default VCORE is LDO VCORE0 so no change necessary
+
+ // Switches LDO VCORE0 to DCDC VCORE0 i