├── .gitignore ├── BLE_MultiRole__1.1_manifest.html ├── Components ├── hal │ └── target │ │ └── _common │ │ └── cc26xx │ │ └── mb_PATCH_tirtos_2p15_port.c ├── icall │ └── ports │ │ └── tirtos │ │ └── ICallCC2650_tirtos_2p15_port.c ├── npi │ └── unified │ │ ├── README.md │ │ ├── doc_resources │ │ ├── four_wire_latency.PNG │ │ ├── profiler_snippet.PNG │ │ └── two_wire_latency.PNG │ │ ├── inc │ │ ├── npi_data_swhs.h │ │ ├── npi_task_swhs.h │ │ ├── npi_tl_swhs.h │ │ └── npi_tl_uart_swhs.h │ │ ├── npi_task_swhs.c │ │ ├── npi_tl_swhs.c │ │ └── npi_tl_uart_swhs.c └── uart_log │ ├── README.md │ ├── uart_logs.c │ └── uart_logs.h ├── Projects └── ble │ ├── Profiles │ └── Roles │ │ └── CC26xx │ │ ├── multi.c │ │ └── multi.h │ ├── ancs │ ├── CC26xx │ │ ├── CCS │ │ │ ├── Config │ │ │ │ ├── appBLE.cfg │ │ │ │ ├── ccfg_appBLE.c │ │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ │ └── ccsLinkerDefines.cmd │ │ │ ├── ancs │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ │ └── ancs_stack │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ ├── IAR │ │ │ ├── Application │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640App.ewd │ │ │ │ │ └── CC2640App.ewp │ │ │ ├── Config │ │ │ │ ├── IAR-Boundary.bdef │ │ │ │ ├── IAR-Boundary.xcl │ │ │ │ ├── appBLE.cfg │ │ │ │ └── ccfg_appBLE.c │ │ │ ├── Stack │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640Stack.ewd │ │ │ │ │ ├── CC2640Stack.ewp │ │ │ │ │ └── buildConfig.opt │ │ │ ├── ancs.custom_argvars │ │ │ └── ancs.eww │ │ └── Source │ │ │ ├── Application │ │ │ ├── ancs.h │ │ │ ├── ancsApp.c │ │ │ ├── ancsApp.h │ │ │ ├── ancs_client.c │ │ │ └── main.c │ │ │ └── Stack │ │ │ └── OSAL_ICallBle.c │ ├── README.md │ └── doc_resources │ │ ├── ancs_srf06.jpg │ │ └── ancs_terminal.png │ ├── common │ └── cc26xx │ │ ├── board_key.c │ │ ├── board_key.h │ │ ├── board_lcd_tirtos_2p15_port.c │ │ └── board_lcd_uartlog.c │ ├── multi_role │ ├── CC26xx │ │ ├── CCS │ │ │ ├── Config │ │ │ │ ├── appBLE.cfg │ │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ │ └── ccsLinkerDefines.cmd │ │ │ ├── multi_role │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ │ └── multi_role_stack │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ ├── IAR │ │ │ ├── Application │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640App.ewd │ │ │ │ │ └── CC2640App.ewp │ │ │ ├── Config │ │ │ │ ├── IAR-Boundary.bdef │ │ │ │ ├── IAR-Boundary.xcl │ │ │ │ ├── appBLE.cfg │ │ │ │ └── ccfg_appBLE.c │ │ │ ├── Stack │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640Stack.ewd │ │ │ │ │ ├── CC2640Stack.ewp │ │ │ │ │ └── buildConfig.opt │ │ │ ├── multi_role.custom_argvars │ │ │ └── multi_role.eww │ │ └── Source │ │ │ ├── Application │ │ │ ├── main.c │ │ │ ├── multi_role.c │ │ │ └── multi_role.h │ │ │ └── Stack │ │ │ └── OSAL_ICallBle.c │ ├── Demo Hex Files │ │ ├── CC2540_HTR.hex │ │ ├── CC2540_SBP.hex │ │ ├── CC2541_SBP.hex │ │ ├── CC2640_MR.bin │ │ └── CC2640_SBP.bin │ ├── README.md │ └── doc_resources │ │ ├── device_menu.jpg │ │ ├── main_menu.jpg │ │ └── topology_example.png │ ├── sap_lib_sw_handshaking │ ├── CC26xx │ │ ├── CCS │ │ │ ├── .ccsproject │ │ │ ├── .cproject │ │ │ ├── .project │ │ │ └── sap_lib_sw_handshaking_prebuilt.lib │ │ └── IAR │ │ │ ├── sap_lib_sw_handshaking.custom_argvars │ │ │ ├── sap_lib_sw_handshaking.ewp │ │ │ └── sap_lib_sw_handshaking.eww │ └── README.md │ ├── simple_ap_sw_handshaking │ ├── CC26xx │ │ ├── CCS │ │ │ ├── Config │ │ │ │ ├── appBLE.cfg │ │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ │ └── ccsLinkerDefines.cmd │ │ │ └── simple_ap_sw_handshaking │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ ├── IAR │ │ │ ├── Application │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640App.ewd │ │ │ │ │ └── CC2640App.ewp │ │ │ ├── Config │ │ │ │ └── appBLE.cfg │ │ │ ├── simple_ap_sw_handshaking.custom_argvars │ │ │ └── simple_ap_sw_handshaking.eww │ │ └── Source │ │ │ └── Application │ │ │ ├── simple_ap_swhs.c │ │ │ └── simple_ap_swhs_stk.c │ └── README.md │ ├── simple_ble_peripheral_tirtos_2p15 │ ├── CC26xx │ │ ├── CCS │ │ │ ├── Config │ │ │ │ ├── appBLE.cfg │ │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ │ └── ccsLinkerDefines.cmd │ │ │ ├── SimpleBLEPeripheral │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ │ └── SimpleBLEPeripheralStack │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ ├── IAR │ │ │ ├── Application │ │ │ │ └── CC2640 │ │ │ │ │ ├── CC2640App.ewd │ │ │ │ │ └── CC2640App.ewp │ │ │ ├── Config │ │ │ │ ├── IAR-Boundary.bdef │ │ │ │ ├── IAR-Boundary.xcl │ │ │ │ ├── appBLE.cfg │ │ │ │ └── ccfg_appBLE.c │ │ │ ├── SimpleBLEPeripheral.custom_argvars │ │ │ ├── SimpleBLEPeripheral.eww │ │ │ └── Stack │ │ │ │ └── CC2640 │ │ │ │ ├── CC2640Stack.ewd │ │ │ │ ├── CC2640Stack.ewp │ │ │ │ └── buildConfig.opt │ │ └── Source │ │ │ └── Application │ │ │ ├── main.c │ │ │ └── simpleBLEPeripheral.c │ └── README.md │ ├── simple_ble_peripheral_uartdisplay │ ├── CC26xx │ │ ├── CCS │ │ │ ├── Config │ │ │ │ ├── appBLE.cfg │ │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ │ └── ccsLinkerDefines.cmd │ │ │ ├── SimpleBLEPeripheral │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ │ └── SimpleBLEPeripheralStack │ │ │ │ ├── .ccsproject │ │ │ │ ├── .cproject │ │ │ │ └── .project │ │ └── IAR │ │ │ ├── Application │ │ │ └── CC2640 │ │ │ │ ├── CC2640App.ewd │ │ │ │ └── CC2640App.ewp │ │ │ ├── Config │ │ │ ├── IAR-Boundary.bdef │ │ │ ├── IAR-Boundary.xcl │ │ │ └── appBLE.cfg │ │ │ ├── SimpleBLEPeripheral.custom_argvars │ │ │ ├── SimpleBLEPeripheral.eww │ │ │ └── Stack │ │ │ └── CC2640 │ │ │ ├── CC2640Stack.ewd │ │ │ ├── CC2640Stack.ewp │ │ │ └── buildConfig.opt │ └── README.md │ └── simple_np_sw_handshaking │ ├── CC26xx │ ├── CCS │ │ ├── Config │ │ │ ├── appBLE.cfg │ │ │ ├── ccsCompilerDefines.bcfg │ │ │ └── ccsLinkerDefines.cmd │ │ ├── simple_np_sw_handshaking │ │ │ ├── .ccsproject │ │ │ ├── .cproject │ │ │ └── .project │ │ └── simple_np_sw_handshaking_stack │ │ │ ├── .ccsproject │ │ │ ├── .cproject │ │ │ └── .project │ └── IAR │ │ ├── Application │ │ └── CC2640 │ │ │ ├── CC2640App.ewd │ │ │ └── CC2640App.ewp │ │ ├── Config │ │ ├── IAR-Boundary.bdef │ │ ├── IAR-Boundary.xcl │ │ └── appBLE.cfg │ │ ├── Stack │ │ └── CC2640 │ │ │ ├── CC2640Stack.ewd │ │ │ ├── CC2640Stack.ewp │ │ │ └── buildConfig.opt │ │ ├── simple_np_sw_handshaking.custom_argvars │ │ └── simple_np_sw_handshaking.eww │ └── README.md ├── README.md ├── Sample_Apps_Manifest.html ├── Util └── tirtos_2_13_patches │ └── ti │ └── boards │ ├── CC2650DK_4XS │ ├── Board.h │ ├── CC2650DK_4XS.c │ └── CC2650DK_4XS.h │ ├── CC2650DK_5XD │ ├── Board.h │ ├── CC2650DK_5XD.c │ └── CC2650DK_5XD.h │ ├── CC2650DK_7ID │ ├── Board.h │ ├── CC2650DK_7ID.c │ └── CC2650DK_7ID.h │ ├── CC2650STK │ ├── Board.h │ ├── CC2650STK.c │ └── CC2650STK.h │ ├── CC2650_LAUNCHXL │ ├── Board.h │ ├── CC2650_LAUNCHXL.c │ └── CC2650_LAUNCHXL.h │ └── README.md └── checkout_210.png /.gitignore: -------------------------------------------------------------------------------- 1 | **/settings 2 | **/Debug/* 3 | **/FlashOnly/* 4 | **/FlashROM/* 5 | **/cc2640em_sw_handshaking/ 6 | **/cc2640em_sw_handshaking_debug/ 7 | **/cc2650stk_sw_handshaking/ 8 | **/cc2650stk_sw_handshaking_debug/ 9 | **/sap_lib_swhs/ 10 | **/CC2650/configPkg/* 11 | **/CC2640/configPkg/* 12 | **/configPkg/* 13 | **/*.dep 14 | **/*.log 15 | **/*.ewt 16 | **/*.tmp 17 | **/*.bak 18 | **/cc2650/config/src/* 19 | **/CCS/Config/src/* 20 | **/IAR/Config/src/* 21 | **/*.obj 22 | **/*.a 23 | **/*.pos 24 | **/*.pp 25 | **/*.exclude 26 | **/.xdchelp 27 | **/.settings/* 28 | **/.launches/* 29 | **/targetConfigs/* 30 | -------------------------------------------------------------------------------- /Components/npi/unified/doc_resources/four_wire_latency.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Components/npi/unified/doc_resources/four_wire_latency.PNG -------------------------------------------------------------------------------- /Components/npi/unified/doc_resources/profiler_snippet.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Components/npi/unified/doc_resources/profiler_snippet.PNG -------------------------------------------------------------------------------- /Components/npi/unified/doc_resources/two_wire_latency.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Components/npi/unified/doc_resources/two_wire_latency.PNG -------------------------------------------------------------------------------- /Components/uart_log/README.md: -------------------------------------------------------------------------------- 1 | Redirect TI-RTOS Log_xx to UART 2 | ======== 3 | The logging system in TI-RTOS is quite useful and configurable. In the below we will set the logging system up to give us log events which are stored in a circular buffer and then printed out later in the idle thread. 4 | 5 | Log system 6 | ---------- 7 | The short version is, xdc.runtime.Log provides an interface (a lot of macros) that you can use. The RTOS config file can then be set up to make the RTOS precompiler route the logs to whichever logger implementation you want. 8 | 9 | We are going to use xdc.runtime.LoggerCallback, which is a lightweight implementation, to hand us the arguments to the Log call for storage and output. 10 | 11 | Implementation 12 | -------------- 13 | [LoggerCallback][LoggerCallback] allows us to specify an [outputFxn][outputFxn] which will be called each time `Log_xx` is called. It receives a user-specified argument (ignored in this example), a [Log_EventRec][Log_EventRec] struct which contains the pointers to the strings to be printed, and finally the number of arguments. 14 | 15 | To interfere as little as possible with the operation of the device, the `uartLog_outputFxn` does not print anything, just stores the string pointers, and adds a serial number and a timestamp. Each stored record is `40 bytes`, and if more than `UARTLOG_NUM_EVT_BUF` events are received before the device has entered the Idle thread, the oldest record is lost. 16 | 17 | In the `Idle` thread, we add `uartLog_flush` which loops through the records in the buffer, formats using System_snprintf into a local buffer of length `UARTLOG_OUTBUF_LEN`, and sends the formatted string array to the UART driver for transport. 18 | 19 | **Note**: The UART driver must be opened in **blocking** mode, as the `uartLog_flush` loop depends on this. 20 | 21 | Both the above defines for string length and buffer length can be overridden via precompiler defines, or source code changes. 22 | 23 | 24 | References 25 | ---------- 26 | * [xdc.runtime.Log cdocs](http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/Log.html) 27 | * [xdc.runtime.LoggerCallback cdocs](http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/LoggerCallback.html) 28 | * [uia.ti.sysbios.LoggerIdle wiki example for Stellaris](http://processors.wiki.ti.com/index.php/LoggerIdle_Uart) 29 | * [RTSC Logging tips](http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_Logging) 30 | 31 | Compiler options 32 | ----------------- 33 | ### Remove global Log disable define 34 | TI-RTOS will remove all Log_xx statements from compiled code if the define `xdc_runtime_Log_DISABLE_ALL` is defined when `Log.h` is included. Typically, all the BLE SDK example projects have this define present to save flash. 35 | * Remove this define from the project settings, or rename it to e.g. `Xxdc_runtime_Log_DISABLE_ALL` 36 | 37 | ### Change what `__FILE__` does 38 | `Log_info`, `Log_warning` and `Log_error` includes the filename and line number of the log invocation via `__FILE__` and `__LINE__`. By default the file name includes the complete path to the source file. 39 | 40 | This takes up a lot of space in flash and in the UART buffer, so we'll change this. 41 | #### IAR 42 | Add extra compiler option *--no_path_in_file_macros* 43 | 44 | #### CCS 45 | Add an extra precompiler define: `xdc_FILE="\"${InputFileName}\""` 46 | 47 | 48 | TI-RTOS Config file 49 | ------------------- 50 | This is where the magic happens. The file is typically called `appBLE.cfg` or something else ending in `.cfg`. We will include the Log module/interface from the XDC Runtime package, and the LoggerCallback plugin for the Log module, and we will tell LoggerCallback to route Log calls to our own output handler function. 51 | 52 | ```javascript 53 | // Need Text loaded for formatting of Log_info/warning/error, but not for Log_print. 54 | Text.isLoaded = true; 55 | 56 | // Logging 57 | var Log = xdc.useModule('xdc.runtime.Log'); 58 | 59 | // Override error output color with ANSI codes, and use shorter (file.c:line) format. 60 | Log.L_error = { 61 | mask: Diags.STATUS, 62 | level: Diags.ERROR, 63 | msg: "\x1b[31;1mERROR:\x1b[0m (%s:%d) %$S" 64 | }; 65 | 66 | Log.L_info = { 67 | mask: Diags.INFO, 68 | msg: "\x1b[32;1mINFO:\x1b[0m (%s:%d) %$S" 69 | }; 70 | 71 | Log.L_warning = { 72 | mask: Diags.STATUS, 73 | level: Diags.WARNING, 74 | msg: "\x1b[33;1mWARNING:\x1b[0m (%s:%d) %$S" 75 | }; 76 | 77 | // Pull in LoggerCallback 78 | var LoggerCallback = xdc.useModule('xdc.runtime.LoggerCallback'); 79 | 80 | // Tell LoggerCallback to call our output function 81 | LoggerCallback.outputFxn = "&uartLog_outputFxn"; 82 | 83 | // Tell the Idle module to add our flush() function to the idle loop (before Power) 84 | var Idle = xdc.useModule('ti.sysbios.knl.Idle'); // Add if Idle isn't already imported. 85 | Idle.addFunc('&uartLog_flush'); 86 | 87 | // Create a static instance of LoggerCallback and set as default Main logger 88 | var loggerParams = new LoggerCallback.Params(); 89 | loggerParams.arg = 1; 90 | 91 | // Only for Main (code that's not in an rtsc module) 92 | Main.common$.logger = LoggerCallback.create(loggerParams); 93 | //Defaults.common$.logger = LoggerCallback.create(loggerParams); // Use for all log events 94 | 95 | // Turn on USER1 logs and INFO in Main module (user code). Turn off USER2 for fun. 96 | Main.common$.diags_USER1 = Diags.ALWAYS_ON; 97 | Main.common$.diags_USER2 = Diags.ALWAYS_OFF; 98 | Main.common$.diags_USER6 = Diags.ALWAYS_ON; 99 | Main.common$.diags_INFO = Diags.ALWAYS_ON; 100 | ``` 101 | 102 | 103 | main.c or other init 104 | ------------------- 105 | Even though our output function is now being called each time Log_xx is called, we need to set up the UART and tell the output function about it. 106 | 107 | ```c 108 | // To open the UART 109 | #include 110 | // To initialize the uart log output (only needed here) 111 | #include "uart_logs.h" 112 | // ... 113 | int main() 114 | { 115 | PIN_init(BoardGpioInitTable); 116 | // ... 117 | UART_Params uartParams; 118 | UART_Params_init(&uartParams); 119 | uartParams.baudRate = 115200; 120 | UART_Handle hUart = UART_open(Board_UART, &uartParams); 121 | // Initialize the logger output 122 | UartLog_init(hUart); 123 | // ... 124 | ``` 125 | 126 | Add log statements to your code 127 | ------------------------------- 128 | 129 | ```c 130 | #include // For Log_warning1("Warning number #%d", 4); things 131 | #include // For Log_print0(Diags_USER1, "hello"); things. 132 | // ... 133 | int myfunc() 134 | { 135 | // ... 136 | Log_info0("Hello world via Log_info0"); 137 | Log_error0("Out of cheese error!"); 138 | } 139 | ``` 140 | 141 | Include uart_logs.c in the project 142 | --------------------- 143 | The functions referenced in the TI-RTOS config file, `uartLog_flush` and `uartLog_outputFxn` can be found in [uart_logs.c](uart_logs.c) which must be included. 144 | 145 | 146 | How it looks 147 | ------------ 148 | he above example, and Simple BLE Peripheral plus a custom service instrumented with Log_info and Log_error statements looks like this: 149 | 150 | ![Putty session](http://processors.wiki.ti.com/images/9/9c/Uart_log.png "Putty session") 151 | 152 | [LoggerCallback]: http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/LoggerCallback.html 153 | [outputFxn]: http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/LoggerCallback.html#.Output.Fxn 154 | [Log_EventRec]: http://rtsc.eclipse.org/cdoc-tip/xdc/runtime/Log.html#.Event.Rec 155 | -------------------------------------------------------------------------------- /Components/uart_log/uart_logs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filename: uart_log.h 3 | * 4 | * Description: This file contains the TI-RTOS hooks for printing to UART via 5 | * Log_xx(..). 6 | * 7 | * This is a very basic implementation made for the purposes of 8 | * terminal feedback in workshops, trainings and debug. 9 | * 10 | * 11 | * Copyright (c) 2015, Texas Instruments Incorporated 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * 18 | * * Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * 21 | * * Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in the 23 | * documentation and/or other materials provided with the distribution. 24 | * 25 | * * Neither the name of Texas Instruments Incorporated nor the names of 26 | * its contributors may be used to endorse or promote products derived 27 | * from this software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 31 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 32 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 33 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 34 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 35 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 36 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 37 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 38 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 39 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | */ 41 | 42 | #ifndef UART_LOG_H 43 | #define UART_LOG_H 44 | 45 | #ifdef __cplusplus 46 | extern "C" 47 | { 48 | #endif 49 | /********************************************************************* 50 | * INCLUDES 51 | */ 52 | #include 53 | 54 | /********************************************************************* 55 | * CONSTANTS 56 | */ 57 | 58 | /********************************************************************* 59 | * TYPEDEFS 60 | */ 61 | 62 | /********************************************************************* 63 | * PUBLIC FUNCTIONS 64 | */ 65 | 66 | /********************************************************************* 67 | * @fn UartLog_init 68 | * 69 | * @brief Initializes module with the handle to the UART. 70 | * 71 | * @param handle - UART driver handle to an initialized and opened UART. 72 | * 73 | * @return None. 74 | */ 75 | void UartLog_init(UART_Handle handle); 76 | 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif // UART_LOG_H 83 | -------------------------------------------------------------------------------- /Projects/ble/Profiles/Roles/CC26xx/multi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/Profiles/Roles/CC26xx/multi.h -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | 132 | /******* Logging to UART overrides *****/ 133 | 134 | // Need Text loaded for formatting of Log_info/warning/error, but not for Log_print. 135 | Text.isLoaded = true; 136 | 137 | // Logging 138 | var Log = xdc.useModule('xdc.runtime.Log'); 139 | 140 | // Override error output color with ANSI codes, and use shorter (file.c:line) format. 141 | Log.L_error = { 142 | mask: Diags.STATUS, 143 | level: Diags.ERROR, 144 | msg: "\x1b[31;1mERROR:\x1b[0m (%s:%d) %$S" 145 | }; 146 | 147 | Log.L_info = { 148 | mask: Diags.INFO, 149 | msg: "\x1b[32;1mINFO:\x1b[0m (%s:%d) %$S" 150 | }; 151 | 152 | Log.L_warning = { 153 | mask: Diags.STATUS, 154 | level: Diags.WARNING, 155 | msg: "\x1b[33;1mWARNING:\x1b[0m (%s:%d) %$S" 156 | }; 157 | 158 | // Pull in LoggerCallback 159 | var LoggerCallback = xdc.useModule('xdc.runtime.LoggerCallback'); 160 | 161 | // Tell LoggerCallback to call our output function 162 | LoggerCallback.outputFxn = "&uartLog_outputFxn"; 163 | 164 | // Tell the Idle module to add our flush() function to the idle loop (before Power) 165 | var Idle = xdc.useModule('ti.sysbios.knl.Idle'); // Add if Idle isn't already imported. 166 | Idle.addFunc('&uartLog_flush'); 167 | 168 | // Create a static instance of LoggerCallback and set as default Main logger 169 | var loggerParams = new LoggerCallback.Params(); 170 | loggerParams.arg = 1; 171 | Main.common$.logger = LoggerCallback.create(loggerParams); // Only for Main (code that's not in an rtsc module) 172 | //Defaults.common$.logger = LoggerCallback.create(loggerParams); // Use for all log events 173 | 174 | // Turn off all other log masks than USER6. 175 | Main.common$.diags_USER1 = Diags.ALWAYS_OFF; 176 | Main.common$.diags_USER2 = Diags.ALWAYS_OFF; 177 | Main.common$.diags_USER3 = Diags.ALWAYS_OFF; 178 | Main.common$.diags_USER4 = Diags.ALWAYS_OFF; 179 | Main.common$.diags_USER5 = Diags.ALWAYS_OFF; 180 | Main.common$.diags_USER6 = Diags.ALWAYS_ON; 181 | Main.common$.diags_INFO = Diags.ALWAYS_ON; -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/Config/ccfg_appBLE.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Filename: ccfg.c 3 | * Revised: $Date: 2015-01-15 15:45:13 +0100 (to, 15 jan 2015) $ 4 | * Revision: $Revision: 14826 $ 5 | * 6 | * Description: Customer Configuration CC26xx PG2 device family. 7 | * 8 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 9 | * 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | ******************************************************************************/ 39 | 40 | // 41 | // ===> READ THIS BEFORE MODIFYING THIS FILE 42 | // 43 | // 44 | // ===> READ THIS BEFORE MODIFYING THIS FILE 45 | // 46 | // 47 | // ===> READ THIS BEFORE MODIFYING THIS FILE 48 | // 49 | 50 | // The customer configuration area (ccfg section) is located at the end of the 51 | // flash and reflect the hw configuration of the device. it is very important 52 | // that it remains align with the version of driverlib you are using. 53 | // all BLE project except sensor tag use the same configuration. 54 | // Keeping the "#include " garanty that your project using 55 | // driverlib and the ccfg area will be align. 56 | 57 | // you can modify it if you want, the recommend way will be to remove the 58 | // bellow include, copy the content of the file in this 59 | // file and rebuild. 60 | 61 | // ==> KEEP IN MIND that if you do so, be sure that any further update of the 62 | // driverlib must be align with your modified verson of ccfg area. 63 | #include 64 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000C000 7 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000C000 7 | --define=ICALL_RAM0_ADDR=0x200043C8 8 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/ancs/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/CCS/ancs_stack/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/Config/IAR-Boundary.bdef: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | -D ICALL_STACK0_ADDR=0x0000C000 7 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/Config/IAR-Boundary.xcl: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --config_def ICALL_STACK0_ADDR=0x0000C000 7 | --config_def ICALL_RAM0_ADDR=0x200043C8 8 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | 132 | /******* Logging to UART overrides *****/ 133 | 134 | // Need Text loaded for formatting of Log_info/warning/error, but not for Log_print. 135 | Text.isLoaded = true; 136 | 137 | // Logging 138 | var Log = xdc.useModule('xdc.runtime.Log'); 139 | 140 | // Override error output color with ANSI codes, and use shorter (file.c:line) format. 141 | Log.L_error = { 142 | mask: Diags.STATUS, 143 | level: Diags.ERROR, 144 | msg: "\x1b[31;1mERROR:\x1b[0m (%s:%d) %$S" 145 | }; 146 | 147 | Log.L_info = { 148 | mask: Diags.INFO, 149 | msg: "\x1b[32;1mINFO:\x1b[0m (%s:%d) %$S" 150 | }; 151 | 152 | Log.L_warning = { 153 | mask: Diags.STATUS, 154 | level: Diags.WARNING, 155 | msg: "\x1b[33;1mWARNING:\x1b[0m (%s:%d) %$S" 156 | }; 157 | 158 | // Pull in LoggerCallback 159 | var LoggerCallback = xdc.useModule('xdc.runtime.LoggerCallback'); 160 | 161 | // Tell LoggerCallback to call our output function 162 | LoggerCallback.outputFxn = "&uartLog_outputFxn"; 163 | 164 | // Tell the Idle module to add our flush() function to the idle loop (before Power) 165 | var Idle = xdc.useModule('ti.sysbios.knl.Idle'); // Add if Idle isn't already imported. 166 | Idle.addFunc('&uartLog_flush'); 167 | 168 | // Create a static instance of LoggerCallback and set as default Main logger 169 | var loggerParams = new LoggerCallback.Params(); 170 | loggerParams.arg = 1; 171 | Main.common$.logger = LoggerCallback.create(loggerParams); // Only for Main (code that's not in an rtsc module) 172 | //Defaults.common$.logger = LoggerCallback.create(loggerParams); // Use for all log events 173 | 174 | // Turn off all other log masks than USER6. 175 | Main.common$.diags_USER1 = Diags.ALWAYS_OFF; 176 | Main.common$.diags_USER2 = Diags.ALWAYS_OFF; 177 | Main.common$.diags_USER3 = Diags.ALWAYS_OFF; 178 | Main.common$.diags_USER4 = Diags.ALWAYS_OFF; 179 | Main.common$.diags_USER5 = Diags.ALWAYS_OFF; 180 | Main.common$.diags_USER6 = Diags.ALWAYS_ON; 181 | Main.common$.diags_INFO = Diags.ALWAYS_ON; -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/Config/ccfg_appBLE.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Filename: ccfg.c 3 | * Revised: $Date: 2015-01-15 15:45:13 +0100 (to, 15 jan 2015) $ 4 | * Revision: $Revision: 14826 $ 5 | * 6 | * Description: Customer Configuration CC26xx PG2 device family. 7 | * 8 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 9 | * 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | ******************************************************************************/ 39 | 40 | // 41 | // ===> READ THIS BEFORE MODIFYING THIS FILE 42 | // 43 | // 44 | // ===> READ THIS BEFORE MODIFYING THIS FILE 45 | // 46 | // 47 | // ===> READ THIS BEFORE MODIFYING THIS FILE 48 | // 49 | 50 | // The customer configuration area (ccfg section) is located at the end of the 51 | // flash and reflect the hw configuration of the device. it is very important 52 | // that it remains align with the version of driverlib you are using. 53 | // all BLE project except sensor tag use the same configuration. 54 | // Keeping the "#include " garanty that your project using 55 | // driverlib and the ccfg area will be align. 56 | 57 | // you can modify it if you want, the recommend way will be to remove the 58 | // bellow include, copy the content of the file in this 59 | // file and rebuild. 60 | 61 | // ==> KEEP IN MIND that if you do so, be sure that any further update of the 62 | // driverlib must be align with your modified verson of ccfg area. 63 | #include 64 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/ancs.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TI_RTOS_DRIVERS_BASE 7 | C:\ti\tirtos_simplelink_2_13_00_06\packages 8 | 9 | 10 | CC26XXWARE 11 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 12 | 13 | 14 | XDCROOT 15 | C:\ti\xdctools_3_31_01_33_core 16 | 17 | 18 | XDCPATH 19 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 20 | 21 | 22 | BOUNDARY 23 | C:\Program Files (x86)\Texas Instruments\Boundary 24 | 25 | 26 | TI_BLE_SDK_BASE 27 | C:\ti\simplelink\ble_cc26xx_2_01_01_44627 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/IAR/ancs.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Application\CC2640\CC2640App.ewp 6 | 7 | 8 | $WS_DIR$\Stack\CC2640\CC2640Stack.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/Source/Application/ancs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ancs.h 3 | * 4 | * Shared ANCS demo structures 5 | * 6 | * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef ANCS_H 40 | #define ANCS_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" 44 | { 45 | #endif 46 | 47 | /********************************************************************* 48 | * INCLUDES 49 | */ 50 | 51 | /********************************************************************* 52 | * CONSTANTS 53 | */ 54 | 55 | // ANCS discovery states 56 | enum 57 | { 58 | DISC_IDLE = 0x00, // Idle state 59 | 60 | DISC_ANCS_START = 0x10, // ANCS service 61 | DISC_ANCS_SVC, // Discover service 62 | DISC_ANCS_CHAR, // Discover all characteristics 63 | DISC_ANCS_CCCD, // Discover ANCS CCCD 64 | 65 | DISC_FAILED = 0xFF // Discovery failed 66 | }; 67 | 68 | // ANCS handle cache indexes 69 | enum 70 | { 71 | HDL_ANCS_NTF_NOTIF_START, // ANCS notification characteristic start handle 72 | HDL_ANCS_NTF_NOTIF_END, // ANCS notification characteristic end handle 73 | HDL_ANCS_NTF_CCCD, // ANCS notification CCCD 74 | 75 | HDL_ANCS_CTRL_PT_START, 76 | HDL_ANCS_CTRL_PT_END, 77 | 78 | HDL_ANCS_DATA_SRC_START, // ANCS data source characteristic start handle 79 | HDL_ANCS_DATA_SRC_END, // ANCS data source characteristic end handle 80 | HDL_ANCS_DATA_SRC_CCCD, // ANCS data source CCCD 81 | 82 | 83 | HDL_CACHE_LEN 84 | }; 85 | 86 | 87 | 88 | 89 | 90 | /********************************************************************* 91 | * TYPEDEFS 92 | */ 93 | typedef int32 notificationUID_t; 94 | 95 | typedef struct 96 | { 97 | uint8 attrID; // 98 | uint16 maxLen; // Some attributes need to have length 99 | } ctrlPtCmdParamAttrWithLen_t; 100 | 101 | typedef struct 102 | { 103 | uint8 attrID; // 104 | } ctrlPtCmdParamAttr_t; 105 | 106 | typedef struct _ancsCSKey_t 107 | { 108 | uint_least16_t hwikey; 109 | uint_least16_t taskkey; 110 | } _ancsCSKey_t; 111 | /********************************************************************* 112 | * MACROS 113 | */ 114 | 115 | // CommandID Values 116 | #define CommandIDGetNotificationAttributes 0 // CommandIDGetNotificationAttributes 117 | #define CommandIDGetAppAttributes 1 // CommandIDGetAppAttributes 118 | #define CommandIDPerformNotificationAction 2 // CommandIDPerformNotificationAction 119 | 120 | #define ActionIDPositive 0 121 | #define ActionIDNegative 1 122 | 123 | // Notification AttributeID Values 124 | #define NotificationAttributeIDAppIdentifier 0 // 125 | #define NotificationAttributeIDTitle 1 // (Needs to be followed by a 2-bytes max length parameter) 126 | #define NotificationAttributeIDSubtitle 2 // (Needs to be followed by a 2-bytes max length parameter) 127 | #define NotificationAttributeIDMessage 3 // (Needs to be followed by a 2-bytes max length parameter) 128 | #define NotificationAttributeIDMessageSize 4 129 | #define NotificationAttributeIDDate 5 130 | #define NotificationAttributeIDPositiveActionLabel 6 131 | #define NotificationAttributeIDNegativeActionLabel 7 132 | 133 | // EventID Values 134 | #define EventIDNotificationAdded 0 135 | #define EventIDNotificationModified 1 136 | #define EventIDNotificationRemoved 2 137 | 138 | // EventFlags 139 | #define EventFlagSilent 0x01 // (1 << 0) 140 | #define EventFlagImportant 0x02 // (1 << 1) 141 | #define EventFlagPreExisting 0x04 // (1 << 2) 142 | #define EventFlagPositiveAction 0x08 // (1 << 3) 143 | #define EventFlagNegativeAction 0x10 // (1 << 4) 144 | 145 | // CategoryID Values 146 | #define CategoryIDOther 0 147 | #define CategoryIDIncomingCall 1 148 | #define CategoryIDMissedCall 2 149 | #define CategoryIDVoicemail 3 150 | #define CategoryIDSocial 4 151 | #define CategoryIDSchedule 5 152 | #define CategoryIDEmail 6 153 | #define CategoryIDNews 7 154 | #define CategoryIDHealthAndFitness 8 155 | #define CategoryIDBusinessAndFinance 9 156 | #define CategoryIDLocation 10 157 | #define CategoryIDEntertainment 11 158 | 159 | //Define ANCS Client Flags 160 | #define CLIENT_NONE 0x00 161 | #define CLIENT_IMPORTANT_ALERT 0x01 162 | #define CLIENT_POSITIVE_ACT 0x02 163 | #define CLIENT_NEG_ACT 0x04 164 | 165 | 166 | /********************************************************************* 167 | * GLOBAL 168 | */ 169 | enum 170 | { 171 | CCCD_CONFIG_NOTIF = 0x00, 172 | CCCD_CONFIG_DATA, 173 | CCCD_CONFIG_DONE 174 | }; 175 | 176 | 177 | // Connection handle 178 | extern uint16_t Ancs_connHandle; 179 | 180 | // Handle cache 181 | extern uint16_t Ancs_handleCache[HDL_CACHE_LEN]; 182 | 183 | /********************************************************************* 184 | * FUNCTIONS 185 | */ 186 | 187 | /* 188 | * ANCS service discovery functions. 189 | */ 190 | extern uint8_t Ancs_discStart(void); 191 | extern uint8_t Ancs_discGattMsg(uint8_t state, gattMsgEvent_t *pMsg); 192 | extern uint8_t Ancs_subsNotifSrc(void); 193 | extern uint8_t Ancs_unSubsNotifSrc(void); 194 | extern uint8_t Ancs_subsDataSrc(void); 195 | extern uint8_t Ancs_unSubsDataSrc(void); 196 | extern void Ancs_performPositiveAction(); 197 | extern void Ancs_performNegativeAction(); 198 | 199 | /* 200 | * ANCS notification handling function. 201 | */ 202 | extern void Ancs_handleNotification(gattMsgEvent_t *pMsg); 203 | 204 | /********************************************************************* 205 | *********************************************************************/ 206 | 207 | #ifdef __cplusplus 208 | } 209 | #endif 210 | 211 | #endif /* ANCS_H */ 212 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/Source/Application/ancsApp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ancsApp.h 3 | * 4 | * Application task functionality for the ANCS demo 5 | * 6 | * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef ANCSAPP_H 40 | #define ANCSAPP_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" 44 | { 45 | #endif 46 | 47 | /********************************************************************* 48 | * INCLUDES 49 | */ 50 | 51 | /********************************************************************* 52 | * CONSTANTS 53 | */ 54 | 55 | /********************************************************************* 56 | * TYPEDEFS 57 | */ 58 | 59 | /********************************************************************* 60 | * MACROS 61 | */ 62 | 63 | /********************************************************************* 64 | * GLOBAL 65 | */ 66 | 67 | /********************************************************************* 68 | * FUNCTIONS 69 | */ 70 | 71 | /* 72 | * Create TIRTOS task for Time App application. 73 | */ 74 | extern void AncsApp_createTask(); 75 | 76 | 77 | /********************************************************************* 78 | *********************************************************************/ 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* ANCSAPP_H */ 85 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/Source/Application/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * main.c 3 | * 4 | * Program entry point 5 | * 6 | * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include "ICall.h" 44 | #include "bcomdef.h" 45 | #include "peripheral.h" 46 | #include "AncsApp.h" 47 | 48 | #ifndef USE_DEFAULT_USER_CFG 49 | 50 | #include "bleUserConfig.h" 51 | 52 | // BLE user defined configuration 53 | bleUserCfg_t user0Cfg = BLE_USER_CFG; 54 | 55 | #endif // USE_DEFAULT_USER_CFG 56 | 57 | /** 58 | * Exception handler 59 | */ 60 | void exceptionHandler() 61 | { 62 | volatile char i = 1; 63 | while(i); 64 | } 65 | 66 | /* 67 | * ======== main ======== 68 | */ 69 | Void main() 70 | { 71 | PIN_init(BoardGpioInitTable); 72 | 73 | #ifndef POWER_SAVING 74 | /* Set constraints for Standby, powerdown and idle mode */ 75 | Power_setConstraint (Power_SB_DISALLOW); 76 | Power_setConstraint (Power_IDLE_PD_DISALLOW); 77 | #endif //POWER_SAVING 78 | 79 | /* Initialize ICall module */ 80 | ICall_init(); 81 | 82 | /* Start tasks of external images - Priority 5 */ 83 | ICall_createRemoteTasks(); 84 | 85 | /* Kick off profile - Priority 3 */ 86 | GAPRole_createTask(); 87 | 88 | /* Kick off application - Priority 1 */ 89 | AncsApp_createTask(); 90 | 91 | /* enable interrupts and start SYS/BIOS */ 92 | BIOS_start(); 93 | } 94 | 95 | /** 96 | * Error handled to be hooked into TI-RTOS 97 | */ 98 | Void smallErrorHook(Error_Block *eb) 99 | { 100 | for (;;); 101 | } 102 | 103 | /** 104 | * HAL assert handler required by OSAL memory module. 105 | */ 106 | void halAssertHandler(void) 107 | { 108 | for (;;); 109 | } 110 | -------------------------------------------------------------------------------- /Projects/ble/ancs/CC26xx/Source/Stack/OSAL_ICallBle.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file OSAL_IcallBle.c 3 | * 4 | * @description Setup function for the BLE Stack task 5 | * 6 | * 7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *****************************************************************************/ 39 | 40 | /************************************************************************************************** 41 | * INCLUDES 42 | **************************************************************************************************/ 43 | #include 44 | #include "hal_types.h" 45 | #include "OSAL.h" 46 | #include "OSAL_Tasks.h" 47 | #include "osal_snv.h" 48 | 49 | 50 | /* LL */ 51 | #include "ll.h" 52 | 53 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 54 | #include "osal_cbtimer.h" 55 | #endif 56 | 57 | /* L2CAP */ 58 | #include "l2cap.h" 59 | 60 | /* gap */ 61 | #include "gap.h" 62 | 63 | #if defined ( GAP_BOND_MGR ) 64 | #include "gapbondmgr.h" 65 | #endif 66 | 67 | /* GATT */ 68 | #include "gatt.h" 69 | 70 | /* Application */ 71 | #include "hci_tl.h" 72 | 73 | #include "gattservapp.h" 74 | 75 | #include "gapbondmgr.h" 76 | 77 | #include "bleUserConfig.h" 78 | #include "bleDispatch.h" 79 | 80 | /********************************************************************* 81 | * GLOBAL VARIABLES 82 | */ 83 | 84 | // The order in this table must be identical to the task initialization calls below in osalInitTask. 85 | const pTaskEventHandlerFn tasksArr[] = 86 | { 87 | LL_ProcessEvent, // task 0 88 | HCI_ProcessEvent, // task 1 89 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 90 | OSAL_CBTIMER_PROCESS_EVENT( osal_CbTimerProcessEvent ), // task 2 91 | #endif 92 | L2CAP_ProcessEvent, // task 3 93 | GAP_ProcessEvent, // task 4 94 | SM_ProcessEvent, // task 5 95 | GATT_ProcessEvent, // task 6 96 | GATTServApp_ProcessEvent, // task 7 97 | #if defined ( GAP_BOND_MGR ) 98 | GAPBondMgr_ProcessEvent, // task 8 99 | #endif 100 | bleDispatch_ProcessEvent // task 9 101 | }; 102 | 103 | const uint8 tasksCnt = sizeof( tasksArr ) / sizeof( tasksArr[0] ); 104 | uint16 *tasksEvents; 105 | 106 | /********************************************************************* 107 | * FUNCTIONS 108 | *********************************************************************/ 109 | 110 | /********************************************************************* 111 | * @fn osalInitTasks 112 | * 113 | * @brief This function invokes the initialization function for each task. 114 | * 115 | * @param void 116 | * 117 | * @return none 118 | */ 119 | void osalInitTasks( void ) 120 | { 121 | ICall_EntityID entity; 122 | ICall_Semaphore sem; 123 | uint8 taskID = 0; 124 | uint8 i; 125 | 126 | tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt); 127 | osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt)); 128 | 129 | /* LL Task */ 130 | LL_Init( taskID++ ); 131 | 132 | /* HCI Task */ 133 | HCI_Init( taskID++ ); 134 | 135 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 136 | /* Callback Timer Tasks */ 137 | osal_CbTimerInit( taskID ); 138 | taskID += OSAL_CBTIMER_NUM_TASKS; 139 | #endif 140 | 141 | /* L2CAP Task */ 142 | L2CAP_Init( taskID++ ); 143 | 144 | /* GAP Task */ 145 | GAP_Init( taskID++ ); 146 | 147 | /* SM Task */ 148 | SM_Init( taskID++ ); 149 | 150 | /* GATT Task */ 151 | GATT_Init( taskID++ ); 152 | 153 | /* GATT Server App Task */ 154 | GATTServApp_Init( taskID++ ); 155 | 156 | #if defined ( GAP_BOND_MGR ) 157 | /* Bond Manager Task */ 158 | GAPBondMgr_Init( taskID++ ); 159 | #endif 160 | 161 | /* ICall BLE Dispatcher Task */ 162 | bleDispatch_Init( taskID ); 163 | 164 | // ICall enrollment 165 | /* Enroll the service that this stack represents */ 166 | ICall_enrollService(ICALL_SERVICE_CLASS_BLE, NULL, &entity, &sem); 167 | 168 | /* Enroll the obtained dispatcher entity and OSAL task ID of HCI Ext App 169 | * to OSAL so that OSAL can route the dispatcher message into 170 | * the appropriate OSAL task. 171 | */ 172 | osal_enroll_dispatchid(taskID, entity); 173 | 174 | /* Register all other OSAL tasks to use the registered dispatcher entity 175 | * ID as the source of dispatcher messages, even though the other OSAL 176 | * tasks didn't register themselves to receive messages from application. 177 | */ 178 | for (i = 0; i < taskID; i++) 179 | { 180 | osal_enroll_senderid(i, entity); 181 | } 182 | } 183 | 184 | /** 185 | * Main entry function for the stack image 186 | */ 187 | int stack_main( void *arg ) 188 | { 189 | /* User reconfiguration of BLE Controller and Host variables */ 190 | setBleUserConfig( (bleUserCfg_t *)arg ); 191 | 192 | /* Establish OSAL for a stack service that requires accompanying 193 | * messaging service */ 194 | if (ICall_enrollService(ICALL_SERVICE_CLASS_BLE_MSG, 195 | (ICall_ServiceFunc) osal_service_entry, 196 | &osal_entity, &osal_semaphore) != 197 | ICALL_ERRNO_SUCCESS) 198 | { 199 | /* abort */ 200 | ICall_abort(); 201 | } 202 | 203 | halIntState_t state; 204 | HAL_ENTER_CRITICAL_SECTION(state); 205 | 206 | // Turn off interrupts 207 | //osal_int_disable( INTS_ALL ); 208 | 209 | // Initialize NV System 210 | osal_snv_init( ); 211 | 212 | // Initialize the operating system 213 | osal_init_system(); 214 | 215 | // Allow interrupts 216 | //osal_int_enable( INTS_ALL ); 217 | HAL_EXIT_CRITICAL_SECTION(state); 218 | 219 | osal_start_system(); // No Return from here 220 | 221 | return 0; // Shouldn't get here. 222 | } 223 | 224 | /********************************************************************* 225 | *********************************************************************/ 226 | -------------------------------------------------------------------------------- /Projects/ble/ancs/doc_resources/ancs_srf06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/ancs/doc_resources/ancs_srf06.jpg -------------------------------------------------------------------------------- /Projects/ble/ancs/doc_resources/ancs_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/ancs/doc_resources/ancs_terminal.png -------------------------------------------------------------------------------- /Projects/ble/common/cc26xx/board_key.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | /********************************************************************* 34 | * INCLUDES 35 | */ 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | #ifdef USE_ICALL 45 | #include 46 | #endif 47 | 48 | #include 49 | #include "bcomdef.h" 50 | 51 | #include "util.h" 52 | #include "board_key.h" 53 | #include "Board.h" 54 | 55 | /********************************************************************* 56 | * TYPEDEFS 57 | */ 58 | 59 | /********************************************************************* 60 | * LOCAL FUNCTIONS 61 | */ 62 | static void Board_keyChangeHandler(UArg a0); 63 | static void Board_keyCallback(PIN_Handle hPin, PIN_Id pinId); 64 | 65 | /******************************************************************************* 66 | * EXTERNAL VARIABLES 67 | */ 68 | 69 | /********************************************************************* 70 | * LOCAL VARIABLES 71 | */ 72 | 73 | // Value of keys Pressed 74 | static volatile uint8_t keysPressed; 75 | 76 | // Key debounce clock 77 | static Clock_Struct keyChangeClock; 78 | 79 | // Pointer to application callback 80 | keysPressedCB_t appKeyChangeHandler = NULL; 81 | 82 | // Memory for the GPIO module to construct a Hwi 83 | Hwi_Struct callbackHwiKeys; 84 | 85 | // PIN configuration structure to set all KEY pins as inputs with pullups enabled 86 | PIN_Config keyPinsCfg[] = 87 | { 88 | Board_BUTTON0 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */ 89 | Board_BUTTON1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, 90 | PIN_TERMINATE 91 | }; 92 | 93 | PIN_State keyPins; 94 | PIN_Handle hKeyPins; 95 | 96 | /********************************************************************* 97 | * PUBLIC FUNCTIONS 98 | */ 99 | /********************************************************************* 100 | * @fn Board_initKeys 101 | * 102 | * @brief Enable interrupts for keys on GPIOs. 103 | * 104 | * @param appKeyCB - application key pressed callback 105 | * 106 | * @return none 107 | */ 108 | void Board_initKeys(keysPressedCB_t appKeyCB) 109 | { 110 | // Initialize KEY pins. Enable int after callback registered 111 | hKeyPins = PIN_open(&keyPins, keyPinsCfg); 112 | PIN_registerIntCb(hKeyPins, Board_keyCallback); 113 | 114 | PIN_setConfig(hKeyPins, PIN_BM_IRQ, Board_BUTTON0 | PIN_IRQ_NEGEDGE); 115 | PIN_setConfig(hKeyPins, PIN_BM_IRQ, Board_BUTTON1 | PIN_IRQ_NEGEDGE); 116 | 117 | #ifdef POWER_SAVING 118 | //Enable wakeup 119 | PIN_setConfig(hKeyPins, PINCC26XX_BM_WAKEUP, Board_BUTTON0 | PINCC26XX_WAKEUP_NEGEDGE); 120 | PIN_setConfig(hKeyPins, PINCC26XX_BM_WAKEUP, Board_BUTTON1 | PINCC26XX_WAKEUP_NEGEDGE); 121 | #endif 122 | 123 | // Setup keycallback for keys 124 | Util_constructClock(&keyChangeClock, Board_keyChangeHandler, 125 | KEY_DEBOUNCE_TIMEOUT, 0, false, 0); 126 | 127 | // Set the application callback 128 | appKeyChangeHandler = appKeyCB; 129 | } 130 | 131 | /********************************************************************* 132 | * @fn Board_keyCallback 133 | * 134 | * @brief Interrupt handler for Keys 135 | * 136 | * @param none 137 | * 138 | * @return none 139 | */ 140 | static void Board_keyCallback(PIN_Handle hPin, PIN_Id pinId) 141 | { 142 | keysPressed = 0; 143 | 144 | if ( PIN_getInputValue(Board_BUTTON0) == 0 ) 145 | { 146 | keysPressed |= KEY_ID_BUTTON0; 147 | } 148 | 149 | if ( PIN_getInputValue(Board_BUTTON1) == 0 ) 150 | { 151 | keysPressed |= KEY_ID_BUTTON1; 152 | } 153 | 154 | Util_startClock(&keyChangeClock); 155 | } 156 | 157 | /********************************************************************* 158 | * @fn Board_keyChangeHandler 159 | * 160 | * @brief Handler for key change 161 | * 162 | * @param UArg a0 - ignored 163 | * 164 | * @return none 165 | */ 166 | static void Board_keyChangeHandler(UArg a0) 167 | { 168 | if (appKeyChangeHandler != NULL) 169 | { 170 | // Notify the application 171 | (*appKeyChangeHandler)(keysPressed); 172 | } 173 | } 174 | /********************************************************************* 175 | *********************************************************************/ 176 | -------------------------------------------------------------------------------- /Projects/ble/common/cc26xx/board_key.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef BOARD_KEY_H 34 | #define BOARD_KEY_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /********************************************************************* 41 | * INCLUDES 42 | */ 43 | 44 | /********************************************************************* 45 | * EXTERNAL VARIABLES 46 | */ 47 | 48 | /********************************************************************* 49 | * CONSTANTS 50 | */ 51 | #define KEY_ID_BUTTON0 0x01 52 | #define KEY_ID_BUTTON1 0x02 53 | #define KEY_ID_BUTTON_BOTH 0x03 54 | 55 | // Debounce timeout in milliseconds 56 | #define KEY_DEBOUNCE_TIMEOUT 200 57 | 58 | /********************************************************************* 59 | * TYPEDEFS 60 | */ 61 | typedef void (*keysPressedCB_t)(uint8 keysPressed); 62 | 63 | /********************************************************************* 64 | * MACROS 65 | */ 66 | 67 | /********************************************************************* 68 | * API FUNCTIONS 69 | */ 70 | 71 | /********************************************************************* 72 | * @fn Board_initKeys 73 | * 74 | * @brief Enable interrupts for keys on GPIOs. 75 | * 76 | * @param appKeyCB - application key pressed callback 77 | * 78 | * @return none 79 | */ 80 | void Board_initKeys(keysPressedCB_t appKeyCB); 81 | 82 | /********************************************************************* 83 | *********************************************************************/ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* BOARD_KEY_H */ 90 | -------------------------------------------------------------------------------- /Projects/ble/common/cc26xx/board_lcd_tirtos_2p15_port.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | /********************************************************************* 34 | * INCLUDES 35 | */ 36 | #include 37 | 38 | #include "board_lcd.h" 39 | #include "Board.h" 40 | 41 | /********************************************************************* 42 | * TYPEDEFS 43 | */ 44 | 45 | /********************************************************************* 46 | * LOCAL FUNCTIONS 47 | */ 48 | 49 | /******************************************************************************* 50 | * EXTERNAL VARIABLES 51 | */ 52 | 53 | /********************************************************************* 54 | * LOCAL VARIABLES 55 | */ 56 | 57 | // LCD parameter 58 | static LCD_Handle lcdHandle = NULL; 59 | 60 | #ifdef TI_DRIVERS_LCD_INCLUDED 61 | // LCD pin table 62 | PIN_Config LCDPinTable[] = { 63 | Board_3V3_EN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, // Enable 3V3 domain. Need to be high for LCD to work. 64 | PIN_TERMINATE // Terminate list 65 | }; 66 | 67 | // LCD pin state 68 | PIN_State LCDPinState; 69 | 70 | // LCD pin handle 71 | PIN_Handle hLCDPins; 72 | #endif //TI_DRIVERS_LCD_INCLUDED 73 | 74 | Char lcdBuffer0[LCD_BYTES] = {0}; 75 | 76 | LCD_Buffer lcdBuffers[] = { 77 | {lcdBuffer0, LCD_BYTES, NULL}, 78 | }; 79 | 80 | /********************************************************************* 81 | * PUBLIC FUNCTIONS 82 | */ 83 | 84 | /********************************************************************* 85 | * @fn Board_openLCD 86 | * 87 | * @brief Open LCD peripheral on SRF06EB. 88 | * 89 | * @param none 90 | * 91 | * @return void 92 | */ 93 | void Board_openLCD(void) 94 | { 95 | #ifdef TI_DRIVERS_LCD_INCLUDED 96 | //Enable the 3V3 domain for the LCD 97 | hLCDPins = PIN_open(&LCDPinState, LCDPinTable); 98 | 99 | LCD_Params lcdParams; 100 | 101 | LCD_Params_init(&lcdParams); 102 | 103 | // Open LCD peripheral 104 | lcdHandle = LCD_open(&lcdBuffers[0], 1, &lcdParams); 105 | 106 | if ( lcdHandle ) 107 | { 108 | LCD_bufferClear(lcdHandle, 0); 109 | LCD_update(lcdHandle, 0); 110 | } 111 | #endif 112 | } 113 | 114 | /********************************************************************* 115 | * @fn Board_writeString 116 | * 117 | * @brief Write a string on the LCD display. 118 | * 119 | * @param str - string to print 120 | * @param line - line (page) to write (0-7) 121 | * 122 | * @return void 123 | */ 124 | void Board_writeString(char *str, uint8_t line) 125 | { 126 | if (lcdHandle != NULL) 127 | { 128 | LCD_bufferClearPage(lcdHandle, 0, (LCD_Page)line); 129 | LCD_bufferPrintString(lcdHandle, 0, str, 0, (LCD_Page)line); 130 | LCD_update(lcdHandle, 0); 131 | } 132 | } 133 | 134 | /********************************************************************* 135 | * @fn Board_writeStringValue 136 | * 137 | * @brief Write a string and value on the LCD display. 138 | * 139 | * @param str - string to print 140 | * @param value - value to print 141 | * @param format - base of the value to print (2,8,16 etc) 142 | * @param line - line (page) to write (0-7) 143 | * 144 | * @return void 145 | */ 146 | void Board_writeStringValue(char *str, uint32_t value, uint8_t format, 147 | uint8_t line) 148 | { 149 | if (lcdHandle != NULL) 150 | { 151 | // Write string and 32-bit number 152 | LCD_writeLine(lcdHandle, 0, str, value, format, line); 153 | } 154 | } 155 | 156 | /********************************************************************* 157 | *********************************************************************/ 158 | -------------------------------------------------------------------------------- /Projects/ble/common/cc26xx/board_lcd_uartlog.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Filename: board_lcd_uartlog.c 3 | * 4 | * Description: This file implements the board_lcd interface used by several 5 | * BLE SDK sample applications, but redirects the output to 6 | * the TI-RTOS Log system instead of an LCD. 7 | * 8 | * Also initializes a sample "Log to UART" plugin, so that Log 9 | * statements are routed to the UART. 10 | * 11 | * The rest of the UART-Log initialization is done in the TI-RTOS 12 | * config file. 13 | * 14 | * Copyright (c) 2015, Texas Instruments Incorporated 15 | * All rights reserved. 16 | * 17 | * Redistribution and use in source and binary forms, with or without 18 | * modification, are permitted provided that the following conditions 19 | * are met: 20 | * 21 | * * Redistributions of source code must retain the above copyright 22 | * notice, this list of conditions and the following disclaimer. 23 | * 24 | * * Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in the 26 | * documentation and/or other materials provided with the distribution. 27 | * 28 | * * Neither the name of Texas Instruments Incorporated nor the names of 29 | * its contributors may be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 34 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 35 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 36 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 38 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 39 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 40 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 41 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 42 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | */ 44 | 45 | 46 | /********************************************************************* 47 | * INCLUDES 48 | */ 49 | #include 50 | #include 51 | 52 | #include // For Log_warning1("Warning number #%d", 4); things 53 | #include // For Log_print0(Diags_USER1, "hello"); things. 54 | 55 | #include 56 | 57 | /********************************************************************* 58 | * TYPEDEFS 59 | */ 60 | 61 | /********************************************************************* 62 | * LOCAL FUNCTIONS 63 | */ 64 | 65 | /******************************************************************************* 66 | * EXTERNAL VARIABLES 67 | */ 68 | 69 | /********************************************************************* 70 | * LOCAL VARIABLES 71 | */ 72 | 73 | /********************************************************************* 74 | * PUBLIC FUNCTIONS 75 | */ 76 | 77 | /********************************************************************* 78 | * @fn Board_openLCD 79 | * 80 | * @brief Open the UART port and initialize Log callback plugin. 81 | * 82 | * @param none 83 | * 84 | * @return void 85 | */ 86 | void Board_openLCD(void) 87 | { 88 | UART_Params uartParams; 89 | UART_Params_init(&uartParams); 90 | uartParams.baudRate = 115200; 91 | UART_Handle hUart = UART_open(Board_UART, &uartParams); 92 | 93 | UartLog_init(hUart); 94 | } 95 | 96 | /********************************************************************* 97 | * @fn Board_writeString 98 | * 99 | * @brief Write a string to the Log system 100 | * 101 | * @param str - string to print 102 | * @param line - line (page) to write (0-7) - ignored for UART 103 | * 104 | * @return void 105 | */ 106 | void Board_writeString(char *str, uint8_t line) 107 | { 108 | if (strlen(str)) 109 | Log_print1(Diags_USER6, "LCD: %$S", (IArg)str); 110 | } 111 | 112 | /********************************************************************* 113 | * @fn Board_writeStringValue 114 | * 115 | * @brief Write a string and value to the Log system 116 | * 117 | * @param str - string to print 118 | * @param value - value to print 119 | * @param format - base of the value to print (10 and 16 supported for UART). 120 | * @param line - line (page) to write (0-7) - ignored for UART 121 | * 122 | * @return void 123 | */ 124 | void Board_writeStringValue(char *str, uint32_t value, uint8_t format, 125 | uint8_t line) 126 | { 127 | char *fmt; 128 | 129 | switch (format) 130 | { 131 | case 10: 132 | fmt = "LCD: %$S %d"; 133 | break; 134 | case 16: 135 | default: 136 | fmt = "LCD: %$S %x"; 137 | break; 138 | } 139 | 140 | Log_print2(Diags_USER6, fmt, (IArg)str, (IArg)value); 141 | } 142 | 143 | /********************************************************************* 144 | *********************************************************************/ 145 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/CCS/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000D000 7 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000D000 7 | --define=ICALL_RAM0_ADDR=0x20004478 8 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/CCS/multi_role/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/CCS/multi_role_stack/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/Config/IAR-Boundary.bdef: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | -D ICALL_STACK0_ADDR=0x0000E000 7 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/Config/IAR-Boundary.xcl: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --config_def ICALL_STACK0_ADDR=0x0000E000 7 | --config_def ICALL_RAM0_ADDR=0x20004474 8 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/Config/ccfg_appBLE.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file ccfg_appBLE.c 3 | * 4 | * @description Wrapper for the CC26xxWare customer configuration area setup. 5 | * 6 | * 7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *****************************************************************************/ 39 | 40 | // 41 | // ===> READ THIS BEFORE MODIFYING THIS FILE 42 | // 43 | // 44 | // ===> READ THIS BEFORE MODIFYING THIS FILE 45 | // 46 | // 47 | // ===> READ THIS BEFORE MODIFYING THIS FILE 48 | // 49 | 50 | // The customer configuration area (ccfg section) is located at the end of the 51 | // flash and reflect the hw configuration of the device. it is very important 52 | // that it remains align with the version of driverlib you are using. 53 | // all BLE project except sensor tag use the same configuration. 54 | // Keeping the "#include " guarantee that your project using 55 | // driverlib and the ccfg area will be align. 56 | 57 | // you can modify it if you want, the recommend way will be to remove the 58 | // bellow include, copy the content of the file in this 59 | // file and rebuild. 60 | 61 | // ==> KEEP IN MIND that if you do so, be sure that any further update of the 62 | // driverlib must be align with your modified version of ccfg area. 63 | #include 64 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/multi_role.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TI_RTOS_DRIVERS_BASE 7 | C:\ti\tirtos_simplelink_2_13_00_06\packages 8 | 9 | 10 | CC26XXWARE 11 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 12 | 13 | 14 | XDCROOT 15 | C:\ti\xdctools_3_31_01_33_core 16 | 17 | 18 | XDCPATH 19 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 20 | 21 | 22 | BOUNDARY 23 | C:\Program Files (x86)\Texas Instruments\Boundary 24 | 25 | 26 | TI_BLE_SDK_BASE 27 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/IAR/multi_role.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Application\CC2640\CC2640App.ewp 6 | 7 | 8 | $WS_DIR$\Stack\CC2640\CC2640Stack.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/Source/Application/main.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file main.c 3 | * 4 | * @description Application entry point 5 | * 6 | * 7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *****************************************************************************/ 39 | 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | #include "ICall.h" 46 | #include "bcomdef.h" 47 | #include "multi.h" 48 | #include "multi_role.h" 49 | 50 | #ifndef USE_DEFAULT_USER_CFG 51 | #include "bleUserConfig.h" 52 | // BLE user defined configuration 53 | bleUserCfg_t user0Cfg = BLE_USER_CFG; 54 | #endif // USE_DEFAULT_USER_CFG 55 | 56 | 57 | /* 58 | * ======== main ======== 59 | */ 60 | int main() 61 | { 62 | PIN_init(BoardGpioInitTable); 63 | 64 | #ifndef POWER_SAVING 65 | /* Set constraints for Standby, powerdown and idle mode */ 66 | Power_setConstraint(Power_SB_DISALLOW); 67 | Power_setConstraint(Power_IDLE_PD_DISALLOW); 68 | #endif // POWER_SAVING 69 | 70 | /* Initialize ICall module */ 71 | ICall_init(); 72 | 73 | /* Start tasks of external images - Priority 5 */ 74 | ICall_createRemoteTasks(); 75 | 76 | /* Kick off profile - Priority 3 */ 77 | GAPRole_createTask(); 78 | 79 | SimpleTopology_createTask(); 80 | 81 | /* enable interrupts and start SYS/BIOS */ 82 | BIOS_start(); 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/Source/Application/multi_role.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file simple_ble_topology.c 3 | * 4 | * @description Definitions and prototypes for the Simple Topology example 5 | * 6 | * 7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *****************************************************************************/ 39 | 40 | #ifndef SIMPLEBLETOPOLOGY_H 41 | #define SIMPLEBLETOPOLOGY_H 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /********************************************************************* 49 | * INCLUDES 50 | */ 51 | 52 | /********************************************************************* 53 | * EXTERNAL VARIABLES 54 | */ 55 | 56 | /********************************************************************* 57 | * CONSTANTS 58 | */ 59 | 60 | /********************************************************************* 61 | * MACROS 62 | */ 63 | 64 | /********************************************************************* 65 | * FUNCTIONS 66 | */ 67 | 68 | /* 69 | * Task creation function for the Simple BLE Peripheral. 70 | */ 71 | extern void SimpleTopology_createTask(void); 72 | 73 | /********************************************************************* 74 | *********************************************************************/ 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* SIMPLEBLETOPOLOGY_H */ 81 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/CC26xx/Source/Stack/OSAL_ICallBle.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file OSAL_IcallBle.c 3 | * 4 | * @description Setup function for the BLE Stack task 5 | * 6 | * 7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *****************************************************************************/ 39 | 40 | /************************************************************************************************** 41 | * INCLUDES 42 | **************************************************************************************************/ 43 | #include 44 | #include "hal_types.h" 45 | #include "OSAL.h" 46 | #include "OSAL_Tasks.h" 47 | #include "osal_snv.h" 48 | 49 | 50 | /* LL */ 51 | #include "ll.h" 52 | 53 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 54 | #include "osal_cbtimer.h" 55 | #endif 56 | 57 | /* L2CAP */ 58 | #include "l2cap.h" 59 | 60 | /* gap */ 61 | #include "gap.h" 62 | 63 | #if defined ( GAP_BOND_MGR ) 64 | #include "gapbondmgr.h" 65 | #endif 66 | 67 | /* GATT */ 68 | #include "gatt.h" 69 | 70 | /* Application */ 71 | #include "hci_tl.h" 72 | 73 | #include "gattservapp.h" 74 | 75 | #include "gapbondmgr.h" 76 | 77 | #include "bleUserConfig.h" 78 | #include "bleDispatch.h" 79 | 80 | /********************************************************************* 81 | * GLOBAL VARIABLES 82 | */ 83 | 84 | // The order in this table must be identical to the task initialization calls below in osalInitTask. 85 | const pTaskEventHandlerFn tasksArr[] = 86 | { 87 | LL_ProcessEvent, // task 0 88 | HCI_ProcessEvent, // task 1 89 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 90 | OSAL_CBTIMER_PROCESS_EVENT( osal_CbTimerProcessEvent ), // task 2 91 | #endif 92 | L2CAP_ProcessEvent, // task 3 93 | GAP_ProcessEvent, // task 4 94 | SM_ProcessEvent, // task 5 95 | GATT_ProcessEvent, // task 6 96 | GATTServApp_ProcessEvent, // task 7 97 | #if defined ( GAP_BOND_MGR ) 98 | GAPBondMgr_ProcessEvent, // task 8 99 | #endif 100 | bleDispatch_ProcessEvent // task 9 101 | }; 102 | 103 | const uint8 tasksCnt = sizeof( tasksArr ) / sizeof( tasksArr[0] ); 104 | uint16 *tasksEvents; 105 | 106 | /********************************************************************* 107 | * FUNCTIONS 108 | *********************************************************************/ 109 | 110 | /********************************************************************* 111 | * @fn osalInitTasks 112 | * 113 | * @brief This function invokes the initialization function for each task. 114 | * 115 | * @param void 116 | * 117 | * @return none 118 | */ 119 | void osalInitTasks( void ) 120 | { 121 | ICall_EntityID entity; 122 | ICall_Semaphore sem; 123 | uint8 taskID = 0; 124 | uint8 i; 125 | 126 | tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt); 127 | osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt)); 128 | 129 | /* LL Task */ 130 | LL_Init( taskID++ ); 131 | 132 | /* HCI Task */ 133 | HCI_Init( taskID++ ); 134 | 135 | #if defined ( OSAL_CBTIMER_NUM_TASKS ) 136 | /* Callback Timer Tasks */ 137 | osal_CbTimerInit( taskID ); 138 | taskID += OSAL_CBTIMER_NUM_TASKS; 139 | #endif 140 | 141 | /* L2CAP Task */ 142 | L2CAP_Init( taskID++ ); 143 | 144 | /* GAP Task */ 145 | GAP_Init( taskID++ ); 146 | 147 | /* SM Task */ 148 | SM_Init( taskID++ ); 149 | 150 | /* GATT Task */ 151 | GATT_Init( taskID++ ); 152 | 153 | /* GATT Server App Task */ 154 | GATTServApp_Init( taskID++ ); 155 | 156 | #if defined ( GAP_BOND_MGR ) 157 | /* Bond Manager Task */ 158 | GAPBondMgr_Init( taskID++ ); 159 | #endif 160 | 161 | /* ICall BLE Dispatcher Task */ 162 | bleDispatch_Init( taskID ); 163 | 164 | // ICall enrollment 165 | /* Enroll the service that this stack represents */ 166 | ICall_enrollService(ICALL_SERVICE_CLASS_BLE, NULL, &entity, &sem); 167 | 168 | /* Enroll the obtained dispatcher entity and OSAL task ID of HCI Ext App 169 | * to OSAL so that OSAL can route the dispatcher message into 170 | * the appropriate OSAL task. 171 | */ 172 | osal_enroll_dispatchid(taskID, entity); 173 | 174 | /* Register all other OSAL tasks to use the registered dispatcher entity 175 | * ID as the source of dispatcher messages, even though the other OSAL 176 | * tasks didn't register themselves to receive messages from application. 177 | */ 178 | for (i = 0; i < taskID; i++) 179 | { 180 | osal_enroll_senderid(i, entity); 181 | } 182 | } 183 | 184 | /** 185 | * Main entry function for the stack image 186 | */ 187 | int stack_main( void *arg ) 188 | { 189 | /* User reconfiguration of BLE Controller and Host variables */ 190 | setBleUserConfig( (bleUserCfg_t *)arg ); 191 | 192 | /* Establish OSAL for a stack service that requires accompanying 193 | * messaging service */ 194 | if (ICall_enrollService(ICALL_SERVICE_CLASS_BLE_MSG, 195 | (ICall_ServiceFunc) osal_service_entry, 196 | &osal_entity, &osal_semaphore) != 197 | ICALL_ERRNO_SUCCESS) 198 | { 199 | /* abort */ 200 | ICall_abort(); 201 | } 202 | 203 | halIntState_t state; 204 | HAL_ENTER_CRITICAL_SECTION(state); 205 | 206 | // Turn off interrupts 207 | //osal_int_disable( INTS_ALL ); 208 | 209 | // Initialize NV System 210 | osal_snv_init( ); 211 | 212 | // Initialize the operating system 213 | osal_init_system(); 214 | 215 | // Allow interrupts 216 | //osal_int_enable( INTS_ALL ); 217 | HAL_EXIT_CRITICAL_SECTION(state); 218 | 219 | osal_start_system(); // No Return from here 220 | 221 | return 0; // Shouldn't get here. 222 | } 223 | 224 | /********************************************************************* 225 | *********************************************************************/ 226 | -------------------------------------------------------------------------------- /Projects/ble/multi_role/Demo Hex Files/CC2640_MR.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/multi_role/Demo Hex Files/CC2640_MR.bin -------------------------------------------------------------------------------- /Projects/ble/multi_role/Demo Hex Files/CC2640_SBP.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/multi_role/Demo Hex Files/CC2640_SBP.bin -------------------------------------------------------------------------------- /Projects/ble/multi_role/doc_resources/device_menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/multi_role/doc_resources/device_menu.jpg -------------------------------------------------------------------------------- /Projects/ble/multi_role/doc_resources/main_menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/multi_role/doc_resources/main_menu.jpg -------------------------------------------------------------------------------- /Projects/ble/multi_role/doc_resources/topology_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/multi_role/doc_resources/topology_example.png -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/CC26xx/CCS/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/CC26xx/CCS/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sap_lib_sw_handshaking 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 15 | full,incremental, 16 | 17 | 18 | 19 | 20 | 21 | com.ti.ccstudio.core.ccsNature 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | 29 | NPI 30 | 2 31 | virtual:/virtual 32 | 33 | 34 | SAP 35 | 2 36 | virtual:/virtual 37 | 38 | 39 | NPI/Subsystem 40 | 2 41 | virtual:/virtual 42 | 43 | 44 | NPI/TL 45 | 2 46 | virtual:/virtual 47 | 48 | 49 | NPI/npi_data_swhs.h 50 | 1 51 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/inc/npi_data_swhs.h 52 | 53 | 54 | NPI/npi_task_swhs.c 55 | 1 56 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/npi_task_swhs.c 57 | 58 | 59 | NPI/npi_task_swhs.h 60 | 1 61 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/inc/npi_task_swhs.h 62 | 63 | 64 | NPI/npi_util.c 65 | 1 66 | TI_BLE_SDK_BASE/Components/npi/unified/npi_util.c 67 | 68 | 69 | NPI/npi_util.h 70 | 1 71 | TI_BLE_SDK_BASE/Components/npi/unified/inc/npi_util.h 72 | 73 | 74 | SAP/snp_rpc.c 75 | 1 76 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/snp_rpc.c 77 | 78 | 79 | SAP/snp_rpc.h 80 | 1 81 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/snp_rpc.h 82 | 83 | 84 | SAP/sap.c 85 | 1 86 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/sap.c 87 | 88 | 89 | SAP/np.h 90 | 1 91 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/sap.h 92 | 93 | 94 | SAP/snp_rpc_synchro.c 95 | 1 96 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/snp_rpc_synchro.c 97 | 98 | 99 | SAP/snp_rpc_synchro.h 100 | 1 101 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/snp_rpc_synchro.h 102 | 103 | 104 | NPI/Subsystem/npi_ss_ble_sap.c 105 | 1 106 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/npi_ss_ble_sap.c 107 | 108 | 109 | NPI/Subsystem/npi_ss_ble_sap.h 110 | 1 111 | TI_BLE_SDK_BASE/Projects/ble/SAP/CC26xx/Source/npi_ss_ble_sap.h 112 | 113 | 114 | NPI/TL/UART 115 | 2 116 | virtual:/virtual 117 | 118 | 119 | NPI/TL/npi_tl_swhs.c 120 | 1 121 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/npi_tl_swhs.c 122 | 123 | 124 | NPI/TL/npi_tl_swhs.h 125 | 1 126 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/inc/npi_tl_swhs.h 127 | 128 | 129 | NPI/TL/UART/npi_tl_uart_swhs.h 130 | 1 131 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/inc/npi_tl_uart_swhs.h 132 | 133 | 134 | NPI/TL/UART/npi_tl_uart_swhs.c 135 | 1 136 | PARENT-5-ORG_PROJ_DIR/Components/npi/unified/npi_tl_uart_swhs.c 137 | 138 | 139 | 140 | 141 | CC26XXWARE 142 | file:/C:/ti/tirtos_simplelink_2_13_00_06/products/cc26xxware_2_21_01_15600 143 | 144 | 145 | ORG_PROJ_DIR 146 | $%7BPROJECT_LOC%7D 147 | 148 | 149 | TI_RTOS_DRIVERS_BASE 150 | file:/C:/ti/tirtos_simplelink_2_13_00_06/packages 151 | 152 | 153 | XDCPATH 154 | file:/C:/ti/tirtos_simplelink_2_13_00_06/products/bios_6_42_00_08/packages 155 | 156 | 157 | XDCROOT 158 | file:/C:/ti/xdctools_3_31_01_33_core 159 | 160 | 161 | TI_BLE_SDK_BASE 162 | file:/C:/ti/simplelink/ble_cc26xx_2_01_00_44423 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/CC26xx/CCS/sap_lib_sw_handshaking_prebuilt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/sap_lib_sw_handshaking/CC26xx/CCS/sap_lib_sw_handshaking_prebuilt.lib -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/CC26xx/IAR/sap_lib_sw_handshaking.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TI_RTOS_DRIVERS_BASE 8 | C:\ti\tirtos_simplelink_2_13_00_06\packages 9 | 10 | 11 | CC26XXWARE 12 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 13 | 14 | 15 | XDCROOT 16 | C:\ti\xdctools_3_31_01_33_core 17 | 18 | 19 | XDCPATH 20 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 21 | 22 | 23 | BOUNDARY 24 | C:\Program Files (x86)\Texas Instruments\Boundary 25 | 26 | 27 | TI_BLE_SDK_BASE 28 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/CC26xx/IAR/sap_lib_sw_handshaking.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\sap_lib_sw_handshaking.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Projects/ble/sap_lib_sw_handshaking/README.md: -------------------------------------------------------------------------------- 1 | SAP Library with UART Software Handshaking 2 | ==================== 3 | 4 | This project is a duplicate of the SAP project in the SDK, and is aimed at adding software handshaking to the NPI protocol on the TI CC2640 BLE SoC. This allows the device to wake up on the UART RX line and enter power saving mode without needing hardware flow control. 5 | 6 | All the files in the project are referenced from their location within the BLE SDK, with the exception of the modified NPI files in this repository: `/Components/npi/**/*swhs.*` 7 | 8 | The functionality can be added to an existing project by swapping out the applicable files in your IDE with their `_swhs.*` counterpart, and adding the include search paths. 9 | 10 | More information on Unified NPI with UART Software handshaking: 11 | [Unified NPI with UART Software Handshaking](../../../Components/npi/unified) 12 | 13 | More information about the SimpleAP and SimpleNP projects: 14 | [http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP](http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP) 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/CCS/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 2 | var Types = xdc.useModule('xdc.runtime.Types'); 3 | var Diags = xdc.useModule('xdc.runtime.Diags'); 4 | var Error = xdc.useModule('xdc.runtime.Error'); 5 | var Main = xdc.useModule('xdc.runtime.Main'); 6 | var Memory = xdc.useModule('xdc.runtime.Memory') 7 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 8 | var System = xdc.useModule('xdc.runtime.System'); 9 | var Text = xdc.useModule('xdc.runtime.Text'); 10 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 11 | var Reset = xdc.useModule('xdc.runtime.Reset'); 12 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 13 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 14 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 15 | 16 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 17 | var Event = xdc.useModule('ti.sysbios.knl.Event'); 18 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 19 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 20 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 21 | 22 | /* Enable idle task (default). */ 23 | Task.enableIdleTask = true; 24 | 25 | /* Idle CPU when threads blocked waiting for an interrupt */ 26 | Power.idle = true; 27 | Power.policyFunc = Power.standbyPolicy; 28 | 29 | /* Compile out all Assert's */ 30 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 31 | 32 | /* Don't load string names of modules on the target */ 33 | Defaults.common$.namedModule = false; 34 | 35 | /* Allow Mod_create() and Mod_delete() */ 36 | Defaults.common$.memoryPolicy = Types.DELETE_POLICY; 37 | 38 | /* Don't load diagnostic/descriptive text strings on the target */ 39 | Text.isLoaded = false; 40 | 41 | /* Use the minimal user-supplied callback provider */ 42 | System.SupportProxy = SysCallback; 43 | /* no exit handlers needed */ 44 | System.maxAtexitHandlers = 0; 45 | 46 | /* main() and Hwi, Swi stack size */ 47 | Program.stack = 512; 48 | 49 | /* Build a custom, optimized version of SYS/BIOS */ 50 | BIOS.libType = BIOS.LibType_Custom; 51 | 52 | /* No logging - all compiled out */ 53 | BIOS.logsEnabled = false; 54 | 55 | /* Disable Asserts in SYS/BIOS code */ 56 | BIOS.assertsEnabled = false; 57 | 58 | /* Reduce number of Task priority levels to save RAM */ 59 | Task.numPriorities = 6; 60 | 61 | /* Set the default Task stack size - used if one is not specified */ 62 | Task.defaultStackSize = 512; 63 | 64 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 65 | Task.checkStackFlag = false; 66 | 67 | /* Disable exception handling to save Flash - undo during active development */ 68 | M3Hwi.enableException = true; 69 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 70 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 71 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 72 | 73 | /* Don't check for interrupt stack overflow during Idle loop */ 74 | Hwi.checkStackFlag = false; 75 | 76 | /* Minimize Flash and RAM usage of Error module */ 77 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 78 | Error.maxDepth = 2; 79 | 80 | /* Set the default CPU frequency */ 81 | BIOS.cpuFreq.lo = 48000000; 82 | 83 | /* Put reset vector at start of Flash */ 84 | M3Hwi.resetVectorAddress = 0x0; 85 | 86 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 87 | M3Hwi.vectorTableAddress = 0x20000000; 88 | 89 | /* CC2650 has 50 interrupts */ 90 | M3Hwi.NUM_INTERRUPTS = 50; 91 | 92 | /* Create a small heap */ 93 | var HeapMemParams = new HeapMem.Params; 94 | HeapMemParams.size = 8192; 95 | var myHeapMem = HeapMem.create(HeapMemParams); 96 | Memory.defaultHeapInstance = myHeapMem; 97 | 98 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 99 | Swi.numPriorities = 6; 100 | BIOS.swiEnabled = true; 101 | 102 | BIOS.includeXdcRuntime = true; 103 | 104 | /* Tasks cannot pend based on priority */ 105 | Semaphore.supportsPriority = false; 106 | 107 | /* Change default error function -- just spin */ 108 | Error.policyFxn = Error.policySpin; 109 | 110 | /* true: Allow runtime creation of e.g. semaphores 111 | * false: Compile out reference to Memory in BIOS */ 112 | BIOS.runtimeCreatesEnabled = true; 113 | 114 | /* Abort and exit functions -- just spin */ 115 | System.abortFxn = System.abortSpin; 116 | System.exitFxn = System.exitSpin; 117 | 118 | /* CC26xx Boot module */ 119 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 120 | Boot.driverlibVersion = 2; 121 | Boot.customerConfig = false; 122 | //Boot.checkBackdoor = false; 123 | 124 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 125 | Power.calibrateRCOSC = true; 126 | //Power.calibrateRCOSC = false; 127 | 128 | /* 10 us tick period */ 129 | Clock.tickPeriod = 10; 130 | 131 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000F000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000F000 7 | --define=ICALL_RAM0_ADDR=0x200044B8 8 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/CCS/simple_ap_sw_handshaking/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/IAR/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 2 | var Types = xdc.useModule('xdc.runtime.Types'); 3 | var Diags = xdc.useModule('xdc.runtime.Diags'); 4 | var Error = xdc.useModule('xdc.runtime.Error'); 5 | var Main = xdc.useModule('xdc.runtime.Main'); 6 | var Memory = xdc.useModule('xdc.runtime.Memory') 7 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 8 | var System = xdc.useModule('xdc.runtime.System'); 9 | var Text = xdc.useModule('xdc.runtime.Text'); 10 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 11 | var Reset = xdc.useModule('xdc.runtime.Reset'); 12 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 13 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 14 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 15 | 16 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 17 | var Event = xdc.useModule('ti.sysbios.knl.Event'); 18 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 19 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 20 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 21 | 22 | /* Enable idle task (default). */ 23 | Task.enableIdleTask = true; 24 | 25 | /* Idle CPU when threads blocked waiting for an interrupt */ 26 | Power.idle = true; 27 | Power.policyFunc = Power.standbyPolicy; 28 | 29 | /* Compile out all Assert's */ 30 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 31 | 32 | /* Don't load string names of modules on the target */ 33 | Defaults.common$.namedModule = false; 34 | 35 | /* Allow Mod_create() and Mod_delete() */ 36 | Defaults.common$.memoryPolicy = Types.DELETE_POLICY; 37 | 38 | /* Don't load diagnostic/descriptive text strings on the target */ 39 | Text.isLoaded = false; 40 | 41 | /* Use the minimal user-supplied callback provider */ 42 | System.SupportProxy = SysCallback; 43 | /* no exit handlers needed */ 44 | System.maxAtexitHandlers = 0; 45 | 46 | /* main() and Hwi, Swi stack size */ 47 | Program.stack = 512; 48 | 49 | /* Build a custom, optimized version of SYS/BIOS */ 50 | BIOS.libType = BIOS.LibType_Custom; 51 | 52 | /* No logging - all compiled out */ 53 | BIOS.logsEnabled = false; 54 | 55 | /* Disable Asserts in SYS/BIOS code */ 56 | BIOS.assertsEnabled = false; 57 | 58 | /* Reduce number of Task priority levels to save RAM */ 59 | Task.numPriorities = 6; 60 | 61 | /* Set the default Task stack size - used if one is not specified */ 62 | Task.defaultStackSize = 512; 63 | 64 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 65 | Task.checkStackFlag = false; 66 | 67 | /* Disable exception handling to save Flash - undo during active development */ 68 | M3Hwi.enableException = true; 69 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 70 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 71 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 72 | 73 | /* Don't check for interrupt stack overflow during Idle loop */ 74 | Hwi.checkStackFlag = false; 75 | 76 | /* Minimize Flash and RAM usage of Error module */ 77 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 78 | Error.maxDepth = 2; 79 | 80 | /* Set the default CPU frequency */ 81 | BIOS.cpuFreq.lo = 48000000; 82 | 83 | /* Put reset vector at start of Flash */ 84 | M3Hwi.resetVectorAddress = 0x0; 85 | 86 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 87 | M3Hwi.vectorTableAddress = 0x20000000; 88 | 89 | /* CC2650 has 50 interrupts */ 90 | M3Hwi.NUM_INTERRUPTS = 50; 91 | 92 | /* Create a small heap */ 93 | var HeapMemParams = new HeapMem.Params; 94 | HeapMemParams.size = 8192; 95 | var myHeapMem = HeapMem.create(HeapMemParams); 96 | Memory.defaultHeapInstance = myHeapMem; 97 | 98 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 99 | Swi.numPriorities = 6; 100 | BIOS.swiEnabled = true; 101 | 102 | BIOS.includeXdcRuntime = true; 103 | 104 | /* Tasks cannot pend based on priority */ 105 | Semaphore.supportsPriority = false; 106 | 107 | /* Change default error function -- just spin */ 108 | Error.policyFxn = Error.policySpin; 109 | 110 | /* true: Allow runtime creation of e.g. semaphores 111 | * false: Compile out reference to Memory in BIOS */ 112 | BIOS.runtimeCreatesEnabled = true; 113 | 114 | /* Abort and exit functions -- just spin */ 115 | System.abortFxn = System.abortSpin; 116 | System.exitFxn = System.exitSpin; 117 | 118 | /* CC26xx Boot module */ 119 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 120 | Boot.driverlibVersion = 2; 121 | Boot.customerConfig = false; 122 | //Boot.checkBackdoor = false; 123 | 124 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 125 | Power.calibrateRCOSC = true; 126 | //Power.calibrateRCOSC = false; 127 | 128 | /* 10 us tick period */ 129 | Clock.tickPeriod = 10; 130 | 131 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/IAR/simple_ap_sw_handshaking.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TI_RTOS_DRIVERS_BASE 8 | C:\ti\tirtos_simplelink_2_13_00_06\packages 9 | 10 | 11 | CC26XXWARE 12 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 13 | 14 | 15 | XDCROOT 16 | C:\ti\xdctools_3_31_01_33_core 17 | 18 | 19 | XDCPATH 20 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 21 | 22 | 23 | BOUNDARY 24 | C:\Program Files (x86)\Texas Instruments\Boundary 25 | 26 | 27 | TI_BLE_SDK_BASE 28 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/CC26xx/IAR/simple_ap_sw_handshaking.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $TI_BLE_SDK_BASE$\Projects\ble\util\BIM_extflash\CC26xx\IARBIM_extflash.ewp 6 | 7 | 8 | $WS_DIR$\Application\CC2640\CC2640App.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/simple_ap_sw_handshaking/README.md: -------------------------------------------------------------------------------- 1 | SimpleAP with UART Software Handshaking 2 | ==================== 3 | 4 | This project is a duplicate of the SimpleAP project in the SDK, and is aimed at adding software handshaking to the NPI protocol on the TI CC2640 BLE SoC. This allows the device to wake up on the UART RX line and enter power saving mode without needing hardware flow control. 5 | 6 | This project is built to run on the SmartRF06 Evaluation Board with a CC2650 7x7 Evaluation Module or CC2650 SensorTag. To use a different board, exchange the Board.c file and change the search path for the board files. 7 | 8 | The SAP library must be built before building the SimpleAP project. The modified SAP library with software handshaking added can be found in the sap_lib_sw_handshaking folder. See links below for more information about the SAP library and how it functions. 9 | 10 | All the files in the project are referenced from their location within the BLE SDK, with the exception of the modified NPI files in this repository: `/Components/npi/**/*swhs.*` 11 | 12 | The functionality can be added to an existing project by swapping out the applicable files in your IDE with their `_swhs.*` counterpart, and adding the include search paths. 13 | 14 | More information on Unified NPI with UART Software handshaking: 15 | [Unified NPI with UART Software Handshaking](../../../Components/npi/unified) 16 | 17 | More information about the SimpleAP and SimpleNP projects: 18 | [http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP](http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP) 19 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000E000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | 7 | --define=ICALL_STACK0_ADDR=0x0000E000 8 | --define=ICALL_RAM0_ADDR=0x200043E8 9 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/CCS/SimpleBLEPeripheral/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/CCS/SimpleBLEPeripheralStack/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/Config/IAR-Boundary.bdef: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | -D ICALL_STACK0_ADDR=0x0000F000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/Config/IAR-Boundary.xcl: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --config_def ICALL_STACK0_ADDR=0x0000F000 7 | --config_def ICALL_RAM0_ADDR=0x200043E4 8 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/Config/ccfg_appBLE.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Filename: ccfg.c 3 | * Revised: $Date: 2015-01-15 15:45:13 +0100 (to, 15 jan 2015) $ 4 | * Revision: $Revision: 14826 $ 5 | * 6 | * Description: Customer Configuration CC26xx PG2 device family. 7 | * 8 | * Copyright (C) 2014 - 2015 Texas Instruments Incorporated - http://www.ti.com/ 9 | * 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | ******************************************************************************/ 39 | 40 | // 41 | // ===> READ THIS BEFORE MODIFYING THIS FILE 42 | // 43 | // 44 | // ===> READ THIS BEFORE MODIFYING THIS FILE 45 | // 46 | // 47 | // ===> READ THIS BEFORE MODIFYING THIS FILE 48 | // 49 | 50 | // The customer configuration area (ccfg section) is located at the end of the 51 | // flash and reflect the hw configuration of the device. it is very important 52 | // that it remains align with the version of driverlib you are using. 53 | // all BLE project except sensor tag use the same configuration. 54 | // Keeping the "#include " guarantee that your project using 55 | // driverlib and the ccfg area will be align. 56 | 57 | // you can modify it if you want, the recommend way is to define your overrides 58 | // in this file and then include the official ccfg.c example file 59 | // ==> KEEP IN MIND that if you do so, be sure that any further update of the 60 | // driverlib must be align with your modified version of ccfg area. 61 | #include 62 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/SimpleBLEPeripheral.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TI_RTOS_DRIVERS_BASE 7 | C:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\products\tidrivers_cc13xx_cc26xx_2_15_00_26\packages 8 | 9 | 10 | CC26XXWARE 11 | C:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\products\cc26xxware_2_23_00_16374 12 | 13 | 14 | XDCROOT 15 | C:\ti\xdctools_3_32_00_06_core 16 | 17 | 18 | XDCPATH 19 | c:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\packages;c:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\products\tidrivers_cc13xx_cc26xx_2_15_00_26\packages;c:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\products\bios_6_45_00_20\packages;c:\ti\tirtos_cc13xx_cc26xx_2_15_00_17\products\uia_2_00_02_39\packages 20 | 21 | 22 | BOUNDARY 23 | C:\Program Files (x86)\Texas Instruments\Boundary 24 | 25 | 26 | TI_BLE_SDK_BASE 27 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/SimpleBLEPeripheral.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Application\CC2640\CC2640App.ewp 6 | 7 | 8 | $WS_DIR$\Stack\CC2640\CC2640Stack.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/Stack/CC2640/buildConfig.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/IAR/Stack/CC2640/buildConfig.opt -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/Source/Application/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @brief main entry of the BLE stack sample application. 4 | * 5 | * Copyright (c) 2015, Texas Instruments Incorporated 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * * Neither the name of Texas Instruments Incorporated nor the names of 20 | * its contributors may be used to endorse or promote products derived 21 | * from this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 25 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 26 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 27 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 29 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 30 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 31 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 32 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 33 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include 37 | #include 38 | #include "Board.h" 39 | #include 40 | #include 41 | #include 42 | 43 | #include "ICall.h" 44 | #include "bcomdef.h" 45 | #include "peripheral.h" 46 | #include "simpleBLEPeripheral.h" 47 | 48 | /* Header files required to enable instruction fetch cache */ 49 | #include 50 | #include 51 | 52 | #ifndef USE_DEFAULT_USER_CFG 53 | 54 | #include "bleUserConfig.h" 55 | 56 | // BLE user defined configuration 57 | bleUserCfg_t user0Cfg = BLE_USER_CFG; 58 | 59 | #endif // USE_DEFAULT_USER_CFG 60 | 61 | /** 62 | * Exception handler 63 | */ 64 | void exceptionHandler() 65 | { 66 | volatile uint8_t i = 1; 67 | while(i){} 68 | } 69 | 70 | #ifdef FEATURE_OAD 71 | #if defined(__IAR_SYSTEMS_ICC__) 72 | extern uint32_t __vector_table; 73 | #elif defined (__TI_COMPILER_VERSION__) 74 | extern uint32_t ti_sysbios_family_arm_m3_Hwi_resetVectors; 75 | #endif //Compiler 76 | #endif //FEATURE_OAD 77 | 78 | /* 79 | * ======== main ======== 80 | */ 81 | int main() 82 | { 83 | Board_initGeneral(); 84 | 85 | #ifndef POWER_SAVING 86 | /* Set constraints for Standby, powerdown and idle mode */ 87 | Power_setConstraint(Power_SB_DISALLOW); 88 | Power_setConstraint(Power_IDLE_PD_DISALLOW); 89 | #endif // POWER_SAVING 90 | 91 | /* Initialize ICall module */ 92 | ICall_init(); 93 | 94 | /* Start tasks of external images - Priority 5 */ 95 | ICall_createRemoteTasks(); 96 | 97 | /* Kick off profile - Priority 3 */ 98 | GAPRole_createTask(); 99 | 100 | SimpleBLEPeripheral_createTask(); 101 | 102 | #ifdef FEATURE_OAD 103 | { 104 | uint8_t counter; 105 | uint32_t *vectorTable = (uint32_t*) 0x20000000; 106 | #if defined(__IAR_SYSTEMS_ICC__) 107 | uint32_t *flashVectors = &__vector_table; 108 | #elif defined(__TI_COMPILER_VERSION__) 109 | uint32_t *flashVectors = &ti_sysbios_family_arm_m3_Hwi_resetVectors; 110 | #endif //Compiler. 111 | 112 | // Write image specific interrupt vectors into RAM vector table. 113 | for(counter = 0; counter < 15; ++counter) 114 | { 115 | *vectorTable++ = *flashVectors++; 116 | } 117 | } 118 | #endif //FEATURE_OAD 119 | 120 | /* enable interrupts and start SYS/BIOS */ 121 | BIOS_start(); 122 | 123 | return 0; 124 | } 125 | 126 | /** 127 | * Error handled to be hooked into TI-RTOS 128 | */ 129 | Void smallErrorHook(Error_Block *eb) 130 | { 131 | for (;;); 132 | } 133 | 134 | /** 135 | * HAL assert handler required by OSAL memory module. 136 | */ 137 | void halAssertHandler(void) 138 | { 139 | for (;;); 140 | } 141 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_tirtos_2p15/README.md: -------------------------------------------------------------------------------- 1 | # BLE stack v2.1 - TI RTOS 2.15 Porting Guide 2 | 3 | 4 | This guide will show how to port the SimpleBLEPeripheral project to use TI RTOS 5 | 2.15.00.17 instead of the original 2.13.00.06 version. 6 | 7 | ## Why upgrade? 8 | - Beta version of PDM (pulse density modulation) driver for microphones 9 | - Bug fixes in several drivers (UART, SPI, I2C) 10 | - RF driver for proprietary modes 11 | - All drivers now have configurable interrupt priority 12 | - Board file fixes for CCS 13 | - Improved calibration routine for oscillators 14 | - Kernel power management is now a separate driver 15 | 16 | If you do not have any problems with your current solution using TI RTOS 2.13.00.06, 17 | it is recommended to not update. 18 | 19 | This version of TI RTOS has not undergone thorough testing with the BLE stack so 20 | there might still exist unknown issues. 21 | 22 | Before starting the porting process, please read the migration guide found at: 23 | - http://processors.wiki.ti.com/index.php/TI-RTOS_Migration_2_15 24 | 25 | ## Prerequisites 26 | - Clone the ble-sdk-210-extra repository: 27 | - https://github.com/ti-simplelink/ble-sdk-210-extra.git 28 | - Download and install TI RTOS for SimpleLink Wireless MCUs (2.15.00.17): 29 | - http://www.ti.com/tool/ti-rtos-mcu 30 | 31 | The example projects in ble-sdk-210-extra have split the stack installation path 32 | from the project so that they are movable. All included files and search paths 33 | references the stack installation using the variable *TI_BLE_SDK_BASE* which 34 | should point to your stack installation path. 35 | 36 | # Steps 37 | 38 | All changes necessary to manually port the project are shown in the Git diff of 39 | this repository. 40 | 41 | 1. (Optional) Make a copy of the following files: 42 | - Components/hal/target/_common/cc26xx/mb_PATCH.c 43 | - Components/icall/ports/tirtos/ICallCC2650.c 44 | - Projects/ble/common/cc26xx/board_lcd.c 45 | - Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/Source/Application/main.c 46 | - Projects/ble/simple_ble_peripheral_tirtos_2p15/CC26xx/Source/Application/simpleBLEPeripheral.c 47 | 48 | The copies can either be renamed to append *_tirtos_2p15_port* as in this 49 | example or modified directly. 50 | 51 | These files must be added to your workspace and the originals excluded from 52 | the build. 53 | 54 | 2. Add a missing compiler search path to your project. 55 | This step is necessary if you are working on the ble-sdk-210-extra repository. 56 | - IAR: Properties -> C/C++ Compiler -> Preprocessors 57 | - $TI_BLE_SDK_BASE$/Components/icall/ports/tirtos 58 | - Update board file to point to: $TI_RTOS_DRIVERS_BASE$/ti/boards/CC2650DK_7ID 59 | - CCS: Properties -> Build -> ARM Compiler -> Include Options: 60 | - "${TI_BLE_SDK_BASE}/Components/icall/ports/tirtos" 61 | - Update board file to point to: "${TI_RTOS_DRIVERS_BASE}/ti/boards/CC2650DK_7ID" 62 | 63 | 3. In the CC2640Stack project, the unused file hal_rtc_wrapper.h from HAL/Target/CC2650/Drivers. 64 | This no longer compiles as an interrupt name has changed. 65 | 66 | 4. Modify mb_PATCH.c in stack(hal/target/_common/cc26xx/mb_PATCH.c)(interrupt names changed) 67 | - INT_RF_CPE1 -> INT_RFC_CPE_1 68 | - INT_RF_CPE0 -> INT_RFC_CPE_0 69 | - INT_RF_HW -> INT_RFC_HW_COMB 70 | - INT_RF_CMD_ACK -> INT_RFC_CMD_ACK 71 | 72 | 5. Modify the includes of the Power module ( ICallCC2650.c, main.c) 73 | This is now a driver located together with the other TI RTOS drivers. 74 | - ti/sysbios/family/arm/cc26xx/Power.h -> ti/drivers/Power.h 75 | - ti/sysbios/family/arm/cc26xx/PowerCC2650.h -> Linked resources: 94 | - Update CC26XXWARE and TI_RTOS_DRIVERS_BASE paths. CC26XXWARE must be updated in both stack and Application 95 | 96 | 2. Properties -> General -> RTSC: 97 | - Select TIRTOS 2.15.0.15 and XDCTools 3.32.0.06. 98 | 99 | 3. Properties -> Build -> ARM Linker -> File Search Path: 100 | - Update path to RTOS drivers library to "${TI_RTOS_DRIVERS_BASE}/ti/drivers/lib/drivers_cc26xxware.arm3" 101 | 102 | 4. Modify path of LCD driver source (now located in ti/mw instead of ti/drivers) 103 | 104 | 5. Remove path to old Board.c file, add new CC2650DK_7ID.c file to workspace (for 7x7 EVM) 105 | 106 | ## IAR specific steps 107 | 108 | 1. Update custom argument variables (SimpleBLEPeripheral.custom_argvars), restart workspace. See diff for updated TI RTOS paths. 109 | 110 | 2. Modify path of LCD driver source (now located in ti/mw instead of ti/drivers) 111 | 112 | 3. Remove path to old Board.c file, add new CC2650DK_7ID.c file to workspace (for 7x7 EVM) 113 | 114 | 4. Update the paths to configPkg as instructed in the TI RTOS Migration 2.15 wiki 115 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/CCS/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | 132 | /******* Logging to UART overrides *****/ 133 | 134 | // Need Text loaded for formatting of Log_info/warning/error, but not for Log_print. 135 | Text.isLoaded = true; 136 | 137 | // Logging 138 | var Log = xdc.useModule('xdc.runtime.Log'); 139 | 140 | // Override error output color with ANSI codes, and use shorter (file.c:line) format. 141 | Log.L_error = { 142 | mask: Diags.STATUS, 143 | level: Diags.ERROR, 144 | msg: "\x1b[31;1mERROR:\x1b[0m (%s:%d) %$S" 145 | }; 146 | 147 | Log.L_info = { 148 | mask: Diags.INFO, 149 | msg: "\x1b[32;1mINFO:\x1b[0m (%s:%d) %$S" 150 | }; 151 | 152 | Log.L_warning = { 153 | mask: Diags.STATUS, 154 | level: Diags.WARNING, 155 | msg: "\x1b[33;1mWARNING:\x1b[0m (%s:%d) %$S" 156 | }; 157 | 158 | // Pull in LoggerCallback 159 | var LoggerCallback = xdc.useModule('xdc.runtime.LoggerCallback'); 160 | 161 | // Tell LoggerCallback to call our output function 162 | LoggerCallback.outputFxn = "&uartLog_outputFxn"; 163 | 164 | // Tell the Idle module to add our flush() function to the idle loop (before Power) 165 | var Idle = xdc.useModule('ti.sysbios.knl.Idle'); // Add if Idle isn't already imported. 166 | Idle.addFunc('&uartLog_flush'); 167 | 168 | // Create a static instance of LoggerCallback and set as default Main logger 169 | var loggerParams = new LoggerCallback.Params(); 170 | loggerParams.arg = 1; 171 | Main.common$.logger = LoggerCallback.create(loggerParams); // Only for Main (code that's not in an rtsc module) 172 | //Defaults.common$.logger = LoggerCallback.create(loggerParams); // Use for all log events 173 | 174 | // Turn off all other log masks than USER6. 175 | Main.common$.diags_USER1 = Diags.ALWAYS_OFF; 176 | Main.common$.diags_USER2 = Diags.ALWAYS_OFF; 177 | Main.common$.diags_USER3 = Diags.ALWAYS_OFF; 178 | Main.common$.diags_USER4 = Diags.ALWAYS_OFF; 179 | Main.common$.diags_USER5 = Diags.ALWAYS_OFF; 180 | Main.common$.diags_USER6 = Diags.ALWAYS_ON; 181 | Main.common$.diags_INFO = Diags.ALWAYS_ON; -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000E000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | 7 | --define=ICALL_STACK0_ADDR=0x0000E000 8 | --define=ICALL_RAM0_ADDR=0x200043E8 9 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/CCS/SimpleBLEPeripheral/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/CCS/SimpleBLEPeripheralStack/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/Config/IAR-Boundary.bdef: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | -D ICALL_STACK0_ADDR=0x0000F000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/Config/IAR-Boundary.xcl: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --config_def ICALL_STACK0_ADDR=0x0000F000 7 | --config_def ICALL_RAM0_ADDR=0x200043E4 8 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | 132 | /******* Logging to UART overrides *****/ 133 | 134 | // Need Text loaded for formatting of Log_info/warning/error, but not for Log_print. 135 | Text.isLoaded = true; 136 | 137 | // Logging 138 | var Log = xdc.useModule('xdc.runtime.Log'); 139 | 140 | // Override error output color with ANSI codes, and use shorter (file.c:line) format. 141 | Log.L_error = { 142 | mask: Diags.STATUS, 143 | level: Diags.ERROR, 144 | msg: "\x1b[31;1mERROR:\x1b[0m (%s:%d) %$S" 145 | }; 146 | 147 | Log.L_info = { 148 | mask: Diags.INFO, 149 | msg: "\x1b[32;1mINFO:\x1b[0m (%s:%d) %$S" 150 | }; 151 | 152 | Log.L_warning = { 153 | mask: Diags.STATUS, 154 | level: Diags.WARNING, 155 | msg: "\x1b[33;1mWARNING:\x1b[0m (%s:%d) %$S" 156 | }; 157 | 158 | // Pull in LoggerCallback 159 | var LoggerCallback = xdc.useModule('xdc.runtime.LoggerCallback'); 160 | 161 | // Tell LoggerCallback to call our output function 162 | LoggerCallback.outputFxn = "&uartLog_outputFxn"; 163 | 164 | // Tell the Idle module to add our flush() function to the idle loop (before Power) 165 | var Idle = xdc.useModule('ti.sysbios.knl.Idle'); // Add if Idle isn't already imported. 166 | Idle.addFunc('&uartLog_flush'); 167 | 168 | // Create a static instance of LoggerCallback and set as default Main logger 169 | var loggerParams = new LoggerCallback.Params(); 170 | loggerParams.arg = 1; 171 | Main.common$.logger = LoggerCallback.create(loggerParams); // Only for Main (code that's not in an rtsc module) 172 | //Defaults.common$.logger = LoggerCallback.create(loggerParams); // Use for all log events 173 | 174 | // Turn off all other log masks than USER6. 175 | Main.common$.diags_USER1 = Diags.ALWAYS_OFF; 176 | Main.common$.diags_USER2 = Diags.ALWAYS_OFF; 177 | Main.common$.diags_USER3 = Diags.ALWAYS_OFF; 178 | Main.common$.diags_USER4 = Diags.ALWAYS_OFF; 179 | Main.common$.diags_USER5 = Diags.ALWAYS_OFF; 180 | Main.common$.diags_USER6 = Diags.ALWAYS_ON; 181 | Main.common$.diags_INFO = Diags.ALWAYS_ON; -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/SimpleBLEPeripheral.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TI_RTOS_DRIVERS_BASE 7 | C:\ti\tirtos_simplelink_2_13_00_06\packages 8 | 9 | 10 | CC26XXWARE 11 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 12 | 13 | 14 | XDCROOT 15 | C:\ti\xdctools_3_31_01_33_core 16 | 17 | 18 | XDCPATH 19 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 20 | 21 | 22 | BOUNDARY 23 | C:\Program Files (x86)\Texas Instruments\Boundary 24 | 25 | 26 | TI_BLE_SDK_BASE 27 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/SimpleBLEPeripheral.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Application\CC2640\CC2640App.ewp 6 | 7 | 8 | $WS_DIR$\Stack\CC2640\CC2640Stack.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/Stack/CC2640/buildConfig.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/Projects/ble/simple_ble_peripheral_uartdisplay/CC26xx/IAR/Stack/CC2640/buildConfig.opt -------------------------------------------------------------------------------- /Projects/ble/simple_ble_peripheral_uartdisplay/README.md: -------------------------------------------------------------------------------- 1 | Redirect LCD writes to UART 2 | ========================== 3 | 4 | Most of the sample applications in the BLE SDK use the LCD display on the SmartRF06 evaluation board to show status information. 5 | 6 | For boards without an LCD, it's possible to hijack the LCD writes and output them in other ways. 7 | 8 | The project files in this folder show how, using helper files in this repository, the `board_lcd.h` interface used by the sample apps can be left alone, but the output can be sent to the UART. 9 | 10 | The project files reference `SimpleBLEPeripheral` source files from the BLE SDK, but the steps can be applied to any project. 11 | 12 | Steps 13 | ----- 14 | The steps below are applied to this project. A further description can be found in the Readme for `Components/uart_log` in this repository. 15 | 16 | 1. Add `uart_logs.c` from `Components/uart_log` in this repository to the project. 17 | 18 | 2. Remove `board_lcd.c` from the project, and add `Projects/ble/common/cc26xx/board_lcd_uartlog.c` from this repository instead. 19 | 20 | 3. Add an include path for `Components/uart_log` in this repository, so `board_lcd_uartlog.c` can initialize the UART logging. 21 | 22 | 4. Add logging to the TI-RTOS configuration file (see references below) 23 | 24 | 5. Remove the global Log disable define `xdc_runtime_Log_DISABLE_ALL` 25 | 26 | 6. (Optional for LCD to UART) Change `__FILE__` behavior to use short path. 27 | 28 | 29 | Bonus exercise 30 | ----- 31 | 32 | Observant readers will note that since the method for LCD redirection uses the Log functionality and the project is set up to use this, feel free to throw in a couple of `Log_info0("Hello world!");` in the source files. 33 | 34 | Note the limitations in the UART Log readme, and also note that nothing will be output before the "LCD" has been opened, as this is what tells `uart_logs.c` about the UART. 35 | 36 | Build configurations 37 | ------------------- 38 | The IAR and CCS application projects have two build configurations each, the difference between them being which Board.c and Board.h file to use. This is to let the source files refer to `Board_UART` independently of the board used. 39 | 40 | * FlashROM-STK 41 | - SensorTag rev 1.2+ board files from SensorTag patch files in BLE SDK 2.1 42 | * FlashROM-SRF06EB 43 | - SmartRF06 Evaluation board 7x7 EM board files from TIRTOS 2.13.00.06 44 | 45 | #### Choosing Build Config in IAR 46 | When the CC2640App project is active, select build configuration from the drop-down menu in the workspace pane. 47 | 48 | #### Choosing Build Config in CCS 49 | Right click on the SimpleBLEPeripheral project, go to Build Configurations -> Set active, and choose from the list. 50 | 51 | #### Debugger connection 52 | Be aware that the debugger connection in some cases must be configured separately from the build configuration. If the wrong debugger connection is active, refer to the Software Developers User Guide in the BLE SDK install folder or the CCS help on how to change this. 53 | 54 | References 55 | -------- 56 | * [UART Log Readme](../../../Components/uart_log) 57 | * Git diff for the steps: f2b4f0d4ae023dc02111a9aef8f1cdf49ccd5194 58 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/CCS/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/CCS/Config/ccsCompilerDefines.bcfg: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000E000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/CCS/Config/ccsLinkerDefines.cmd: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* CCS Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --define=ICALL_STACK0_ADDR=0x0000E000 7 | --define=ICALL_RAM0_ADDR=0x200044A0 8 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/CCS/simple_np_sw_handshaking/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/CCS/simple_np_sw_handshaking_stack/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/IAR/Config/IAR-Boundary.bdef: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Compiler Command Line Options */ 4 | /* Auto-generated compiler option(s) */ 5 | 6 | -D ICALL_STACK0_ADDR=0x00011000 7 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/IAR/Config/IAR-Boundary.xcl: -------------------------------------------------------------------------------- 1 | /* WARNING - Do not modify this line. Modifications below this line can be overwritten by the Boundary tool */ 2 | /* Boundary auto gen parser version 1.0.3 */ 3 | /* IAR Linker Command Line Options */ 4 | /* Auto-generated linker option(s) */ 5 | 6 | --config_def ICALL_STACK0_ADDR=0x00011000 7 | --config_def ICALL_RAM0_ADDR=0x200044A0 8 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/IAR/Config/appBLE.cfg: -------------------------------------------------------------------------------- 1 | var ROM = xdc.useModule('ti.sysbios.rom.ROM'); 2 | ROM.romName = ROM.CC2650; 3 | 4 | var Defaults = xdc.useModule('xdc.runtime.Defaults'); 5 | var Types = xdc.useModule('xdc.runtime.Types'); 6 | var Diags = xdc.useModule('xdc.runtime.Diags'); 7 | var Error = xdc.useModule('xdc.runtime.Error'); 8 | var Main = xdc.useModule('xdc.runtime.Main'); 9 | var Memory = xdc.useModule('xdc.runtime.Memory') 10 | var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 11 | var System = xdc.useModule('xdc.runtime.System'); 12 | var Text = xdc.useModule('xdc.runtime.Text'); 13 | var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); 14 | var Reset = xdc.useModule('xdc.runtime.Reset'); 15 | var BIOS = xdc.useModule('ti.sysbios.BIOS'); 16 | var Clock = xdc.useModule('ti.sysbios.knl.Clock'); 17 | var Task = xdc.useModule('ti.sysbios.knl.Task'); 18 | 19 | var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); 20 | var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); 21 | var M3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); 22 | var Power = xdc.useModule('ti.sysbios.family.arm.cc26xx.Power'); 23 | 24 | /* Enable idle task (default). */ 25 | Task.enableIdleTask = true; 26 | 27 | /* Idle CPU when threads blocked waiting for an interrupt */ 28 | Power.idle = true; 29 | Power.policyFunc = Power.standbyPolicy; 30 | 31 | /* compile out all Assert's */ 32 | Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; 33 | 34 | /* Don't load string names of modules on the target */ 35 | Defaults.common$.namedModule = false; 36 | 37 | /* Allow Mod_create() and Mod_construct() but not delete() or destruct() */ 38 | Defaults.common$.memoryPolicy = Types.CREATE_POLICY; 39 | 40 | /* Don't load diagnostic/descriptive text strings on the target */ 41 | Text.isLoaded = false; 42 | 43 | /* Use the minimal user-supplied callback provider */ 44 | System.SupportProxy = SysCallback; 45 | /* no exit handlers needed */ 46 | System.maxAtexitHandlers = 0; 47 | 48 | /* main() and Hwi, Swi stack size */ 49 | Program.stack = 1024; 50 | /* no command-line arguments main(argc, argv) needed */ 51 | Program.argSize = 0; 52 | 53 | /* build a custom, optimized version of SYS/BIOS */ 54 | BIOS.libType = BIOS.LibType_Custom; 55 | 56 | /* no logging - all compiled out */ 57 | BIOS.logsEnabled = false; 58 | 59 | /* disable Asserts in SYS/BIOS code */ 60 | BIOS.assertsEnabled = false; 61 | 62 | /* Reduce number of Task priority levels to save RAM */ 63 | Task.numPriorities = 6; 64 | 65 | /* Set the default Task stack size - used if one is not specified */ 66 | Task.defaultStackSize = 512; 67 | 68 | /* Don't check stacks for overflow - saves cycles (and power) and Flash */ 69 | Task.checkStackFlag = false; 70 | 71 | /* Disable exception handling to save Flash - undo during active development */ 72 | M3Hwi.enableException = true; 73 | M3Hwi.excHandlerFunc = null; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */ 74 | M3Hwi.nvicCCR.UNALIGN_TRP = 0; 75 | M3Hwi.nvicCCR.DIV_0_TRP = 0; 76 | 77 | /* Don't check for interrupt stack overflow during Idle loop */ 78 | Hwi.checkStackFlag = false; 79 | 80 | /* Minimize Flash and RAM usage of Error module */ 81 | Error.raiseHook = null; /* null = default while loop function. Use e.g. "&myFxn" to your own handler function. */ 82 | Error.maxDepth = 2; 83 | 84 | /* Set the default CPU frequency */ 85 | BIOS.cpuFreq.lo = 48000000; 86 | 87 | /* Put reset vector at start of Flash */ 88 | M3Hwi.resetVectorAddress = 0x0; 89 | 90 | /* Put interrupt vector at start of RAM so interrupts can be configured at runtime */ 91 | M3Hwi.vectorTableAddress = 0x20000000; 92 | 93 | /* CC2650 has 50 interrupts */ 94 | M3Hwi.NUM_INTERRUPTS = 50; 95 | 96 | /* Set heap size */ 97 | BIOS.heapSize = 1668; 98 | 99 | var Swi = xdc.useModule('ti.sysbios.knl.Swi'); 100 | Swi.numPriorities = 6; 101 | BIOS.swiEnabled = true; 102 | 103 | BIOS.includeXdcRuntime = true; 104 | 105 | /* Tasks cannot pend based on priority */ 106 | Semaphore.supportsPriority = false; 107 | 108 | /* Change default error function -- just spin */ 109 | Error.policyFxn = Error.policySpin; 110 | 111 | /* true: Allow runtime creation of e.g. semaphores 112 | * false: Compile out reference to Memory in BIOS */ 113 | BIOS.runtimeCreatesEnabled = true; 114 | 115 | /* Abort and exit functions -- just spin */ 116 | System.abortFxn = System.abortSpin; 117 | System.exitFxn = System.exitSpin; 118 | 119 | /* CC26xx Boot module */ 120 | var Boot = xdc.useModule('ti.sysbios.family.arm.cc26xx.Boot'); 121 | Boot.driverlibVersion = 2; 122 | Boot.customerConfig = false; 123 | //Boot.checkBackdoor = false; 124 | 125 | /* Turn on RCOSC_HF calibration, thus enabling fast startup */ 126 | Power.calibrateRCOSC = true; 127 | //Power.calibrateRCOSC = false; 128 | 129 | /* 10 us tick period */ 130 | Clock.tickPeriod = 10; 131 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/IAR/simple_np_sw_handshaking.custom_argvars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TI_RTOS_DRIVERS_BASE 7 | C:\ti\tirtos_simplelink_2_13_00_06\packages 8 | 9 | 10 | CC26XXWARE 11 | C:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600 12 | 13 | 14 | XDCROOT 15 | C:\ti\xdctools_3_31_01_33_core 16 | 17 | 18 | XDCPATH 19 | C:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages 20 | 21 | 22 | BOUNDARY 23 | C:\Program Files (x86)\Texas Instruments\Boundary 24 | 25 | 26 | TI_BLE_SDK_BASE 27 | C:\ti\simplelink\ble_cc26xx_2_01_00_44423 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/CC26xx/IAR/simple_np_sw_handshaking.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Application\CC2640\CC2640App.ewp 6 | 7 | 8 | $WS_DIR$\Stack\CC2640\CC2640Stack.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Projects/ble/simple_np_sw_handshaking/README.md: -------------------------------------------------------------------------------- 1 | SimpleNP with UART Software Handshaking 2 | ==================== 3 | 4 | This project is a duplicate of the SimpleNP project in the SDK, and is aimed at adding software handshaking to the NPI protocol on the TI CC2640 BLE SoC. This allows the device to wake up on the UART RX line and enter power saving mode without needing hardware flow control. 5 | 6 | This project is built to run on the SmartRF06 Evaluation Board with a CC2650 7x7 Evaluation Module. To use a different board, exchange the Board.c file and change the search path for the board files. 7 | 8 | All the files in the project are referenced from their location within the BLE SDK, with the exception of the modified NPI files in this repository: `/Components/npi/**/*swhs.*` 9 | 10 | The functionality can be added to an existing project by swapping out the applicable files in your IDE with their `_swhs.*` counterpart, and adding the include search paths. 11 | 12 | More information on Unified NPI with UART Software handshaking: 13 | [Unified NPI with UART Software Handshaking](../../../Components/npi/unified) 14 | 15 | More information about the SimpleAP and SimpleNP projects: 16 | [http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP](http://processors.wiki.ti.com/index.php/SimpleAP%2BSNP) 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository has been depricated 2 | =================================== 3 | 4 | All of the examples on this repository have been moved to the [ble_examples](https://github.com/ti-simplelink/ble\_examples) repository. 5 | 6 | The ble\_examples repository will be maintained/updated with further releases of the TI BLE SDK. It will contain branches for each SDK release. 7 | 8 | You can access the content of this repository by checking out the ble\_examples-2.1 branch of the ble\_examples repository. See the picture below. 9 | 10 | ![Checkout ble_examples-2.1](checkout_210.png) -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650DK_4XS/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef __BOARD_H 34 | #define __BOARD_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | //#include 41 | 42 | #include "CC2650DK_4XS.h" 43 | 44 | /* These #defines allow us to reuse TI-RTOS across other device families */ 45 | #define Board_LED0 Board_LED1 46 | 47 | #define Board_BUTTON0 Board_KEY_UP 48 | #define Board_BUTTON1 Board_KEY_DOWN 49 | 50 | #define Board_UART0 Board_UART 51 | #define Board_AES0 Board_AES 52 | #define Board_WATCHDOG0 Board_WATCHDOG 53 | 54 | #define Board_initGeneral() { \ 55 | Power_init(); \ 56 | if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) \ 57 | {System_abort("Error with PIN_init\n"); \ 58 | } \ 59 | } 60 | 61 | #define Board_initGPIO() 62 | #define Board_initSPI() SPI_init() 63 | #define Board_initUART() UART_init() 64 | #define Board_initWatchdog() Watchdog_init() 65 | #define GPIO_toggle(n) 66 | #define GPIO_write(n,m) 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* __BOARD_H */ 73 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650DK_4XS/CC2650DK_4XS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | /** ============================================================================ 33 | * @file Board.h 34 | * 35 | * @brief CC2650EM_4XS Board Specific header file. 36 | * The project options should point to this file if this is the 37 | * CC2650EM you are developing code for. 38 | * 39 | * The CC2650 header file should be included in an application as follows: 40 | * @code 41 | * #include 42 | * @endcode 43 | * 44 | * ============================================================================ 45 | */ 46 | #ifndef __CC2650EM_4XS_H__ 47 | #define __CC2650EM_4XS_H__ 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** ============================================================================ 54 | * Symbol by generic Board.c to include the correct kit specific Board.c 55 | * ==========================================================================*/ 56 | #define CC2650EM_4XS 57 | 58 | /** ============================================================================ 59 | * Includes 60 | * ==========================================================================*/ 61 | #include 62 | #include 63 | 64 | /** ============================================================================ 65 | * Externs 66 | * ==========================================================================*/ 67 | extern const PIN_Config BoardGpioInitTable[]; 68 | 69 | /** ============================================================================ 70 | * Defines 71 | * ==========================================================================*/ 72 | 73 | /* Mapping of pins to board signals using general board aliases 74 | * 75 | */ 76 | /* Leds */ 77 | #define Board_LED_ON 1 /* LEDs on CC2650 are active high */ 78 | #define Board_LED_OFF 0 79 | #define Board_LED1 PIN_UNASSIGNED 80 | #define Board_LED2 PIN_UNASSIGNED 81 | #define Board_LED3 IOID_5 /* P1.2 */ 82 | #define Board_LED4 IOID_6 /* P1.4 */ 83 | /* Button Board */ 84 | #define Board_KEY_SELECT IOID_7 /* P1.14 */ 85 | #define Board_KEY_UP IOID_4 /* P1.10 */ 86 | #define Board_KEY_DOWN IOID_3 /* P1.12 */ 87 | #define Board_KEY_LEFT PIN_UNASSIGNED 88 | #define Board_KEY_RIGHT PIN_UNASSIGNED 89 | /* LCD Board */ 90 | #define Board_3V3_EN PIN_UNASSIGNED 91 | #define Board_LCD_MODE PIN_UNASSIGNED 92 | #define Board_LCD_RST PIN_UNASSIGNED 93 | #define Board_LCD_CSN PIN_UNASSIGNED 94 | /* UART Board */ 95 | #define Board_UART_RX IOID_1 /* P1.7 */ 96 | #define Board_UART_TX IOID_2 /* P1.9 */ 97 | #define Board_UART_CTS PIN_UNASSIGNED 98 | #define Board_UART_RTS PIN_UNASSIGNED 99 | /* SPI Board */ 100 | #define Board_SPI0_MISO IOID_0 /* P1.20 */ 101 | #define Board_SPI0_MOSI IOID_9 /* P1.18 */ 102 | #define Board_SPI0_CLK IOID_8 /* P1.16 */ 103 | #define Board_SPI0_CSN PIN_UNASSIGNED 104 | 105 | /** ============================================================================ 106 | * Instance identifiers 107 | * ==========================================================================*/ 108 | /* Generic SPI instance identifiers */ 109 | #define Board_SPI0 CC2650DK_4XS_SPI0 110 | /* Generic UART instance identifiers */ 111 | #define Board_UART CC2650DK_4XS_UART0 112 | /* Generic Crypto instance identifiers */ 113 | #define Board_CRYPTO CC2650DK_4XS_CRYPTO0 114 | 115 | /** ============================================================================ 116 | * Number of peripherals and their names 117 | * ==========================================================================*/ 118 | 119 | /*! 120 | * @def CC2650DK_4XS_CryptoName 121 | * @brief Enum of Crypto names on the CC2650 dev board 122 | */ 123 | typedef enum CC2650DK_4XS_CryptoName { 124 | CC2650DK_4XS_CRYPTO0 = 0, 125 | CC2650DK_4XS_CRYPTOCOUNT 126 | } CC2650DK_4XS_CryptoName; 127 | 128 | /*! 129 | * @def CC2650DK_4XS_SPIName 130 | * @brief Enum of SPI names on the CC2650 dev board 131 | */ 132 | typedef enum CC2650DK_4XS_SPIName { 133 | CC2650DK_4XS_SPI0 = 0, 134 | CC2650DK_4XS_SPICOUNT 135 | } CC2650DK_4XS_SPIName; 136 | 137 | /*! 138 | * @def CC2650DK_4XS_UARTName 139 | * @brief Enum of UARTs on the CC2650 dev board 140 | */ 141 | typedef enum CC2650DK_4XS_UARTName { 142 | CC2650DK_4XS_UART0 = 0, 143 | CC2650DK_4XS_UARTCOUNT 144 | } CC2650DK_4XS_UARTName; 145 | 146 | /*! 147 | * @def CC2650DK_4XS_UdmaName 148 | * @brief Enum of DMA buffers 149 | */ 150 | typedef enum CC2650DK_4XS_UdmaName { 151 | CC2650DK_4XS_UDMA0 = 0, 152 | CC2650DK_4XS_UDMACOUNT 153 | } CC2650DK_4XS_UdmaName; 154 | 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | 159 | #endif /* __CC2650EM_H__ */ 160 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650DK_5XD/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef __BOARD_H 34 | #define __BOARD_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | //#include 41 | 42 | #include "CC2650DK_5XD.h" 43 | 44 | /* These #defines allow us to reuse TI-RTOS across other device families */ 45 | #define Board_LED0 Board_LED1 46 | 47 | #define Board_BUTTON0 Board_KEY_UP 48 | #define Board_BUTTON1 Board_KEY_DOWN 49 | 50 | #define Board_UART0 Board_UART 51 | #define Board_AES0 Board_AES 52 | #define Board_WATCHDOG0 Board_WATCHDOG 53 | 54 | #define Board_initGeneral() { \ 55 | Power_init(); \ 56 | if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) \ 57 | {System_abort("Error with PIN_init\n"); \ 58 | } \ 59 | } 60 | 61 | #define Board_initGPIO() 62 | #define Board_initSPI() SPI_init() 63 | #define Board_initUART() UART_init() 64 | #define Board_initWatchdog() Watchdog_init() 65 | #define GPIO_toggle(n) 66 | #define GPIO_write(n,m) 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* __BOARD_H */ 73 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650DK_5XD/CC2650DK_5XD.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | /** ============================================================================ 33 | * @file Board.h 34 | * 35 | * @brief CC2650EM_5XD Board Specific header file. 36 | * The project options should point to this file if this is the 37 | * CC2650EM you are developing code for. 38 | * 39 | * The CC2650 header file should be included in an application as follows: 40 | * @code 41 | * #include 42 | * @endcode 43 | * 44 | * ============================================================================ 45 | */ 46 | #ifndef __CC2650EM_5XD_H__ 47 | #define __CC2650EM_5XD_H__ 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** ============================================================================ 54 | * Symbol by generic Board.c to include the correct kit specific Board.c 55 | * ==========================================================================*/ 56 | #define CC2650EM_5XD 57 | 58 | /** ============================================================================ 59 | * Includes 60 | * ==========================================================================*/ 61 | #include 62 | #include 63 | 64 | /** ============================================================================ 65 | * Externs 66 | * ==========================================================================*/ 67 | extern const PIN_Config BoardGpioInitTable[]; 68 | 69 | /** ============================================================================ 70 | * Defines 71 | * ==========================================================================*/ 72 | 73 | /* Mapping of pins to board signals using general board aliases 74 | * 75 | */ 76 | /* Leds */ 77 | #define Board_LED_ON 1 /* LEDs on CC2650 are active high */ 78 | #define Board_LED_OFF 0 79 | #define Board_LED1 PIN_UNASSIGNED 80 | #define Board_LED2 PIN_UNASSIGNED 81 | #define Board_LED3 IOID_2 /* P1.2 */ 82 | #define Board_LED4 IOID_3 /* P1.4 */ 83 | /* Button Board */ 84 | #define Board_KEY_SELECT IOID_9 /* P1.14 */ 85 | #define Board_KEY_UP IOID_6 /* P1.10 */ 86 | #define Board_KEY_DOWN IOID_4 /* P1.12 */ 87 | #define Board_KEY_LEFT IOID_5 /* P1.6 */ 88 | #define Board_KEY_RIGHT IOID_13 /* P1.8 */ 89 | /* LCD Board */ 90 | #define Board_LCD_MODE IOID_7 /* P1.11 */ 91 | #define Board_LCD_RST PIN_UNASSIGNED 92 | #define Board_LCD_CSN IOID_8 /* P1.17 */ 93 | /* UART Board */ 94 | #define Board_UART_RX IOID_1 /* P1.7 */ 95 | #define Board_UART_TX IOID_0 /* P1.9 */ 96 | #define Board_UART_CTS PIN_UNASSIGNED 97 | #define Board_UART_RTS PIN_UNASSIGNED 98 | /* SPI Board */ 99 | #define Board_SPI0_MISO IOID_12 /* P1.20 */ 100 | #define Board_SPI0_MOSI IOID_11 /* P1.18 */ 101 | #define Board_SPI0_CLK IOID_10 /* P1.16 */ 102 | #define Board_SPI0_CSN PIN_UNASSIGNED 103 | /* Power Board */ 104 | #define Board_3V3_EN IOID_14 /* P1.15 */ 105 | 106 | /** ============================================================================ 107 | * Instance identifiers 108 | * ==========================================================================*/ 109 | /* Generic SPI instance identifiers */ 110 | #define Board_SPI0 CC2650DK_5XD_SPI0 111 | /* Generic UART instance identifiers */ 112 | #define Board_UART CC2650DK_5XD_UART0 113 | /* Generic Crypto instance identifiers */ 114 | #define Board_CRYPTO CC2650DK_5XD_CRYPTO0 115 | 116 | /** ============================================================================ 117 | * Number of peripherals and their names 118 | * ==========================================================================*/ 119 | 120 | /*! 121 | * @def CC2650DK_5XD_CryptoName 122 | * @brief Enum of Crypto names on the CC2650 dev board 123 | */ 124 | typedef enum CC2650DK_5XD_CryptoName { 125 | CC2650DK_5XD_CRYPTO0 = 0, 126 | CC2650DK_5XD_CRYPTOCOUNT 127 | } CC2650DK_5XD_CryptoName; 128 | 129 | /*! 130 | * @def CC2650DK_5XD_SPIName 131 | * @brief Enum of SPI names on the CC2650 dev board 132 | */ 133 | typedef enum CC2650DK_5XD_SPIName { 134 | CC2650DK_5XD_SPI0 = 0, 135 | CC2650DK_5XD_SPICOUNT 136 | } CC2650DK_5XD_SPIName; 137 | 138 | /*! 139 | * @def CC2650DK_5XD_UARTName 140 | * @brief Enum of UARTs on the CC2650 dev board 141 | */ 142 | typedef enum CC2650DK_5XD_UARTName { 143 | CC2650DK_5XD_UART0 = 0, 144 | CC2650DK_5XD_UARTCOUNT 145 | } CC2650DK_5XD_UARTName; 146 | 147 | /*! 148 | * @def CC2650DK_5XD_UdmaName 149 | * @brief Enum of DMA buffers 150 | */ 151 | typedef enum CC2650DK_5XD_UdmaName { 152 | CC2650DK_5XD_UDMA0 = 0, 153 | CC2650DK_5XD_UDMACOUNT 154 | } CC2650DK_5XD_UdmaName; 155 | 156 | #ifdef __cplusplus 157 | } 158 | #endif 159 | 160 | #endif /* __CC2650EM_H__ */ 161 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650DK_7ID/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef __BOARD_H 34 | #define __BOARD_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | //#include 41 | 42 | #include "CC2650DK_7ID.h" 43 | 44 | /* These #defines allow us to reuse TI-RTOS across other device families */ 45 | #define Board_LED0 Board_LED1 46 | 47 | #define Board_BUTTON0 Board_KEY_UP 48 | #define Board_BUTTON1 Board_KEY_DOWN 49 | 50 | #define Board_UART0 Board_UART 51 | #define Board_AES0 Board_AES 52 | #define Board_WATCHDOG0 Board_WATCHDOG 53 | 54 | #define Board_initGeneral() { \ 55 | Power_init(); \ 56 | if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) \ 57 | {System_abort("Error with PIN_init\n"); \ 58 | } \ 59 | } 60 | 61 | #define Board_initGPIO() 62 | #define Board_initSPI() SPI_init() 63 | #define Board_initUART() UART_init() 64 | #define Board_initWatchdog() Watchdog_init() 65 | #define GPIO_toggle(n) 66 | #define GPIO_write(n,m) 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* __BOARD_H */ 73 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650STK/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef __BOARD_H 34 | #define __BOARD_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | //#include 41 | 42 | #include "CC2650STK.h" 43 | 44 | /* These #defines allow us to reuse TI-RTOS across other device families */ 45 | #define Board_LED0 Board_LED1 46 | 47 | #define Board_BUTTON0 Board_KEY_LEFT 48 | #define Board_BUTTON1 Board_KEY_RIGHT 49 | 50 | #define Board_I2C0 Board_I2C 51 | #define Board_I2C_TMP Board_I2C0 52 | #define Board_UART0 Board_UART 53 | #define Board_AES0 Board_AES 54 | #define Board_WATCHDOG0 Board_WATCHDOG 55 | 56 | #define Board_initGeneral() { \ 57 | Power_init(); \ 58 | if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) \ 59 | {System_abort("Error with PIN_init\n"); \ 60 | } \ 61 | } 62 | 63 | #define Board_initGPIO() 64 | #define Board_initI2C() I2C_init() 65 | #define Board_initSPI() SPI_init() 66 | #define Board_initUART() UART_init() 67 | #define Board_initWatchdog() Watchdog_init() 68 | #define GPIO_toggle(n) 69 | #define GPIO_write(n,m) 70 | 71 | /* Board specific I2C addresses */ 72 | #define Board_TMP006_ADDR (0x44) 73 | #define Board_MPU9250_ADDR (0x68) 74 | #define Board_SHT21_ADDR (0x40) 75 | #define Board_OPT3001_ADDR (0x45) 76 | #define Board_BMP280_ADDR (0x77) 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* __BOARD_H */ 83 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/CC2650_LAUNCHXL/Board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef __BOARD_H 34 | #define __BOARD_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | //#include 41 | 42 | #include "CC2650_LAUNCHXL.h" 43 | 44 | /* These #defines allow us to reuse TI-RTOS across other device families */ 45 | #define Board_LED0 Board_RLED 46 | #define Board_LED1 Board_GLED 47 | #define Board_LED2 Board_LED0 48 | 49 | #define Board_BUTTON0 Board_BTN1 50 | #define Board_BUTTON1 Board_BTN2 51 | 52 | #define Board_UART0 Board_UART 53 | #define Board_AES0 Board_AES 54 | #define Board_WATCHDOG0 Board_WATCHDOG 55 | 56 | #define Board_initGeneral() { \ 57 | Power_init(); \ 58 | if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) \ 59 | {System_abort("Error with PIN_init\n"); \ 60 | } \ 61 | } 62 | 63 | #define Board_initGPIO() 64 | #define Board_initSPI() SPI_init() 65 | #define Board_initUART() UART_init() 66 | #define Board_initWatchdog() Watchdog_init() 67 | #define GPIO_toggle(n) 68 | #define GPIO_write(n,m) 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __BOARD_H */ 75 | -------------------------------------------------------------------------------- /Util/tirtos_2_13_patches/ti/boards/README.md: -------------------------------------------------------------------------------- 1 | Migrating to TI-RTOS 2.15.xx.xx Board File Format 2 | ======== 3 | There are a number of data structures and conventions that have changed in the latest TI-RTOS 2.15.xx.xx release. This guide will explain how to port TI-RTOS 2.13.00.06 style board files to this new format. The CC2650 Launchpad board files will be used throughout this example, thus this can serve as a porting guide for this evaluation kit. 4 | 5 | Board files in the new format have been backported to be compatible with TI-RTOS 2.13.00.06, they are included in Util/board_files directory. 6 | 7 | New Drivers 8 | ---------- 9 | TI-RTOS 2.15.xx.xx features a few new drivers older versions (i.e. 2.13.00.06) are not aware of. Notably these are the: 10 | * RF Driver 11 | * PDM Driver 12 | * Modified Power Driver 13 | * Middleware Display Driver 14 | 15 | In order make these files compatible with TI-RTOS 2.13.00.06, all references to the new drivers must be commented out. For example: 16 | ```C 17 | /* RF hwi and swi priority */ 18 | /* 19 | const RFCC26XX_HWAttrs RFCC26XX_hwAttrs = { 20 | .hwiCpe0Priority = ~0, 21 | .hwiHwPriority = ~0, 22 | .swiCpe0Priority = 0, 23 | .swiHwPriority = 0, 24 | }; 25 | */ 26 | ``` 27 | 28 | HWAttrs Structure Changes 29 | -------------- 30 | 31 | The HWAttrs data structure is used to configure the peripheral's driver with board specific settings. In the newer RTOS versions, this structure has been updated in a couple of ways: 32 | 1. A version system has been added 33 | 2. New fields have been added 34 | 35 | Since older (i.e. 2.13.00.06) versions of TI-RTOS are not aware of these changes, new fields and version tags must be removed, for example: 36 | ```C 37 | //const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC2650STK_I2CCOUNT] = { 38 | const I2CCC26XX_HWAttrs i2cCC26xxHWAttrs[CC2650STK_I2CCOUNT] = { 39 | { 40 | .baseAddr = I2C0_BASE, 41 | .powerMngrId = PERIPH_I2C0, //PowerCC26XX_PERIPH_I2C0, 42 | .intNum = INT_I2C, //INT_I2C_IRQ, 43 | //.intPriority = ~0, 44 | //.swiPriority = 0, 45 | .sdaPin = Board_I2C0_SDA0, 46 | .sclPin = Board_I2C0_SCL0, 47 | } 48 | }; 49 | ``` 50 | Migrating to CC2650 LaunchPad 51 | -------------- 52 | 53 | The CC2650LP is most similar to the CC2650EM-7ID evaluation module. The main exception is that there is no LCD present by default on the LP. This can be remedied by using the UART logger functionality from the simple_ble_peripheral_uartdisplay project in this repo. 54 | -------------------------------------------------------------------------------- /checkout_210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/ble-sdk-210-extra/e4b0d9cc4b922228be599a79d666c3e261b04bba/checkout_210.png --------------------------------------------------------------------------------