diff options
Diffstat (limited to 'testhal/TIVA/TM4C123x/SPI')
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/.cproject | 21 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/.project | 11 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/Makefile | 6 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/chconf.h | 1 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch | 10 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/main.c | 34 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/SPI/mcuconf.h | 8 |
7 files changed, 51 insertions, 40 deletions
diff --git a/testhal/TIVA/TM4C123x/SPI/.cproject b/testhal/TIVA/TM4C123x/SPI/.cproject index 483936f..2e8f6a8 100644 --- a/testhal/TIVA/TM4C123x/SPI/.cproject +++ b/testhal/TIVA/TM4C123x/SPI/.cproject @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?> -<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> +<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <storageModule moduleId="org.eclipse.cdt.core.settings"> <cconfiguration id="0.114656749"> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.114656749" moduleId="org.eclipse.cdt.core.settings" name="Default"> @@ -22,12 +21,30 @@ <builder autoBuildTarget="all" cleanBuildTarget="clean" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.settings.default.builder.579570726" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.2143276802" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <tool id="org.eclipse.cdt.build.core.settings.holder.1873650595" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> + <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.972953796" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"> + <listOptionValue builtIn="false" value="C:/ChibiStudio/ChibiOS-Contrib/os/common/ports/ARMCMx/devices/TM4C123x"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/ext/CMSIS/include"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx/compilers/GCC"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx"/> + </option> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1337802279" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> </tool> <tool id="org.eclipse.cdt.build.core.settings.holder.1707090075" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder"> + <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.959676881" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"> + <listOptionValue builtIn="false" value="C:/ChibiStudio/ChibiOS-Contrib/os/common/ports/ARMCMx/devices/TM4C123x"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/ext/CMSIS/include"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx/compilers/GCC"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx"/> + </option> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.338985256" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> </tool> <tool id="org.eclipse.cdt.build.core.settings.holder.1165165914" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder"> + <option id="org.eclipse.cdt.build.core.settings.holder.undef.incpaths.1617159785" superClass="org.eclipse.cdt.build.core.settings.holder.undef.incpaths" valueType="undefIncludePath"> + <listOptionValue builtIn="false" value="C:/ChibiStudio/ChibiOS-Contrib/os/common/ports/ARMCMx/devices/TM4C123x"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/ext/CMSIS/include"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx/compilers/GCC"/> + <listOptionValue builtIn="false" value="C:/ChibiStudio/chibios161/os/rt/ports/ARMCMx"/> + </option> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.714476670" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> </tool> </toolChain> diff --git a/testhal/TIVA/TM4C123x/SPI/.project b/testhal/TIVA/TM4C123x/SPI/.project index 150ab22..6301d40 100644 --- a/testhal/TIVA/TM4C123x/SPI/.project +++ b/testhal/TIVA/TM4C123x/SPI/.project @@ -79,22 +79,17 @@ <link> <name>board</name> <type>2</type> - <locationURI>CHIBIOS3/community/os/hal/boards/TI_TM4C123G_LAUNCHPAD</locationURI> + <locationURI>PARENT-1-CHIBIOS/ChibiOS-Contrib/os/hal/boards/TI_TM4C123G_LAUNCHPAD</locationURI> </link> <link> <name>community_os</name> <type>2</type> - <locationURI>CHIBIOS3/community/os</locationURI> + <locationURI>PARENT-1-CHIBIOS/ChibiOS-Contrib/os</locationURI> </link> <link> <name>os</name> <type>2</type> - <locationURI>CHIBIOS3/os</locationURI> - </link> - <link> - <name>test</name> - <type>2</type> - <locationURI>CHIBIOS3/test</locationURI> + <locationURI>CHIBIOS/os</locationURI> </link> </linkedResources> <variableList> diff --git a/testhal/TIVA/TM4C123x/SPI/Makefile b/testhal/TIVA/TM4C123x/SPI/Makefile index f587083..f2833ec 100644 --- a/testhal/TIVA/TM4C123x/SPI/Makefile +++ b/testhal/TIVA/TM4C123x/SPI/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + # # Build global options ############################################################################## diff --git a/testhal/TIVA/TM4C123x/SPI/chconf.h b/testhal/TIVA/TM4C123x/SPI/chconf.h index 25e39f6..0d24275 100644 --- a/testhal/TIVA/TM4C123x/SPI/chconf.h +++ b/testhal/TIVA/TM4C123x/SPI/chconf.h @@ -18,6 +18,7 @@ #define _CHCONF_H_ #define _CHIBIOS_RT_CONF_ +#define _CHIBIOS_RT_CONF_VER_5_0_ /*===========================================================================*/ /** diff --git a/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 8772f9c..0000000 --- a/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\bin\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/SPI/main.c b/testhal/TIVA/TM4C123x/SPI/main.c index f04cdbf..91cb02a 100644 --- a/testhal/TIVA/TM4C123x/SPI/main.c +++ b/testhal/TIVA/TM4C123x/SPI/main.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2014..2016 Marco Veeneman + Copyright (C) 2014..2017 Marco Veeneman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ static const SPIConfig hs_spicfg = NULL, GPIOA, 3, - TIVA_CR0_DSS(8) | /*TIVA_CR0_SPH | TIVA_CR_SPO |*/ TIVA_CR0_SRC(0), + SSI_CR0_DSS_8 | /*SSI_CR0_SPH | SSI_CR0_SPO |*/ SSI_CR0_SCR(0), 16 }; @@ -43,7 +43,7 @@ static const SPIConfig ls_spicfg = NULL, GPIOA, 3, - TIVA_CR0_DSS(8) | /*TIVA_CR0_SPH | TIVA_CR_SPO |*/ TIVA_CR0_SRC(0), + SSI_CR0_DSS_8 | /*SSI_CR0_SPH | SSI_CR0_SPO |*/ SSI_CR0_SCR(0), 80 }; @@ -104,15 +104,11 @@ int main(void) halInit(); chSysInit(); - palSetPadMode(GPIOA, GPIOA_SSI0_CLK, PAL_MODE_OUTPUT_PUSHPULL | - PAL_MODE_ALTERNATE(2)); - palSetPadMode(GPIOA, GPIOA_SSI0_RX, PAL_MODE_OUTPUT_PUSHPULL | - PAL_MODE_ALTERNATE(2)); - palSetPadMode(GPIOA, GPIOA_SSI0_TX, PAL_MODE_OUTPUT_PUSHPULL | - PAL_MODE_ALTERNATE(2)); - palSetPadMode(GPIOA, GPIOA_PIN3, PAL_MODE_OUTPUT_PUSHPULL); - - palSetPadMode(GPIOF, GPIOF_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL); + palSetLineMode(LINE_SSI0_CLK, PAL_MODE_OUTPUT_PUSHPULL | PAL_MODE_ALTERNATE(2)); + palSetLineMode(LINE_SSI0_RX, PAL_MODE_OUTPUT_PUSHPULL | PAL_MODE_ALTERNATE(2)); + palSetLineMode(LINE_SSI0_TX, PAL_MODE_OUTPUT_PUSHPULL | PAL_MODE_ALTERNATE(2)); + palSetLineMode(LINE_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, GPIOA_PIN3, PAL_MODE_OUTPUT_PUSHPULL); /* * Prepare transmit pattern. @@ -124,10 +120,16 @@ int main(void) /* * Starting the transmitter and receiver threads. */ - chThdCreateStatic(spi_thread_1_wa, sizeof(spi_thread_1_wa), - NORMALPRIO + 1, spi_thread_1, NULL); - chThdCreateStatic(spi_thread_2_wa, sizeof(spi_thread_2_wa), - NORMALPRIO + 1, spi_thread_2, NULL); + chThdCreateStatic(spi_thread_1_wa, + sizeof(spi_thread_1_wa), + NORMALPRIO + 1, + spi_thread_1, + NULL); + chThdCreateStatic(spi_thread_2_wa, + sizeof(spi_thread_2_wa), + NORMALPRIO + 1, + spi_thread_2, + NULL); /* * Normal main() thread activity diff --git a/testhal/TIVA/TM4C123x/SPI/mcuconf.h b/testhal/TIVA/TM4C123x/SPI/mcuconf.h index 74a4da3..e936c02 100644 --- a/testhal/TIVA/TM4C123x/SPI/mcuconf.h +++ b/testhal/TIVA/TM4C123x/SPI/mcuconf.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014..2016 Marco Veeneman + Copyright (C) 2014..2017 Marco Veeneman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,15 +30,15 @@ /* * HAL driver system settings. */ -#define TIVA_OSCSRC TIVA_RCC2_OSCSRC2_MOSC +#define TIVA_OSCSRC SYSCTL_RCC2_OSCSRC2_MO #define TIVA_MOSC_ENABLE TRUE #define TIVA_DIV400_VALUE 1 #define TIVA_SYSDIV_VALUE 2 #define TIVA_USESYSDIV_ENABLE FALSE #define TIVA_SYSDIV2LSB_ENABLE FALSE #define TIVA_BYPASS_VALUE 0 -#define TIVA_PWM_FIELDS (TIVA_RCC_USEPWMDIV | \ - TIVA_RCC_PWMDIV_8) +#define TIVA_PWM_FIELDS (SYSCTL_RCC_USEPWMDIV | \ + SYSCTL_RCC_PWMDIV_8) /* * GPIO driver system settings. |