├── .gitignore ├── FreeRTOS ├── croutine.c ├── event_groups.c ├── include │ ├── FreeRTOS.h │ ├── StackMacros.h │ ├── croutine.h │ ├── deprecated_definitions.h │ ├── event_groups.h │ ├── list.h │ ├── mpu_prototypes.h │ ├── mpu_wrappers.h │ ├── portable.h │ ├── projdefs.h │ ├── queue.h │ ├── semphr.h │ ├── stdint.readme │ ├── task.h │ └── timers.h ├── list.c ├── portable │ └── CCS │ │ └── c28x │ │ ├── porASM.asm │ │ ├── port.c │ │ └── portmacro.h ├── queue.c ├── readme.txt ├── tasks.c └── timers.c ├── LICENSE ├── README.md └── examples ├── blinky_tms320f28027 ├── .ccsproject ├── .cproject ├── .project ├── .settings │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.debug.core.prefs ├── F2802x_Headers_nonBIOS.cmd ├── F2802x_generic_flash.cmd ├── FreeRTOSConfig.h ├── blinky.c ├── readme.txt └── targetConfigs │ ├── TMS320F28027.ccxml │ ├── TMS320F28034.ccxml │ └── readme.txt ├── blinky_tms320f28034 ├── .ccsproject ├── .cproject ├── .launches │ └── blinky_f28034.launch ├── .project ├── .settings │ ├── org.eclipse.cdt.codan.core.prefs │ ├── org.eclipse.cdt.core.prefs │ └── org.eclipse.cdt.debug.core.prefs ├── 28034_RAM_lnk.cmd ├── DSP2803x_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── blinky.c └── targetConfigs │ ├── TMS320F28034.ccxml │ └── readme.txt ├── blinky_tms320f28069 ├── .ccsproject ├── .cproject ├── .project ├── 28069_RAM_lnk.cmd ├── F2806x_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── TMS320F28069.ccxml ├── main.c └── targetConfigs │ ├── TMS320F28069.ccxml │ └── readme.txt ├── blinky_tms320f28377s ├── .ccsproject ├── .cproject ├── .launches │ ├── blinky_f28377s.launch │ └── blinky_tms320f28377s.launch ├── .project ├── .settings │ ├── org.eclipse.cdt.codan.core.prefs │ ├── org.eclipse.cdt.core.prefs │ └── org.eclipse.cdt.debug.core.prefs ├── 2837xS_Generic_RAM_lnk.cmd ├── F2837xS_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── blinky.c └── targetConfigs │ ├── TMS320F28377S.ccxml │ └── readme.txt ├── drivers ├── pwm.c ├── pwm.h ├── spi.c ├── spi.h ├── uart.c └── uart.h ├── fpu_f28377s ├── .ccsproject ├── .cproject ├── .project ├── 2837xS_Generic_FLASH_lnk.cmd ├── F2837xS_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── fpu_test.c ├── fpu_test.h ├── main.c └── targetConfigs │ ├── TMS320F28377S.ccxml │ └── readme.txt ├── libs ├── fatfs │ ├── diskio.c │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ └── integer.h └── sdcard_spi │ ├── SD.h │ ├── SD_SPI_Erase.c │ ├── SD_SPI_Initialization.c │ ├── SD_SPI_Read.c │ ├── SD_SPI_Registers.c │ ├── SD_SPI_Transmission.c │ └── SD_SPI_Write.c ├── pwm_tms320f28377s ├── .ccsproject ├── .cproject ├── .project ├── 2837xS_Generic_RAM_lnk.cmd ├── F2837xS_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── main.c └── targetConfigs │ ├── TMS320F28377S.ccxml │ └── readme.txt ├── sdcard_f28377s ├── .ccsproject ├── .cproject ├── .project ├── 2837xS_Generic_FLASH_lnk.cmd ├── F2837xS_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── main.c └── targetConfigs │ ├── TMS320F28377S.ccxml │ └── readme.txt └── uart_f28377s ├── .ccsproject ├── .cproject ├── .project ├── 2837xS_Generic_RAM_lnk.cmd ├── F2837xS_Headers_nonBIOS.cmd ├── FreeRTOSConfig.h ├── main.c └── targetConfigs ├── TMS320F28377S.ccxml └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | **/Cpu1_ram/** 2 | **/.launches/** 3 | **/.settings/** 4 | **/Debug/** -------------------------------------------------------------------------------- /FreeRTOS/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /FreeRTOS/portable/CCS/c28x/port.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------------------- 2 | // Author: Ivan Zaitsev, ivan.zaitsev@gmail.com 3 | // 4 | // This file follows the FreeRTOS distribution license. 5 | // 6 | // FreeRTOS is free software; you can redistribute it and/or modify it under 7 | // the terms of the GNU General Public License (version 2) as published by the 8 | // Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 9 | // 10 | // *************************************************************************** 11 | // >>! NOTE: The modification to the GPL is included to allow you to !<< 12 | // >>! distribute a combined work that includes FreeRTOS without being !<< 13 | // >>! obliged to provide the source code for proprietary components !<< 14 | // >>! outside of the FreeRTOS kernel. !<< 15 | // *************************************************************************** 16 | // 17 | // FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 18 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 19 | // FOR A PARTICULAR PURPOSE. Full license text is available on the following 20 | // link: http://www.freertos.org/a00114.html 21 | //------------------------------------------------------------------------------------------------- 22 | 23 | //------------------------------------------------------------------------------------------------- 24 | // Scheduler includes. 25 | //------------------------------------------------------------------------------------------------- 26 | #include "FreeRTOS.h" 27 | #include "task.h" 28 | 29 | //------------------------------------------------------------------------------------------------- 30 | // Implementation of functions defined in portable.h for the C28x port. 31 | //------------------------------------------------------------------------------------------------- 32 | 33 | // Constants required for hardware setup. 34 | #define portINITIAL_CRITICAL_NESTING ( ( uint16_t ) 10 ) 35 | #define portFLAGS_INT_ENABLED ( ( StackType_t ) 0x08 ) 36 | #if defined(__TMS320C28XX_FPU32__) 37 | # define AUX_REGISTERS_TO_SAVE 19 // XAR + FPU registers 38 | # define XAR4_REGISTER_POSITION 6 // XAR4 position in AUX registers array 39 | # define STF_REGISTER_POSITION 10 // STF position in AUX registers array 40 | #else 41 | # define AUX_REGISTERS_TO_SAVE 9 // XAR registers only 42 | # define XAR4_REGISTER_POSITION 5 // XAR4 position in AUX registers array 43 | #endif 44 | 45 | extern uint32_t getSTF( void ); 46 | extern void vApplicationSetupTimerInterrupt( void ); 47 | 48 | // Each task maintains a count of the critical section nesting depth. Each 49 | // time a critical section is entered the count is incremented. Each time a 50 | // critical section is exited the count is decremented - with interrupts only 51 | // being re-enabled if the count is zero. 52 | // 53 | // ulCriticalNesting will get set to zero when the scheduler starts, but must 54 | // not be initialised to zero as this will cause problems during the startup 55 | // sequence. 56 | // ulCriticalNesting should be 32 bit value to keep stack alignment unchanged. 57 | volatile uint32_t ulCriticalNesting = portINITIAL_CRITICAL_NESTING; 58 | volatile uint16_t bYield = 0; 59 | volatile uint16_t bPreemptive = 0; 60 | 61 | //------------------------------------------------------------------------------------------------- 62 | // Initialise the stack of a task to look exactly as if 63 | // timer interrupt was executed. 64 | //------------------------------------------------------------------------------------------------- 65 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) 66 | { 67 | uint16_t i; 68 | uint16_t base = 0; 69 | 70 | pxTopOfStack[base++] = 0x0080; // ST0. PSM = 0(No shift) 71 | pxTopOfStack[base++] = 0x0000; // T 72 | pxTopOfStack[base++] = 0x0000; // AL 73 | pxTopOfStack[base++] = 0x0000; // AH 74 | pxTopOfStack[base++] = 0xFFFF; // PL 75 | pxTopOfStack[base++] = 0xFFFF; // PH 76 | pxTopOfStack[base++] = 0xFFFF; // AR0 77 | pxTopOfStack[base++] = 0xFFFF; // AR1 78 | pxTopOfStack[base++] = 0x8A08; // ST1 79 | pxTopOfStack[base++] = 0x0000; // DP 80 | pxTopOfStack[base++] = 0x0000; // IER 81 | pxTopOfStack[base++] = 0x0000; // DBGSTAT 82 | pxTopOfStack[base++] = ((uint32_t)pxCode) & 0xFFFFU; // PCL 83 | pxTopOfStack[base++] = ((uint32_t)pxCode >> 16) & 0x00FFU; // PCH 84 | pxTopOfStack[base++] = 0xAAAA; // Alignment 85 | pxTopOfStack[base++] = 0xBBBB; // Alignment 86 | 87 | // Fill the rest of the registers with dummy values. 88 | for(i = 0; i < (2 * AUX_REGISTERS_TO_SAVE); i++) 89 | { 90 | uint16_t low = 0x0000; 91 | uint16_t high = 0x0000; 92 | 93 | if(i == (2 * XAR4_REGISTER_POSITION)) 94 | { 95 | low = ((uint32_t)pvParameters) & 0xFFFFU; 96 | high = ((uint32_t)pvParameters >> 16) & 0xFFFFU; 97 | } 98 | 99 | #if defined(__TMS320C28XX_FPU32__) 100 | if(i == (2 * STF_REGISTER_POSITION)) 101 | { 102 | uint32_t stf = getSTF(); 103 | 104 | low = stf & 0xFFFFU; 105 | high = (stf >> 16) & 0xFFFFU; 106 | } 107 | #endif 108 | 109 | pxTopOfStack[base + i] = low; 110 | i++; 111 | pxTopOfStack[base + i] = high; 112 | } 113 | 114 | base += i; 115 | 116 | // Reserve place for ST1 which will be used in context switch 117 | // to set correct SPA bit ASAP. 118 | pxTopOfStack[base++] = 0x8A18; // ST1 with SPA bit set 119 | pxTopOfStack[base++] = 0x0000; // DP 120 | pxTopOfStack[base++] = 0x0000; // placeholder for 32 bit ulCriticalNesting 121 | pxTopOfStack[base++] = 0x0000; 122 | 123 | // Return a pointer to the top of the stack we have generated so this can 124 | // be stored in the task control block for the task. 125 | return pxTopOfStack + base; 126 | } 127 | 128 | //------------------------------------------------------------------------------------------------- 129 | void vPortEndScheduler( void ) 130 | { 131 | // It is unlikely that the TMS320 port will get stopped. 132 | // If required simply disable the tick interrupt here. 133 | } 134 | 135 | //------------------------------------------------------------------------------------------------- 136 | // See header file for description. 137 | //------------------------------------------------------------------------------------------------- 138 | BaseType_t xPortStartScheduler(void) 139 | { 140 | vApplicationSetupTimerInterrupt(); 141 | 142 | ulCriticalNesting = 0; 143 | 144 | #if(configUSE_PREEMPTION == 1) 145 | bPreemptive = 1; 146 | #else 147 | bPreemptive = 0; 148 | #endif 149 | 150 | portENABLE_INTERRUPTS(); 151 | portRESTORE_FIRST_CONTEXT(); 152 | 153 | // Should not get here! 154 | return pdFAIL; 155 | } 156 | 157 | //------------------------------------------------------------------------------------------------- 158 | void vPortEnterCritical( void ) 159 | { 160 | portDISABLE_INTERRUPTS(); 161 | ulCriticalNesting++; 162 | } 163 | 164 | //------------------------------------------------------------------------------------------------- 165 | void vPortExitCritical( void ) 166 | { 167 | ulCriticalNesting--; 168 | if( ulCriticalNesting == 0 ) 169 | { 170 | portENABLE_INTERRUPTS(); 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /FreeRTOS/portable/CCS/c28x/portmacro.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------------------- 2 | // Author: Ivan Zaitsev, ivan.zaitsev@gmail.com 3 | // 4 | // This file follows the FreeRTOS distribution license. 5 | // 6 | // FreeRTOS is free software; you can redistribute it and/or modify it under 7 | // the terms of the GNU General Public License (version 2) as published by the 8 | // Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 9 | // 10 | // *************************************************************************** 11 | // >>! NOTE: The modification to the GPL is included to allow you to !<< 12 | // >>! distribute a combined work that includes FreeRTOS without being !<< 13 | // >>! obliged to provide the source code for proprietary components !<< 14 | // >>! outside of the FreeRTOS kernel. !<< 15 | // *************************************************************************** 16 | // 17 | // FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 18 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 19 | // FOR A PARTICULAR PURPOSE. Full license text is available on the following 20 | // link: http://www.freertos.org/a00114.html 21 | //------------------------------------------------------------------------------------------------- 22 | 23 | #ifndef PORTMACRO_H 24 | #define PORTMACRO_H 25 | 26 | //------------------------------------------------------------------------------------------------- 27 | // Port specific definitions. 28 | // 29 | // The settings in this file configure FreeRTOS correctly for the 30 | // given hardware and compiler. 31 | // 32 | // These settings should not be altered. 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | //------------------------------------------------------------------------------------------------- 36 | // Hardware includes 37 | //------------------------------------------------------------------------------------------------- 38 | 39 | //------------------------------------------------------------------------------------------------- 40 | // Type definitions. 41 | //------------------------------------------------------------------------------------------------- 42 | #define portCHAR uint16_t 43 | #define portFLOAT float 44 | #define portDOUBLE double 45 | #define portLONG uint32_t 46 | #define portSHORT uint16_t 47 | #define portBASE_TYPE uint16_t 48 | #define uint8_t uint16_t 49 | #define int8_t int16_t 50 | #define portSTACK_TYPE uint16_t 51 | 52 | typedef portSTACK_TYPE StackType_t; 53 | typedef int16_t BaseType_t; 54 | typedef uint16_t UBaseType_t; 55 | 56 | #if( configUSE_16_BIT_TICKS == 1 ) 57 | typedef uint16_t TickType_t; 58 | #define portMAX_DELAY ( TickType_t ) 0xffff 59 | #else 60 | typedef uint32_t TickType_t; 61 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 62 | #endif 63 | 64 | //------------------------------------------------------------------------------------------------- 65 | // Interrupt control macros. 66 | //------------------------------------------------------------------------------------------------- 67 | #define portDISABLE_INTERRUPTS() __asm(" setc INTM") 68 | #define portENABLE_INTERRUPTS() __asm(" clrc INTM") 69 | 70 | //------------------------------------------------------------------------------------------------- 71 | // Critical section control macros. 72 | //------------------------------------------------------------------------------------------------- 73 | extern void vPortEnterCritical( void ); 74 | extern void vPortExitCritical( void ); 75 | #define portENTER_CRITICAL() vPortEnterCritical() 76 | #define portEXIT_CRITICAL() vPortExitCritical() 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | // Task utilities. 80 | //------------------------------------------------------------------------------------------------- 81 | #define portYIELD() do{bYield = 1; __asm(" INTR INT14");}while(0) 82 | #define portYIELD_FROM_ISR( x ) do{if(x == pdTRUE){bYield = 1; __asm(" OR IFR, #0x2000");}}while(0) 83 | 84 | extern void portTICK_ISR( void ); 85 | extern void portRESTORE_FIRST_CONTEXT( void ); 86 | extern void vTaskSwitchContext( void ); 87 | extern volatile uint16_t bYield; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | // Hardware specifics. 91 | //------------------------------------------------------------------------------------------------- 92 | #define portBYTE_ALIGNMENT 4 93 | #define portSTACK_GROWTH ( 1 ) 94 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 95 | #define portNOP() __asm(" NOP") 96 | 97 | //------------------------------------------------------------------------------------------------- 98 | // Task function macros as described on the FreeRTOS.org WEB site. 99 | //------------------------------------------------------------------------------------------------- 100 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 101 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 102 | 103 | #endif /* PORTMACRO_H */ 104 | -------------------------------------------------------------------------------- /FreeRTOS/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Ivan Zaitsev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # freertos_c28x 2 | FreeRTOS port for TI C2000's C28x based microcontrollers TMS320 family. 3 | 4 | Compiled in CCS v6.1.2. FreeRTOS v9.0.0. 5 | Developed and tested on following MCUs: 6 | * TMS320F28377S 7 | * TMS320F28034 8 | * TMS320F28069 9 | 10 | Should work with any TMS320 MCU and any futher version of FreeRTOS. 11 | 12 | This project contains FreeRTOS, port and simple examples for TMS320F28377S and TMS320F28034. 13 | Examples needs TI's controlSUITE to be installed for both MCU and project settings 14 | should be adjusted to let compiler find device support files. 15 | 16 | This project is distributed under MIT open source license. 17 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | blinky_f28027 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 | F2802x_GlobalVariableDefs.c 30 | 1 31 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_headers/source/F2802x_GlobalVariableDefs.c 32 | 33 | 34 | FreeRTOS 35 | 2 36 | virtual:/virtual 37 | 38 | 39 | f2802x_codestartbranch.asm 40 | 1 41 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_codestartbranch.asm 42 | 43 | 44 | f2802x_cputimers.c 45 | 1 46 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_cputimers.c 47 | 48 | 49 | f2802x_defaultisr.c 50 | 1 51 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_defaultisr.c 52 | 53 | 54 | f2802x_gpio.c 55 | 1 56 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_gpio.c 57 | 58 | 59 | f2802x_piectrl.c 60 | 1 61 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_piectrl.c 62 | 63 | 64 | f2802x_pievect.c 65 | 1 66 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_pievect.c 67 | 68 | 69 | f2802x_sysctrl.c 70 | 1 71 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_sysctrl.c 72 | 73 | 74 | f2802x_usdelay.asm 75 | 1 76 | $%7BTI_PRODUCTS_DIR%7D/controlSUITE/device_support/f2802x/v230/f2802x_common/source/f2802x_usdelay.asm 77 | 78 | 79 | FreeRTOS/list.c 80 | 1 81 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 82 | 83 | 84 | FreeRTOS/port 85 | 2 86 | virtual:/virtual 87 | 88 | 89 | FreeRTOS/queue.c 90 | 1 91 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 92 | 93 | 94 | FreeRTOS/tasks.c 95 | 1 96 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 97 | 98 | 99 | FreeRTOS/port/porASM.asm 100 | 1 101 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 102 | 103 | 104 | FreeRTOS/port/port.c 105 | 1 106 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 107 | 108 | 109 | FreeRTOS/port/portmacro.h 110 | 1 111 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 112 | 113 | 114 | 115 | 116 | copy_PARENT 117 | $%7BPARENT-1-PROJECT_LOC%7D/freertos_c28x-master/freertos_c28x-master 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/.settings/org.eclipse.cdt.debug.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker 3 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/F2802x_Headers_nonBIOS.cmd: -------------------------------------------------------------------------------- 1 | /* 2 | //########################################################################### 3 | // 4 | // FILE: F2802x_Headers_nonBIOS.cmd 5 | // 6 | // TITLE: F2802x Peripheral registers linker command file 7 | // 8 | // DESCRIPTION: 9 | // 10 | // This file is for use in Non-BIOS applications. 11 | // 12 | // Linker command file to place the peripheral structures 13 | // used within the F2802x headerfiles into the correct memory 14 | // mapped locations. 15 | // 16 | // This version of the file includes the PieVectorTable structure. 17 | // For BIOS applications, please use the F2802x_Headers_BIOS.cmd file 18 | // which does not include the PieVectorTable structure. 19 | // 20 | //########################################################################### 21 | // $TI Release: F2802x Support Library v230 $ 22 | // $Release Date: Fri May 8 07:43:05 CDT 2015 $ 23 | // $Copyright: Copyright (C) 2008-2015 Texas Instruments Incorporated - 24 | // http://www.ti.com/ ALL RIGHTS RESERVED $ 25 | //########################################################################### 26 | */ 27 | 28 | MEMORY 29 | { 30 | PAGE 0: /* Program Memory */ 31 | 32 | PAGE 1: /* Data Memory */ 33 | 34 | DEV_EMU : origin = 0x000880, length = 0x000105 /* device emulation registers */ 35 | SYS_PWR_CTL : origin = 0x000985, length = 0x000003 /* System power control registers */ 36 | FLASH_REGS : origin = 0x000A80, length = 0x000060 /* FLASH registers */ 37 | CSM : origin = 0x000AE0, length = 0x000010 /* code security module registers */ 38 | 39 | ADC_RESULT : origin = 0x000B00, length = 0x000020 /* ADC Results register */ 40 | 41 | CPU_TIMER0 : origin = 0x000C00, length = 0x000008 /* CPU Timer0 registers */ 42 | CPU_TIMER1 : origin = 0x000C08, length = 0x000008 /* CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)*/ 43 | CPU_TIMER2 : origin = 0x000C10, length = 0x000008 /* CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)*/ 44 | 45 | PIE_CTRL : origin = 0x000CE0, length = 0x000020 /* PIE control registers */ 46 | PIE_VECT : origin = 0x000D00, length = 0x000100 /* PIE Vector Table */ 47 | 48 | COMP1 : origin = 0x006400, length = 0x000020 /* Comparator 1 registers */ 49 | COMP2 : origin = 0x006420, length = 0x000020 /* Comparator 2 registers */ 50 | 51 | EPWM1 : origin = 0x006800, length = 0x000040 /* Enhanced PWM 1 registers */ 52 | EPWM2 : origin = 0x006840, length = 0x000040 /* Enhanced PWM 2 registers */ 53 | EPWM3 : origin = 0x006880, length = 0x000040 /* Enhanced PWM 3 registers */ 54 | EPWM4 : origin = 0x0068C0, length = 0x000040 /* Enhanced PWM 4 registers */ 55 | 56 | ECAP1 : origin = 0x006A00, length = 0x000020 /* Enhanced Capture 1 registers */ 57 | 58 | GPIOCTRL : origin = 0x006F80, length = 0x000040 /* GPIO control registers */ 59 | GPIODAT : origin = 0x006FC0, length = 0x000020 /* GPIO data registers */ 60 | GPIOINT : origin = 0x006FE0, length = 0x000020 /* GPIO interrupt/LPM registers */ 61 | 62 | SYSTEM : origin = 0x007010, length = 0x000020 /* System control registers */ 63 | 64 | SPIA : origin = 0x007040, length = 0x000010 /* SPI-A registers */ 65 | 66 | SCIA : origin = 0x007050, length = 0x000010 /* SCI-A registers */ 67 | 68 | NMIINTRUPT : origin = 0x007060, length = 0x000010 /* NMI Watchdog Interrupt Registers */ 69 | XINTRUPT : origin = 0x007070, length = 0x000010 /* external interrupt registers */ 70 | 71 | ADC : origin = 0x007100, length = 0x000080 /* ADC registers */ 72 | 73 | I2CA : origin = 0x007900, length = 0x000040 /* I2C-A registers */ 74 | 75 | CSM_PWL : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASHA. CSM password locations. */ 76 | 77 | PARTID : origin = 0x3D7FFF, length = 0x000001 /* Part ID register location */ 78 | } 79 | 80 | 81 | SECTIONS 82 | { 83 | 84 | /*** PIE Vect Table and Boot ROM Variables Structures ***/ 85 | UNION run = PIE_VECT, PAGE = 1 86 | { 87 | PieVectTableFile 88 | GROUP 89 | { 90 | EmuKeyVar 91 | EmuBModeVar 92 | FlashCallbackVar 93 | FlashScalingVar 94 | } 95 | } 96 | 97 | /*** Peripheral Frame 0 Register Structures ***/ 98 | DevEmuRegsFile : > DEV_EMU, PAGE = 1 99 | SysPwrCtrlRegsFile: > SYS_PWR_CTL, PAGE = 1 100 | FlashRegsFile : > FLASH_REGS, PAGE = 1 101 | CsmRegsFile : > CSM, PAGE = 1 102 | AdcResultFile : > ADC_RESULT, PAGE = 1 103 | CpuTimer0RegsFile : > CPU_TIMER0, PAGE = 1 104 | CpuTimer1RegsFile : > CPU_TIMER1, PAGE = 1 105 | CpuTimer2RegsFile : > CPU_TIMER2, PAGE = 1 106 | PieCtrlRegsFile : > PIE_CTRL, PAGE = 1 107 | 108 | /*** Peripheral Frame 1 Register Structures ***/ 109 | ECap1RegsFile : > ECAP1 PAGE = 1 110 | GpioCtrlRegsFile : > GPIOCTRL PAGE = 1 111 | GpioDataRegsFile : > GPIODAT PAGE = 1 112 | GpioIntRegsFile : > GPIOINT PAGE = 1 113 | 114 | /*** Peripheral Frame 2 Register Structures ***/ 115 | SysCtrlRegsFile : > SYSTEM, PAGE = 1 116 | SpiaRegsFile : > SPIA, PAGE = 1 117 | SciaRegsFile : > SCIA, PAGE = 1 118 | NmiIntruptRegsFile: > NMIINTRUPT, PAGE = 1 119 | XIntruptRegsFile : > XINTRUPT, PAGE = 1 120 | AdcRegsFile : > ADC, PAGE = 1 121 | I2caRegsFile : > I2CA, PAGE = 1 122 | 123 | /*** Peripheral Frame 3 Register Structures ***/ 124 | Comp1RegsFile : > COMP1, PAGE = 1 125 | Comp2RegsFile : > COMP2, PAGE = 1 126 | EPwm1RegsFile : > EPWM1 PAGE = 1 127 | EPwm2RegsFile : > EPWM2 PAGE = 1 128 | EPwm3RegsFile : > EPWM3 PAGE = 1 129 | EPwm4RegsFile : > EPWM4 PAGE = 1 130 | 131 | 132 | /*** Code Security Module Register Structures ***/ 133 | CsmPwlFile : > CSM_PWL, PAGE = 1 134 | 135 | /*** Device Part ID Register Structures ***/ 136 | PartIdRegsFile : > PARTID, PAGE = 1 137 | 138 | } 139 | 140 | /* 141 | //=========================================================================== 142 | // End of file. 143 | //=========================================================================== 144 | */ 145 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | //#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 0 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | 32 | // Set the following definitions to 1 to include the API function, or zero 33 | // to exclude the API function. 34 | 35 | #define INCLUDE_vTaskPrioritySet 0 36 | #define INCLUDE_uxTaskPriorityGet 0 37 | #define INCLUDE_vTaskDelete 0 38 | #define INCLUDE_vTaskCleanUpResources 0 39 | #define INCLUDE_vTaskSuspend 0 40 | #define INCLUDE_vTaskDelayUntil 0 41 | #define INCLUDE_vTaskDelay 1 42 | 43 | #endif /* FREERTOS_CONFIG_H */ 44 | 45 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/blinky.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "DSP28x_Project.h" // Device Headerfile and Examples Include File 4 | #include "FreeRTOS.h" 5 | #include "task.h" 6 | #include "semphr.h" 7 | 8 | #define STACK_SIZE 128U 9 | 10 | static StaticTask_t redTaskBuffer; 11 | static StackType_t redTaskStack[STACK_SIZE]; 12 | 13 | static StaticTask_t blueTaskBuffer; 14 | static StackType_t blueTaskStack[STACK_SIZE]; 15 | 16 | static StaticTask_t idleTaskBuffer; 17 | static StackType_t idleTaskStack[STACK_SIZE]; 18 | 19 | static SemaphoreHandle_t xSemaphore = NULL; 20 | static StaticSemaphore_t xSemaphoreBuffer; 21 | 22 | //------------------------------------------------------------------------------------------------- 23 | void vApplicationSetupTimerInterrupt( void ) 24 | { 25 | // Start the timer than activate timer interrupt to switch into first task. 26 | EALLOW; 27 | PieVectTable.TINT2 = &portTICK_ISR; 28 | EDIS; 29 | 30 | ConfigCpuTimer(&CpuTimer2, 31 | configCPU_CLOCK_HZ / 1000000, // CPU clock in MHz 32 | 1000000 / configTICK_RATE_HZ); // Timer period in uS 33 | CpuTimer2Regs.TCR.all = 0x4000; // Enable interrupt and start timer 34 | IER |= M_INT14; 35 | } 36 | 37 | //------------------------------------------------------------------------------------------------- 38 | static void blueLedToggle(void) 39 | { 40 | static uint32_t counter = 0; 41 | 42 | counter++; 43 | if(counter & 1) 44 | { 45 | GpioDataRegs.GPACLEAR.bit.GPIO1 = 1; 46 | } 47 | else 48 | { 49 | GpioDataRegs.GPASET.bit.GPIO1 = 1; 50 | } 51 | } 52 | 53 | //------------------------------------------------------------------------------------------------- 54 | static void redLedToggle(void) 55 | { 56 | static uint32_t counter = 0; 57 | 58 | counter++; 59 | if(counter & 1) 60 | { 61 | GpioDataRegs.GPACLEAR.bit.GPIO2 = 1; 62 | } 63 | else 64 | { 65 | GpioDataRegs.GPASET.bit.GPIO2 = 1; 66 | } 67 | } 68 | 69 | //------------------------------------------------------------------------------------------------- 70 | interrupt void timer1_ISR( void ) 71 | { 72 | BaseType_t xHigherPriorityTaskWoken = pdFALSE; 73 | 74 | xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken ); 75 | portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); 76 | } 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | static void setupTimer1( void ) 80 | { 81 | // Start the timer than activate timer interrupt to switch into first task. 82 | EALLOW; 83 | PieVectTable.TINT1 = &timer1_ISR; 84 | EDIS; 85 | 86 | ConfigCpuTimer(&CpuTimer1, 87 | configCPU_CLOCK_HZ / 1000000, // CPU clock in MHz 88 | 100000); // Timer period in uS 89 | CpuTimer1Regs.TCR.all = 0x4000; // Enable interrupt and start timer 90 | 91 | IER |= M_INT13; 92 | } 93 | 94 | //------------------------------------------------------------------------------------------------- 95 | void LED_TaskRed(void * pvParameters) 96 | { 97 | for(;;) 98 | { 99 | if(xSemaphoreTake( xSemaphore, portMAX_DELAY ) == pdTRUE) 100 | { 101 | blueLedToggle(); 102 | } 103 | } 104 | } 105 | 106 | //------------------------------------------------------------------------------------------------- 107 | void LED_TaskBlue(void * pvParameters) 108 | { 109 | for(;;) 110 | { 111 | redLedToggle(); 112 | vTaskDelay(500 / portTICK_PERIOD_MS); 113 | } 114 | } 115 | 116 | //------------------------------------------------------------------------------------------------- 117 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 118 | { 119 | *ppxIdleTaskTCBBuffer = &idleTaskBuffer; 120 | *ppxIdleTaskStackBuffer = idleTaskStack; 121 | *pulIdleTaskStackSize = STACK_SIZE; 122 | } 123 | 124 | //------------------------------------------------------------------------------------------------- 125 | void main(void) 126 | { 127 | // Step 1. Initialize System Control: 128 | // PLL, WatchDog, enable Peripheral Clocks 129 | // This example function is found in the F2837xS_SysCtrl.c file. 130 | InitSysCtrl(); 131 | 132 | // Step 2. Initialize GPIO: 133 | // This example function is found in the F2837xS_Gpio.c file and 134 | // illustrates how to set the GPIO to it's default state. 135 | InitCpuTimers(); 136 | InitGpio(); 137 | 138 | EALLOW; 139 | GpioCtrlRegs.GPADIR.bit.GPIO1 = 1; 140 | GpioCtrlRegs.GPADIR.bit.GPIO2 = 1; 141 | GpioCtrlRegs.GPADIR.bit.GPIO3 = 1; 142 | GpioCtrlRegs.GPADIR.bit.GPIO4 = 1; 143 | GpioCtrlRegs.GPADIR.bit.GPIO5 = 1; 144 | GpioCtrlRegs.GPADIR.bit.GPIO23 = 1; 145 | GpioDataRegs.GPACLEAR.bit.GPIO1 = 1; 146 | GpioDataRegs.GPACLEAR.bit.GPIO2 = 1; 147 | GpioDataRegs.GPACLEAR.bit.GPIO3 = 1; 148 | GpioDataRegs.GPACLEAR.bit.GPIO4 = 1; 149 | GpioDataRegs.GPACLEAR.bit.GPIO5 = 1; 150 | GpioDataRegs.GPACLEAR.bit.GPIO23 = 1; 151 | EDIS; 152 | 153 | // Step 3. Clear all interrupts and initialize PIE vector table: 154 | // Disable CPU interrupts 155 | DINT; 156 | 157 | // Initialize the PIE control registers to their default state. 158 | // The default state is all PIE interrupts disabled and flags 159 | // are cleared. 160 | // This function is found in the F2837xS_PieCtrl.c file. 161 | InitPieCtrl(); 162 | 163 | // Disable CPU interrupts and clear all CPU interrupt flags: 164 | IER = 0x0000; 165 | IFR = 0x0000; 166 | 167 | InitPieVectTable(); 168 | 169 | // Initialize the PIE vector table with pointers to the shell Interrupt 170 | // Service Routines (ISR). 171 | // This will populate the entire table, even if the interrupt 172 | // is not used in this example. This is useful for debug purposes. 173 | // The shell ISR routines are found in F2837xS_DefaultIsr.c. 174 | // This function is found in F2837xS_PieVect.c. 175 | InitPieVectTable(); 176 | 177 | // Enable global Interrupts and higher priority real-time debug events: 178 | EINT; // Enable Global interrupt INTM 179 | ERTM; // Enable Global realtime interrupt DBGM 180 | 181 | setupTimer1(); 182 | 183 | xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer ); 184 | 185 | // Create the task without using any dynamic memory allocation. 186 | xTaskCreateStatic(LED_TaskRed, // Function that implements the task. 187 | "Red LED task", // Text name for the task. 188 | STACK_SIZE, // Number of indexes in the xStack array. 189 | ( void * ) 1, // Parameter passed into the task. 190 | tskIDLE_PRIORITY + 2, // Priority at which the task is created. 191 | redTaskStack, // Array to use as the task's stack. 192 | &redTaskBuffer ); // Variable to hold the task's data structure. 193 | 194 | xTaskCreateStatic(LED_TaskBlue, // Function that implements the task. 195 | "Blue LED task", // Text name for the task. 196 | STACK_SIZE, // Number of indexes in the xStack array. 197 | ( void * ) 2, // Parameter passed into the task. 198 | tskIDLE_PRIORITY + 1, // Priority at which the task is created. 199 | blueTaskStack, // Array to use as the task's stack. 200 | &blueTaskBuffer ); // Variable to hold the task's data structure. 201 | 202 | vTaskStartScheduler(); 203 | } 204 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/readme.txt: -------------------------------------------------------------------------------- 1 | Author: rosalesr (rosales.r@gmail.com) 2 | Date: 2016/11/20 3 | 4 | Description: blinky_f28027 is an example project utilizing IvanZuy's FreeRTOS port to the 5 | TMS320F2x processors. This example is compatible with the F28027 Piccolo MCU 6 | on the C2000 Launchpad. 7 | 8 | Just took the blinky_f28034 from IvanZuy and changed out the library paths to 9 | point to the appropriate F28027 headers included in the TI ControlSuite library. 10 | 11 | Loads the blink LED example into the F28027 flash memory so you have to make sure 12 | the launchpad is setup to boot from flash: 13 | 14 | Dipswitch S1.1 - high 15 | Dipswitch S1.2 - high 16 | Dipswitch S1.3 - high (JTAG_TRST routed to F28027 TRST pin for debugger support) 17 | 18 | Tested on the following hardware: 19 | TI ControlSuite v3.4.3 (November 07, 2016) 20 | C2000 Launchpad 21 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/targetConfigs/TMS320F28027.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/targetConfigs/TMS320F28034.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28027/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.launches/blinky_f28034.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | blinky_f28034 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 | DSP2803x_CodeStartBranch.asm 30 | 1 31 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_CodeStartBranch.asm 32 | 33 | 34 | DSP2803x_CpuTimers.c 35 | 1 36 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_CpuTimers.c 37 | 38 | 39 | DSP2803x_DefaultIsr.c 40 | 1 41 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_DefaultIsr.c 42 | 43 | 44 | DSP2803x_GlobalVariableDefs.c 45 | 1 46 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_headers/source/DSP2803x_GlobalVariableDefs.c 47 | 48 | 49 | DSP2803x_Gpio.c 50 | 1 51 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_Gpio.c 52 | 53 | 54 | DSP2803x_PieCtrl.c 55 | 1 56 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_PieCtrl.c 57 | 58 | 59 | DSP2803x_PieVect.c 60 | 1 61 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_PieVect.c 62 | 63 | 64 | DSP2803x_SysCtrl.c 65 | 1 66 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_SysCtrl.c 67 | 68 | 69 | DSP2803x_usDelay.asm 70 | 1 71 | TI_PRODUCTS_DIR/controlSUITE/device_support/f2803x/v130/DSP2803x_common/source/DSP2803x_usDelay.asm 72 | 73 | 74 | FreeRTOS 75 | 2 76 | virtual:/virtual 77 | 78 | 79 | FreeRTOS/list.c 80 | 1 81 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 82 | 83 | 84 | FreeRTOS/port 85 | 2 86 | virtual:/virtual 87 | 88 | 89 | FreeRTOS/queue.c 90 | 1 91 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 92 | 93 | 94 | FreeRTOS/tasks.c 95 | 1 96 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 97 | 98 | 99 | FreeRTOS/port/porASM.asm 100 | 1 101 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 102 | 103 | 104 | FreeRTOS/port/port.c 105 | 1 106 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 107 | 108 | 109 | FreeRTOS/port/portmacro.h 110 | 1 111 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/project/com.ti.ccstudio.buildDefinitions.C2000.Debug.1768483994/append=true 3 | environment/project/com.ti.ccstudio.buildDefinitions.C2000.Debug.1768483994/appendContributed=true 4 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/.settings/org.eclipse.cdt.debug.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker 3 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/28034_RAM_lnk.cmd: -------------------------------------------------------------------------------- 1 | /* 2 | // TI File $Revision: /main/2 $ 3 | // Checkin $Date: February 20, 2009 15:33:59 $ 4 | //########################################################################### 5 | // 6 | // FILE: 28034_RAM_lnk.cmd 7 | // 8 | // TITLE: Linker Command File For 28034 examples that run out of RAM 9 | // 10 | // This ONLY includes all SARAM blocks on the 28034 device. 11 | // This does not include flash or OTP. 12 | // 13 | // Keep in mind that L0,L1,L2, and L3 are protected by the code 14 | // security module. 15 | // 16 | // What this means is in most cases you will want to move to 17 | // another memory map file which has more memory defined. 18 | // 19 | //########################################################################### 20 | // $TI Release: 2803x Internal Release 2 $ 21 | // $Release Date: November 11, 2008 $ 22 | //########################################################################### 23 | */ 24 | 25 | /* ====================================================== 26 | // For Code Composer Studio V2.2 and later 27 | // --------------------------------------- 28 | // In addition to this memory linker command file, 29 | // add the header linker command file directly to the project. 30 | // The header linker command file is required to link the 31 | // peripheral structures to the proper locations within 32 | // the memory map. 33 | // 34 | // The header linker files are found in \DSP2803x_headers\cmd 35 | // 36 | // For BIOS applications add: DSP2803x_Headers_BIOS.cmd 37 | // For nonBIOS applications add: DSP2803x_Headers_nonBIOS.cmd 38 | ========================================================= */ 39 | 40 | /* ====================================================== 41 | // For Code Composer Studio prior to V2.2 42 | // -------------------------------------- 43 | // 1) Use one of the following -l statements to include the 44 | // header linker command file in the project. The header linker 45 | // file is required to link the peripheral structures to the proper 46 | // locations within the memory map */ 47 | 48 | /* Uncomment this line to include file only for non-BIOS applications */ 49 | /* -l DSP2803x_Headers_nonBIOS.cmd */ 50 | 51 | /* Uncomment this line to include file only for BIOS applications */ 52 | /* -l DSP2803x_Headers_BIOS.cmd */ 53 | 54 | /* 2) In your project add the path to \DSP2803x_headers\cmd to the 55 | library search path under project->build options, linker tab, 56 | library search path (-i). 57 | /*========================================================= */ 58 | 59 | /* Define the memory block start/length for the DSP2803x 60 | PAGE 0 will be used to organize program sections 61 | PAGE 1 will be used to organize data sections 62 | 63 | Notes: 64 | Memory blocks on F28034 are uniform (ie same 65 | physical memory) in both PAGE 0 and PAGE 1. 66 | That is the same memory region should not be 67 | defined for both PAGE 0 and PAGE 1. 68 | Doing so will result in corruption of program 69 | and/or data. 70 | 71 | L0 block is mirrored - that is it 72 | can be accessed in high memory or low memory. 73 | For simplicity only one instance is used in this 74 | linker file. 75 | 76 | Contiguous SARAM memory blocks can be combined 77 | if required to create a larger memory block. 78 | */ 79 | 80 | MEMORY 81 | { 82 | PAGE 0 : 83 | /* BEGIN is used for the "boot to SARAM" bootloader mode */ 84 | 85 | BEGIN : origin = 0x000000, length = 0x000002 86 | RAMM0 : origin = 0x000050, length = 0x0003B0 87 | RAML0L1 : origin = 0x008000, length = 0x000C00 88 | RESET : origin = 0x3FFFC0, length = 0x000002 89 | IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */ 90 | IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */ 91 | IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */ 92 | 93 | BOOTROM : origin = 0x3FF27C, length = 0x000D44 94 | 95 | 96 | PAGE 1 : 97 | 98 | BOOT_RSVD : origin = 0x000002, length = 0x00004E /* Part of M0, BOOT rom will use this for stack */ 99 | RAMM1 : origin = 0x000480, length = 0x000380 /* on-chip RAM block M1 */ 100 | RAML2 : origin = 0x008C00, length = 0x000400 101 | RAML3 : origin = 0x009000, length = 0x001000 102 | } 103 | 104 | 105 | SECTIONS 106 | { 107 | /* Setup for "boot to SARAM" mode: 108 | The codestart section (found in DSP28_CodeStartBranch.asm) 109 | re-directs execution to the start of user code. */ 110 | codestart : > BEGIN, PAGE = 0 111 | ramfuncs : > RAMM0 PAGE = 0 112 | .text : > RAML3, PAGE = 1 113 | .cinit : > RAMM0, PAGE = 0 114 | .pinit : > RAMM0, PAGE = 0 115 | .switch : > RAMM0, PAGE = 0 116 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 117 | 118 | .stack : > RAMM1, PAGE = 1 119 | .ebss : > RAML2, PAGE = 1 120 | .econst : > RAML2 | RAML3 | RAMM1, PAGE = 1 121 | .esysmem : > RAML2, PAGE = 1 122 | 123 | IQmath : > RAML0L1, PAGE = 0 124 | IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD 125 | 126 | /* Uncomment the section below if calling the IQNexp() or IQexp() 127 | functions from the IQMath.lib library in order to utilize the 128 | relevant IQ Math table in Boot ROM (This saves space and Boot ROM 129 | is 1 wait-state). If this section is not uncommented, IQmathTables2 130 | will be loaded into other memory (SARAM, Flash, etc.) and will take 131 | up space, but 0 wait-state is possible. 132 | */ 133 | /* 134 | IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD 135 | { 136 | 137 | IQmath.lib (IQmathTablesRam) 138 | 139 | } 140 | */ 141 | /* Uncomment the section below if calling the IQNasin() or IQasin() 142 | functions from the IQMath.lib library in order to utilize the 143 | relevant IQ Math table in Boot ROM (This saves space and Boot ROM 144 | is 1 wait-state). If this section is not uncommented, IQmathTables2 145 | will be loaded into other memory (SARAM, Flash, etc.) and will take 146 | up space, but 0 wait-state is possible. 147 | */ 148 | /* 149 | IQmathTables3 : > IQTABLES3, PAGE = 0, TYPE = NOLOAD 150 | { 151 | 152 | IQmath.lib (IQmathTablesRam) 153 | 154 | } 155 | */ 156 | 157 | } 158 | 159 | /* 160 | //=========================================================================== 161 | // End of file. 162 | //=========================================================================== 163 | */ 164 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | //#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 0 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | 32 | // Set the following definitions to 1 to include the API function, or zero 33 | // to exclude the API function. 34 | 35 | #define INCLUDE_vTaskPrioritySet 0 36 | #define INCLUDE_uxTaskPriorityGet 0 37 | #define INCLUDE_vTaskDelete 0 38 | #define INCLUDE_vTaskCleanUpResources 0 39 | #define INCLUDE_vTaskSuspend 0 40 | #define INCLUDE_vTaskDelayUntil 0 41 | #define INCLUDE_vTaskDelay 1 42 | 43 | #endif /* FREERTOS_CONFIG_H */ 44 | 45 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/blinky.c: -------------------------------------------------------------------------------- 1 | #include "DSP28x_Project.h" // Device Headerfile and Examples Include File 2 | #include "FreeRTOS.h" 3 | #include "task.h" 4 | #include "semphr.h" 5 | 6 | #define STACK_SIZE 128U 7 | 8 | static StaticTask_t redTaskBuffer; 9 | static StackType_t redTaskStack[STACK_SIZE]; 10 | 11 | static StaticTask_t blueTaskBuffer; 12 | static StackType_t blueTaskStack[STACK_SIZE]; 13 | 14 | static StaticTask_t idleTaskBuffer; 15 | static StackType_t idleTaskStack[STACK_SIZE]; 16 | 17 | static SemaphoreHandle_t xSemaphore = NULL; 18 | static StaticSemaphore_t xSemaphoreBuffer; 19 | 20 | //------------------------------------------------------------------------------------------------- 21 | void vApplicationSetupTimerInterrupt( void ) 22 | { 23 | // Start the timer than activate timer interrupt to switch into first task. 24 | EALLOW; 25 | PieVectTable.TINT2 = &portTICK_ISR; 26 | EDIS; 27 | 28 | ConfigCpuTimer(&CpuTimer2, 29 | configCPU_CLOCK_HZ / 1000000, // CPU clock in MHz 30 | 1000000 / configTICK_RATE_HZ); // Timer period in uS 31 | CpuTimer2Regs.TCR.all = 0x4000; // Enable interrupt and start timer 32 | IER |= M_INT14; 33 | } 34 | 35 | //------------------------------------------------------------------------------------------------- 36 | static void blueLedToggle(void) 37 | { 38 | static uint32_t counter = 0; 39 | 40 | counter++; 41 | if(counter & 1) 42 | { 43 | GpioDataRegs.GPACLEAR.bit.GPIO1 = 1; 44 | } 45 | else 46 | { 47 | GpioDataRegs.GPASET.bit.GPIO1 = 1; 48 | } 49 | } 50 | 51 | //------------------------------------------------------------------------------------------------- 52 | static void redLedToggle(void) 53 | { 54 | static uint32_t counter = 0; 55 | 56 | counter++; 57 | if(counter & 1) 58 | { 59 | GpioDataRegs.GPACLEAR.bit.GPIO2 = 1; 60 | } 61 | else 62 | { 63 | GpioDataRegs.GPASET.bit.GPIO2 = 1; 64 | } 65 | } 66 | 67 | //------------------------------------------------------------------------------------------------- 68 | interrupt void timer1_ISR( void ) 69 | { 70 | BaseType_t xHigherPriorityTaskWoken = pdFALSE; 71 | 72 | xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken ); 73 | portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); 74 | } 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | static void setupTimer1( void ) 78 | { 79 | // Start the timer than activate timer interrupt to switch into first task. 80 | EALLOW; 81 | PieVectTable.TINT1 = &timer1_ISR; 82 | EDIS; 83 | 84 | ConfigCpuTimer(&CpuTimer1, 85 | configCPU_CLOCK_HZ / 1000000, // CPU clock in MHz 86 | 100000); // Timer period in uS 87 | CpuTimer1Regs.TCR.all = 0x4000; // Enable interrupt and start timer 88 | 89 | IER |= M_INT13; 90 | } 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | void LED_TaskRed(void * pvParameters) 94 | { 95 | for(;;) 96 | { 97 | if(xSemaphoreTake( xSemaphore, portMAX_DELAY ) == pdTRUE) 98 | { 99 | blueLedToggle(); 100 | } 101 | } 102 | } 103 | 104 | //------------------------------------------------------------------------------------------------- 105 | void LED_TaskBlue(void * pvParameters) 106 | { 107 | for(;;) 108 | { 109 | redLedToggle(); 110 | vTaskDelay(500 / portTICK_PERIOD_MS); 111 | } 112 | } 113 | 114 | //------------------------------------------------------------------------------------------------- 115 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 116 | { 117 | *ppxIdleTaskTCBBuffer = &idleTaskBuffer; 118 | *ppxIdleTaskStackBuffer = idleTaskStack; 119 | *pulIdleTaskStackSize = STACK_SIZE; 120 | } 121 | 122 | //------------------------------------------------------------------------------------------------- 123 | void main(void) 124 | { 125 | // Step 1. Initialize System Control: 126 | // PLL, WatchDog, enable Peripheral Clocks 127 | // This example function is found in the F2837xS_SysCtrl.c file. 128 | InitSysCtrl(); 129 | 130 | // Step 2. Initialize GPIO: 131 | // This example function is found in the F2837xS_Gpio.c file and 132 | // illustrates how to set the GPIO to it's default state. 133 | InitCpuTimers(); 134 | InitGpio(); 135 | 136 | EALLOW; 137 | GpioCtrlRegs.GPADIR.bit.GPIO1 = 1; 138 | GpioCtrlRegs.GPADIR.bit.GPIO2 = 1; 139 | GpioCtrlRegs.GPADIR.bit.GPIO3 = 1; 140 | GpioCtrlRegs.GPADIR.bit.GPIO4 = 1; 141 | GpioCtrlRegs.GPADIR.bit.GPIO5 = 1; 142 | GpioCtrlRegs.GPADIR.bit.GPIO23 = 1; 143 | GpioDataRegs.GPACLEAR.bit.GPIO1 = 1; 144 | GpioDataRegs.GPACLEAR.bit.GPIO2 = 1; 145 | GpioDataRegs.GPACLEAR.bit.GPIO3 = 1; 146 | GpioDataRegs.GPACLEAR.bit.GPIO4 = 1; 147 | GpioDataRegs.GPACLEAR.bit.GPIO5 = 1; 148 | GpioDataRegs.GPACLEAR.bit.GPIO23 = 1; 149 | EDIS; 150 | 151 | // Step 3. Clear all interrupts and initialize PIE vector table: 152 | // Disable CPU interrupts 153 | DINT; 154 | 155 | // Initialize the PIE control registers to their default state. 156 | // The default state is all PIE interrupts disabled and flags 157 | // are cleared. 158 | // This function is found in the F2837xS_PieCtrl.c file. 159 | InitPieCtrl(); 160 | 161 | // Disable CPU interrupts and clear all CPU interrupt flags: 162 | IER = 0x0000; 163 | IFR = 0x0000; 164 | 165 | InitPieVectTable(); 166 | 167 | // Initialize the PIE vector table with pointers to the shell Interrupt 168 | // Service Routines (ISR). 169 | // This will populate the entire table, even if the interrupt 170 | // is not used in this example. This is useful for debug purposes. 171 | // The shell ISR routines are found in F2837xS_DefaultIsr.c. 172 | // This function is found in F2837xS_PieVect.c. 173 | InitPieVectTable(); 174 | 175 | // Enable global Interrupts and higher priority real-time debug events: 176 | EINT; // Enable Global interrupt INTM 177 | ERTM; // Enable Global realtime interrupt DBGM 178 | 179 | setupTimer1(); 180 | 181 | xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer ); 182 | 183 | // Create the task without using any dynamic memory allocation. 184 | xTaskCreateStatic(LED_TaskRed, // Function that implements the task. 185 | "Red LED task", // Text name for the task. 186 | STACK_SIZE, // Number of indexes in the xStack array. 187 | ( void * ) 1, // Parameter passed into the task. 188 | tskIDLE_PRIORITY + 2, // Priority at which the task is created. 189 | redTaskStack, // Array to use as the task's stack. 190 | &redTaskBuffer ); // Variable to hold the task's data structure. 191 | 192 | xTaskCreateStatic(LED_TaskBlue, // Function that implements the task. 193 | "Blue LED task", // Text name for the task. 194 | STACK_SIZE, // Number of indexes in the xStack array. 195 | ( void * ) 2, // Parameter passed into the task. 196 | tskIDLE_PRIORITY + 1, // Priority at which the task is created. 197 | blueTaskStack, // Array to use as the task's stack. 198 | &blueTaskBuffer ); // Variable to hold the task's data structure. 199 | 200 | vTaskStartScheduler(); 201 | } 202 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/targetConfigs/TMS320F28034.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28034/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | blinky_f28069 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 | F2806x_CpuTimers.c 30 | 1 31 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_CpuTimers.c 32 | 33 | 34 | F2806x_DefaultIsr.c 35 | 1 36 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_DefaultIsr.c 37 | 38 | 39 | F2806x_GlobalVariableDefs.c 40 | 1 41 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_headers/source/F2806x_GlobalVariableDefs.c 42 | 43 | 44 | F2806x_Gpio.c 45 | 1 46 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_Gpio.c 47 | 48 | 49 | F2806x_PieCtrl.c 50 | 1 51 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_PieCtrl.c 52 | 53 | 54 | F2806x_PieVect.c 55 | 1 56 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_PieVect.c 57 | 58 | 59 | F2806x_SysCtrl.c 60 | 1 61 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_SysCtrl.c 62 | 63 | 64 | F2806x_usDelay.asm 65 | 1 66 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/f2806x/v151/F2806x_common/source/F2806x_usDelay.asm 67 | 68 | 69 | FreeRTOS 70 | 2 71 | virtual:/virtual 72 | 73 | 74 | FreeRTOS/list.c 75 | 1 76 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 77 | 78 | 79 | FreeRTOS/port 80 | 2 81 | virtual:/virtual 82 | 83 | 84 | FreeRTOS/queue.c 85 | 1 86 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 87 | 88 | 89 | FreeRTOS/tasks.c 90 | 1 91 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 92 | 93 | 94 | FreeRTOS/port/porASM.asm 95 | 1 96 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 97 | 98 | 99 | FreeRTOS/port/port.c 100 | 1 101 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 102 | 103 | 104 | FreeRTOS/port/portmacro.h 105 | 1 106 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/28069_RAM_lnk.cmd: -------------------------------------------------------------------------------- 1 | /* 2 | // TI File $Revision: /main/3 $ 3 | // Checkin $Date: March 3, 2011 13:45:43 $ 4 | //########################################################################### 5 | // 6 | // FILE: 28069_RAM_lnk.cmd 7 | // 8 | // TITLE: Linker Command File For F28069 examples that run out of RAM 9 | // 10 | // This ONLY includes all SARAM blocks on the F28069 device. 11 | // This does not include flash or OTP. 12 | // 13 | // Keep in mind that L0,L1,L2,L3 and L4 are protected by the code 14 | // security module. 15 | // 16 | // What this means is in most cases you will want to move to 17 | // another memory map file which has more memory defined. 18 | // 19 | //########################################################################### 20 | // $TI Release: $ 21 | // $Release Date: $ 22 | //########################################################################### 23 | */ 24 | 25 | /* ====================================================== 26 | // For Code Composer Studio V2.2 and later 27 | // --------------------------------------- 28 | // In addition to this memory linker command file, 29 | // add the header linker command file directly to the project. 30 | // The header linker command file is required to link the 31 | // peripheral structures to the proper locations within 32 | // the memory map. 33 | // 34 | // The header linker files are found in \F2806x_headers\cmd 35 | // 36 | // For BIOS applications add: F2806x_Headers_BIOS.cmd 37 | // For nonBIOS applications add: F2806x_Headers_nonBIOS.cmd 38 | ========================================================= */ 39 | 40 | /* ====================================================== 41 | // For Code Composer Studio prior to V2.2 42 | // -------------------------------------- 43 | // 1) Use one of the following -l statements to include the 44 | // header linker command file in the project. The header linker 45 | // file is required to link the peripheral structures to the proper 46 | // locations within the memory map */ 47 | 48 | /* Uncomment this line to include file only for non-BIOS applications */ 49 | /* -l F2806x_Headers_nonBIOS.cmd */ 50 | 51 | /* Uncomment this line to include file only for BIOS applications */ 52 | /* -l F2806x_Headers_BIOS.cmd */ 53 | 54 | /* 2) In your project add the path to \F2806x_headers\cmd to the 55 | library search path under project->build options, linker tab, 56 | library search path (-i). 57 | /*========================================================= */ 58 | 59 | /* Define the memory block start/length for the F2806x 60 | PAGE 0 will be used to organize program sections 61 | PAGE 1 will be used to organize data sections 62 | 63 | Notes: 64 | Memory blocks on F28069 are uniform (ie same 65 | physical memory) in both PAGE 0 and PAGE 1. 66 | That is the same memory region should not be 67 | defined for both PAGE 0 and PAGE 1. 68 | Doing so will result in corruption of program 69 | and/or data. 70 | 71 | Contiguous SARAM memory blocks can be combined 72 | if required to create a larger memory block. 73 | */ 74 | 75 | MEMORY 76 | { 77 | PAGE 0 : 78 | /* BEGIN is used for the "boot to SARAM" bootloader mode */ 79 | 80 | BEGIN : origin = 0x000000, length = 0x000002 81 | RAMM0 : origin = 0x000050, length = 0x0003B0 82 | RAML0_L3 : origin = 0x008000, length = 0x002000 /* RAML0-3 combined for size of .text */ 83 | /* in Example_F2806xSWPrioritezedInterrupts */ 84 | RESET : origin = 0x3FFFC0, length = 0x000002 85 | FPUTABLES : origin = 0x3FD860, length = 0x0006A0 /* FPU Tables in Boot ROM */ 86 | IQTABLES : origin = 0x3FDF00, length = 0x000B50 /* IQ Math Tables in Boot ROM */ 87 | IQTABLES2 : origin = 0x3FEA50, length = 0x00008C /* IQ Math Tables in Boot ROM */ 88 | IQTABLES3 : origin = 0x3FEADC, length = 0x0000AA /* IQ Math Tables in Boot ROM */ 89 | 90 | BOOTROM : origin = 0x3FF3B0, length = 0x000C10 91 | 92 | 93 | PAGE 1 : 94 | 95 | BOOT_RSVD : origin = 0x000002, length = 0x00004E /* Part of M0, BOOT rom will use this for stack */ 96 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 97 | RAML4 : origin = 0x00A000, length = 0x002000 /* on-chip RAM block L4 */ 98 | RAML5 : origin = 0x00C000, length = 0x002000 /* on-chip RAM block L5 */ 99 | RAML6 : origin = 0x00E000, length = 0x002000 /* on-chip RAM block L6 */ 100 | RAML7 : origin = 0x010000, length = 0x002000 /* on-chip RAM block L7 */ 101 | RAML8 : origin = 0x012000, length = 0x002000 /* on-chip RAM block L8 */ 102 | USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */ 103 | } 104 | 105 | 106 | SECTIONS 107 | { 108 | /* Setup for "boot to SARAM" mode: 109 | The codestart section (found in DSP28_CodeStartBranch.asm) 110 | re-directs execution to the start of user code. */ 111 | codestart : > BEGIN, PAGE = 0 112 | ramfuncs : > RAMM0, PAGE = 0 113 | .text : > RAML0_L3, PAGE = 0 114 | .cinit : > RAMM0, PAGE = 0 115 | .pinit : > RAMM0, PAGE = 0 116 | .switch : > RAMM0, PAGE = 0 117 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 118 | 119 | .stack : > RAMM1, PAGE = 1 120 | .ebss : > RAML4, PAGE = 1 121 | .econst : > RAML4, PAGE = 1 122 | .esysmem : > RAML4, PAGE = 1 123 | 124 | IQmath : > RAML0_L3, PAGE = 0 125 | IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD 126 | 127 | /* Allocate FPU math areas: */ 128 | FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD 129 | 130 | DMARAML5 : > RAML5, PAGE = 1 131 | DMARAML6 : > RAML6, PAGE = 1 132 | DMARAML7 : > RAML7, PAGE = 1 133 | DMARAML8 : > RAML8, PAGE = 1 134 | 135 | /* Uncomment the section below if calling the IQNexp() or IQexp() 136 | functions from the IQMath.lib library in order to utilize the 137 | relevant IQ Math table in Boot ROM (This saves space and Boot ROM 138 | is 1 wait-state). If this section is not uncommented, IQmathTables2 139 | will be loaded into other memory (SARAM, Flash, etc.) and will take 140 | up space, but 0 wait-state is possible. 141 | */ 142 | /* 143 | IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD 144 | { 145 | 146 | IQmath.lib (IQmathTablesRam) 147 | 148 | } 149 | */ 150 | /* Uncomment the section below if calling the IQNasin() or IQasin() 151 | functions from the IQMath.lib library in order to utilize the 152 | relevant IQ Math table in Boot ROM (This saves space and Boot ROM 153 | is 1 wait-state). If this section is not uncommented, IQmathTables2 154 | will be loaded into other memory (SARAM, Flash, etc.) and will take 155 | up space, but 0 wait-state is possible. 156 | */ 157 | /* 158 | IQmathTables3 : > IQTABLES3, PAGE = 0, TYPE = NOLOAD 159 | { 160 | 161 | IQmath.lib (IQmathTablesRam) 162 | 163 | } 164 | */ 165 | 166 | } 167 | 168 | /* 169 | //=========================================================================== 170 | // End of file. 171 | //=========================================================================== 172 | */ 173 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 90000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | 32 | // Set the following definitions to 1 to include the API function, or zero 33 | // to exclude the API function. 34 | 35 | #define INCLUDE_vTaskPrioritySet 0 36 | #define INCLUDE_uxTaskPriorityGet 0 37 | #define INCLUDE_vTaskDelete 0 38 | #define INCLUDE_vTaskCleanUpResources 0 39 | #define INCLUDE_vTaskSuspend 0 40 | #define INCLUDE_vTaskDelayUntil 0 41 | #define INCLUDE_vTaskDelay 1 42 | 43 | #endif /* FREERTOS_CONFIG_H */ 44 | 45 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/TMS320F28069.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/targetConfigs/TMS320F28069.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28069/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.launches/blinky_f28377s.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.launches/blinky_tms320f28377s.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | blinky_f28377s 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 | F2837xS_CodeStartBranch.asm 30 | 1 31 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CodeStartBranch.asm 32 | 33 | 34 | F2837xS_CpuTimers.c 35 | 1 36 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CpuTimers.c 37 | 38 | 39 | F2837xS_DefaultISR.c 40 | 1 41 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_DefaultISR.c 42 | 43 | 44 | F2837xS_GlobalVariableDefs.c 45 | 1 46 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_headers/source/F2837xS_GlobalVariableDefs.c 47 | 48 | 49 | F2837xS_Gpio.c 50 | 1 51 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_Gpio.c 52 | 53 | 54 | F2837xS_PieCtrl.c 55 | 1 56 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieCtrl.c 57 | 58 | 59 | F2837xS_PieVect.c 60 | 1 61 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieVect.c 62 | 63 | 64 | F2837xS_SysCtrl.c 65 | 1 66 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_SysCtrl.c 67 | 68 | 69 | FreeRTOS 70 | 2 71 | virtual:/virtual 72 | 73 | 74 | FreeRTOS/list.c 75 | 1 76 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 77 | 78 | 79 | FreeRTOS/port 80 | 2 81 | virtual:/virtual 82 | 83 | 84 | FreeRTOS/queue.c 85 | 1 86 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 87 | 88 | 89 | FreeRTOS/tasks.c 90 | 1 91 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 92 | 93 | 94 | FreeRTOS/port/porASM.asm 95 | 1 96 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 97 | 98 | 99 | FreeRTOS/port/port.c 100 | 1 101 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 102 | 103 | 104 | FreeRTOS/port/portmacro.h 105 | 1 106 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 107 | 108 | 109 | 110 | 111 | copy_PARENT 112 | $%7BPARENT-2-PROJECT_LOC%7D/freertos_c28x 113 | 114 | 115 | copy_PARENT1 116 | $%7Bcopy_PARENT%7D/freertos_c28x 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/project/com.ti.ccstudio.buildDefinitions.C2000.Debug.1262401933/append=true 3 | environment/project/com.ti.ccstudio.buildDefinitions.C2000.Debug.1262401933/appendContributed=true 4 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/.settings/org.eclipse.cdt.debug.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker 3 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/2837xS_Generic_RAM_lnk.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0 : 5 | /* BEGIN is used for the "boot to SARAM" bootloader mode */ 6 | 7 | BEGIN : origin = 0x000000, length = 0x000002 8 | RAMM0 : origin = 0x000122, length = 0x0002DE 9 | RAMD0 : origin = 0x00B000, length = 0x000800 10 | RAMLS0 : origin = 0x008000, length = 0x000800 11 | RAMLS1 : origin = 0x008800, length = 0x000800 12 | RAMLS2 : origin = 0x009000, length = 0x000800 13 | RAMLS3 : origin = 0x009800, length = 0x000800 14 | RAMLS4 : origin = 0x00A000, length = 0x000800 15 | RESET : origin = 0x3FFFC0, length = 0x000002 16 | 17 | PAGE 1 : 18 | 19 | BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ 20 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 21 | RAMD1 : origin = 0x00B800, length = 0x000800 22 | 23 | 24 | RAMLS5 : origin = 0x00A800, length = 0x000800 25 | 26 | RAMGS0 : origin = 0x00C000, length = 0x001000 27 | RAMGS1 : origin = 0x00D000, length = 0x001000 28 | RAMGS2 : origin = 0x00E000, length = 0x001000 29 | RAMGS3 : origin = 0x00F000, length = 0x001000 30 | RAMGS4 : origin = 0x010000, length = 0x001000 31 | RAMGS5 : origin = 0x011000, length = 0x001000 32 | RAMGS6 : origin = 0x012000, length = 0x001000 33 | RAMGS7 : origin = 0x013000, length = 0x001000 34 | RAMGS8 : origin = 0x014000, length = 0x001000 35 | RAMGS9 : origin = 0x015000, length = 0x001000 36 | RAMGS10 : origin = 0x016000, length = 0x001000 37 | RAMGS11 : origin = 0x017000, length = 0x001000 38 | 39 | CANA_MSG_RAM : origin = 0x049000, length = 0x000800 40 | CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 41 | } 42 | 43 | 44 | SECTIONS 45 | { 46 | codestart : > BEGIN, PAGE = 0 47 | ramfuncs : > RAMM0 PAGE = 0 48 | .text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0 49 | .cinit : > RAMM0, PAGE = 0 50 | .pinit : > RAMM0, PAGE = 0 51 | .switch : > RAMM0, PAGE = 0 52 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 53 | 54 | .stack : > RAMM1, PAGE = 1 55 | .ebss : > RAMLS5, PAGE = 1 56 | .econst : > RAMLS5, PAGE = 1 57 | .esysmem : > RAMLS5, PAGE = 1 58 | 59 | ramgs0 : > RAMGS0, PAGE = 1 60 | ramgs1 : > RAMGS1, PAGE = 1 61 | 62 | #ifdef __TI_COMPILER_VERSION 63 | #if __TI_COMPILER_VERSION >= 15009000 64 | .TI.ramfunc : {} > RAMM0, PAGE = 0 65 | #endif 66 | #endif 67 | 68 | /* The following section definitions are for SDFM examples */ 69 | Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 70 | Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 71 | Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 72 | Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 73 | Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333 74 | } 75 | 76 | /* 77 | //=========================================================================== 78 | // End of file. 79 | //=========================================================================== 80 | */ 81 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 200000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | 32 | // Set the following definitions to 1 to include the API function, or zero 33 | // to exclude the API function. 34 | 35 | #define INCLUDE_vTaskPrioritySet 0 36 | #define INCLUDE_uxTaskPriorityGet 0 37 | #define INCLUDE_vTaskDelete 0 38 | #define INCLUDE_vTaskCleanUpResources 0 39 | #define INCLUDE_vTaskSuspend 0 40 | #define INCLUDE_vTaskDelayUntil 0 41 | #define INCLUDE_vTaskDelay 1 42 | 43 | #endif /* FREERTOS_CONFIG_H */ 44 | 45 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/targetConfigs/TMS320F28377S.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/blinky_tms320f28377s/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/drivers/pwm.h: -------------------------------------------------------------------------------- 1 | #ifndef __PWM_H__ 2 | #define __PWM_H__ 3 | 4 | typedef enum 5 | { 6 | PWM_FREQ_300K, 7 | PWM_FREQ_200K, 8 | } Pwm_Freq_E; 9 | 10 | void PWM_init(void); 11 | void PWM_setFrequency(Pwm_Freq_E frequency); 12 | void PWM_setPahse(float phase); 13 | 14 | #endif // __PWM_H__ 15 | -------------------------------------------------------------------------------- /examples/drivers/spi.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------------------- 2 | // Simplified SPI driver. 3 | // 4 | //------------------------------------------------------------------------------------------------- 5 | #include "spi.h" 6 | #include "semphr.h" 7 | 8 | //------------------------------------------------------------------------------------------------- 9 | #define CS_GPIO_PIN 61 10 | #define SPI_BRR(x) ((200E6 / 4) / (x)) - 1 11 | #define SPI_BRR_FAST(x) ((200E6) / (x)) - 1 12 | #define SPI_CHAR_BITS 8 13 | #define SPI_CHAR_BITS_MASK 0x00FF 14 | #define TX_FIFO_INT_LVL 2 15 | #define RX_DUMMY_VALUE 0xFFFF 16 | 17 | //------------------------------------------------------------------------------------------------- 18 | static void initPins(void) 19 | { 20 | EALLOW; 21 | 22 | // Enable internal pull-up for the selected pins 23 | GpioCtrlRegs.GPBPUD.bit.GPIO58 = 0; // Enable pull-up on GPIO58 (SPIA_MOSI) 24 | GpioCtrlRegs.GPBPUD.bit.GPIO59 = 0; // Enable pull-up on GPIO59 (SPIA_MISO) 25 | GpioCtrlRegs.GPBPUD.bit.GPIO60 = 0; // Enable pull-up on GPIO60 (SPIA_CLK) 26 | 27 | // Set qualification for selected pins to asynch only 28 | GpioCtrlRegs.GPBQSEL2.bit.GPIO58 = 3; 29 | GpioCtrlRegs.GPBQSEL2.bit.GPIO59 = 3; 30 | GpioCtrlRegs.GPBQSEL2.bit.GPIO60 = 3; 31 | GpioCtrlRegs.GPBQSEL2.bit.GPIO61 = 3; 32 | 33 | //Configure SPI-A pins using GPIO regs 34 | GpioCtrlRegs.GPBGMUX2.bit.GPIO58 = 3; 35 | GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 3; // Configure GPIO58 as SPIA_MOSI 36 | GpioCtrlRegs.GPBGMUX2.bit.GPIO59 = 3; 37 | GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 3; // Configure GPIO59 as SPIA_MISO 38 | GpioCtrlRegs.GPBGMUX2.bit.GPIO60 = 3; 39 | GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 3; // Configure GPIO60 as SPIA_CLK 40 | 41 | EDIS; 42 | 43 | GPIO_SetupPinMux(61, GPIO_MUX_CPU1, 0); 44 | GPIO_SetupPinOptions(61, GPIO_OUTPUT, GPIO_PUSHPULL); 45 | } 46 | 47 | //------------------------------------------------------------------------------------------------- 48 | static void initSpia(void) 49 | { 50 | // Set reset low before configuration changes 51 | // Clock polarity (0 == rising, 1 == falling) 52 | // 16-bit character 53 | // Enable HS mode 54 | SpiaRegs.SPICCR.bit.SPISWRESET = 0; 55 | SpiaRegs.SPICCR.bit.CLKPOLARITY = 1; 56 | SpiaRegs.SPICCR.bit.HS_MODE = 1; 57 | SpiaRegs.SPICCR.bit.SPICHAR = (SPI_CHAR_BITS-1); 58 | 59 | // Enable master (0 == slave, 1 == master) 60 | // Enable transmission (Talk) 61 | // Clock phase (0 == normal, 1 == delayed) 62 | // SPI interrupts are disabled 63 | SpiaRegs.SPICTL.bit.MASTER_SLAVE = 1; 64 | SpiaRegs.SPICTL.bit.TALK = 1; 65 | SpiaRegs.SPICTL.bit.CLK_PHASE = 0; 66 | SpiaRegs.SPICTL.bit.SPIINTENA = 0; 67 | 68 | // Initialize SPI TX_FIFO register 69 | SpiaRegs.SPIFFTX.bit.TXFFIL = TX_FIFO_INT_LVL; 70 | SpiaRegs.SPIFFTX.bit.TXFFIENA = 0; 71 | SpiaRegs.SPIFFTX.bit.TXFFINTCLR = 1; 72 | SpiaRegs.SPIFFTX.bit.TXFIFO = 1; 73 | SpiaRegs.SPIFFTX.bit.SPIFFENA = 1; 74 | SpiaRegs.SPIFFTX.bit.SPIRST = 1; 75 | 76 | // Initialize SPI RX_FIFO register 77 | SpiaRegs.SPIFFRX.bit.RXFFIL = 0x10; 78 | SpiaRegs.SPIFFRX.bit.RXFFIENA = 0; 79 | SpiaRegs.SPIFFRX.bit.RXFFINTCLR = 1; 80 | SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1; 81 | 82 | // Initialize SPI CT_FIFO register 83 | SpiaRegs.SPIFFCT.all = 0; 84 | 85 | SpiaRegs.SPIFFRX.all = 0x2044; 86 | SpiaRegs.SPIFFCT.all = 0x0; 87 | 88 | // Set the baud rate 89 | SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = SPI_BRR(400E3); 90 | 91 | // Set FREE bit 92 | // Halting on a breakpoint will not halt the SPI 93 | SpiaRegs.SPIPRI.bit.FREE = 1; 94 | 95 | // Release the SPI from reset 96 | SpiaRegs.SPICCR.bit.SPISWRESET = 1; 97 | } 98 | 99 | //------------------------------------------------------------------------------------------------- 100 | void SPI_open(void) 101 | { 102 | initPins(); 103 | initSpia(); 104 | } 105 | 106 | //------------------------------------------------------------------------------------------------- 107 | void SPI_close(void) 108 | { 109 | 110 | } 111 | 112 | //------------------------------------------------------------------------------------------------- 113 | __attribute__((ramfunc)) 114 | uint16_t SPI_sendByte(uint16_t byte) 115 | { 116 | SpiaRegs.SPITXBUF = byte; //Transmit Byte 117 | while(SpiaRegs.SPIFFRX.bit.RXFFST == 0); //Wait until the RX FIFO has received one byte 118 | return (SpiaRegs.SPIRXBUF << (16 - SPI_CHAR_BITS)); //Read Byte from RXBUF and return 119 | } 120 | 121 | //------------------------------------------------------------------------------------------------- 122 | __attribute__((ramfunc)) 123 | uint16_t SPI_send(uint8_t* buff, uint16_t buffSize, TickType_t timeout) 124 | { 125 | uint8_t* Buff = buff; 126 | uint16_t BuffSize = buffSize; 127 | uint16_t txBuffIdx = 0; 128 | 129 | // Send buffer to SPI bus 130 | while(txBuffIdx < BuffSize) 131 | { 132 | if(SpiaRegs.SPIFFTX.bit.TXFFST != 16) 133 | { 134 | SpiaRegs.SPITXBUF = Buff[txBuffIdx++] << (16 - SPI_CHAR_BITS); 135 | } 136 | } 137 | 138 | // Wait untill TX FIFO is empty and reset RX FIFO. 139 | while(SpiaRegs.SPIFFTX.bit.TXFFST != 0); 140 | SpiaRegs.SPIFFRX.bit.RXFIFORESET = 0; 141 | SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1; 142 | 143 | return txBuffIdx; 144 | } 145 | 146 | //------------------------------------------------------------------------------------------------- 147 | __attribute__((ramfunc)) 148 | uint16_t SPI_receive(uint8_t* buff, uint16_t buffSize, TickType_t timeout) 149 | { 150 | uint8_t* Buff = buff; 151 | uint16_t BuffSize = buffSize; 152 | uint16_t txBuffIdx = 0; 153 | uint16_t rxBuffIdx = 0; 154 | 155 | while(txBuffIdx < BuffSize) 156 | { 157 | if(SpiaRegs.SPIFFTX.bit.TXFFST != 16) 158 | { 159 | SpiaRegs.SPITXBUF = RX_DUMMY_VALUE; 160 | txBuffIdx++; 161 | } 162 | 163 | while(SpiaRegs.SPIFFRX.bit.RXFFST != 0) 164 | { 165 | Buff[rxBuffIdx++] = SpiaRegs.SPIRXBUF & SPI_CHAR_BITS_MASK; 166 | } 167 | } 168 | 169 | while(SpiaRegs.SPIFFTX.bit.TXFFST != 0); 170 | while(SpiaRegs.SPIFFRX.bit.RXFFST != 0) 171 | { 172 | Buff[rxBuffIdx++] = SpiaRegs.SPIRXBUF & SPI_CHAR_BITS_MASK; 173 | } 174 | 175 | return rxBuffIdx; 176 | } 177 | 178 | //------------------------------------------------------------------------------------------------- 179 | void SPI_setCsHigh(void) 180 | { 181 | GPIO_WritePin(CS_GPIO_PIN, 1); 182 | } 183 | 184 | //------------------------------------------------------------------------------------------------- 185 | void SPI_setCsLow(void) 186 | { 187 | GPIO_WritePin(CS_GPIO_PIN, 0); 188 | } 189 | 190 | //------------------------------------------------------------------------------------------------- 191 | void SPI_setClockFreq(uint32_t freqHz) 192 | { 193 | if(ClkCfgRegs.LOSPCP.all == 0) 194 | { 195 | SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = SPI_BRR_FAST(freqHz); 196 | } 197 | else 198 | { 199 | SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = SPI_BRR(freqHz); 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /examples/drivers/spi.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPI_H__ 2 | #define __SPI_H__ 3 | 4 | #include 5 | #include "FreeRTOS.h" 6 | 7 | void SPI_open(void); 8 | void SPI_close(void); 9 | uint16_t SPI_send(uint8_t* buff, uint16_t buffSize, TickType_t timeout); 10 | uint16_t SPI_sendByte(uint16_t byte); 11 | uint16_t SPI_receive(uint8_t* buff, uint16_t buffSize, TickType_t timeout); 12 | void SPI_setCsHigh(void); 13 | void SPI_setCsLow(void); 14 | void SPI_setClockFreq(uint32_t freqHz); 15 | 16 | #endif // __SPI_H__ 17 | -------------------------------------------------------------------------------- /examples/drivers/uart.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------------------- 2 | // Simplified UART driver. 3 | // 4 | //------------------------------------------------------------------------------------------------- 5 | #include "uart.h" 6 | #include "semphr.h" 7 | 8 | //------------------------------------------------------------------------------------------------- 9 | static SemaphoreHandle_t xTxMutex = NULL; 10 | static StaticSemaphore_t xTxMutexBuffer; 11 | static SemaphoreHandle_t xRxSemaphore = NULL; 12 | static StaticSemaphore_t xRxSemaphoreBuffer; 13 | 14 | //------------------------------------------------------------------------------------------------- 15 | interrupt void sciaRx_ISR(void) 16 | { 17 | BaseType_t xHigherPriorityTaskWoken = pdFALSE; 18 | 19 | xSemaphoreGiveFromISR(xRxSemaphore, &xHigherPriorityTaskWoken); 20 | 21 | PieCtrlRegs.PIEACK.all|=0x100; // Issue PIE Group 9 ack 22 | 23 | portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); 24 | } 25 | 26 | //------------------------------------------------------------------------------------------------- 27 | void UART_open(void) 28 | { 29 | // Init OS primitives. 30 | xTxMutex = xSemaphoreCreateMutexStatic(&xTxMutexBuffer); 31 | xRxSemaphore = xSemaphoreCreateBinaryStatic(&xRxSemaphoreBuffer); 32 | 33 | // Init pins. 34 | GPIO_SetupPinMux(84, GPIO_MUX_CPU1, 5); 35 | GPIO_SetupPinOptions(85, GPIO_OUTPUT, GPIO_ASYNC); 36 | GPIO_SetupPinMux(85, GPIO_MUX_CPU1, 5); 37 | GPIO_SetupPinOptions(85, GPIO_INPUT, GPIO_PUSHPULL); 38 | 39 | // Setup FIFO. 40 | SciaRegs.SCIFFTX.all = 0xE040; 41 | SciaRegs.SCIFFRX.all = 0x2061; 42 | SciaRegs.SCIFFCT.all = 0x0; 43 | 44 | // Setup UART parameters. 45 | SciaRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback 46 | // No parity,8 char bits, 47 | // async mode, idle-line protocol 48 | SciaRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK, 49 | // Disable RX ERR, SLEEP, TXWAKE 50 | SciaRegs.SCICTL2.all = 0x0003; 51 | SciaRegs.SCICTL2.bit.RXBKINTENA = 1; 52 | 53 | 54 | // SCIA at 9600 baud 55 | // SciaRegs.SCIHBAUD.all = 0x0002; 56 | // SciaRegs.SCILBAUD.all = 0x008B; 57 | 58 | // SCIA at 115200 baud 59 | if(ClkCfgRegs.LOSPCP.all == 0) 60 | { 61 | SciaRegs.SCIHBAUD.all = 0x0000; 62 | SciaRegs.SCILBAUD.all = 0x00D9; 63 | } 64 | else 65 | { 66 | SciaRegs.SCIHBAUD.all = 0x0000; 67 | SciaRegs.SCILBAUD.all = 0x0036; 68 | } 69 | 70 | SciaRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset 71 | 72 | 73 | // Init UART RX interrupt. 74 | EALLOW; 75 | PieVectTable.SCIA_RX_INT = &sciaRx_ISR; 76 | EDIS; 77 | PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block 78 | PieCtrlRegs.PIEIER9.bit.INTx1 = 1; // PIE Group 9, INT1, SCIA_RX 79 | IER = M_INT9; // Enable CPU INT9 80 | } 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | void UART_close(void) 84 | { 85 | 86 | } 87 | 88 | //------------------------------------------------------------------------------------------------- 89 | uint16_t UART_send(const uint8_t* buff, uint16_t buffSize) 90 | { 91 | uint16_t i = 0; 92 | 93 | if(xSemaphoreTake(xTxMutex, portMAX_DELAY) == pdTRUE) 94 | { 95 | for(i = 0; i < buffSize; i++) 96 | { 97 | while(SciaRegs.SCIFFTX.bit.TXFFST == 0x10) {} 98 | SciaRegs.SCITXBUF.all = buff[i]; 99 | } 100 | 101 | xSemaphoreGive(xTxMutex); 102 | } 103 | 104 | return i; 105 | } 106 | 107 | //------------------------------------------------------------------------------------------------- 108 | uint16_t UART_receive(uint8_t* buff, uint16_t buffSize, TickType_t timeout) 109 | { 110 | uint16_t i = 0; 111 | 112 | while(i < buffSize) 113 | { 114 | if(xSemaphoreTake(xRxSemaphore, timeout) == pdTRUE) 115 | { 116 | while((SciaRegs.SCIFFRX.bit.RXFFST != 0) && (i < buffSize)) 117 | { 118 | buff[i++] = SciaRegs.SCIRXBUF.all; 119 | } 120 | SciaRegs.SCIFFRX.bit.RXFFINTCLR=1; // Clear Interrupt flag 121 | } 122 | else 123 | { 124 | break; 125 | } 126 | } 127 | 128 | return i; 129 | } 130 | -------------------------------------------------------------------------------- /examples/drivers/uart.h: -------------------------------------------------------------------------------- 1 | #ifndef __UART_H__ 2 | #define __UART_H__ 3 | 4 | #include 5 | #include "FreeRTOS.h" 6 | 7 | void UART_open(void); 8 | void UART_close(void); 9 | uint16_t UART_send(const uint8_t* buff, uint16_t buffSize); 10 | uint16_t UART_receive(uint8_t* buff, uint16_t buffSize, TickType_t timeout); 11 | 12 | #endif // __UART_H__ 13 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | fpu_f28377s 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 | FreeRTOS 30 | 2 31 | virtual:/virtual 32 | 33 | 34 | controlSUITE 35 | 2 36 | virtual:/virtual 37 | 38 | 39 | drivers 40 | 2 41 | virtual:/virtual 42 | 43 | 44 | FreeRTOS/list.c 45 | 1 46 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 47 | 48 | 49 | FreeRTOS/port 50 | 2 51 | virtual:/virtual 52 | 53 | 54 | FreeRTOS/queue.c 55 | 1 56 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 57 | 58 | 59 | FreeRTOS/tasks.c 60 | 1 61 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 62 | 63 | 64 | controlSUITE/F2837xS_CodeStartBranch.asm 65 | 1 66 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CodeStartBranch.asm 67 | 68 | 69 | controlSUITE/F2837xS_CpuTimers.c 70 | 1 71 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CpuTimers.c 72 | 73 | 74 | controlSUITE/F2837xS_DefaultISR.c 75 | 1 76 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_DefaultISR.c 77 | 78 | 79 | controlSUITE/F2837xS_GlobalVariableDefs.c 80 | 1 81 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_headers/source/F2837xS_GlobalVariableDefs.c 82 | 83 | 84 | controlSUITE/F2837xS_Gpio.c 85 | 1 86 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_Gpio.c 87 | 88 | 89 | controlSUITE/F2837xS_PieCtrl.c 90 | 1 91 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieCtrl.c 92 | 93 | 94 | controlSUITE/F2837xS_PieVect.c 95 | 1 96 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieVect.c 97 | 98 | 99 | controlSUITE/F2837xS_SysCtrl.c 100 | 1 101 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_SysCtrl.c 102 | 103 | 104 | drivers/uart.c 105 | 1 106 | PARENT-1-PROJECT_LOC/drivers/uart.c 107 | 108 | 109 | FreeRTOS/port/porASM.asm 110 | 1 111 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 112 | 113 | 114 | FreeRTOS/port/port.c 115 | 1 116 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 117 | 118 | 119 | FreeRTOS/port/portmacro.h 120 | 1 121 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/2837xS_Generic_FLASH_lnk.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0 : /* Program Memory */ 5 | /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */ 6 | /* BEGIN is used for the "boot to Flash" bootloader mode */ 7 | 8 | BEGIN : origin = 0x080000, length = 0x000002 9 | RAMM0 : origin = 0x000122, length = 0x0002DE 10 | RAMD0 : origin = 0x00B000, length = 0x000800 11 | RAMLS0 : origin = 0x008000, length = 0x000800 12 | RAMLS1 : origin = 0x008800, length = 0x000800 13 | RAMLS2 : origin = 0x009000, length = 0x000800 14 | RAMLS3 : origin = 0x009800, length = 0x000800 15 | RAMLS4 : origin = 0x00A000, length = 0x000800 16 | RESET : origin = 0x3FFFC0, length = 0x000002 17 | 18 | /* Flash sectors */ 19 | FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */ 20 | FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */ 21 | FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */ 22 | FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */ 23 | FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */ 24 | FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */ 25 | FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */ 26 | FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */ 27 | FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */ 28 | FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */ 29 | FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */ 30 | FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */ 31 | FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */ 32 | FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */ 33 | 34 | PAGE 1 : /* Data Memory */ 35 | /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */ 36 | 37 | BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ 38 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 39 | RAMD1 : origin = 0x00B800, length = 0x000800 40 | 41 | RAMLS5 : origin = 0x00A800, length = 0x000800 42 | 43 | RAMGS0 : origin = 0x00C000, length = 0x001000 44 | RAMGS1 : origin = 0x00D000, length = 0x001000 45 | RAMGS2 : origin = 0x00E000, length = 0x001000 46 | RAMGS3 : origin = 0x00F000, length = 0x001000 47 | RAMGS4 : origin = 0x010000, length = 0x001000 48 | RAMGS5 : origin = 0x011000, length = 0x001000 49 | RAMGS6 : origin = 0x012000, length = 0x001000 50 | RAMGS7 : origin = 0x013000, length = 0x001000 51 | RAMGS8 : origin = 0x014000, length = 0x001000 52 | RAMGS9 : origin = 0x015000, length = 0x001000 53 | RAMGS10 : origin = 0x016000, length = 0x001000 54 | RAMGS11 : origin = 0x017000, length = 0x001000 55 | } 56 | 57 | SECTIONS 58 | { 59 | /* Allocate program areas: */ 60 | .cinit : > FLASHB PAGE = 0, ALIGN(4) 61 | .pinit : > FLASHB, PAGE = 0, ALIGN(4) 62 | .text : >> FLASHB | FLASHC | FLASHD | FLASHE PAGE = 0, ALIGN(4) 63 | codestart : > BEGIN PAGE = 0, ALIGN(4) 64 | 65 | /* Allocate uninitalized data sections: */ 66 | .stack : > RAMM1 PAGE = 1 67 | .ebss : >> RAMLS5 | RAMGS0 | RAMGS1 PAGE = 1 68 | .esysmem : > RAMLS5 PAGE = 1 69 | 70 | /* Initalized sections go in Flash */ 71 | .econst : >> FLASHF | FLASHG | FLASHH PAGE = 0, ALIGN(4) 72 | .switch : > FLASHB PAGE = 0, ALIGN(4) 73 | 74 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 75 | 76 | #ifdef __TI_COMPILER_VERSION__ 77 | #if __TI_COMPILER_VERSION__ >= 15009000 78 | .TI.ramfunc : {} LOAD = FLASHD, 79 | RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3, 80 | LOAD_START(_RamfuncsLoadStart), 81 | LOAD_SIZE(_RamfuncsLoadSize), 82 | LOAD_END(_RamfuncsLoadEnd), 83 | RUN_START(_RamfuncsRunStart), 84 | RUN_SIZE(_RamfuncsRunSize), 85 | RUN_END(_RamfuncsRunEnd), 86 | PAGE = 0, ALIGN(4) 87 | #else 88 | ramfuncs : LOAD = FLASHD, 89 | RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3, 90 | LOAD_START(_RamfuncsLoadStart), 91 | LOAD_SIZE(_RamfuncsLoadSize), 92 | LOAD_END(_RamfuncsLoadEnd), 93 | RUN_START(_RamfuncsRunStart), 94 | RUN_SIZE(_RamfuncsRunSize), 95 | RUN_END(_RamfuncsRunEnd), 96 | PAGE = 0, ALIGN(4) 97 | #endif 98 | #endif 99 | 100 | ramgs0 : > RAMGS0, PAGE = 1 101 | ramgs1 : > RAMGS1, PAGE = 1 102 | 103 | /* The following section definitions are for SDFM examples */ 104 | Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 105 | Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 106 | Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 107 | Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 108 | Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333 109 | } 110 | 111 | /* 112 | //=========================================================================== 113 | // End of file. 114 | //=========================================================================== 115 | */ 116 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 200000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | #define configUSE_MUTEXES 1 32 | 33 | // Set the following definitions to 1 to include the API function, or zero 34 | // to exclude the API function. 35 | 36 | #define INCLUDE_vTaskPrioritySet 0 37 | #define INCLUDE_uxTaskPriorityGet 0 38 | #define INCLUDE_vTaskDelete 0 39 | #define INCLUDE_vTaskCleanUpResources 0 40 | #define INCLUDE_vTaskSuspend 0 41 | #define INCLUDE_vTaskDelayUntil 0 42 | #define INCLUDE_vTaskDelay 1 43 | 44 | #endif /* FREERTOS_CONFIG_H */ 45 | 46 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/fpu_test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "fpu_test.h" 3 | 4 | //------------------------------------------------------------------------------------------------- 5 | double compute_pi_machin (double x, double y) 6 | { 7 | double x2 = x * x; 8 | double x3 = x2 * x; 9 | double x5 = x3 * x2; 10 | double x7 = x5 * x2; 11 | double x9 = x7 * x2; 12 | double x11 = x9 * x2; 13 | double x13 = x11 * x2; 14 | double x15 = x13 * x2; 15 | double x17 = x15 * x2; 16 | double x19 = x17 * x2; 17 | double atx = x17/17 - x19/19; 18 | atx += x13/13 - x15/15; 19 | atx += x9/9 - x11/11; 20 | atx += x5/5 - x7/7; 21 | atx += x - x3/3; 22 | 23 | double y2 = y * y; 24 | double y3 = y2 * y; 25 | double y5 = y3 * y2; 26 | double y7 = y5 * y2; 27 | double y9 = y7 * y2; 28 | double y11 = y9 * y2; 29 | double y13 = y11 * y2; 30 | double y15 = y13 * y2; 31 | double aty = y13/13 - y15/15; 32 | aty += y9/9 - y11/11; 33 | aty += y5/5 - y7/7; 34 | aty += y - y3/3; 35 | return 4 * (4*atx - aty); 36 | } 37 | 38 | //------------------------------------------------------------------------------------------------- 39 | double compute_pi_gauss (double x, double y, double z) 40 | { 41 | double x2 = x * x; 42 | double x3 = x2 * x; 43 | double x5 = x3 * x2; 44 | double x7 = x5 * x2; 45 | double x9 = x7 * x2; 46 | double x11 = x9 * x2; 47 | double x13 = x11 * x2; 48 | double x15 = x13 * x2; 49 | double atx = x13/13 - x15/15; 50 | atx += x9/9 - x11/11; 51 | atx += x5/5 - x7/7; 52 | atx += x - x3/3; 53 | 54 | double y2 = y * y; 55 | double y3 = y2 * y; 56 | double y5 = y3 * y2; 57 | double y7 = y5 * y2; 58 | double y9 = y7 * y2; 59 | double y11 = y9 * y2; 60 | double y13 = y11 * y2; 61 | double y15 = y13 * y2; 62 | double aty = y13/13 - y15/15; 63 | aty += y9/9 - y11/11; 64 | aty += y5/5 - y7/7; 65 | aty += y - y3/3; 66 | 67 | double z2 = z * z; 68 | double z3 = z2 * z; 69 | double z5 = z3 * z2; 70 | double z7 = z5 * z2; 71 | double z9 = z7 * z2; 72 | double z11 = z9 * z2; 73 | double z13 = z11 * z2; 74 | double z15 = z13 * z2; 75 | double atz = z13/13 - z15/15; 76 | atz += z9/9 - z11/11; 77 | atz += z5/5 - z7/7; 78 | atz += z - z3/3; 79 | return 4 * (12*atx + 8*aty - 5*atz); 80 | } 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | double compute_pi_brent (double a0, double b0, double t0, double p0) 84 | { 85 | double a1 = (a0 + b0) / 2; 86 | double b1 = sqrt (a0 * b0); 87 | double t1 = t0 - p0 * (a0 - a1)*(a0 - a1); 88 | double p1 = p0 + p0; 89 | 90 | double a2 = (a1 + b1) / 2; 91 | double b2 = sqrt (a1 * b1); 92 | double t2 = t1 - p1 * (a1 - a2)*(a1 - a2); 93 | double p2 = p1 + p1; 94 | 95 | double a3 = (a2 + b2) / 2; 96 | double b3 = sqrt (a2 * b2); 97 | double t3 = t2 - p2 * (a2 - a3)*(a2 - a3); 98 | return (a3 + b3)*(a3 + b3) / (4 * t3); 99 | } 100 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/fpu_test.h: -------------------------------------------------------------------------------- 1 | #ifndef __FPU_TEST_H__ 2 | #define __FPU_TEST_H__ 3 | 4 | /* 5 | * Calculating Pi - Machin Algorithm: 6 | * pi/4 = 4*arctan(1/5) - arctan(1/239) 7 | * Executing compute_pi_machin(1./5, 1./239) returns PI. 8 | */ 9 | double compute_pi_machin (double x, double y); 10 | 11 | /* 12 | * Calculating Pi - Gauss Algorithm: 13 | * pi/4 = 12*arctan(1/18) + 8*arctan(1/57) - 5*arctan(1/239) 14 | * Executing compute_pi_gauss(1./18, 1./57, 1./239) returns PI. 15 | */ 16 | double compute_pi_gauss (double x, double y, double z); 17 | 18 | /* 19 | * Calculating Pi - Brent-Salamin Algorithm: 20 | * a[0] = 1 21 | * b[0] = sqrt (2) 22 | * t[0] = 1/4 23 | * p[0] = 1 24 | * a[n+1] = (a[n] + b[n]) / 2 25 | * b[n+1] = sqrt (a[n] * b[n]) 26 | * t[n+1] = t[n] - p[n] * (a[n] - a[n+1])^2 27 | * p[n+1] = 2 * p[n] 28 | * Result: 29 | * pi = (a[n] + b[n])^2 / 4 * t[n] 30 | * 31 | * Executing compute_pi_brent(1.0, M_SQRT1_2l, 0.25, 1.0) returns PI 32 | */ 33 | double compute_pi_brent (double a0, double b0, double t0, double p0); 34 | 35 | #endif // __FPU_TEST_H__ 36 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/targetConfigs/TMS320F28377S.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/fpu_f28377s/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/libs/fatfs/diskio.c: -------------------------------------------------------------------------------- 1 | /*-----------------------------------------------------------------------*/ 2 | /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2016 */ 3 | /*-----------------------------------------------------------------------*/ 4 | /* If a working storage control module is available, it should be */ 5 | /* attached to the FatFs via a glue function rather than modifying it. */ 6 | /* This is an example of glue functions to attach various exsisting */ 7 | /* storage control modules to the FatFs module with a defined API. */ 8 | /*-----------------------------------------------------------------------*/ 9 | #include 10 | #include 11 | #include "uart.h" 12 | #include "diskio.h" /* FatFs lower layer API */ 13 | #include "SD.h" 14 | 15 | /* Definitions of physical drive number for each drive */ 16 | #define DEV_MMC 0 /* Example: Map MMC/SD card to physical drive 1 */ 17 | 18 | #define SECTOR_SIZE 512 19 | #define READ_BUFF_SECTORS 8 20 | #define BUFF_INVALID -1 21 | 22 | #pragma DATA_SECTION(readBuff, "ramgs2"); 23 | uint8_t readBuff[READ_BUFF_SECTORS * SECTOR_SIZE]; 24 | int32_t readBuffStartSector; 25 | 26 | /*-----------------------------------------------------------------------*/ 27 | /* Get Drive Status */ 28 | /*-----------------------------------------------------------------------*/ 29 | 30 | DSTATUS disk_status ( 31 | BYTE pdrv /* Physical drive nmuber to identify the drive */ 32 | ) 33 | { 34 | return 0; 35 | } 36 | 37 | 38 | 39 | /*-----------------------------------------------------------------------*/ 40 | /* Inidialize a Drive */ 41 | /*-----------------------------------------------------------------------*/ 42 | 43 | DSTATUS disk_initialize ( 44 | BYTE pdrv /* Physical drive nmuber to identify the drive */ 45 | ) 46 | { 47 | readBuffStartSector = BUFF_INVALID; 48 | return 0; 49 | } 50 | 51 | 52 | 53 | /*-----------------------------------------------------------------------*/ 54 | /* Read Sector(s) */ 55 | /*-----------------------------------------------------------------------*/ 56 | 57 | DRESULT disk_read ( 58 | BYTE pdrv, /* Physical drive nmuber to identify the drive */ 59 | BYTE *buff, /* Data buffer to store read data */ 60 | DWORD sector, /* Start sector in LBA */ 61 | UINT count /* Number of sectors to read */ 62 | ) 63 | { 64 | if( (readBuffStartSector == BUFF_INVALID) 65 | ||(sector < readBuffStartSector) 66 | ||(sector >= (readBuffStartSector + READ_BUFF_SECTORS))) 67 | { 68 | sd_read_multiple_block(sector, (Uint16*)readBuff, READ_BUFF_SECTORS); 69 | readBuffStartSector = sector; 70 | } 71 | memcpy(buff, readBuff + ((sector - readBuffStartSector) * SECTOR_SIZE), SECTOR_SIZE); 72 | 73 | return RES_OK; 74 | } 75 | 76 | 77 | 78 | /*-----------------------------------------------------------------------*/ 79 | /* Write Sector(s) */ 80 | /*-----------------------------------------------------------------------*/ 81 | DRESULT disk_write ( 82 | BYTE pdrv, /* Physical drive nmuber to identify the drive */ 83 | const BYTE *buff, /* Data to be written */ 84 | DWORD sector, /* Start sector in LBA */ 85 | UINT count /* Number of sectors to write */ 86 | ) 87 | { 88 | sd_write_block(sector, (Uint16*)buff); 89 | if((sector >= readBuffStartSector) && (sector < (readBuffStartSector + READ_BUFF_SECTORS))) 90 | { 91 | memcpy(readBuff + ((sector - readBuffStartSector) * SECTOR_SIZE), buff, SECTOR_SIZE); 92 | } 93 | return RES_OK; 94 | } 95 | 96 | 97 | 98 | /*-----------------------------------------------------------------------*/ 99 | /* Miscellaneous Functions */ 100 | /*-----------------------------------------------------------------------*/ 101 | 102 | DRESULT disk_ioctl ( 103 | BYTE pdrv, /* Physical drive nmuber (0..) */ 104 | BYTE cmd, /* Control code */ 105 | void *buff /* Buffer to send/receive control data */ 106 | ) 107 | { 108 | return RES_OK; 109 | } 110 | 111 | -------------------------------------------------------------------------------- /examples/libs/fatfs/diskio.h: -------------------------------------------------------------------------------- 1 | /*-----------------------------------------------------------------------/ 2 | / Low level disk interface modlue include file (C)ChaN, 2014 / 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO_DEFINED 6 | #define _DISKIO_DEFINED 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #include "integer.h" 13 | 14 | 15 | /* Status of Disk Functions */ 16 | typedef BYTE DSTATUS; 17 | 18 | /* Results of Disk Functions */ 19 | typedef enum { 20 | RES_OK = 0, /* 0: Successful */ 21 | RES_ERROR, /* 1: R/W Error */ 22 | RES_WRPRT, /* 2: Write Protected */ 23 | RES_NOTRDY, /* 3: Not Ready */ 24 | RES_PARERR /* 4: Invalid Parameter */ 25 | } DRESULT; 26 | 27 | 28 | /*---------------------------------------*/ 29 | /* Prototypes for disk control functions */ 30 | 31 | 32 | DSTATUS disk_initialize (BYTE pdrv); 33 | DSTATUS disk_status (BYTE pdrv); 34 | DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); 35 | DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); 36 | DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); 37 | 38 | 39 | /* Disk Status Bits (DSTATUS) */ 40 | 41 | #define STA_NOINIT 0x01 /* Drive not initialized */ 42 | #define STA_NODISK 0x02 /* No medium in the drive */ 43 | #define STA_PROTECT 0x04 /* Write protected */ 44 | 45 | 46 | /* Command code for disk_ioctrl fucntion */ 47 | 48 | /* Generic command (Used by FatFs) */ 49 | #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ 50 | #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ 51 | #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ 52 | #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ 53 | #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ 54 | 55 | /* Generic command (Not used by FatFs) */ 56 | #define CTRL_POWER 5 /* Get/Set power status */ 57 | #define CTRL_LOCK 6 /* Lock/Unlock media removal */ 58 | #define CTRL_EJECT 7 /* Eject media */ 59 | #define CTRL_FORMAT 8 /* Create physical format on the media */ 60 | 61 | /* MMC/SDC specific ioctl command */ 62 | #define MMC_GET_TYPE 10 /* Get card type */ 63 | #define MMC_GET_CSD 11 /* Get CSD */ 64 | #define MMC_GET_CID 12 /* Get CID */ 65 | #define MMC_GET_OCR 13 /* Get OCR */ 66 | #define MMC_GET_SDSTAT 14 /* Get SD status */ 67 | #define ISDIO_READ 55 /* Read data form SD iSDIO register */ 68 | #define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ 69 | #define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ 70 | 71 | /* ATA/CF specific ioctl command */ 72 | #define ATA_GET_REV 20 /* Get F/W revision */ 73 | #define ATA_GET_MODEL 21 /* Get model name */ 74 | #define ATA_GET_SN 22 /* Get serial number */ 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /examples/libs/fatfs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | #include 18 | 19 | /* These types MUST be 16-bit or 32-bit */ 20 | typedef int32_t INT; 21 | typedef uint32_t UINT; 22 | 23 | /* This type MUST be 8-bit */ 24 | typedef uint16_t BYTE; 25 | 26 | /* These types MUST be 16-bit */ 27 | typedef uint16_t SHORT; 28 | typedef uint16_t WORD; 29 | typedef uint16_t WCHAR; 30 | 31 | /* These types MUST be 32-bit */ 32 | typedef uint32_t LONG; 33 | typedef uint32_t DWORD; 34 | 35 | /* This type MUST be 64-bit (Remove this for C89 compatibility) */ 36 | typedef uint64_t QWORD; 37 | 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /examples/libs/sdcard_spi/SD_SPI_Erase.c: -------------------------------------------------------------------------------- 1 | //############################################################################ 2 | // 3 | // FILE: SD_SPI_Erase.c 4 | // 5 | // TITLE: SD/MMC Erase Function 6 | // 7 | //############################################################################ 8 | // Author: Tim Love 9 | // Release Date: July 2007 10 | //############################################################################ 11 | 12 | 13 | /* *********************************************************** 14 | * THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR 15 | * REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, 16 | * INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR 18 | * COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. 19 | * TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET 20 | * POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY 21 | * INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR 22 | * YOUR USE OF THE PROGRAM. 23 | * 24 | * IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 25 | * CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY 26 | * THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED 27 | * OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT 28 | * OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. 29 | * EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF 30 | * REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS 31 | * OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF 32 | * USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S 33 | * AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF 34 | * YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS 35 | * (U.S.$500). 36 | * 37 | * Unless otherwise stated, the Program written and copyrighted 38 | * by Texas Instruments is distributed as "freeware". You may, 39 | * only under TI's copyright in the Program, use and modify the 40 | * Program without any charge or restriction. You may 41 | * distribute to third parties, provided that you transfer a 42 | * copy of this license to the third party and the third party 43 | * agrees to these terms by its first use of the Program. You 44 | * must reproduce the copyright notice and any other legend of 45 | * ownership on each copy or partial copy, of the Program. 46 | * 47 | * You acknowledge and agree that the Program contains 48 | * copyrighted material, trade secrets and other TI proprietary 49 | * information and is protected by copyright laws, 50 | * international copyright treaties, and trade secret laws, as 51 | * well as other intellectual property laws. To protect TI's 52 | * rights in the Program, you agree not to decompile, reverse 53 | * engineer, disassemble or otherwise translate any object code 54 | * versions of the Program to a human-readable form. You agree 55 | * that in no event will you alter, remove or destroy any 56 | * copyright notice included in the Program. TI reserves all 57 | * rights not specifically granted under this license. Except 58 | * as specifically provided herein, nothing in this agreement 59 | * shall be construed as conferring by implication, estoppel, 60 | * or otherwise, upon you, any license or other right under any 61 | * TI patents, copyrights or trade secrets. 62 | * 63 | * You may not use the Program in non-TI devices. 64 | * ********************************************************* */ 65 | 66 | 67 | #include "SD.h" //SD Include File 68 | 69 | //############################# SD_ERASE_BLOCK ############################### 70 | void sd_erase_block(Uint16 starting_sector, Uint16 total_sectors) 71 | { 72 | CS_LOW; //Pull CS low 73 | data_manipulation = TRUE; //Data manipulation function 74 | 75 | //Transmit Erase Start Block Command 76 | spi_xmit_command(ERASE_WR_BLK_START_ADDR, starting_sector, DUMMY_CRC); 77 | 78 | RESET_RESPONSE; //Reset response 79 | while(response != STATUS_SUCCESS) //Wait until card responds with SUCCESS response 80 | sd_command_response(); 81 | 82 | //After receiving response clock must be active for 8 clock cycles 83 | EIGHT_CLOCK_CYCLE_DELAY; 84 | 85 | //Add starting sector to total number of sectors to find ending address 86 | total_sectors += starting_sector; 87 | 88 | //Transmit Erase End Block command 89 | spi_xmit_command(ERASE_WR_BLK_END_ADDR, total_sectors, DUMMY_CRC); 90 | 91 | RESET_RESPONSE; //Reset response 92 | while(response != STATUS_SUCCESS) //Wait until card responds with SUCCESS response 93 | sd_command_response(); 94 | 95 | //After receiving response clock must be active for 8 clock cycles 96 | EIGHT_CLOCK_CYCLE_DELAY; 97 | 98 | //Transmit ERASE command 99 | spi_xmit_command(ERASE, STUFF_BITS, DUMMY_CRC); 100 | 101 | RESET_RESPONSE; //Reset response 102 | while(response != STATUS_SUCCESS) //Wait until card responds with SUCCESS response 103 | sd_command_response(); 104 | 105 | //Card will respond with the DATA OUT line pulled low if the card is still busy 106 | //erasing. Continue checking DATA OUT line until line is released high. 107 | while(response != DUMMY_DATA) 108 | response = spi_xmit_byte(DUMMY_DATA); 109 | 110 | CS_HIGH; //Pull CS high 111 | //After receiving response clock must be active for 8 clock cycles 112 | EIGHT_CLOCK_CYCLE_DELAY; 113 | } 114 | //############################# SD_ERASE_BLOCK ############################### 115 | -------------------------------------------------------------------------------- /examples/libs/sdcard_spi/SD_SPI_Read.c: -------------------------------------------------------------------------------- 1 | //############################################################################ 2 | // 3 | // FILE: SD_SPI_Read.c 4 | // 5 | // TITLE: SD/MMC Read Data Functions 6 | // 7 | //############################################################################ 8 | // Author: Tim Love 9 | // Release Date: July 2007 10 | //############################################################################ 11 | 12 | 13 | /* *********************************************************** 14 | * THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR 15 | * REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, 16 | * INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR 18 | * COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. 19 | * TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET 20 | * POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY 21 | * INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR 22 | * YOUR USE OF THE PROGRAM. 23 | * 24 | * IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 25 | * CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY 26 | * THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED 27 | * OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT 28 | * OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. 29 | * EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF 30 | * REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS 31 | * OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF 32 | * USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S 33 | * AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF 34 | * YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS 35 | * (U.S.$500). 36 | * 37 | * Unless otherwise stated, the Program written and copyrighted 38 | * by Texas Instruments is distributed as "freeware". You may, 39 | * only under TI's copyright in the Program, use and modify the 40 | * Program without any charge or restriction. You may 41 | * distribute to third parties, provided that you transfer a 42 | * copy of this license to the third party and the third party 43 | * agrees to these terms by its first use of the Program. You 44 | * must reproduce the copyright notice and any other legend of 45 | * ownership on each copy or partial copy, of the Program. 46 | * 47 | * You acknowledge and agree that the Program contains 48 | * copyrighted material, trade secrets and other TI proprietary 49 | * information and is protected by copyright laws, 50 | * international copyright treaties, and trade secret laws, as 51 | * well as other intellectual property laws. To protect TI's 52 | * rights in the Program, you agree not to decompile, reverse 53 | * engineer, disassemble or otherwise translate any object code 54 | * versions of the Program to a human-readable form. You agree 55 | * that in no event will you alter, remove or destroy any 56 | * copyright notice included in the Program. TI reserves all 57 | * rights not specifically granted under this license. Except 58 | * as specifically provided herein, nothing in this agreement 59 | * shall be construed as conferring by implication, estoppel, 60 | * or otherwise, upon you, any license or other right under any 61 | * TI patents, copyrights or trade secrets. 62 | * 63 | * You may not use the Program in non-TI devices. 64 | * ********************************************************* */ 65 | 66 | 67 | #include "SD.h" //SD Include File 68 | 69 | //############################# SD_READ_BLOCK ################################ 70 | void sd_read_block(Uint16 sector, Uint16 *pBuffer) 71 | { 72 | CS_LOW; //Pull CS low 73 | data_manipulation = TRUE; //Data manipulation function 74 | 75 | //Transmit READ SINGLE BLOCK command 76 | spi_xmit_command(READ_SINGLE_BLOCK, sector, DUMMY_CRC); 77 | 78 | RESET_RESPONSE; //Reset Response 79 | while(response != STATUS_SUCCESS) //Wait until card responds with SUCCESS response 80 | sd_command_response(); 81 | 82 | //After receiving response clock must be active for 8 clock cycles 83 | EIGHT_CLOCK_CYCLE_DELAY; 84 | 85 | //Call sd_data_response to read specified sector 86 | sd_data_response(pBuffer, SINGLE_SECTOR); 87 | 88 | CS_HIGH; //Pull CS high 89 | //After receiving response clock must be active for 8 clock cycles 90 | EIGHT_CLOCK_CYCLE_DELAY; 91 | } 92 | //############################# SD_READ_BLOCK ################################ 93 | 94 | 95 | //######################## SD_READ_MULTIPLE_BLOCK ############################ 96 | void sd_read_multiple_block(Uint16 sector, Uint16 *pBuffer, Uint16 total_sectors) 97 | { 98 | Uint16 i; 99 | 100 | CS_LOW; //Pull CS low 101 | data_manipulation = TRUE; //Data manipulation function 102 | 103 | //Transmit READ MULTIPLE BLOCK command 104 | spi_xmit_command(READ_MULTIPLE_BLOCK, sector, DUMMY_CRC); 105 | 106 | RESET_RESPONSE; //Reset response 107 | while(response != STATUS_SUCCESS) //Wait until card responds with SUCCESS response 108 | sd_command_response(); 109 | 110 | //After receiving response clock must be active for 8 clock cycles 111 | EIGHT_CLOCK_CYCLE_DELAY; 112 | 113 | //Call sd_data_response to read specified sectors 114 | sd_data_response(pBuffer, total_sectors); 115 | 116 | //Transmit STOP TRANSMISSION command 117 | spi_xmit_command(STOP_TRANSMISSION, STUFF_BITS, DUMMY_CRC); 118 | 119 | RESET_RESPONSE; //Reset response 120 | 121 | //Wait 64 clock cycles or until card responds with SUCCESS response to move on 122 | for(i=0;i<8;i++) 123 | { 124 | response = spi_xmit_byte(DUMMY_DATA); 125 | if (response == STATUS_SUCCESS) 126 | break; 127 | } 128 | 129 | CS_HIGH; //Pull CS high 130 | //After receiving response clock must be active for 8 clock cycles 131 | EIGHT_CLOCK_CYCLE_DELAY; 132 | } 133 | //######################## SD_READ_MULTIPLE_BLOCK ############################ 134 | 135 | 136 | //########################### SD_DATA_RESPONSE ############################### 137 | void sd_data_response(Uint16 *pBuffer, Uint16 total_sectors) 138 | { 139 | Uint16 i; 140 | 141 | data_manipulation = TRUE; //Data manipulation function 142 | 143 | //Continue until all total sectors requested are transmitted 144 | for(i=0;i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/pwm_tms320f28377s/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | pwm_f28377s 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 | F2837xS_CodeStartBranch.asm 30 | 1 31 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CodeStartBranch.asm 32 | 33 | 34 | F2837xS_CpuTimers.c 35 | 1 36 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CpuTimers.c 37 | 38 | 39 | F2837xS_DefaultISR.c 40 | 1 41 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_DefaultISR.c 42 | 43 | 44 | F2837xS_GlobalVariableDefs.c 45 | 1 46 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_headers/source/F2837xS_GlobalVariableDefs.c 47 | 48 | 49 | F2837xS_Gpio.c 50 | 1 51 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_Gpio.c 52 | 53 | 54 | F2837xS_PieCtrl.c 55 | 1 56 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieCtrl.c 57 | 58 | 59 | F2837xS_PieVect.c 60 | 1 61 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieVect.c 62 | 63 | 64 | F2837xS_SysCtrl.c 65 | 1 66 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_SysCtrl.c 67 | 68 | 69 | FreeRTOS 70 | 2 71 | virtual:/virtual 72 | 73 | 74 | drivers 75 | 2 76 | virtual:/virtual 77 | 78 | 79 | FreeRTOS/list.c 80 | 1 81 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 82 | 83 | 84 | FreeRTOS/port 85 | 2 86 | virtual:/virtual 87 | 88 | 89 | FreeRTOS/queue.c 90 | 1 91 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 92 | 93 | 94 | FreeRTOS/tasks.c 95 | 1 96 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 97 | 98 | 99 | drivers/pwm.c 100 | 1 101 | C:/ivan/ccs/freertos_c28x/examples/drivers/pwm.c 102 | 103 | 104 | FreeRTOS/port/porASM.asm 105 | 1 106 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 107 | 108 | 109 | FreeRTOS/port/port.c 110 | 1 111 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 112 | 113 | 114 | FreeRTOS/port/portmacro.h 115 | 1 116 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /examples/pwm_tms320f28377s/2837xS_Generic_RAM_lnk.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0 : 5 | /* BEGIN is used for the "boot to SARAM" bootloader mode */ 6 | 7 | BEGIN : origin = 0x000000, length = 0x000002 8 | RAMM0 : origin = 0x000122, length = 0x0002DE 9 | RAMD0 : origin = 0x00B000, length = 0x000800 10 | RAMLS0 : origin = 0x008000, length = 0x000800 11 | RAMLS1 : origin = 0x008800, length = 0x000800 12 | RAMLS2 : origin = 0x009000, length = 0x000800 13 | RAMLS3 : origin = 0x009800, length = 0x000800 14 | RAMLS4 : origin = 0x00A000, length = 0x000800 15 | RESET : origin = 0x3FFFC0, length = 0x000002 16 | 17 | PAGE 1 : 18 | 19 | BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ 20 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 21 | RAMD1 : origin = 0x00B800, length = 0x000800 22 | 23 | 24 | RAMLS5 : origin = 0x00A800, length = 0x000800 25 | 26 | RAMGS0 : origin = 0x00C000, length = 0x001000 27 | RAMGS1 : origin = 0x00D000, length = 0x001000 28 | RAMGS2 : origin = 0x00E000, length = 0x001000 29 | RAMGS3 : origin = 0x00F000, length = 0x001000 30 | RAMGS4 : origin = 0x010000, length = 0x001000 31 | RAMGS5 : origin = 0x011000, length = 0x001000 32 | RAMGS6 : origin = 0x012000, length = 0x001000 33 | RAMGS7 : origin = 0x013000, length = 0x001000 34 | RAMGS8 : origin = 0x014000, length = 0x001000 35 | RAMGS9 : origin = 0x015000, length = 0x001000 36 | RAMGS10 : origin = 0x016000, length = 0x001000 37 | RAMGS11 : origin = 0x017000, length = 0x001000 38 | 39 | CANA_MSG_RAM : origin = 0x049000, length = 0x000800 40 | CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 41 | } 42 | 43 | 44 | SECTIONS 45 | { 46 | codestart : > BEGIN, PAGE = 0 47 | ramfuncs : > RAMM0 PAGE = 0 48 | .text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0 49 | .cinit : > RAMM0, PAGE = 0 50 | .pinit : > RAMM0, PAGE = 0 51 | .switch : > RAMM0, PAGE = 0 52 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 53 | 54 | .stack : > RAMM1, PAGE = 1 55 | .ebss : > RAMLS5, PAGE = 1 56 | .econst : > RAMLS5, PAGE = 1 57 | .esysmem : > RAMLS5, PAGE = 1 58 | 59 | ramgs0 : > RAMGS0, PAGE = 1 60 | ramgs1 : > RAMGS1, PAGE = 1 61 | 62 | #ifdef __TI_COMPILER_VERSION 63 | #if __TI_COMPILER_VERSION >= 15009000 64 | .TI.ramfunc : {} > RAMM0, PAGE = 0 65 | #endif 66 | #endif 67 | 68 | /* The following section definitions are for SDFM examples */ 69 | Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 70 | Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 71 | Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 72 | Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 73 | Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333 74 | } 75 | 76 | /* 77 | //=========================================================================== 78 | // End of file. 79 | //=========================================================================== 80 | */ 81 | -------------------------------------------------------------------------------- /examples/pwm_tms320f28377s/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 200000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | 32 | // Set the following definitions to 1 to include the API function, or zero 33 | // to exclude the API function. 34 | 35 | #define INCLUDE_vTaskPrioritySet 0 36 | #define INCLUDE_uxTaskPriorityGet 0 37 | #define INCLUDE_vTaskDelete 0 38 | #define INCLUDE_vTaskCleanUpResources 0 39 | #define INCLUDE_vTaskSuspend 0 40 | #define INCLUDE_vTaskDelayUntil 0 41 | #define INCLUDE_vTaskDelay 1 42 | 43 | #endif /* FREERTOS_CONFIG_H */ 44 | 45 | -------------------------------------------------------------------------------- /examples/pwm_tms320f28377s/targetConfigs/TMS320F28377S.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/pwm_tms320f28377s/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/sdcard_f28377s/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/sdcard_f28377s/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sdcard_f28377s 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 | FreeRTOS 30 | 2 31 | virtual:/virtual 32 | 33 | 34 | controlSUITE 35 | 2 36 | virtual:/virtual 37 | 38 | 39 | drivers 40 | 2 41 | virtual:/virtual 42 | 43 | 44 | libs 45 | 2 46 | virtual:/virtual 47 | 48 | 49 | FreeRTOS/list.c 50 | 1 51 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 52 | 53 | 54 | FreeRTOS/port 55 | 2 56 | virtual:/virtual 57 | 58 | 59 | FreeRTOS/queue.c 60 | 1 61 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 62 | 63 | 64 | FreeRTOS/tasks.c 65 | 1 66 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 67 | 68 | 69 | controlSUITE/F2837xS_CodeStartBranch.asm 70 | 1 71 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CodeStartBranch.asm 72 | 73 | 74 | controlSUITE/F2837xS_CpuTimers.c 75 | 1 76 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CpuTimers.c 77 | 78 | 79 | controlSUITE/F2837xS_DefaultISR.c 80 | 1 81 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_DefaultISR.c 82 | 83 | 84 | controlSUITE/F2837xS_Dma.c 85 | 1 86 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/F2837xS/v210/F2837xS_common/source/F2837xS_Dma.c 87 | 88 | 89 | controlSUITE/F2837xS_GlobalVariableDefs.c 90 | 1 91 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_headers/source/F2837xS_GlobalVariableDefs.c 92 | 93 | 94 | controlSUITE/F2837xS_Gpio.c 95 | 1 96 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_Gpio.c 97 | 98 | 99 | controlSUITE/F2837xS_PieCtrl.c 100 | 1 101 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieCtrl.c 102 | 103 | 104 | controlSUITE/F2837xS_PieVect.c 105 | 1 106 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieVect.c 107 | 108 | 109 | controlSUITE/F2837xS_SysCtrl.c 110 | 1 111 | PARENT-5-PROJECT_LOC/ti/controlSUITE/device_support/F2837xS/v210/F2837xS_common/source/F2837xS_SysCtrl.c 112 | 113 | 114 | drivers/spi.c 115 | 1 116 | PARENT-1-PROJECT_LOC/drivers/spi.c 117 | 118 | 119 | drivers/uart.c 120 | 1 121 | PARENT-1-PROJECT_LOC/drivers/uart.c 122 | 123 | 124 | libs/FatFs 125 | 2 126 | virtual:/virtual 127 | 128 | 129 | libs/sdcard_spi 130 | 2 131 | virtual:/virtual 132 | 133 | 134 | FreeRTOS/port/porASM.asm 135 | 1 136 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 137 | 138 | 139 | FreeRTOS/port/port.c 140 | 1 141 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 142 | 143 | 144 | FreeRTOS/port/portmacro.h 145 | 1 146 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 147 | 148 | 149 | libs/FatFs/diskio.c 150 | 1 151 | PARENT-1-PROJECT_LOC/libs/fatfs/diskio.c 152 | 153 | 154 | libs/FatFs/ff.c 155 | 1 156 | PARENT-1-PROJECT_LOC/libs/fatfs/ff.c 157 | 158 | 159 | libs/sdcard_spi/SD_SPI_Erase.c 160 | 1 161 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Erase.c 162 | 163 | 164 | libs/sdcard_spi/SD_SPI_Initialization.c 165 | 1 166 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Initialization.c 167 | 168 | 169 | libs/sdcard_spi/SD_SPI_Read.c 170 | 1 171 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Read.c 172 | 173 | 174 | libs/sdcard_spi/SD_SPI_Registers.c 175 | 1 176 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Registers.c 177 | 178 | 179 | libs/sdcard_spi/SD_SPI_Transmission.c 180 | 1 181 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Transmission.c 182 | 183 | 184 | libs/sdcard_spi/SD_SPI_Write.c 185 | 1 186 | PARENT-1-PROJECT_LOC/libs/sdcard_spi/SD_SPI_Write.c 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /examples/sdcard_f28377s/2837xS_Generic_FLASH_lnk.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0 : /* Program Memory */ 5 | /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */ 6 | /* BEGIN is used for the "boot to Flash" bootloader mode */ 7 | 8 | BEGIN : origin = 0x080000, length = 0x000002 9 | RAMM0 : origin = 0x000122, length = 0x0002DE 10 | RAMD0 : origin = 0x00B000, length = 0x000800 11 | RAMLS0 : origin = 0x008000, length = 0x000800 12 | RAMLS1 : origin = 0x008800, length = 0x000800 13 | RAMLS2 : origin = 0x009000, length = 0x000800 14 | RAMLS3 : origin = 0x009800, length = 0x000800 15 | RAMLS4 : origin = 0x00A000, length = 0x000800 16 | RESET : origin = 0x3FFFC0, length = 0x000002 17 | 18 | /* Flash sectors */ 19 | FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */ 20 | FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */ 21 | FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */ 22 | FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */ 23 | FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */ 24 | FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */ 25 | FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */ 26 | FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */ 27 | FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */ 28 | FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */ 29 | FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */ 30 | FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */ 31 | FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */ 32 | FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */ 33 | 34 | PAGE 1 : /* Data Memory */ 35 | /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */ 36 | 37 | BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ 38 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 39 | RAMD1 : origin = 0x00B800, length = 0x000800 40 | 41 | RAMLS5 : origin = 0x00A800, length = 0x000800 42 | 43 | RAMGS0 : origin = 0x00C000, length = 0x001000 44 | RAMGS1 : origin = 0x00D000, length = 0x001000 45 | RAMGS2 : origin = 0x00E000, length = 0x001000 46 | RAMGS3 : origin = 0x00F000, length = 0x001000 47 | RAMGS4 : origin = 0x010000, length = 0x001000 48 | RAMGS5 : origin = 0x011000, length = 0x001000 49 | RAMGS6 : origin = 0x012000, length = 0x001000 50 | RAMGS7 : origin = 0x013000, length = 0x001000 51 | RAMGS8 : origin = 0x014000, length = 0x001000 52 | RAMGS9 : origin = 0x015000, length = 0x001000 53 | RAMGS10 : origin = 0x016000, length = 0x001000 54 | RAMGS11 : origin = 0x017000, length = 0x001000 55 | } 56 | 57 | SECTIONS 58 | { 59 | /* Allocate program areas: */ 60 | .cinit : > FLASHB PAGE = 0, ALIGN(4) 61 | .pinit : > FLASHB, PAGE = 0, ALIGN(4) 62 | .text : >> FLASHB | FLASHC | FLASHD | FLASHE PAGE = 0, ALIGN(4) 63 | codestart : > BEGIN PAGE = 0, ALIGN(4) 64 | 65 | /* Allocate uninitalized data sections: */ 66 | .stack : > RAMM1 PAGE = 1 67 | .ebss : >> RAMLS5 | RAMGS0 | RAMGS1 PAGE = 1 68 | .esysmem : > RAMLS5 PAGE = 1 69 | 70 | /* Initalized sections go in Flash */ 71 | .econst : >> FLASHF | FLASHG | FLASHH PAGE = 0, ALIGN(4) 72 | .switch : > FLASHB PAGE = 0, ALIGN(4) 73 | 74 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 75 | 76 | #ifdef __TI_COMPILER_VERSION__ 77 | #if __TI_COMPILER_VERSION__ >= 15009000 78 | .TI.ramfunc : {} LOAD = FLASHD, 79 | RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3, 80 | LOAD_START(_RamfuncsLoadStart), 81 | LOAD_SIZE(_RamfuncsLoadSize), 82 | LOAD_END(_RamfuncsLoadEnd), 83 | RUN_START(_RamfuncsRunStart), 84 | RUN_SIZE(_RamfuncsRunSize), 85 | RUN_END(_RamfuncsRunEnd), 86 | PAGE = 0, ALIGN(4) 87 | #else 88 | ramfuncs : LOAD = FLASHD, 89 | RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3, 90 | LOAD_START(_RamfuncsLoadStart), 91 | LOAD_SIZE(_RamfuncsLoadSize), 92 | LOAD_END(_RamfuncsLoadEnd), 93 | RUN_START(_RamfuncsRunStart), 94 | RUN_SIZE(_RamfuncsRunSize), 95 | RUN_END(_RamfuncsRunEnd), 96 | PAGE = 0, ALIGN(4) 97 | #endif 98 | #endif 99 | 100 | ramgs0 : > RAMGS0, PAGE = 1 101 | ramgs1 : > RAMGS1, PAGE = 1 102 | ramgs2 : > RAMGS2, PAGE = 1 103 | ramgs3 : > RAMGS3, PAGE = 1 104 | 105 | /* The following section definitions are for SDFM examples */ 106 | Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 107 | Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 108 | Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 109 | Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 110 | Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333 111 | } 112 | 113 | /* 114 | //=========================================================================== 115 | // End of file. 116 | //=========================================================================== 117 | */ 118 | -------------------------------------------------------------------------------- /examples/sdcard_f28377s/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 200000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | #define configUSE_MUTEXES 1 32 | 33 | // Set the following definitions to 1 to include the API function, or zero 34 | // to exclude the API function. 35 | 36 | #define INCLUDE_vTaskPrioritySet 0 37 | #define INCLUDE_uxTaskPriorityGet 0 38 | #define INCLUDE_vTaskDelete 0 39 | #define INCLUDE_vTaskCleanUpResources 0 40 | #define INCLUDE_vTaskSuspend 0 41 | #define INCLUDE_vTaskDelayUntil 0 42 | #define INCLUDE_vTaskDelay 1 43 | 44 | #endif /* FREERTOS_CONFIG_H */ 45 | 46 | -------------------------------------------------------------------------------- /examples/sdcard_f28377s/targetConfigs/TMS320F28377S.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/sdcard_f28377s/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /examples/uart_f28377s/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/uart_f28377s/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | uart_f28377s 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 | FreeRTOS 30 | 2 31 | virtual:/virtual 32 | 33 | 34 | controlSUITE 35 | 2 36 | virtual:/virtual 37 | 38 | 39 | drivers 40 | 2 41 | virtual:/virtual 42 | 43 | 44 | FreeRTOS/list.c 45 | 1 46 | PARENT-2-PROJECT_LOC/FreeRTOS/list.c 47 | 48 | 49 | FreeRTOS/port 50 | 2 51 | virtual:/virtual 52 | 53 | 54 | FreeRTOS/queue.c 55 | 1 56 | PARENT-2-PROJECT_LOC/FreeRTOS/queue.c 57 | 58 | 59 | FreeRTOS/tasks.c 60 | 1 61 | PARENT-2-PROJECT_LOC/FreeRTOS/tasks.c 62 | 63 | 64 | controlSUITE/F2837xS_CodeStartBranch.asm 65 | 1 66 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CodeStartBranch.asm 67 | 68 | 69 | controlSUITE/F2837xS_CpuTimers.c 70 | 1 71 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_CpuTimers.c 72 | 73 | 74 | controlSUITE/F2837xS_DefaultISR.c 75 | 1 76 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_DefaultISR.c 77 | 78 | 79 | controlSUITE/F2837xS_GlobalVariableDefs.c 80 | 1 81 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_headers/source/F2837xS_GlobalVariableDefs.c 82 | 83 | 84 | controlSUITE/F2837xS_Gpio.c 85 | 1 86 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_Gpio.c 87 | 88 | 89 | controlSUITE/F2837xS_PieCtrl.c 90 | 1 91 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieCtrl.c 92 | 93 | 94 | controlSUITE/F2837xS_PieVect.c 95 | 1 96 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_PieVect.c 97 | 98 | 99 | controlSUITE/F2837xS_SysCtrl.c 100 | 1 101 | TI_PRODUCTS_DIR/controlSUITE/device_support/F2837xS/v200/F2837xS_common/source/F2837xS_SysCtrl.c 102 | 103 | 104 | drivers/uart.c 105 | 1 106 | PARENT-1-PROJECT_LOC/drivers/uart.c 107 | 108 | 109 | FreeRTOS/port/porASM.asm 110 | 1 111 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/porASM.asm 112 | 113 | 114 | FreeRTOS/port/port.c 115 | 1 116 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/port.c 117 | 118 | 119 | FreeRTOS/port/portmacro.h 120 | 1 121 | PARENT-2-PROJECT_LOC/FreeRTOS/portable/CCS/c28x/portmacro.h 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /examples/uart_f28377s/2837xS_Generic_RAM_lnk.cmd: -------------------------------------------------------------------------------- 1 | 2 | MEMORY 3 | { 4 | PAGE 0 : 5 | /* BEGIN is used for the "boot to SARAM" bootloader mode */ 6 | 7 | BEGIN : origin = 0x000000, length = 0x000002 8 | RAMM0 : origin = 0x000122, length = 0x0002DE 9 | RAMD0 : origin = 0x00B000, length = 0x000800 10 | RAMLS0 : origin = 0x008000, length = 0x000800 11 | RAMLS1 : origin = 0x008800, length = 0x000800 12 | RAMLS2 : origin = 0x009000, length = 0x000800 13 | RAMLS3 : origin = 0x009800, length = 0x000800 14 | RAMLS4 : origin = 0x00A000, length = 0x000800 15 | RESET : origin = 0x3FFFC0, length = 0x000002 16 | 17 | PAGE 1 : 18 | 19 | BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ 20 | RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ 21 | RAMD1 : origin = 0x00B800, length = 0x000800 22 | 23 | 24 | RAMLS5 : origin = 0x00A800, length = 0x000800 25 | 26 | RAMGS0 : origin = 0x00C000, length = 0x001000 27 | RAMGS1 : origin = 0x00D000, length = 0x001000 28 | RAMGS2 : origin = 0x00E000, length = 0x001000 29 | RAMGS3 : origin = 0x00F000, length = 0x001000 30 | RAMGS4 : origin = 0x010000, length = 0x001000 31 | RAMGS5 : origin = 0x011000, length = 0x001000 32 | RAMGS6 : origin = 0x012000, length = 0x001000 33 | RAMGS7 : origin = 0x013000, length = 0x001000 34 | RAMGS8 : origin = 0x014000, length = 0x001000 35 | RAMGS9 : origin = 0x015000, length = 0x001000 36 | RAMGS10 : origin = 0x016000, length = 0x001000 37 | RAMGS11 : origin = 0x017000, length = 0x001000 38 | 39 | CANA_MSG_RAM : origin = 0x049000, length = 0x000800 40 | CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 41 | } 42 | 43 | 44 | SECTIONS 45 | { 46 | codestart : > BEGIN, PAGE = 0 47 | ramfuncs : > RAMM0 PAGE = 0 48 | .text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0 49 | .cinit : > RAMM0, PAGE = 0 50 | .pinit : > RAMM0, PAGE = 0 51 | .switch : > RAMM0, PAGE = 0 52 | .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ 53 | 54 | .stack : > RAMM1, PAGE = 1 55 | .ebss : > RAMLS5, PAGE = 1 56 | .econst : > RAMLS5, PAGE = 1 57 | .esysmem : > RAMLS5, PAGE = 1 58 | 59 | ramgs0 : > RAMGS0, PAGE = 1 60 | ramgs1 : > RAMGS1, PAGE = 1 61 | 62 | #ifdef __TI_COMPILER_VERSION 63 | #if __TI_COMPILER_VERSION >= 15009000 64 | .TI.ramfunc : {} > RAMM0, PAGE = 0 65 | #endif 66 | #endif 67 | 68 | /* The following section definitions are for SDFM examples */ 69 | Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 70 | Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 71 | Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 72 | Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 73 | Difference_RegsFile : >RAMGS5, PAGE = 1, fill=0x3333 74 | } 75 | 76 | /* 77 | //=========================================================================== 78 | // End of file. 79 | //=========================================================================== 80 | */ 81 | -------------------------------------------------------------------------------- /examples/uart_f28377s/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERTOS_CONFIG_H 2 | #define FREERTOS_CONFIG_H 3 | 4 | //-------------------------------------------------------------------------------------------------- 5 | // Application specific definitions. 6 | // 7 | // These definitions should be adjusted for your particular hardware and 8 | // application requirements. 9 | // 10 | // THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 11 | // FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 12 | // 13 | // See http://www.freertos.org/a00110.html. 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define configUSE_PREEMPTION 1 17 | #define configUSE_IDLE_HOOK 0 18 | #define configUSE_TICK_HOOK 0 19 | #define configCPU_CLOCK_HZ ( ( unsigned long ) 200000000 ) 20 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 21 | #define configMAX_PRIORITIES ( 5 ) 22 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) 23 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) 24 | #define configMAX_TASK_NAME_LEN ( 16 ) 25 | #define configUSE_TRACE_FACILITY 0 26 | #define configUSE_16_BIT_TICKS 0 27 | #define configIDLE_SHOULD_YIELD 0 28 | #define configCHECK_FOR_STACK_OVERFLOW 2 29 | #define configSUPPORT_STATIC_ALLOCATION 1 30 | #define configSUPPORT_DYNAMIC_ALLOCATION 0 31 | #define configUSE_MUTEXES 1 32 | 33 | // Set the following definitions to 1 to include the API function, or zero 34 | // to exclude the API function. 35 | 36 | #define INCLUDE_vTaskPrioritySet 0 37 | #define INCLUDE_uxTaskPriorityGet 0 38 | #define INCLUDE_vTaskDelete 0 39 | #define INCLUDE_vTaskCleanUpResources 0 40 | #define INCLUDE_vTaskSuspend 0 41 | #define INCLUDE_vTaskDelayUntil 0 42 | #define INCLUDE_vTaskDelay 1 43 | 44 | #endif /* FREERTOS_CONFIG_H */ 45 | 46 | -------------------------------------------------------------------------------- /examples/uart_f28377s/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "F28x_Project.h" // Device Headerfile and Examples Include File 3 | #include "FreeRTOS.h" 4 | #include "task.h" 5 | #include "semphr.h" 6 | #include "uart.h" 7 | 8 | #define STACK_SIZE 256U 9 | #define RED 0xDEADBEAF 10 | #define BLUE 0xBAADF00D 11 | #define RX_BUFF_SIZE 10 12 | 13 | static StaticTask_t redTaskBuffer; 14 | static StackType_t redTaskStack[STACK_SIZE]; 15 | 16 | static StaticTask_t blueTaskBuffer; 17 | static StackType_t blueTaskStack[STACK_SIZE]; 18 | 19 | static StaticTask_t idleTaskBuffer; 20 | static StackType_t idleTaskStack[STACK_SIZE]; 21 | 22 | //------------------------------------------------------------------------------------------------- 23 | void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName ) 24 | { 25 | while(1); 26 | } 27 | 28 | //------------------------------------------------------------------------------------------------- 29 | static void blueLedToggle(void) 30 | { 31 | static uint32_t counter = 0; 32 | 33 | counter++; 34 | GPIO_WritePin(13, counter & 1); 35 | } 36 | 37 | //------------------------------------------------------------------------------------------------- 38 | static void redLedToggle(void) 39 | { 40 | static uint32_t counter = 0; 41 | 42 | counter++; 43 | GPIO_WritePin(12, counter & 1); 44 | } 45 | 46 | //------------------------------------------------------------------------------------------------- 47 | static void ledToggle(uint32_t led) 48 | { 49 | if(RED == led) 50 | { 51 | redLedToggle(); 52 | } 53 | else 54 | if(BLUE == led) 55 | { 56 | blueLedToggle(); 57 | } 58 | } 59 | 60 | //------------------------------------------------------------------------------------------------- 61 | void vApplicationSetupTimerInterrupt( void ) 62 | { 63 | // Start the timer than activate timer interrupt to switch into first task. 64 | EALLOW; 65 | PieVectTable.TIMER2_INT = &portTICK_ISR; 66 | EDIS; 67 | 68 | ConfigCpuTimer(&CpuTimer2, 69 | configCPU_CLOCK_HZ / 1000000, // CPU clock in MHz 70 | 1000000 / configTICK_RATE_HZ); // Timer period in uS 71 | CpuTimer2Regs.TCR.all = 0x4000; // Enable interrupt and start timer 72 | IER |= M_INT14; 73 | } 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | void LED_TaskRed(void * pvParameters) 77 | { 78 | uint16_t br = 0; 79 | uint8_t buffer[RX_BUFF_SIZE] = {0}; 80 | 81 | for(;;) 82 | { 83 | br = UART_receive(buffer, RX_BUFF_SIZE, 100 / portTICK_PERIOD_MS); 84 | if(br > 0) 85 | { 86 | ledToggle((uint32_t)pvParameters); 87 | UART_send(buffer, br); 88 | } 89 | } 90 | } 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | void LED_TaskBlue(void * pvParameters) 94 | { 95 | const char str[] = "Test UART task 1\n\r"; 96 | 97 | for(;;) 98 | { 99 | ledToggle((uint32_t)pvParameters); 100 | UART_send((uint8_t*)str, strlen(str)); 101 | 102 | vTaskDelay(100 / portTICK_PERIOD_MS); 103 | } 104 | } 105 | 106 | //------------------------------------------------------------------------------------------------- 107 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 108 | { 109 | *ppxIdleTaskTCBBuffer = &idleTaskBuffer; 110 | *ppxIdleTaskStackBuffer = idleTaskStack; 111 | *pulIdleTaskStackSize = STACK_SIZE; 112 | } 113 | 114 | //------------------------------------------------------------------------------------------------- 115 | void main(void) 116 | { 117 | // Step 1. Initialize System Control: 118 | // PLL, WatchDog, enable Peripheral Clocks 119 | // This example function is found in the F2837xS_SysCtrl.c file. 120 | InitSysCtrl(); 121 | 122 | // Step 2. Initialize GPIO: 123 | // This example function is found in the F2837xS_Gpio.c file and 124 | // illustrates how to set the GPIO to it's default state. 125 | InitCpuTimers(); 126 | InitGpio(); 127 | GPIO_SetupPinMux(12, GPIO_MUX_CPU1, 0); 128 | GPIO_SetupPinMux(13, GPIO_MUX_CPU1, 0); 129 | GPIO_SetupPinOptions(12, GPIO_OUTPUT, GPIO_PUSHPULL); 130 | GPIO_SetupPinOptions(13, GPIO_OUTPUT, GPIO_PUSHPULL); 131 | GPIO_WritePin(12, 1); 132 | GPIO_WritePin(13, 1); 133 | 134 | // Step 3. Clear all interrupts and initialize PIE vector table: 135 | // Disable CPU interrupts 136 | DINT; 137 | 138 | // Initialize the PIE control registers to their default state. 139 | // The default state is all PIE interrupts disabled and flags 140 | // are cleared. 141 | // This function is found in the F2837xS_PieCtrl.c file. 142 | InitPieCtrl(); 143 | 144 | // Disable CPU interrupts and clear all CPU interrupt flags: 145 | IER = 0x0000; 146 | IFR = 0x0000; 147 | 148 | InitPieVectTable(); 149 | 150 | // Initialize the PIE vector table with pointers to the shell Interrupt 151 | // Service Routines (ISR). 152 | // This will populate the entire table, even if the interrupt 153 | // is not used in this example. This is useful for debug purposes. 154 | // The shell ISR routines are found in F2837xS_DefaultIsr.c. 155 | // This function is found in F2837xS_PieVect.c. 156 | InitPieVectTable(); 157 | 158 | UART_open(); 159 | 160 | // Enable global Interrupts and higher priority real-time debug events: 161 | EINT; // Enable Global interrupt INTM 162 | ERTM; // Enable Global realtime interrupt DBGM 163 | 164 | // Create the task without using any dynamic memory allocation. 165 | xTaskCreateStatic(LED_TaskRed, // Function that implements the task. 166 | "Red LED task", // Text name for the task. 167 | STACK_SIZE, // Number of indexes in the xStack array. 168 | ( void * ) RED, // Parameter passed into the task. 169 | tskIDLE_PRIORITY + 1, // Priority at which the task is created. 170 | redTaskStack, // Array to use as the task's stack. 171 | &redTaskBuffer ); // Variable to hold the task's data structure. 172 | 173 | xTaskCreateStatic(LED_TaskBlue, // Function that implements the task. 174 | "Blue LED task", // Text name for the task. 175 | STACK_SIZE, // Number of indexes in the xStack array. 176 | ( void * ) BLUE, // Parameter passed into the task. 177 | tskIDLE_PRIORITY + 1, // Priority at which the task is created. 178 | blueTaskStack, // Array to use as the task's stack. 179 | &blueTaskBuffer ); // Variable to hold the task's data structure. 180 | 181 | vTaskStartScheduler(); 182 | } 183 | -------------------------------------------------------------------------------- /examples/uart_f28377s/targetConfigs/TMS320F28377S.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/uart_f28377s/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. --------------------------------------------------------------------------------