/* * Copyright (c) 2018, 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. */ // @cliArgs --board /ti/boards/LP_CC1352P7_1 --rtos tirtos /* * border_router_nanostack_mesh_tirf.syscfg */ /* ======== RF ======== */ var RF = scripting.addModule("/ti/drivers/RF"); /* If an antenna component exists, assign it to the RF instance */ if (system.deviceData.board && system.deviceData.board.components.RF) { RF.$hardware = system.deviceData.board.components.RF; } /* ======== TRNG ======== */ var TRNG = scripting.addModule("/ti/drivers/TRNG", {}, false); var trng = TRNG.addInstance(); trng.$name = "NANOSTACK_TRNG"; /* ======== NVS ======== */ var NVS = scripting.addModule("/ti/drivers/NVS"); // Add a NVS module var NVS_INT = NVS.addInstance(); // Add an internal NVS module instance NVS_INT.$name = "CONFIG_NVSINTERNAL"; // Internal NVS NVS_INT.internalFlash.regionBase = 0x52000; // project has 2 NV pages default NVS_INT.internalFlash.regionSize = 0x4000; /* ======== Watchdog ======== */ var Watchdog = scripting.addModule("/ti/drivers/Watchdog", {}, false); var Watchdog1 = Watchdog.addInstance(); /* ======== UART ======== */ var UART = scripting.addModule("/ti/drivers/UART", {}, false); var UART1 = UART.addInstance(); UART1.$hardware = system.deviceData.board.components.XDS110UART; /* ======== TRNG ======== */ var TRNG = scripting.addModule("/ti/drivers/TRNG", {}, false); var TRNG1 = TRNG.addInstance(); /* ======== LED Red ======== */ var LED = scripting.addModule("/ti/drivers/apps/LED"); // Add a LED module var LED_R = LED.addInstance(); // Add a LED module instance for LED_R /* If a red LED component exists, assign it to the LED_R instance */ if (system.deviceData.board && system.deviceData.board.components.LED_RED) { LED_R.$hardware = system.deviceData.board.components.LED_RED; } else { LED_R.mode = "Output"; // Set the LED pin to output } LED_R.$name = "CONFIG_LED_RED"; LED_R.gpioPin.$name = "CONFIG_GPIO_RLED"; // Descriptive name for the LED_R GPIO LED_R.gpioPin.mode = "Output"; LED_R.gpioPin.callbackFunction = ""; /* ======== LED Green ======== */ var LED = scripting.addModule("/ti/drivers/apps/LED"); // Add a LED module var LED_G = LED.addInstance(); // Add a LED module instance for LED_G /* If a red LED component exists, assign it to the LED_G instance */ if (system.deviceData.board && system.deviceData.board.components.LED_GREEN) { LED_G.$hardware = system.deviceData.board.components.LED_GREEN; } else { LED_G.mode = "Output"; // Set the LED pin to output } LED_G.$name = "CONFIG_LED_GREEN"; LED_G.gpioPin.$name = "CONFIG_GPIO_GLED"; // Descriptive name for the LED_G GPIO LED_G.gpioPin.mode = "Output"; LED_G.gpioPin.callbackFunction = ""; /* ======== Left Button ======== */ var BUTTON = scripting.addModule("/ti/drivers/apps/Button"); // Add a BUTTON module var BUTTON_L = BUTTON.addInstance(); // Add a BUTTON module instance for BUTTON_L /* If a BUTTON0 component exists, assign it to the BUTTON_L instance */ if (system.deviceData.board && system.deviceData.board.components["BTN-1"]) { BUTTON_L.$hardware = system.deviceData.board.components["BTN-1"]; } BUTTON_L.$name = "CONFIG_BTN_LEFT"; BUTTON_L.gpioPin.$name = "CONFIG_GPIO_BTN1"; // Descriptive name for the BUTTON_L GPIO BUTTON_L.gpioPin.pull = "Pull Up"; // Use Pull up resistor /* ======== Right Button ======== */ var BUTTON = scripting.addModule("/ti/drivers/apps/Button"); // Add a BUTTON module var BUTTON_R = BUTTON.addInstance(); // Add a BUTTON module instance for BUTTON_R /* If a BUTTON0 component exists, assign it to the BUTTON_R instance */ if (system.deviceData.board && system.deviceData.board.components["BTN-2"]) { BUTTON_R.$hardware = system.deviceData.board.components["BTN-2"]; } BUTTON_R.$name = "CONFIG_BTN_RIGHT"; BUTTON_R.gpioPin.$name = "CONFIG_GPIO_BTN2"; // Descriptive name for the BUTTON_R GPIO BUTTON_R.gpioPin.pull = "Pull Up"; // Use Pull up resistor /* ======== TI-15.4 Stack ======== */ var TI154Stack = scripting.addModule("/ti/ti_wisunfan/ti_wisunfan"); TI154Stack.project = "borderrouter"; TI154Stack.mode = "frequencyHopping"; TI154Stack.lockProject = true; TI154Stack.rxOnIdle = true; TI154Stack.panID = 0xABCD; TI154Stack.secureLevel = "macSecure"; /* ======== Device ======== */ var device = scripting.addModule("ti/devices/CCFG"); const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings; for(var setting in ccfgSettings) { device[setting] = ccfgSettings[setting]; } /* ======== RTOS ======== */ const RTOS = scripting.addModule("/ti/drivers/RTOS"); RTOS.name = "TI-RTOS";