Update repo

This commit is contained in:
hangpersonal committed 2026-08-30 23:04:35 -07:00
1 parent 749dab5721
commit ce65a0f59a
14950 files changed
+4408250 -1

No files matched your search

@@ -0,0 +1,40 @@
<projectSpec>
<project
name="gpio_ex1_setup"
device="TMS320F28388D"
cgtVersion="22.6.1.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
postBuildStep="
echo &quot;========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) =============&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js&quot; &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/&quot; &quot;${BuildDirectory}/syscfg&quot; &quot;${BuildDirectory}/syscfg/clb.dot&quot;
;if ${GENERATE_DIAGRAM} == 1 mkdir &quot;${BuildDirectory}/diagrams&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js&quot; &quot;${C2000WARE_ROOT}&quot; &quot;${BuildDirectory}/diagrams&quot; &quot;${BuildDirectory}/syscfg&quot;
"
>
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../gpio_ex1_setup.c" targetDirectory="" />
<file action="copy" path="../../empty_projects/c2000.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,34 @@
<projectSpec>
<project
name="gpio_ex2_toggle"
device="TMS320F28388D"
cgtVersion="22.6.1.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json"
postBuildStep="
echo &quot;========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) =============&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js&quot; &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/&quot; &quot;${BuildDirectory}/syscfg&quot; &quot;${BuildDirectory}/syscfg/clb.dot&quot;
;if ${GENERATE_DIAGRAM} == 1 mkdir &quot;${BuildDirectory}/diagrams&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js&quot; &quot;${C2000WARE_ROOT}&quot; &quot;${BuildDirectory}/diagrams&quot; &quot;${BuildDirectory}/syscfg&quot;
;if ${GUI_SUPPORT} == 1 &quot;${BuildDirectory}/syscfg/gui_setup.bat&quot;
"
>
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --define=generic_ram_lnk --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs -lboard.cmd.genlibs -ldevice_cmd.cmd.genlibs --define=generic_ram_lnk" />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} --define=_FLASH --define=generic_flash_lnk -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs -lboard.cmd.genlibs -ldevice_cmd.cmd.genlibs --define=generic_flash_lnk" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
<buildVariable name="CLB_DEBUG" value="0" scope="project" />
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
<buildVariable name="GUI_SUPPORT" value="0" scope="project" />
<file action="copy" path="../gpio_ex2_toggle.c" targetDirectory="" />
<file action="copy" path="../gpio_ex2_toggle.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,41 @@
<projectSpec>
<project
name="gpio_ex3_interrupt"
device="TMS320F28388D"
cgtVersion="22.6.1.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
postBuildStep="
echo &quot;========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) =============&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js&quot; &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/&quot; &quot;${BuildDirectory}/syscfg&quot; &quot;${BuildDirectory}/syscfg/clb.dot&quot;
;if ${GENERATE_DIAGRAM} == 1 mkdir &quot;${BuildDirectory}/diagrams&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js&quot; &quot;${C2000WARE_ROOT}&quot; &quot;${BuildDirectory}/diagrams&quot; &quot;${BuildDirectory}/syscfg&quot;
"
>
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../gpio_ex3_interrupt.c" targetDirectory="" />
<file action="copy" path="../gpio_ex3_interrupt.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,40 @@
<projectSpec>
<project
name="gpio_ex5_interrupt_sysconfig"
device="TMS320F28388D"
cgtVersion="22.6.1.LTS"
products="sysconfig;C2000WARE"
outputFormat="ELF"
launchWizard="False"
linkerCommandFile=""
enableSysConfigTool="true"
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
postBuildStep="
echo &quot;========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) =============&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js&quot; &quot;${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/&quot; &quot;${BuildDirectory}/syscfg&quot; &quot;${BuildDirectory}/syscfg/clb.dot&quot;
;if ${GENERATE_DIAGRAM} == 1 mkdir &quot;${BuildDirectory}/diagrams&quot;
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} &quot;${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js&quot; &quot;${C2000WARE_ROOT}&quot; &quot;${BuildDirectory}/diagrams&quot; &quot;${BuildDirectory}/syscfg&quot;
"
>
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
<file action="copy" path="../gpio_ex5_interrupt_sysconfig.c" targetDirectory="" />
<file action="copy" path="../gpio_ex5_interrupt_sysconfig.syscfg" targetDirectory="" />
</project>
</projectSpec>
@@ -0,0 +1,493 @@
//#############################################################################
//
// FILE: gpio_ex1_setup.c
//
// TITLE: Device GPIO Setup
//
//! \addtogroup driver_example_list
//! <h1> Device GPIO Setup </h1>
//!
//! Configures the device GPIO into two different configurations
//! This code is verbose to illustrate how the GPIO could be setup.
//! In a real application, lines of code can be combined for improved
//! code size and efficiency.
//!
//! This example only sets-up the GPIO. Nothing is actually done with
//! the pins after setup.
//!
//! \b In \b general: \n
//! - All pullup resistors are enabled. For ePWMs this may not be desired.
//! - Input qual for communication ports (CAN, SPI, SCI, I2C) is asynchronous
//! - Input qual for Trip pins (TZ) is asynchronous
//! - Input qual for eCAP and eQEP signals is synch to SYSCLKOUT
//! - Input qual for some I/O's and __interrupts may have a sampling window
//
//#############################################################################
//
//
//
// C2000Ware v5.04.00.00
//
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################
//
// Included Files
//
#include "device.h"
//
// Defines
// Select the example to compile in. Only one example should be set as 1
// the rest should be set as 0.
//
#define EXAMPLE1 1 // Basic pinout configuration example
#define EXAMPLE2 0 // Communication pinout example
//
// Function Prototypes
//
void setup1GPIO(void);
void setup2GPIO(void);
//
// Main
//
void main(void)
{
//
// Initializes system control, device clock, and peripherals
//
Device_init();
//
// Initializes PIE and clear PIE registers. Disables CPU interrupts.
// and clear all CPU interrupt flags.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
#if EXAMPLE1
//
// This example is a basic pinout
//
setup1GPIO();
#endif // - EXAMPLE1
#if EXAMPLE2
//
// This example is a communications pinout
//
setup2GPIO();
#endif
}
//
// setup1GPIO - Is an example that demonstrates the basic pinout
//
void
setup1GPIO(void)
{
//
// Example 1: Basic Pinout.
// This basic pinout includes:
// PWM1-3, ECAP1, ECAP2, TZ1-TZ4, SPI-A, EQEP1, SCI-A, CAN-A, I2C
// and a number of I/O pins
// These can be combined into single statements for improved
// code efficiency.
//
//
// Enable PWM1-3 on GPIO0-GPIO5
//
GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO0
GPIO_setPadConfig(1, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO1
GPIO_setPadConfig(2, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO2
GPIO_setPadConfig(3, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO3
GPIO_setPadConfig(4, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO4
GPIO_setPadConfig(5, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO5
GPIO_setPinConfig(GPIO_0_EPWM1A); // GPIO0 = PWM1A
GPIO_setPinConfig(GPIO_1_EPWM1B); // GPIO1 = PWM1B
GPIO_setPinConfig(GPIO_2_EPWM2A); // GPIO2 = PWM2A
GPIO_setPinConfig(GPIO_3_EPWM2B); // GPIO3 = PWM2B
GPIO_setPinConfig(GPIO_4_EPWM3A); // GPIO4 = PWM3A
GPIO_setPinConfig(GPIO_5_EPWM3B); // GPIO5 = PWM3B
//
// Enable a GPIO output on GPIO6, set it high
//
GPIO_setPadConfig(6, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO6
GPIO_writePin(6, 1); // Load output latch
GPIO_setPinConfig(GPIO_6_GPIO6); // GPIO6 = GPIO6
GPIO_setDirectionMode(6, GPIO_DIR_MODE_OUT); // GPIO6 = output
//
// Enable eCAP1 on GPIO7
//
GPIO_setPadConfig(7, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO7
GPIO_setQualificationMode(7, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT7, 7); // GPIO7 = ECAP1
//
// Enable GPIO outputs on GPIO8 - GPIO11, set it high
//
GPIO_setPadConfig(8, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO8
GPIO_writePin(8, 1); // Load output latch
GPIO_setPinConfig(GPIO_8_GPIO8); // GPIO8 = GPIO8
GPIO_setDirectionMode(8, GPIO_DIR_MODE_OUT); // GPIO8 = output
GPIO_setPadConfig(9, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO9
GPIO_writePin(9, 1); // Load output latch
GPIO_setPinConfig(GPIO_9_GPIO9); // GPIO9 = GPIO9
GPIO_setDirectionMode(9, GPIO_DIR_MODE_OUT); // GPIO9 = output
GPIO_setPadConfig(10, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO10
GPIO_writePin(10, 1); // Load output latch
GPIO_setPinConfig(GPIO_10_GPIO10); // GPIO10 = GPIO10
GPIO_setDirectionMode(10, GPIO_DIR_MODE_OUT); // GPIO10 = output
GPIO_setPadConfig(11, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO11
GPIO_writePin(11, 1); // Load output latch
GPIO_setPinConfig(GPIO_11_GPIO11); // GPIO11 = GPIO11
GPIO_setDirectionMode(11, GPIO_DIR_MODE_OUT); // GPIO11 = output
//
// Enable Trip Zone inputs on GPIO12 - GPIO14
//
GPIO_setPadConfig(12, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO12
GPIO_setPadConfig(13, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO13
GPIO_setPadConfig(14, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO14
GPIO_setQualificationMode(12, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(13, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(14, GPIO_QUAL_ASYNC); // asynch input
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT1, 12); // GPIO12 = TZ1
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT2, 13); // GPIO13 = TZ2
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT3, 14); // GPIO14 = TZ3
//
// Enable SPI-A on GPIO16 - GPIO19
//
GPIO_setPadConfig(16, GPIO_PIN_TYPE_PULLUP); // Pullup GPIO16 (SPISIMOA)
GPIO_setPadConfig(17, GPIO_PIN_TYPE_PULLUP); // Pullup GPIO17 (SPIS0MIA)
GPIO_setPadConfig(18, GPIO_PIN_TYPE_PULLUP); // Pullup GPIO18 (SPICLKA)
GPIO_setPadConfig(19, GPIO_PIN_TYPE_PULLUP); // Pullup GPIO19 (SPISTEA)
GPIO_setQualificationMode(16, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(17, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(19, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_16_SPIA_SIMO); // GPIO16 = SPISIMOA
GPIO_setPinConfig(GPIO_17_SPIA_SOMI); // GPIO17 = SPIS0MIA
GPIO_setPinConfig(GPIO_18_SPIA_CLK); // GPIO18 = SPICLKA
GPIO_setPinConfig(GPIO_19_SPIA_STEN); // GPIO19 = SPISTEA
//
// Enable EQEP1 on GPIO's 20,21,22,23
//
GPIO_setPadConfig(20, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO20
GPIO_setPadConfig(21, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO21
GPIO_setPadConfig(22, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO22
GPIO_setPadConfig(23, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO23
GPIO_setQualificationMode(20, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
GPIO_setQualificationMode(21, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
GPIO_setQualificationMode(22, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
GPIO_setQualificationMode(23, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
GPIO_setPinConfig(GPIO_20_EQEP1_A); // GPIO20 = EQEP1A
GPIO_setPinConfig(GPIO_21_EQEP1_B); // GPIO21 = EQEP1B
GPIO_setPinConfig(GPIO_22_EQEP1_STROBE); // GPIO22 = EQEP1S
GPIO_setPinConfig(GPIO_23_EQEP1_INDEX); // GPIO23 = EQEP1I
//
// Enable eCAP1 on GPIO24
//
GPIO_setPadConfig(24, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO24 (ECAP1)
GPIO_setQualificationMode(24, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT7, 24); // GPIO24 = ECAP1
//
// Set input qualification period for GPIO25 & GPIO26
//
GPIO_setQualificationPeriod(24, 2); // Qual period=SYSCLKOUT/2
GPIO_setQualificationMode(25, GPIO_QUAL_6SAMPLE);// 6 samples
GPIO_setQualificationMode(26, GPIO_QUAL_6SAMPLE);// 6 samples
//
// Make GPIO25 the input source for XINT1
//
GPIO_setPinConfig(GPIO_25_GPIO25); // GPIO25 = GPIO25
GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN); // GPIO25 = input
GPIO_setInterruptPin(25,GPIO_INT_XINT1); // XINT1 connected to GPIO25
//
// Make GPIO26 the input source for XINT2
//
GPIO_setPinConfig(GPIO_26_GPIO26); // GPIO26 = GPIO26
GPIO_setDirectionMode(26, GPIO_DIR_MODE_IN); // GPIO26 = input
GPIO_setInterruptPin(26, GPIO_INT_XINT2); // XINT2 connected to GPIO26
//
// Make GPIO27 wakeup from STANDBY Low Power Modes
//
GPIO_setPinConfig(GPIO_27_GPIO27); // GPIO27 = GPIO27
GPIO_setDirectionMode(27, GPIO_DIR_MODE_IN); // GPIO27 = input
SysCtl_enableLPMWakeupPin(27); // GPIO27 will wake the device
SysCtl_setStandbyQualificationPeriod(2); // Qualify GPIO27 by 2 OSCCLK
// cycles before waking
// the device from STANDBY
//
// Enable SCI-A on GPIO28 - GPIO29
//
GPIO_setPadConfig(28, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO28
GPIO_setQualificationMode(28, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_28_SCIA_RX); // GPIO28 = SCIRXDA
GPIO_setPadConfig(29, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO29
GPIO_setPinConfig(GPIO_29_SCIA_TX); // GPIO29 = SCITXDA
//
// Enable CAN-A on GPIO30 - GPIO31
//
GPIO_setPadConfig(30, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO30
GPIO_setPinConfig(GPIO_30_CANA_RX); // GPIO30 = CANRXA
GPIO_setPadConfig(31, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO31
GPIO_setQualificationMode(31, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_31_CANA_TX); // GPIO31 = CANTXA
//
// Enable I2C-A on GPIO32 - GPIO33
//
GPIO_setPadConfig(32, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO32
GPIO_setPinConfig(GPIO_32_I2CA_SDA); // GPIO32 = SDAA
GPIO_setQualificationMode(32, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPadConfig(33, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO33
GPIO_setQualificationMode(33, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_33_I2CA_SCL); // GPIO33 = SCLA
//
// Make GPIO34 an input on GPIO34
//
GPIO_setPadConfig(34, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO34
GPIO_setPinConfig(GPIO_34_GPIO34); // GPIO34 = GPIO34
GPIO_setDirectionMode(34, GPIO_DIR_MODE_IN); // GPIO34 = input
}
//
// setup2GPIO - Is an example that demonstrates the communications pinout
//
void
setup2GPIO(void)
{
//
// Example 2:
// Communications Pinout.
// This basic communications pinout includes:
// PWM1-3, CAP1, SPI-B, CAN-A, SCI-A and I2C
// and a number of I/O pins
//
//
// Enable PWM1-3 on GPIO0-GPIO5
//
GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO0
GPIO_setPadConfig(1, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO1
GPIO_setPadConfig(2, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO2
GPIO_setPadConfig(3, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO3
GPIO_setPadConfig(4, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO4
GPIO_setPadConfig(5, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO5
GPIO_setPinConfig(GPIO_0_EPWM1A); // GPIO0 = PWM1A
GPIO_setPinConfig(GPIO_1_EPWM1B); // GPIO1 = PWM1B
GPIO_setPinConfig(GPIO_2_EPWM2A); // GPIO2 = PWM2A
GPIO_setPinConfig(GPIO_3_EPWM2B); // GPIO3 = PWM2B
GPIO_setPinConfig(GPIO_4_EPWM3A); // GPIO4 = PWM3A
GPIO_setPinConfig(GPIO_5_EPWM3B); // GPIO5 = PWM3B
//
// Enable an GPIO output on GPIO6
//
GPIO_setPadConfig(6, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO6
GPIO_writePin(6, 1); // Load output latch
GPIO_setPinConfig(GPIO_6_GPIO6); // GPIO6 = GPIO6
GPIO_setDirectionMode(6, GPIO_DIR_MODE_OUT); // GPIO6 = output
//
// Enable eCAP1 on GPIO7
//
GPIO_setPadConfig(7, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO7
GPIO_setQualificationMode(7, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT7, 7); // GPIO7 = ECAP1
//
// Enable GPIO outputs on GPIO8 - GPIO11
//
GPIO_setPadConfig(8, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO8
GPIO_writePin(8, 1); // Load output latch
GPIO_setPinConfig(GPIO_8_GPIO8); // GPIO8 = GPIO8
GPIO_setDirectionMode(8, GPIO_DIR_MODE_OUT); // GPIO8 = output
GPIO_setPadConfig(9, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO9
GPIO_writePin(9, 1); // Load output latch
GPIO_setPinConfig(GPIO_9_GPIO9); // GPIO9 = GPIO9
GPIO_setDirectionMode(9, GPIO_DIR_MODE_OUT); // GPIO9 = output
GPIO_setPadConfig(10, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO10
GPIO_writePin(10, 1); // Load output latch
GPIO_setPinConfig(GPIO_10_GPIO10); // GPIO10 = GPIO10
GPIO_setDirectionMode(10, GPIO_DIR_MODE_OUT); // GPIO10 = output
GPIO_setPadConfig(11, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO11
GPIO_writePin(11, 1); // Load output latch
GPIO_setPinConfig(GPIO_11_GPIO11); // GPIO11 = GPIO11
GPIO_setDirectionMode(11, GPIO_DIR_MODE_OUT); // GPIO11 = output
//
// Enable SPI-B on GPIO22 - GPIO25
//
GPIO_setPadConfig(22, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO22 (SPICLKB)
GPIO_setPadConfig(23, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO23 (SPISTEB)
GPIO_setPadConfig(24, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO24 (SPISIMOB)
GPIO_setPadConfig(25, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO25 (SPISOMIB)
GPIO_setQualificationMode(22, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(23, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(24, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(25, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_22_GPIO22); // Set Group Mux
GPIO_setPinConfig(GPIO_23_GPIO23); // Set Group Mux
GPIO_setPinConfig(GPIO_24_GPIO24); // Set Group Mux
GPIO_setPinConfig(GPIO_25_GPIO25); // Set Group Mux
GPIO_setPinConfig(GPIO_22_SPIB_CLK); // GPIO22 = SPICLK
GPIO_setPinConfig(GPIO_23_SPIB_STEN); // GPIO23 = SPISTEB
GPIO_setPinConfig(GPIO_24_SPIB_SIMO); // GPIO24 = SPISIMOB
GPIO_setPinConfig(GPIO_25_SPIB_SOMI); // GPIO25 = SPISOMIB
//
// Enable SPI-A on GPIO16 - GPIO19
//
GPIO_setPadConfig(16, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO16 (SPISIMOA)
GPIO_setPadConfig(17, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO17 (SPIS0MIA)
GPIO_setPadConfig(18, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO18 (SPICLKA)
GPIO_setPadConfig(19, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO19 (SPISTEA)
GPIO_setQualificationMode(16, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(17, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(19, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_16_SPIA_SIMO); // GPIO16 = SPISIMOA
GPIO_setPinConfig(GPIO_17_SPIA_SOMI); // GPIO17 = SPIS0MIA
GPIO_setPinConfig(GPIO_18_SPIA_CLK); // GPIO18 = SPICLKA
GPIO_setPinConfig(GPIO_19_SPIA_STEN); // GPIO19 = SPISTEA
//
// Enable eCAP1 on GPIO24
//
GPIO_setPadConfig(24, GPIO_PIN_TYPE_PULLUP); // Pullup on GPIO24 (ECAP1)
GPIO_setQualificationMode(24, GPIO_QUAL_SYNC); // Synch to SYSCLKOUT
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT7, 24); // GPIO24 = ECAP1
//
// Set input qualifcation period for GPIO25 & GPIO26 inputs
//
GPIO_setQualificationPeriod(24, 2); // Qual period = SYSCLKOUT/2
GPIO_setQualificationMode(25, GPIO_QUAL_6SAMPLE); // 6 samples
GPIO_setQualificationMode(26, GPIO_QUAL_3SAMPLE); // 3 samples
//
// Make GPIO25 the input source for XINT1
//
GPIO_setPinConfig(GPIO_25_GPIO25); // GPIO25 = GPIO25
GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN); // GPIO25 = input
GPIO_setInterruptPin(25,GPIO_INT_XINT1); // XINT1 connected to GPIO25
//
// Make GPIO26 the input source for XINT2
//
GPIO_setPinConfig(GPIO_26_GPIO26); // GPIO26 = GPIO26
GPIO_setDirectionMode(26, GPIO_DIR_MODE_IN); // GPIO26 = input
GPIO_setInterruptPin(26,GPIO_INT_XINT2); // XINT2 connected to GPIO26
//
// Make GPIO27 wakeup from STANDBY Low Power Modes
//
GPIO_setPinConfig(GPIO_27_GPIO27); // GPIO27 = GPIO27
GPIO_setDirectionMode(27, GPIO_DIR_MODE_IN); // GPIO27 = input
SysCtl_enableLPMWakeupPin(27); // GPIO27 will wake the device
SysCtl_setStandbyQualificationPeriod(2); // Qualify GPIO27 by 2 OSCCLK
// cycles before waking
// the device from STANDBY
//
// Enable SCI-A on GPIO28 - GPIO29
//
GPIO_setPadConfig(28, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO28
GPIO_setQualificationMode(28, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_28_SCIA_RX); // GPIO28 = SCIRXDA
GPIO_setPadConfig(29, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO29
GPIO_setPinConfig(GPIO_29_SCIA_TX); // GPIO29 = SCITXDA
//
// Enable CAN-A on GPIO30 - GPIO31
//
GPIO_setPadConfig(30, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO30
GPIO_setPinConfig(GPIO_30_CANA_RX); // GPIO30 = CANRXA
GPIO_setPadConfig(31, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO31
GPIO_setQualificationMode(31, GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_31_CANA_TX); // GPIO31 = CANTXA
//
// Enable I2C-A on GPIO32 - GPIO33
//
GPIO_setPadConfig(32, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO32
GPIO_setPadConfig(33, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO33
GPIO_setQualificationMode(32, GPIO_QUAL_ASYNC); // asynch input
GPIO_setQualificationMode(33,GPIO_QUAL_ASYNC); // asynch input
GPIO_setPinConfig(GPIO_32_I2CA_SDA); // GPIO32 = SDAA
GPIO_setPinConfig(GPIO_33_I2CA_SCL); // GPIO33 = SCLA
//
// Make GPIO34 an input
//
GPIO_setPadConfig(34, GPIO_PIN_TYPE_PULLUP); // Enable pullup on GPIO34
GPIO_setPinConfig(GPIO_34_GPIO34); // GPIO34 = GPIO34
GPIO_setDirectionMode(34, GPIO_DIR_MODE_IN); // GPIO34 = input
}
//
// End of File
//
@@ -0,0 +1,113 @@
//#############################################################################
//
// FILE: gpio_ex2_toggle.c
//
// TITLE: Device GPIO Toggle
//
//! \addtogroup driver_example_list
//! <h1> Device GPIO Toggle </h1>
//!
//! Configures the device GPIO through the sysconfig file. The GPIO pin is
//! toggled in the infinite loop.
//! In order to migrate the project within syscfg to any device,
//! click the swtich button under the device view and select your
//! corresponding device to migrate, saving the project will
//! auto-migrate your project settings.
//!
//! \note: This example project has support for migration across our C2000
//! device families. If you are wanting to build this project from launchpad
//! or controlCARD, please specify in the .syscfg file the board you're using.
//! At any time you can select another device to migrate this example.
//
//#############################################################################
//
//
//
// C2000Ware v5.04.00.00
//
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Main
//
void main(void)
{
//
// Initializes system control, device clock, and peripherals
//
Device_init();
//
// Initializes PIE and clear PIE registers. Disables CPU interrupts.
// and clear all CPU interrupt flags.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Board Initialization
//
Board_init();
//
// Enables CPU interrupts
//
Interrupt_enableGlobal();
//
// Loop.
//
for(;;)
{
GPIO_togglePin(myGPIOOutput0);
DEVICE_DELAY_US(1000000);
}
}
//
// End of File
//
@@ -0,0 +1,64 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "F2838x" --package "337bga" --part "F2838x_337bga" --context "CPU1" --product "C2000WARE@5.02.00.00"
* @versions {"tool":"1.0.0+dev"}
*/
/**
* Import the modules used in this configuration.
*/
const device_support = scripting.addModule("/driverlib/device_support.js");
const sysctl = scripting.addModule("/driverlib/sysctl.js");
const CMD = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
const CMD1 = CMD.addInstance();
const CMD2 = CMD.addInstance();
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
CMD1.$name = "generic_ram_lnk";
CMD2.$name = "generic_flash_lnk";
CMD1.sectionMemory_text = ["RAMLS0","RAMLS1","RAMLS2","RAMLS3","RAMLS4"];
CMD1.sectionMemory_ramfunc = ["RAMM0"];
CMD1.sectionMemory_cinit = ["RAMM0"];
CMD1.sectionMemory_stack = ["RAMM1"];
CMD1.sectionMemory_init_array = ["RAMM0"];
CMD1.sectionMemory_bss = ["RAMLS5"];
CMD1.sectionMemory_const = ["RAMLS5"];
CMD1.sectionMemory_data = ["RAMLS5"];
CMD1.sectionMemory_switch = ["RAMM0"];
CMD1.sectionMemory_sysmem = ["RAMLS5"];
CMD2.sectionAlignEnable_ramfunc = true;
CMD2.sectionAlignEnable_text = true;
CMD2.sectionAlignEnable_binit = true;
CMD2.sectionAlignEnable_cinit = true;
CMD2.sectionAlignEnable_switch = true;
CMD2.sectionAlignEnable_init_array = true;
CMD2.sectionAlignEnable_const = true;
CMD2.sectionAlignEnable_ovly = true;
CMD2.sectionMemory_codestart = "0x080000";
CMD2.sectionMemory_stack = ["RAMM1"];
CMD2.sectionMemory_bss = ["RAMLS5"];
CMD2.sectionMemory_data = ["RAMLS5"];
CMD2.sectionMemory_sysmem = ["RAMLS5"];
CMD2.sectionMemory_ramfunc = ["FLASH3"];
CMD2.sectionMemory_text = ["FLASH1","FLASH2","FLASH3","FLASH4"];
CMD2.sectionMemory_binit = ["FLASH4"];
CMD2.sectionMemory_cinit = ["FLASH4"];
CMD2.sectionMemory_switch = ["FLASH1"];
CMD2.sectionMemory_init_array = ["FLASH1"];
CMD2.sectionMemory_const = ["FLASH5"];
CMD2.sectionMemory_ovly = ["FLASH6"];
CMD2.sectionRunFromDifferentAddr_ramfunc = true;
CMD2.sectionRun_ramfunc = ["RAMLS0"];
CMD2.sectionBinit_ramfunc = false;
gpio1.direction = "GPIO_DIR_MODE_OUT";
gpio1.$name = "myGPIOOutput0";
gpio1.gpioPin.$assign = "GPIO0";
gpio1.gpioPin.$assign = "GPIO73";
@@ -0,0 +1,123 @@
//#############################################################################
//
// FILE: gpio_ex3_interrupt.c
//
// TITLE: Device GPIO Interrupt
//
//! \addtogroup driver_example_list
//! <h1> Device GPIO Interrupt </h1>
//!
//! Configures the device GPIOs through the sysconfig file. One GPIO output
//! pin, and one GPIO input pin is configured. The example then configures the
//! GPIO input pin to be the source of an external interrupt which toggles
//! the GPIO output pin.
//
//#############################################################################
//
//
//
// C2000Ware v5.04.00.00
//
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
// Interrupt Handler
//
__interrupt void gpioInterruptHandler(void);
//
// Main
//
void main(void)
{
//
// Initializes system control, device clock, and peripherals
//
Device_init();
//
// Initializes PIE and clear PIE registers. Disables CPU interrupts.
// and clear all CPU interrupt flags.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Board Initialization
//
Board_init();
GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_FALLING_EDGE);
GPIO_setInterruptPin(myGPIOInputInterrupt0, GPIO_INT_XINT1);
GPIO_enableInterrupt(GPIO_INT_XINT1);
Interrupt_register(INT_XINT1, &gpioInterruptHandler);
Interrupt_enable(INT_XINT1);
//
// Enables CPU interrupts
//
Interrupt_enableGlobal();
//
// Loop.
//
for(;;)
{
}
}
__interrupt void gpioInterruptHandler(void)
{
GPIO_togglePin(myGPIOOutput0);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// End of File
//
@@ -0,0 +1,16 @@
/**
* Import the modules used in this configuration.
*/
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const gpio2 = gpio.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
gpio1.$name = "myGPIOInputInterrupt0";
gpio1.padConfig = "PULLUP";
gpio2.$name = "myGPIOOutput0";
gpio2.direction = "GPIO_DIR_MODE_OUT";
@@ -0,0 +1,103 @@
//#############################################################################
//
// FILE: gpio_ex5_interrupt_sysconfig.c
//
// TITLE: XINT/XBAR Example
//
// This example demonstrates the XINT feature in SysConfig by using it in
// conjunction with the input and output XBARs. An input is received through a
// GPIO and connected to the input XBAR, while simultaneously triggering an
// external interrupt. The interrupt increments a counter which can be observed
// in the watch window. In addition to triggering an interrupt, the input
// signal is routed from the input XBAR to the output XBAR so that the output
// can be observed via oscilloscope or logic analyzer on a separate pin.
//
//#############################################################################
//
//
//
// C2000Ware v5.04.00.00
//
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
//
//Global Variables
//
int counter = 0;
//
// Main
//
void main(void)
{
Device_init();
//
// Disable pin locks and enable internal pull-ups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
//SysConfig settings
//
Board_init();
EINT;
while(1);
}
__interrupt void INT_myGPIO_INPUT_XINT_ISR(void){
counter++;
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
}
//
// End of File
//
@@ -0,0 +1,33 @@
/**
* Import the modules used in this configuration.
*/
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
const gpio1 = gpio.addInstance();
const inputxbar_input = scripting.addModule("/driverlib/inputxbar_input.js", {}, false);
const inputxbar_input1 = inputxbar_input.addInstance();
const outputxbar = scripting.addModule("/driverlib/outputxbar.js", {}, false);
const outputxbar1 = outputxbar.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
gpio1.padConfig = "PULLUP";
gpio1.$name = "myGPIO_INPUT";
gpio1.useInterrupt = true;
gpio1.gpioPin.$assign = "GPIO4";
gpio1.xint.registerInterrupts = true;
gpio1.xint.enableInt = true;
gpio1.xint.xInt.enableInterrupt = true;
inputxbar_input1.$name = "myINPUTXBARINPUT1";
gpio1.xint.inputxbar = inputxbar_input1;
inputxbar_input1.inputxbarLock = true;
inputxbar_input1.inputxbarGpio = "GPIO4";
outputxbar1.$name = "myOUTPUTXBAR0";
outputxbar1.mux1Config = "XBAR_OUT_MUX01_INPUTXBAR1";
outputxbar1.sourceSignals = ["INPUTXBAR4"];
outputxbar1.useSourceSelect = true;
outputxbar1.outputxbar.$assign = "OUTPUTXBAR3";
outputxbar1.outputxbar.outputxbarPin.$assign = "GPIO5";