diff --git a/examples/CC3200/Makefile b/examples/CC3200/Makefile
index cbb9fe4e..227bc70b 100644
--- a/examples/CC3200/Makefile
+++ b/examples/CC3200/Makefile
@@ -7,9 +7,6 @@ PORT ?= auto
MAKEFLAGS += w
all clean:
- rm -rf ccs/*/Debug
- rm -rf ccs/*/Release
- rm -rf ccs/*/.launches
docker run --rm -i -v $(SRC_DIR):/src $(SDK) \
/bin/bash -c "\
make -C /src/mongoose mongoose.c mongoose.h && \
diff --git a/examples/CC3200/ccs/MG_sensor_demo/.cproject b/examples/CC3200/ccs/MG_sensor_demo/.cproject
index 1cf62a46..c1fd08c5 100644
--- a/examples/CC3200/ccs/MG_sensor_demo/.cproject
+++ b/examples/CC3200/ccs/MG_sensor_demo/.cproject
@@ -31,7 +31,7 @@
@@ -126,7 +126,7 @@
diff --git a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.codan.core.prefs b/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.codan.core.prefs
deleted file mode 100644
index f653028c..00000000
--- a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.codan.core.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-inEditor=false
-onBuild=false
diff --git a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.core.prefs b/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.core.prefs
deleted file mode 100755
index b22c31ed..00000000
--- a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.core.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-environment/project/com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039/append=true
-environment/project/com.ti.ccstudio.buildDefinitions.TMS470.Release.2030896039/appendContributed=true
diff --git a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.debug.core.prefs b/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.debug.core.prefs
deleted file mode 100644
index 2adc7b1d..00000000
--- a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.cdt.debug.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
diff --git a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.core.resources.prefs b/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 37af3674..00000000
--- a/examples/CC3200/ccs/MG_sensor_demo/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-encoding//Debug/makefile=UTF-8
-encoding//Debug/objects.mk=UTF-8
-encoding//Debug/sources.mk=UTF-8
-encoding//Debug/subdir_rules.mk=UTF-8
-encoding//Debug/subdir_vars.mk=UTF-8
-encoding//Release/makefile=UTF-8
-encoding//Release/objects.mk=UTF-8
-encoding//Release/sources.mk=UTF-8
-encoding//Release/subdir_rules.mk=UTF-8
-encoding//Release/subdir_vars.mk=UTF-8
diff --git a/examples/CC3200/ccs/Makefile b/examples/CC3200/ccs/Makefile
new file mode 100644
index 00000000..85279a19
--- /dev/null
+++ b/examples/CC3200/ccs/Makefile
@@ -0,0 +1,2 @@
+clean:
+ rm -rf */Debug */Release */.launches */.settings */.xdchelp */src
diff --git a/examples/CC3200/ccs/Mongoose/.cproject b/examples/CC3200/ccs/Mongoose/.cproject
index f601d79b..814c770f 100644
--- a/examples/CC3200/ccs/Mongoose/.cproject
+++ b/examples/CC3200/ccs/Mongoose/.cproject
@@ -29,7 +29,7 @@
@@ -94,7 +94,7 @@
diff --git a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.codan.core.prefs b/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.codan.core.prefs
deleted file mode 100644
index f653028c..00000000
--- a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.codan.core.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-inEditor=false
-onBuild=false
diff --git a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.debug.core.prefs b/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.debug.core.prefs
deleted file mode 100644
index 2adc7b1d..00000000
--- a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.cdt.debug.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
diff --git a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.core.resources.prefs b/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 37af3674..00000000
--- a/examples/CC3200/ccs/Mongoose/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-encoding//Debug/makefile=UTF-8
-encoding//Debug/objects.mk=UTF-8
-encoding//Debug/sources.mk=UTF-8
-encoding//Debug/subdir_rules.mk=UTF-8
-encoding//Debug/subdir_vars.mk=UTF-8
-encoding//Release/makefile=UTF-8
-encoding//Release/objects.mk=UTF-8
-encoding//Release/sources.mk=UTF-8
-encoding//Release/subdir_rules.mk=UTF-8
-encoding//Release/subdir_vars.mk=UTF-8
diff --git a/examples/CC3200/main.c b/examples/CC3200/main.c
index 81770c81..31f2211b 100644
--- a/examples/CC3200/main.c
+++ b/examples/CC3200/main.c
@@ -228,6 +228,6 @@ void SimpleLinkSockEventHandler(SlSockEvent_t *e) {
}
void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *e) {
- LOG(LL_INFO, ("status %d sender %d", e->EventData.deviceEvent.status,
- e->EventData.deviceEvent.sender));
+ LOG(LL_ERROR, ("status %d sender %d", e->EventData.deviceEvent.status,
+ e->EventData.deviceEvent.sender));
}
diff --git a/examples/MSP432/ccs/MG_hello/.ccsproject b/examples/MSP432/ccs/MG_hello/.ccsproject
new file mode 100644
index 00000000..723a2dd4
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/.ccsproject
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/MSP432/ccs/MG_hello/.cproject b/examples/MSP432/ccs/MG_hello/.cproject
new file mode 100644
index 00000000..1d39d5a4
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/.cproject
@@ -0,0 +1,267 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/MSP432/ccs/MG_hello/.project b/examples/MSP432/ccs/MG_hello/.project
new file mode 100644
index 00000000..6a90575d
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/.project
@@ -0,0 +1,29 @@
+
+
+ MG_hello
+
+
+ Mongoose
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature
+ com.ti.ccstudio.core.ccsNature
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/examples/MSP432/ccs/MG_hello/Board.h b/examples/MSP432/ccs/MG_hello/Board.h
new file mode 100644
index 00000000..31252689
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/Board.h
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+#ifndef __BOARD_H
+#define __BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "MSP_EXP432P401R.h"
+
+#define Board_initGeneral MSP_EXP432P401R_initGeneral
+#define Board_initGPIO MSP_EXP432P401R_initGPIO
+#define Board_initI2C MSP_EXP432P401R_initI2C
+#define Board_initPWM MSP_EXP432P401R_initPWM
+#define Board_initSDSPI MSP_EXP432P401R_initSDSPI
+#define Board_initSPI MSP_EXP432P401R_initSPI
+#define Board_initUART MSP_EXP432P401R_initUART
+#define Board_initWatchdog MSP_EXP432P401R_initWatchdog
+#define Board_initWiFi MSP_EXP432P401R_initWiFi
+
+#define Board_LED_ON MSP_EXP432P401R_LED_ON
+#define Board_LED_OFF MSP_EXP432P401R_LED_OFF
+
+#define Board_BUTTON0 MSP_EXP432P401R_S1
+#define Board_BUTTON1 MSP_EXP432P401R_S2
+#define Board_LED0 MSP_EXP432P401R_LED1
+#define Board_LED1 MSP_EXP432P401R_LED_RED
+#define Board_LED2 MSP_EXP432P401R_LED_RED
+
+/*
+ * MSP_EXP432P401R_LED_GREEN & MSP_EXP432P401R_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_LED2 MSP_EXP432P401R_LED_GREEN
+//#define Board_LED3 MSP_EXP432P401R_LED_BLUE
+
+#define Board_I2C0 MSP_EXP432P401R_I2CB0
+#define Board_I2C_TMP MSP_EXP432P401R_I2CB0
+#define Board_I2C_NFC MSP_EXP432P401R_I2CB0
+#define Board_I2C_TPL0401 MSP_EXP432P401R_I2CB0
+
+#define Board_PWM0 MSP_EXP432P401R_PWM_TA1_1
+#define Board_PWM1 MSP_EXP432P401R_PWM_TA1_2
+
+#define Board_SDSPI0 MSP_EXP432P401R_SDSPIB0
+
+#define Board_SPI0 MSP_EXP432P401R_SPIB0
+#define Board_SPI1 MSP_EXP432P401R_SPIB2
+
+#define Board_UART0 MSP_EXP432P401R_UARTA0
+#define Board_UART1 MSP_EXP432P401R_UARTA2
+
+#define Board_WATCHDOG0 MSP_EXP432P401R_WATCHDOG
+
+#define Board_WIFI MSP_EXP432P401R_WIFI
+#define Board_WIFI_SPI MSP_EXP432P401R_SPIB0
+
+/* Board specific I2C addresses */
+#define Board_TMP006_ADDR (0x40)
+#define Board_RF430CL330_ADDR (0x28)
+#define Board_TPL0401_ADDR (0x40)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BOARD_H */
diff --git a/examples/MSP432/ccs/MG_hello/MG_hello.cfg b/examples/MSP432/ccs/MG_hello/MG_hello.cfg
new file mode 100644
index 00000000..96f21878
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/MG_hello.cfg
@@ -0,0 +1,540 @@
+/*
+ * 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 = 32768;
+
+/*
+ * 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 souces 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 = 1024;
+}
+
+
+
+/*
+ * Enable Semihosting for GNU targets to print to CCS console
+ */
+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 = 512;
+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 ================ */
+var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
diff --git a/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.c b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.c
new file mode 100644
index 00000000..80e15c1e
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.c
@@ -0,0 +1,653 @@
+/*
+ * 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.c ========
+ * This file is responsible for setting up the board specific items for the
+ * MSP_EXP432P401R board.
+ */
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include "MSP_EXP432P401R.h"
+
+/*
+ * =============================== DMA ===============================
+ */
+#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];
+static bool dmaInitialized = false;
+
+/*
+ * ======== dmaErrorHwi ========
+ */
+static void dmaErrorHwi(uintptr_t arg)
+{
+ DebugP_log1("DMA error code: %d\n", MAP_DMA_getErrorStatus());
+ MAP_DMA_clearErrorStatus();
+ DebugP_log0("DMA error!!\n");
+ while(1);
+}
+
+/*
+ * ======== MSP_EXP432P401R_initDMA ========
+ */
+void MSP_EXP432P401R_initDMA(void)
+{
+ HwiP_Params hwiParams;
+ HwiP_Handle dmaErrorHwiHandle;
+
+ if (!dmaInitialized) {
+ HwiP_Params_init(&hwiParams);
+ dmaErrorHwiHandle = HwiP_create(INT_DMA_ERR, dmaErrorHwi, &hwiParams);
+ if (dmaErrorHwiHandle == NULL) {
+ DebugP_log0("Failed to create DMA error Hwi!!\n");
+ while (1);
+ }
+
+ MAP_DMA_enableModule();
+ MAP_DMA_setControlBase(dmaControlTable);
+
+ dmaInitialized = true;
+ }
+}
+
+/*
+ * ======== MSP_EXP432P401R_initGeneral ========
+ */
+void MSP_EXP432P401R_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
+#include
+
+/*
+ * Array of Pin configurations
+ * NOTE: The order of the pin configurations must coincide with what was
+ * defined in MSP_EXP432P401R.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_EXP432P401R_S1 */
+ GPIOMSP432_P1_1 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+ /* MSP_EXP432P401R_S2 */
+ GPIOMSP432_P1_4 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
+
+ /* Output pins */
+ /* MSP_EXP432P401R_LED1 */
+ GPIOMSP432_P1_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+ /* MSP_EXP432P401R_LED_RED */
+ GPIOMSP432_P2_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+
+ /*
+ * MSP_EXP432P401R_LED_GREEN & MSP_EXP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ /* MSP_EXP432P401R_LED_GREEN */
+ //GPIOMSP432_P2_1 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
+ /* MSP_EXP432P401R_LED_BLUE */
+ //GPIOMSP432_P2_2 | 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_EXP432P401R.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_EXP432P401R_S1 */
+ NULL,
+ /* MSP_EXP432P401R_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_EXP432P401R_initGPIO ========
+ */
+void MSP_EXP432P401R_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
+#include
+
+I2CMSP432_Object i2cMSP432Objects[MSP_EXP432P401R_I2CCOUNT];
+
+const I2CMSP432_HWAttrs i2cMSP432HWAttrs[MSP_EXP432P401R_I2CCOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .intNum = INT_EUSCIB0,
+ .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_EXP432P401R_initI2C ========
+ */
+void MSP_EXP432P401R_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. */
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
+ GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ /* Initialize the I2C driver */
+ I2C_init();
+}
+
+/*
+ * =============================== Power ===============================
+ */
+const PowerMSP432_Config PowerMSP432_config = {
+ .policyInitFxn = &PowerMSP432_initPolicy,
+ .policyFxn = &PowerMSP432_sleepPolicy,
+ .initialPerfLevel = 2,
+ .enablePolicy = false,
+ .enablePerf = 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
+#include
+
+PWMTimerMSP432_Object pwmTimerMSP432Objects[MSP_EXP432P401R_PWMCOUNT];
+
+const PWMTimerMSP432_HWAttrs pwmTimerMSP432HWAttrs[MSP_EXP432P401R_PWMCOUNT] = {
+ {
+ .baseAddr = TIMER_A1_BASE,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1
+ },
+ {
+ .baseAddr = TIMER_A1_BASE,
+ .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2
+ }
+};
+
+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_EXP432P401R_initPWM ========
+ */
+void MSP_EXP432P401R_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);
+
+ /* Enable PWM output on GPIO pins */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2,
+ GPIO_PIN1 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
+
+ PWM_init();
+}
+
+/*
+ * =============================== SDSPI ===============================
+ */
+/* Place into subsections to allow the TI linker to remove items properly */
+#if defined(__TI_COMPILER_VERSION__)
+#pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
+#pragma DATA_SECTION(sdspiMSP432HWAttrs, ".const:sdspiMSP432HWAttrs")
+#endif
+
+#include
+#include
+
+SDSPIMSP432_Object sdspiMSP432Objects[MSP_EXP432P401R_SDSPICOUNT];
+
+const SDSPIMSP432_HWAttrs sdspiMSP432HWAttrs[MSP_EXP432P401R_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}
+};
+
+/*
+ * ======== MSP_EXP432P401R_initSDSPI ========
+ */
+void MSP_EXP432P401R_initSDSPI(void)
+{
+ SDSPI_init();
+}
+
+/*
+ * =============================== 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
+#include
+
+SPIMSP432DMA_Object spiMSP432DMAObjects[MSP_EXP432P401R_SPICOUNT];
+
+const SPIMSP432DMA_HWAttrs spiMSP432DMAHWAttrs[MSP_EXP432P401R_SPICOUNT] = {
+ {
+ .baseAddr = EUSCI_B0_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT1,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH1_EUSCIB0RX0,
+ .txDMAChannelIndex = DMA_CH0_EUSCIB0TX0
+ },
+ {
+ .baseAddr = EUSCI_B2_BASE,
+ .bitOrder = EUSCI_B_SPI_MSB_FIRST,
+ .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
+
+ .defaultTxBufValue = 0,
+
+ .dmaIntNum = INT_DMA_INT2,
+ .intPriority = (~0),
+ .rxDMAChannelIndex = DMA_CH5_EUSCIB2RX0,
+ .txDMAChannelIndex = DMA_CH4_EUSCIB2TX0
+ }
+};
+
+const SPI_Config SPI_config[] = {
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[0],
+ .hwAttrs = &spiMSP432DMAHWAttrs[0]
+ },
+ {
+ .fxnTablePtr = &SPIMSP432DMA_fxnTable,
+ .object = &spiMSP432DMAObjects[1],
+ .hwAttrs = &spiMSP432DMAHWAttrs[1]
+ },
+ {NULL, NULL, NULL},
+};
+
+/*
+ * ======== MSP_EXP432P401R_initSPI ========
+ */
+void MSP_EXP432P401R_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 SPI1 (EUSCI_B2) */
+ MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P3,
+ GPIO_PIN5 | GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
+ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN7,
+ GPIO_PRIMARY_MODULE_FUNCTION);
+
+ MSP_EXP432P401R_initDMA();
+ 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
+#include
+
+UARTMSP432_Object uartMSP432Objects[MSP_EXP432P401R_UARTCOUNT];
+unsigned char uartMSP432RingBuffer[MSP_EXP432P401R_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_EXP432P401R_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_EXP432P401R_initUART ========
+ */
+void MSP_EXP432P401R_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
+#include
+
+WatchdogMSP432_Object watchdogMSP432Objects[MSP_EXP432P401R_WATCHDOGCOUNT];
+
+const WatchdogMSP432_HWAttrs
+ watchdogMSP432HWAttrs[MSP_EXP432P401R_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_EXP432P401R_initWatchdog ========
+ */
+void MSP_EXP432P401R_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
+#include
+
+WiFiCC3100_Object wiFiCC3100Objects[MSP_EXP432P401R_WIFICOUNT];
+
+const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[MSP_EXP432P401R_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_EXP432P401R_initWiFi ========
+ */
+void MSP_EXP432P401R_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 */
+ MSP_EXP432P401R_initDMA();
+ SPI_init();
+ WiFi_init();
+}
diff --git a/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.cmd b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.cmd
new file mode 100644
index 00000000..82d58a1f
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.cmd
@@ -0,0 +1,61 @@
+/*
+ * 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
+
+ .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/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.h b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.h
new file mode 100644
index 00000000..1738f49e
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/MSP_EXP432P401R.h
@@ -0,0 +1,252 @@
+/*
+ * 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.
+ */
+/** ============================================================================
+ * @file MSP_EXP432P401R.h
+ *
+ * @brief MSP_EXP432P401R Board Specific APIs
+ *
+ * The MSP_EXP432P401R header file should be included in an application as
+ * follows:
+ * @code
+ * #include
+ * @endcode
+ *
+ * ============================================================================
+ */
+#ifndef __MSP_EXP432P401R_H
+#define __MSP_EXP432P401R_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LEDs on MSP_EXP432P401R are active high. */
+#define MSP_EXP432P401R_LED_OFF (0)
+#define MSP_EXP432P401R_LED_ON (1)
+
+/*!
+ * @def MSP_EXP432P401R_GPIOName
+ * @brief Enum of GPIO names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_GPIOName {
+ MSP_EXP432P401R_S1 = 0,
+ MSP_EXP432P401R_S2,
+ MSP_EXP432P401R_LED1,
+ MSP_EXP432P401R_LED_RED,
+
+ /*
+ * MSP_EXP432P401R_LED_GREEN & MSP_EXP432P401R_LED_BLUE are used for
+ * PWM examples. Uncomment the following lines if you would like to control
+ * the LEDs with the GPIO driver.
+ */
+ //MSP_EXP432P401R_LED_GREEN,
+ //MSP_EXP432P401R_LED_BLUE,
+
+ MSP_EXP432P401R_GPIOCOUNT
+} MSP_EXP432P401R_GPIOName;
+
+/*!
+ * @def MSP_EXP432P401R_I2CName
+ * @brief Enum of I2C names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_I2CName {
+ MSP_EXP432P401R_I2CB0 = 0,
+
+ MSP_EXP432P401R_I2CCOUNT
+} MSP_EXP432P401R_I2CName;
+
+/*!
+ * @def MSP_EXP432P401R_PWMName
+ * @brief Enum of PWM names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_PWMName {
+ MSP_EXP432P401R_PWM_TA1_1 = 0,
+ MSP_EXP432P401R_PWM_TA1_2,
+
+ MSP_EXP432P401R_PWMCOUNT
+} MSP_EXP432P401R_PWMName;
+
+/*!
+ * @def MSP_EXP432P401R_SDSPIName
+ * @brief Enum of SDSPI names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_SDSPIName {
+ MSP_EXP432P401R_SDSPIB0 = 0,
+
+ MSP_EXP432P401R_SDSPICOUNT
+} EMSP_EXP432P401R_SDSPIName;
+
+/*!
+ * @def MSP_EXP432P401R_SPIName
+ * @brief Enum of SPI names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_SPIName {
+ MSP_EXP432P401R_SPIB0 = 0,
+ MSP_EXP432P401R_SPIB2,
+
+ MSP_EXP432P401R_SPICOUNT
+} MSP_EXP432P401R_SPIName;
+
+/*!
+ * @def MSP_EXP432P401R_UARTName
+ * @brief Enum of UART names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_UARTName {
+ MSP_EXP432P401R_UARTA0 = 0,
+ MSP_EXP432P401R_UARTA2,
+
+ MSP_EXP432P401R_UARTCOUNT
+} MSP_EXP432P401R_UARTName;
+
+/*!
+ * @def MSP_EXP432P401R_WatchdogName
+ * @brief Enum of Watchdog names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_WatchdogName {
+ MSP_EXP432P401R_WATCHDOG = 0,
+
+ MSP_EXP432P401R_WATCHDOGCOUNT
+} MSP_EXP432P401R_WatchdogName;
+
+/*!
+ * @def MSP_EXP432P401R_WiFiName
+ * @brief Enum of WiFi names on the MSP_EXP432P401R dev board
+ */
+typedef enum MSP_EXP432P401R_WiFiName {
+ MSP_EXP432P401R_WIFI = 0,
+
+ MSP_EXP432P401R_WIFICOUNT
+} MSP_EXP432P401R_WiFiName;
+
+/*!
+ * @brief Initialize the general board specific settings
+ *
+ * This function initializes the general board specific settings.
+ */
+extern void MSP_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_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_EXP432P401R_initWiFi(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MSP_EXP432P401R_H */
diff --git a/examples/MSP432/ccs/MG_hello/main.c b/examples/MSP432/ccs/MG_hello/main.c
new file mode 100644
index 00000000..e1109a7f
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/main.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2014-2016 Cesanta Software Limited
+ * All rights reserved
+ */
+
+/* Set up an AP or connect to existing WiFi network. */
+#define WIFI_AP_SSID "Mongoose"
+#define WIFI_AP_PASS ""
+#define WIFI_AP_CHAN 6
+//#define WIFI_STA_SSID "YourWiFi"
+//#define WIFI_STA_PASS "YourPass"
+
+#define MG_TASK_PRIORITY 3
+#define MG_TASK_STACK_SIZE 8192
+
+#include
+#include
+#include
+
+/* XDCtools Header files */
+#include
+#include
+
+/* BIOS Header files */
+#include
+#include
+
+/* TI-RTOS Header files */
+#include
+#include
+
+/* Example/Board Header file */
+#include "Board.h"
+
+/* Mongoose.h brings in SimpleLink support. Do not include simplelink.h. */
+#include
+
+#include "wifi.h"
+
+void mg_ev_handler(struct mg_connection *nc, int ev, void *p) {
+ static const char *reply_fmt =
+ "HTTP/1.0 200 OK\r\n"
+ "Connection: close\r\n"
+ "Content-Type: text/plain\r\n"
+ "\r\n"
+ "Hello %s\n";
+ LOG(LL_DEBUG, ("conn %p ev %d", nc, ev));
+
+ switch (ev) {
+ case MG_EV_ACCEPT: {
+ char addr[32];
+ mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
+ MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
+ LOG(LL_INFO, ("Connection %p from %s", nc, addr));
+ break;
+ }
+ case MG_EV_HTTP_REQUEST: {
+ char addr[32];
+ struct http_message *hm = (struct http_message *) p;
+ mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
+ MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
+ LOG(LL_INFO,
+ ("HTTP request from %s: %.*s %.*s", addr, (int) hm->method.len,
+ hm->method.p, (int) hm->uri.len, hm->uri.p));
+ mg_printf(nc, reply_fmt, addr);
+ nc->flags |= MG_F_SEND_AND_CLOSE;
+ break;
+ }
+ case MG_EV_CLOSE: {
+ LOG(LL_INFO, ("Connection %p closed", nc));
+ break;
+ }
+ }
+}
+
+static void mg_init(struct mg_mgr *mgr) {
+ WiFi_Params wifiParams;
+ WiFi_Handle handle;
+
+ LOG(LL_INFO, ("MG task running"));
+
+ /* Open WiFi driver */
+ WiFi_Params_init(&wifiParams);
+ wifiParams.bitRate = 2000000;
+ handle = WiFi_open(Board_WIFI, Board_WIFI_SPI, NULL, &wifiParams);
+ if (handle == NULL) {
+ System_abort("WiFi driver failed to open.");
+ }
+
+ sl_Start(0, 0, 0);
+
+ sl_fs_init();
+
+#if defined(WIFI_STA_SSID)
+ if (!wifi_setup_sta(WIFI_STA_SSID, WIFI_STA_PASS)) {
+ LOG(LL_ERROR, ("Error setting up WiFi station"));
+ }
+#elif defined(WIFI_AP_SSID)
+ if (!wifi_setup_ap(WIFI_AP_SSID, WIFI_AP_PASS, WIFI_AP_CHAN)) {
+ LOG(LL_ERROR, ("Error setting up WiFi AP"));
+ }
+#else
+#error WiFi not configured
+#endif
+
+ /* We don't need SimpleLink's web server. */
+ sl_NetAppStop(SL_NET_APP_HTTP_SERVER_ID);
+
+ const char *err = "";
+ struct mg_bind_opts opts;
+ memset(&opts, 0, sizeof(opts));
+ opts.error_string = &err;
+
+ struct mg_connection *nc = mg_bind(mgr, "80", mg_ev_handler);
+ if (nc != NULL) {
+ mg_set_protocol_http_websocket(nc);
+ } else {
+ LOG(LL_ERROR, ("Failed to create listener: %s", err));
+ }
+}
+
+int main(void) {
+ Board_initGeneral();
+ Board_initGPIO();
+ Board_initWiFi();
+
+ setvbuf(stdout, NULL, _IOLBF, 0);
+ setvbuf(stderr, NULL, _IOLBF, 0);
+ cs_log_set_level(LL_INFO);
+ cs_log_set_file(stdout);
+
+ if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
+ LOG(LL_ERROR, ("Error starting Mongoose task"));
+ return 1;
+ }
+
+ LOG(LL_INFO, ("OK"));
+
+ osi_start();
+
+ return 0;
+}
+
+void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *e,
+ SlHttpServerResponse_t *resp) {
+}
+
+void SimpleLinkSockEventHandler(SlSockEvent_t *e) {
+}
+
+void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *e) {
+ LOG(LL_ERROR, ("status %d sender %d", e->EventData.deviceEvent.status,
+ e->EventData.deviceEvent.sender));
+}
diff --git a/examples/MSP432/ccs/MG_hello/targetConfigs/MSP432P401R.ccxml b/examples/MSP432/ccs/MG_hello/targetConfigs/MSP432P401R.ccxml
new file mode 100644
index 00000000..98d3e339
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/targetConfigs/MSP432P401R.ccxml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/MSP432/ccs/MG_hello/targetConfigs/readme.txt b/examples/MSP432/ccs/MG_hello/targetConfigs/readme.txt
new file mode 100644
index 00000000..af97b62d
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/targetConfigs/readme.txt
@@ -0,0 +1,9 @@
+The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
+on the device and connection settings specified in your project on the Properties > General page.
+
+Please note that in automatic target-configuration management, changes to the project's device and/or
+connection settings will either modify an existing or generate a new target-configuration file. Thus,
+if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
+you may create your own target-configuration file for this project and manage it manually. You can
+always switch back to automatic target-configuration management by checking the "Manage the project's
+target-configuration automatically" checkbox on the project's Properties > General page.
\ No newline at end of file
diff --git a/examples/MSP432/ccs/MG_hello/wifi.c b/examples/MSP432/ccs/MG_hello/wifi.c
new file mode 100644
index 00000000..02aa9a51
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/wifi.c
@@ -0,0 +1,116 @@
+#include "wifi.h"
+
+#include "mongoose.h"
+#include "simplelink.h"
+#include "wlan.h"
+
+void SimpleLinkWlanEventHandler(SlWlanEvent_t *e) {
+ switch (e->Event) {
+ case SL_WLAN_CONNECT_EVENT:
+ LOG(LL_INFO, ("WiFi: connected"));
+ break;
+ case SL_WLAN_STA_CONNECTED_EVENT:
+ LOG(LL_INFO, ("WiFi: station connected"));
+ break;
+ case SL_WLAN_STA_DISCONNECTED_EVENT:
+ LOG(LL_INFO, ("WiFi: station disconnected"));
+ break;
+ default:
+ LOG(LL_INFO, ("WiFi: event %d", e->Event));
+ }
+}
+
+int ip_acquired = 0;
+
+void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *e) {
+ if (e->Event == SL_NETAPP_IPV4_IPACQUIRED_EVENT) {
+ SlIpV4AcquiredAsync_t *ed = &e->EventData.ipAcquiredV4;
+ LOG(LL_INFO, ("IP acquired: %lu.%lu.%lu.%lu", SL_IPV4_BYTE(ed->ip, 3),
+ SL_IPV4_BYTE(ed->ip, 2), SL_IPV4_BYTE(ed->ip, 1),
+ SL_IPV4_BYTE(ed->ip, 0)));
+ ip_acquired = 1;
+ } else if (e->Event == SL_NETAPP_IP_LEASED_EVENT) {
+ LOG(LL_INFO, ("IP leased"));
+ } else {
+ LOG(LL_INFO, ("NetApp event %d", e->Event));
+ }
+}
+
+bool wifi_setup_ap(const char *ssid, const char *pass, int channel) {
+ uint8_t v;
+ if (sl_WlanSetMode(ROLE_AP) != 0) {
+ return false;
+ }
+ if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, strlen(ssid),
+ (const uint8_t *) ssid) != 0) {
+ return false;
+ }
+ v = strlen(pass) > 0 ? SL_SEC_TYPE_WPA : SL_SEC_TYPE_OPEN;
+ if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, &v) != 0) {
+ return false;
+ }
+ if (v == SL_SEC_TYPE_WPA &&
+ sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, strlen(pass),
+ (const uint8_t *) pass) != 0) {
+ return false;
+ }
+ v = channel;
+ if (sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_CHANNEL, 1, &v) != 0) {
+ return false;
+ }
+ sl_NetAppStop(SL_NET_APP_DHCP_SERVER_ID);
+ {
+ SlNetCfgIpV4Args_t ipcfg;
+ memset(&ipcfg, 0, sizeof(ipcfg));
+ if (!inet_pton(AF_INET, "192.168.4.1", &ipcfg.ipV4) ||
+ !inet_pton(AF_INET, "255.255.255.0", &ipcfg.ipV4Mask) ||
+ /* This means "disable". 0.0.0.0 won't do. */
+ !inet_pton(AF_INET, "255.255.255.255", &ipcfg.ipV4DnsServer) ||
+ /* We'd like to disable gateway too, but DHCP server refuses to start.
+ */
+ !inet_pton(AF_INET, "192.168.4.1", &ipcfg.ipV4Gateway) ||
+ sl_NetCfgSet(SL_IPV4_AP_P2P_GO_STATIC_ENABLE, IPCONFIG_MODE_ENABLE_IPV4,
+ sizeof(ipcfg), (uint8_t *) &ipcfg) != 0) {
+ return false;
+ }
+ }
+ {
+ SlNetAppDhcpServerBasicOpt_t dhcpcfg;
+ memset(&dhcpcfg, 0, sizeof(dhcpcfg));
+ dhcpcfg.lease_time = 900;
+ if (!inet_pton(AF_INET, "192.168.4.20", &dhcpcfg.ipv4_addr_start) ||
+ !inet_pton(AF_INET, "192.168.4.200", &dhcpcfg.ipv4_addr_last) ||
+ sl_NetAppSet(SL_NET_APP_DHCP_SERVER_ID, NETAPP_SET_DHCP_SRV_BASIC_OPT,
+ sizeof(dhcpcfg), (uint8_t *) &dhcpcfg) != 0) {
+ return false;
+ }
+ }
+ sl_Stop(0);
+ int role = sl_Start(NULL, NULL, NULL);
+ if (role != ROLE_AP) {
+ LOG(LL_ERROR, ("Expected ROLE_AP (%d), got %d", ROLE_AP, role));
+ return false;
+ }
+ if (sl_NetAppStart(SL_NET_APP_DHCP_SERVER_ID) != 0) {
+ LOG(LL_ERROR, ("DHCP server failed to start"));
+ return false;
+ }
+ LOG(LL_INFO, ("WiFi: AP %s configured", ssid));
+ return true;
+}
+
+bool wifi_setup_sta(const char *ssid, const char *pass) {
+ SlSecParams_t sp;
+ LOG(LL_INFO, ("WiFi: connecting to %s", ssid));
+ if (sl_WlanSetMode(ROLE_STA) != 0) return false;
+ sl_Stop(0);
+ sl_Start(NULL, NULL, NULL);
+ sl_WlanDisconnect();
+ sp.Key = (_i8 *) pass;
+ sp.KeyLen = strlen(pass);
+ sp.Type = sp.KeyLen ? SL_SEC_TYPE_WPA : SL_SEC_TYPE_OPEN;
+ if (sl_WlanConnect((const _i8 *) ssid, strlen(ssid), 0, &sp, 0) != 0) {
+ return false;
+ }
+ return true;
+}
diff --git a/examples/MSP432/ccs/MG_hello/wifi.h b/examples/MSP432/ccs/MG_hello/wifi.h
new file mode 100644
index 00000000..e300cbf4
--- /dev/null
+++ b/examples/MSP432/ccs/MG_hello/wifi.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2014-2016 Cesanta Software Limited
+ * All rights reserved
+ */
+
+#ifndef CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_
+#define CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_
+
+#include
+
+bool wifi_setup_ap(const char *ssid, const char *pass, int channel);
+bool wifi_setup_sta(const char *ssid, const char *pass);
+
+#endif /* CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_ */
diff --git a/examples/MSP432/ccs/Makefile b/examples/MSP432/ccs/Makefile
new file mode 100644
index 00000000..d102c42d
--- /dev/null
+++ b/examples/MSP432/ccs/Makefile
@@ -0,0 +1,2 @@
+clean:
+ rm -rf */Debug */Release */.config */.launches */.settings */.xdchelp */src
diff --git a/examples/MSP432/ccs/Mongoose/.ccsproject b/examples/MSP432/ccs/Mongoose/.ccsproject
new file mode 100644
index 00000000..46675f94
--- /dev/null
+++ b/examples/MSP432/ccs/Mongoose/.ccsproject
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/MSP432/ccs/Mongoose/.cproject b/examples/MSP432/ccs/Mongoose/.cproject
new file mode 100644
index 00000000..0001140a
--- /dev/null
+++ b/examples/MSP432/ccs/Mongoose/.cproject
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/MSP432/ccs/Mongoose/.project b/examples/MSP432/ccs/Mongoose/.project
new file mode 100644
index 00000000..5100371d
--- /dev/null
+++ b/examples/MSP432/ccs/Mongoose/.project
@@ -0,0 +1,40 @@
+
+
+ Mongoose
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.rtsc.xdctools.buildDefinitions.XDC.xdcNature
+ com.ti.ccstudio.core.ccsNature
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ mongoose.c
+ 1
+ PARENT-4-PROJECT_LOC/mongoose.c
+
+
+ mongoose.h
+ 1
+ PARENT-4-PROJECT_LOC/mongoose.h
+
+
+
diff --git a/examples/MSP432/ccs/Mongoose/Mongoose.cfg b/examples/MSP432/ccs/Mongoose/Mongoose.cfg
new file mode 100644
index 00000000..8f148c48
--- /dev/null
+++ b/examples/MSP432/ccs/Mongoose/Mongoose.cfg
@@ -0,0 +1 @@
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
diff --git a/examples/Makefile b/examples/Makefile
index 3f179822..5972212a 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -3,7 +3,7 @@
# `wildcard ./*/` works in both linux and linux/wine, while `wildcard */` enumerates nothing under wine
SUBDIRS = $(sort $(dir $(wildcard ./*/)))
-SUBDIRS:=$(filter-out ./ ./CC3200/, $(SUBDIRS))
+SUBDIRS:=$(filter-out ./ ./CC3200/ ./ESP8266_RTOS/ ./MSP432/, $(SUBDIRS))
ifeq ($(OS), Windows_NT)
SUBDIRS:=$(filter-out ./load_balancer/ ./netcat/ ./raspberry_pi_mjpeg_led/ ./captive_dns_server/, $(SUBDIRS))