root: init project
Adding basic board repos, main
This commit is contained in:
206
lpc_board_nxp_lpcxpresso_1549/.cproject
Normal file
206
lpc_board_nxp_lpcxpresso_1549/.cproject
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.crt.advproject.config.lib.debug.981921226">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.debug.981921226" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings>
|
||||
<externalSetting>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/lpc_board_nxp_lpcxpresso_1549"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/lpc_board_nxp_lpcxpresso_1549/Debug"/>
|
||||
<entry flags="RESOLVED" kind="libraryFile" name="lpc_board_nxp_lpcxpresso_1549" srcPrefixMapping="" srcRootPath=""/>
|
||||
</externalSetting>
|
||||
</externalSettings>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.debug.981921226" name="Debug" parent="com.crt.advproject.config.lib.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
||||
<folderInfo id="com.crt.advproject.config.lib.debug.981921226." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.lib.debug.221211259" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.debug">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.debug.313239381" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.debug"/>
|
||||
<builder buildPath="${workspace_loc:/lpc_board_nxp_lpcxpresso_1549}/Debug" id="com.crt.advproject.builder.lib.debug.1299423428" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.debug"/>
|
||||
<tool id="com.crt.advproject.cpp.lib.debug.675557742" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.debug"/>
|
||||
<tool id="com.crt.advproject.gcc.lib.debug.326990449" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.debug">
|
||||
<option id="com.crt.advproject.gcc.arch.482614676" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.448897723" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1357926608" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.318258873" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.2102792065" superClass="com.crt.advproject.gcc.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.2082452274" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<inputType id="com.crt.advproject.compiler.input.1544071183" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.lib.debug.574998630" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.debug">
|
||||
<option id="com.crt.advproject.gas.arch.536223183" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.347736922" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.289599694" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<option id="com.crt.advproject.gas.hdrlib.683846864" superClass="com.crt.advproject.gas.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.263657773" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.1760935485" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.ar.lib.debug.1617586590" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.debug"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.crt.advproject.config.lib.release.682943078">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.release.682943078" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings>
|
||||
<externalSetting>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/lpc_board_nxp_lpcxpresso_1549"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/lpc_board_nxp_lpcxpresso_1549/Release"/>
|
||||
<entry flags="RESOLVED" kind="libraryFile" name="lpc_board_nxp_lpcxpresso_1549" srcPrefixMapping="" srcRootPath=""/>
|
||||
</externalSetting>
|
||||
</externalSettings>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Release build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.release.682943078" name="Release" parent="com.crt.advproject.config.lib.release" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
||||
<folderInfo id="com.crt.advproject.config.lib.release.682943078." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.lib.release.1153809765" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.release">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.release.574021912" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.release"/>
|
||||
<builder buildPath="${workspace_loc:/lpc_board_nxp_lpcxpresso_1549}/Release" id="com.crt.advproject.builder.lib.release.1896744174" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.release"/>
|
||||
<tool id="com.crt.advproject.cpp.lib.release.774476077" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.release"/>
|
||||
<tool id="com.crt.advproject.gcc.lib.release.2054891244" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.release">
|
||||
<option id="com.crt.advproject.gcc.arch.2083085436" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.thumb.1302383086" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.310436762" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__REDLIB__"/>
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.1421044923" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
||||
<option id="com.crt.advproject.gcc.lib.release.option.optimization.level.1347229619" superClass="com.crt.advproject.gcc.lib.release.option.optimization.level"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.1383741172" superClass="com.crt.advproject.gcc.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.include.paths.668546630" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
</option>
|
||||
<inputType id="com.crt.advproject.compiler.input.1067692628" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.lib.release.1490806957" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.release">
|
||||
<option id="com.crt.advproject.gas.arch.1443989186" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.thumb.627609397" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.754957238" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DNDEBUG -D__CODE_RED" valueType="string"/>
|
||||
<option id="com.crt.advproject.gas.hdrlib.1789117190" superClass="com.crt.advproject.gas.hdrlib" value="Redlib" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.244462813" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.1321967737" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.ar.lib.release.529787027" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.release"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="lpc_board_nxp_lpcxpresso_1549.com.crt.advproject.projecttype.lib.243414072" name="Static Library" projectType="com.crt.advproject.projecttype.lib"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="com.crt.config">
|
||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||
<TargetConfig>
|
||||
<Properties property_0="" property_2="LPC15xx_256K.cfx" property_3="NXP" property_4="LPC1549" property_count="5" version="70200"/>
|
||||
<infoList vendor="NXP">
|
||||
<info chip="LPC1549" connectscript="LPC15RunBootRomConnect.scp" flash_driver="LPC15xx_256K.cfx" match_id="0x0" name="LPC1549" resetscript="LPC15RunBootRomReset.scp" stub="crt_emu_cm3_gen">
|
||||
<chip>
|
||||
<name>LPC1549</name>
|
||||
<family>LPC15xx</family>
|
||||
<vendor>NXP (formerly Philips)</vendor>
|
||||
<reset board="None" core="Real" sys="Real"/>
|
||||
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
|
||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
||||
<memory id="RAM" type="RAM"/>
|
||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
||||
<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram0_16" location="0x2000000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram1_16" location="0x2004000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram2_4" location="0x2008000" size="0x1000"/>
|
||||
<peripheralInstance derived_from="V7M_MPU" determined="infoFile" id="MPU" location="0xe000ed90"/>
|
||||
<peripheralInstance derived_from="V7M_NVIC" determined="infoFile" id="NVIC" location="0xe000e000"/>
|
||||
<peripheralInstance derived_from="V7M_DCR" determined="infoFile" id="DCR" location="0xe000edf0"/>
|
||||
<peripheralInstance derived_from="V7M_ITM" determined="infoFile" id="ITM" location="0xe0000000"/>
|
||||
<peripheralInstance derived_from="GPIO-PORT" determined="infoFile" id="GPIO-PORT" location="0x1c000000"/>
|
||||
<peripheralInstance derived_from="DMA" determined="infoFile" id="DMA" location="0x1c004000"/>
|
||||
<peripheralInstance derived_from="USB" determined="infoFile" id="USB" location="0x1c00c000"/>
|
||||
<peripheralInstance derived_from="CRC" determined="infoFile" id="CRC" location="0x1c010000"/>
|
||||
<peripheralInstance derived_from="SCT0" determined="infoFile" id="SCT0" location="0x1c018000"/>
|
||||
<peripheralInstance derived_from="SCT1" determined="infoFile" id="SCT1" location="0x1c01c000"/>
|
||||
<peripheralInstance derived_from="SCT2" determined="infoFile" id="SCT2" location="0x1c020000"/>
|
||||
<peripheralInstance derived_from="SCT3" determined="infoFile" id="SCT3" location="0x1c024000"/>
|
||||
<peripheralInstance derived_from="ADC0" determined="infoFile" id="ADC0" location="0x40000000"/>
|
||||
<peripheralInstance derived_from="DAC" determined="infoFile" id="DAC" location="0x40004000"/>
|
||||
<peripheralInstance derived_from="ACMP" determined="infoFile" id="ACMP" location="0x40008000"/>
|
||||
<peripheralInstance derived_from="INMUX" determined="infoFile" id="INMUX" location="0x40014000"/>
|
||||
<peripheralInstance derived_from="RTC" determined="infoFile" id="RTC" location="0x40028000"/>
|
||||
<peripheralInstance derived_from="WWDT" determined="infoFile" id="WWDT" location="0x4002c000"/>
|
||||
<peripheralInstance derived_from="SWM" determined="infoFile" id="SWM" location="0x40038000"/>
|
||||
<peripheralInstance derived_from="PMU" determined="infoFile" id="PMU" location="0x4003c000"/>
|
||||
<peripheralInstance derived_from="USART0" determined="infoFile" id="USART0" location="0x40040000"/>
|
||||
<peripheralInstance derived_from="USART1" determined="infoFile" id="USART1" location="0x40044000"/>
|
||||
<peripheralInstance derived_from="SPI0" determined="infoFile" id="SPI0" location="0x40048000"/>
|
||||
<peripheralInstance derived_from="SPI1" determined="infoFile" id="SPI1" location="0x4004c000"/>
|
||||
<peripheralInstance derived_from="I2C0" determined="infoFile" id="I2C0" location="0x40050000"/>
|
||||
<peripheralInstance derived_from="QEI" determined="infoFile" id="QEI" location="0x40058000"/>
|
||||
<peripheralInstance derived_from="SYSCON" determined="infoFile" id="SYSCON" location="0x40074000"/>
|
||||
<peripheralInstance derived_from="ADC1" determined="infoFile" id="ADC1" location="0x40080000"/>
|
||||
<peripheralInstance derived_from="MRT" determined="infoFile" id="MRT" location="0x400a0000"/>
|
||||
<peripheralInstance derived_from="PINT" determined="infoFile" id="PINT" location="0x400a4000"/>
|
||||
<peripheralInstance derived_from="GINT0" determined="infoFile" id="GINT0" location="0x400a8000"/>
|
||||
<peripheralInstance derived_from="GINT1" determined="infoFile" id="GINT1" location="0x400ac000"/>
|
||||
<peripheralInstance derived_from="RIT" determined="infoFile" id="RIT" location="0x400b4000"/>
|
||||
<peripheralInstance derived_from="SCTIPU" determined="infoFile" id="SCTIPU" location="0x400b8000"/>
|
||||
<peripheralInstance derived_from="FLASHCTRL" determined="infoFile" id="FLASHCTRL" location="0x400bc000"/>
|
||||
<peripheralInstance derived_from="USART2" determined="infoFile" id="USART2" location="0x400c0000"/>
|
||||
<peripheralInstance derived_from="C-CAN0" determined="infoFile" id="C-CAN0" location="0x400f0000"/>
|
||||
<peripheralInstance derived_from="IOCON" determined="infoFile" id="IOCON" location="0x400f8000"/>
|
||||
</chip>
|
||||
<processor>
|
||||
<name gcc_name="cortex-m3">Cortex-M3</name>
|
||||
<family>Cortex-M</family>
|
||||
</processor>
|
||||
<link href="LPC15xx_peripheral.xme" show="embed" type="simple"/>
|
||||
</info>
|
||||
</infoList>
|
||||
</TargetConfig></projectStorage>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
1
lpc_board_nxp_lpcxpresso_1549/.gitignore
vendored
Normal file
1
lpc_board_nxp_lpcxpresso_1549/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/Debug/
|
||||
26
lpc_board_nxp_lpcxpresso_1549/.project
Normal file
26
lpc_board_nxp_lpcxpresso_1549/.project
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>lpc_board_nxp_lpcxpresso_1549</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="com.crt.advproject.config.lib.debug.981921226" name="Debug">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="com.crt.advproject.GCCBuildCommandParser" keep-relative-paths="false" name="MCU GCC Build Output Parser" parameter="(arm-none-eabi-gcc)|(arm-none-eabi-[gc]\+\+)|(gcc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
|
||||
<provider class="com.crt.advproject.specs.MCUGCCBuiltinSpecsDetector" console="false" env-hash="1861603930977800923" id="com.crt.advproject.GCCBuildSpecCompilerParser" keep-relative-paths="false" name="MCU GCC Built-in Compiler Parser" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
</extension>
|
||||
</configuration>
|
||||
<configuration id="com.crt.advproject.config.lib.release.682943078" name="Release">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider copy-of="extension" id="com.crt.advproject.GCCBuildCommandParser"/>
|
||||
<provider class="com.crt.advproject.specs.MCUGCCBuiltinSpecsDetector" console="false" env-hash="1916695446368863867" id="com.crt.advproject.GCCBuildSpecCompilerParser" keep-relative-paths="false" name="MCU GCC Built-in Compiler Parser" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
||||
111
lpc_board_nxp_lpcxpresso_1549/inc/board.h
Normal file
111
lpc_board_nxp_lpcxpresso_1549/inc/board.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* @brief LPCXPresso LPC1549 board file
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2013
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H_
|
||||
#define __BOARD_H_
|
||||
|
||||
#include "chip.h"
|
||||
/* board_api.h is included at the bottom of this file after DEBUG setup */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @defgroup BOARD_NXP_LPCXPRESSO_1549 LPCXPresso LPC1549 board support software API functions
|
||||
* @ingroup LPCOPEN_15XX_NXP_LPCXPRESSO_1549
|
||||
* The board support software API functions provide some simple abstracted
|
||||
* functions used across multiple LPCOpen board examples. See @ref BOARD_COMMON_API
|
||||
* for the functions defined by this board support layer.<br>
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup BOARD_NXP_LPCXPRESSO_1549_OPTIONS BOARD: LPCXPresso LPC1549 board build options
|
||||
* This board has options that configure its operation at build-time.<br>
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Define DEBUG_ENABLE to enable IO via the DEBUGSTR, DEBUGOUT, and
|
||||
DEBUGIN macros. If not defined, DEBUG* functions will be optimized
|
||||
out of the code at build time.
|
||||
*/
|
||||
#define DEBUG_ENABLE
|
||||
|
||||
/** Define DEBUG_SEMIHOSTING along with DEBUG_ENABLE to enable IO support
|
||||
via semihosting. You may need to use a C library that supports
|
||||
semihosting with this option.
|
||||
*/
|
||||
// #define DEBUG_SEMIHOSTING
|
||||
|
||||
/** Board UART used for debug output and input using the DEBUG* macros. This
|
||||
is also the port used for Board_UARTPutChar, Board_UARTGetChar, and
|
||||
Board_UARTPutSTR functions.
|
||||
*/
|
||||
#define DEBUG_UART LPC_USART0
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Board name */
|
||||
#define BOARD_NXP_LPCXPRESSO_1549
|
||||
|
||||
/**
|
||||
* Joystick defines
|
||||
*/
|
||||
#define JOY_UP 0x01
|
||||
#define JOY_DOWN 0x02
|
||||
#define JOY_LEFT 0x04
|
||||
#define JOY_RIGHT 0x08
|
||||
#define JOY_PRESS 0x10
|
||||
|
||||
/**
|
||||
* @brief Initialize Joystick
|
||||
* @return Nothing
|
||||
*/
|
||||
void Board_Joystick_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Get Joystick status
|
||||
* @return status of Joystick
|
||||
*/
|
||||
uint8_t Joystick_GetStatus(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "board_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BOARD_H_ */
|
||||
196
lpc_board_nxp_lpcxpresso_1549/inc/board_api.h
Normal file
196
lpc_board_nxp_lpcxpresso_1549/inc/board_api.h
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* @brief Common board API functions
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2013
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_API_H_
|
||||
#define __BOARD_API_H_
|
||||
|
||||
#include "lpc_types.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @defgroup BOARD_COMMON_API BOARD: Common board functions
|
||||
* @ingroup BOARD_Common
|
||||
* This file contains common board definitions that are shared across
|
||||
* boards and devices. All of these functions do not need to be
|
||||
* implemented for a specific board, but if they are implemented, they
|
||||
* should use this API standard.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Setup and initialize hardware prior to call to main()
|
||||
* @return None
|
||||
* @note Board_SystemInit() is called prior to the application and sets up system
|
||||
* clocking, memory, and any resources needed prior to the application
|
||||
* starting.
|
||||
*/
|
||||
void Board_SystemInit(void);
|
||||
|
||||
/**
|
||||
* @brief Setup pin multiplexer per board schematics
|
||||
* @return None
|
||||
* @note Board_SetupMuxing() should be called from SystemInit() prior to application
|
||||
* main() is called. So that the PINs are set in proper state.
|
||||
*/
|
||||
void Board_SetupMuxing(void);
|
||||
|
||||
/**
|
||||
* @brief Setup system clocking
|
||||
* @return None
|
||||
* @note This sets up board clocking.
|
||||
*/
|
||||
void Board_SetupClocking(void);
|
||||
|
||||
/**
|
||||
* @brief Setup external system memory
|
||||
* @return None
|
||||
* @note This function is typically called after pin mux setup and clock setup and
|
||||
* sets up any external memory needed by the system (DRAM, SRAM, etc.). Not all
|
||||
* boards need this function.
|
||||
*/
|
||||
void Board_SetupExtMemory(void);
|
||||
|
||||
/**
|
||||
* @brief Set up and initialize all required blocks and functions related to the board hardware.
|
||||
* @return None
|
||||
*/
|
||||
void Board_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Initializes board UART for output, required for printf redirection
|
||||
* @return None
|
||||
*/
|
||||
void Board_Debug_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Sends a single character on the UART, required for printf redirection
|
||||
* @param ch : character to send
|
||||
* @return None
|
||||
*/
|
||||
void Board_UARTPutChar(char ch);
|
||||
|
||||
/**
|
||||
* @brief Classic implementation of itoa -- integer to ASCII
|
||||
* @param value : value to convert
|
||||
* @param result : result string
|
||||
* @param base : output radix
|
||||
* @return result string or NULL
|
||||
*/
|
||||
char *Board_itoa(int value, char *result, int base);
|
||||
|
||||
/**
|
||||
* @brief Get a single character from the UART, required for scanf input
|
||||
* @return EOF if not character was received, or character value
|
||||
*/
|
||||
int Board_UARTGetChar(void);
|
||||
|
||||
/**
|
||||
* @brief Prints a string to the UART
|
||||
* @param str : Terminated string to output
|
||||
* @return None
|
||||
*/
|
||||
void Board_UARTPutSTR(const char *str);
|
||||
|
||||
/**
|
||||
* @brief Sets the state of a board LED to on or off
|
||||
* @param LEDNumber : LED number to set state for
|
||||
* @param State : true for on, false for off
|
||||
* @return None
|
||||
*/
|
||||
void Board_LED_Set(uint8_t LEDNumber, bool State);
|
||||
|
||||
/**
|
||||
* @brief Returns the current state of a board LED
|
||||
* @param LEDNumber : LED number to set state for
|
||||
* @return true if the LED is on, otherwise false
|
||||
*/
|
||||
bool Board_LED_Test(uint8_t LEDNumber);
|
||||
|
||||
/**
|
||||
* @brief Toggles the current state of a board LED
|
||||
* @param LEDNumber : LED number to change state for
|
||||
* @return None
|
||||
*/
|
||||
void Board_LED_Toggle(uint8_t LEDNumber);
|
||||
|
||||
/**
|
||||
* @brief Turn on Board LCD Backlight
|
||||
* @param Intensity : Backlight intensity (0 = off, >=1 = on)
|
||||
* @return None
|
||||
* @note On boards where a GPIO is used to control backlight on/off state, a '0' or '1'
|
||||
* value will turn off or on the backlight. On some boards, a non-0 value will
|
||||
* control backlight intensity via a PWN. For PWM systems, the intensity value
|
||||
* is a percentage value between 0 and 100%.
|
||||
*/
|
||||
void Board_SetLCDBacklight(uint8_t Intensity);
|
||||
|
||||
/**
|
||||
* @brief Function prototype for a MS delay function. Board layers or example code may
|
||||
* define this function as needed.
|
||||
*/
|
||||
typedef void (*p_msDelay_func_t)(uint32_t);
|
||||
|
||||
/* The DEBUG* functions are selected based on system configuration.
|
||||
Code that uses the DEBUG* functions will have their I/O routed to
|
||||
the UART, semihosting, or nowhere. */
|
||||
#if defined(DEBUG_ENABLE)
|
||||
#if defined(DEBUG_SEMIHOSTING)
|
||||
#define DEBUGINIT()
|
||||
#define DEBUGOUT(...) printf(__VA_ARGS__)
|
||||
#define DEBUGSTR(str) printf(str)
|
||||
#define DEBUGIN() (int) EOF
|
||||
|
||||
#else
|
||||
#define DEBUGINIT() Board_Debug_Init()
|
||||
#define DEBUGOUT(...) printf(__VA_ARGS__)
|
||||
#define DEBUGSTR(str) Board_UARTPutSTR(str)
|
||||
#define DEBUGIN() Board_UARTGetChar()
|
||||
#endif /* defined(DEBUG_SEMIHOSTING) */
|
||||
|
||||
#else
|
||||
#define DEBUGINIT()
|
||||
#define DEBUGOUT(...)
|
||||
#define DEBUGSTR(str)
|
||||
#define DEBUGIN() (int) EOF
|
||||
#endif /* defined(DEBUG_ENABLE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BOARD_API_H_ */
|
||||
198
lpc_board_nxp_lpcxpresso_1549/src/board.c
Normal file
198
lpc_board_nxp_lpcxpresso_1549/src/board.c
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* @brief LPCXPresso LPC1549 board file
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2014
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "retarget.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Private types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Public types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/* System oscillator rate and RTC oscillator rate */
|
||||
const uint32_t OscRateIn = 12000000;
|
||||
const uint32_t RTCOscRateIn = 32768;
|
||||
|
||||
/*****************************************************************************
|
||||
* Private functions
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Public functions
|
||||
****************************************************************************/
|
||||
|
||||
/* Sends a character on the UART */
|
||||
void Board_UARTPutChar(char ch)
|
||||
{
|
||||
#if defined(DEBUG_UART)
|
||||
Chip_UART_SendBlocking(DEBUG_UART, &ch, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Gets a character from the UART, returns EOF if no character is ready */
|
||||
int Board_UARTGetChar(void)
|
||||
{
|
||||
#if defined(DEBUG_UART)
|
||||
uint8_t data;
|
||||
|
||||
if (Chip_UART_Read(DEBUG_UART, &data, 1) == 1) {
|
||||
return (int) data;
|
||||
}
|
||||
#endif
|
||||
return EOF;
|
||||
}
|
||||
|
||||
/* Outputs a string on the debug UART */
|
||||
void Board_UARTPutSTR(const char *str)
|
||||
{
|
||||
#if defined(DEBUG_UART)
|
||||
while (*str != '\0') {
|
||||
Board_UARTPutChar(*str++);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Initialize debug output via UART for board */
|
||||
void Board_Debug_Init(void)
|
||||
{
|
||||
#if defined(DEBUG_UART)
|
||||
/* Disables pullups/pulldowns and enable digitial mode */
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 13, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));
|
||||
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 18, (IOCON_MODE_INACT | IOCON_DIGMODE_EN));
|
||||
|
||||
/* UART signal muxing via SWM */
|
||||
Chip_SWM_MovablePortPinAssign(SWM_UART0_RXD_I, 0, 13);
|
||||
Chip_SWM_MovablePortPinAssign(SWM_UART0_TXD_O, 0, 18);
|
||||
|
||||
/* Use main clock rate as base for UART baud rate divider */
|
||||
Chip_Clock_SetUARTBaseClockRate(Chip_Clock_GetMainClockRate(), false);
|
||||
|
||||
/* Setup UART */
|
||||
Chip_UART_Init(DEBUG_UART);
|
||||
Chip_UART_ConfigData(DEBUG_UART, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1);
|
||||
Chip_UART_SetBaud(DEBUG_UART, 115200);
|
||||
Chip_UART_Enable(DEBUG_UART);
|
||||
Chip_UART_TXEnable(DEBUG_UART);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define MAXLEDS 3
|
||||
static const uint8_t ledpins[MAXLEDS] = {25, 3, 1};
|
||||
static const uint8_t ledports[MAXLEDS] = {0, 0, 1};
|
||||
|
||||
/* Initializes board LED(s) */
|
||||
static void Board_LED_Init(void)
|
||||
{
|
||||
int idx;
|
||||
|
||||
for (idx = 0; idx < MAXLEDS; idx++) {
|
||||
/* Set the GPIO as output with initial state off (high) */
|
||||
Chip_GPIO_SetPinDIROutput(LPC_GPIO, ledports[idx], ledpins[idx]);
|
||||
Chip_GPIO_SetPinState(LPC_GPIO, ledports[idx], ledpins[idx], true);
|
||||
}
|
||||
}
|
||||
|
||||
/* Sets the state of a board LED to on or off */
|
||||
void Board_LED_Set(uint8_t LEDNumber, bool On)
|
||||
{
|
||||
if (LEDNumber < MAXLEDS) {
|
||||
/* Toggle state, low is on, high is off */
|
||||
Chip_GPIO_SetPinState(LPC_GPIO, ledports[LEDNumber], ledpins[LEDNumber], !On);
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns the current state of a board LED */
|
||||
bool Board_LED_Test(uint8_t LEDNumber)
|
||||
{
|
||||
bool state = false;
|
||||
|
||||
if (LEDNumber < MAXLEDS) {
|
||||
state = !Chip_GPIO_GetPinState(LPC_GPIO, ledports[LEDNumber], ledpins[LEDNumber]);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Toggles the current state of a board LED */
|
||||
void Board_LED_Toggle(uint8_t LEDNumber)
|
||||
{
|
||||
Chip_GPIO_SetPinToggle(LPC_GPIO, ledports[LEDNumber], ledpins[LEDNumber]);
|
||||
}
|
||||
|
||||
/* Set up and initialize all required blocks and functions related to the
|
||||
board hardware */
|
||||
void Board_Init(void)
|
||||
{
|
||||
/* Sets up DEBUG UART */
|
||||
DEBUGINIT();
|
||||
|
||||
/* Initialize GPIO */
|
||||
Chip_GPIO_Init(LPC_GPIO);
|
||||
|
||||
/* Initialize LEDs */
|
||||
Board_LED_Init();
|
||||
}
|
||||
|
||||
/* Ordered up, down, left, right, press */
|
||||
#define NUM_BUTTONS 5
|
||||
static const uint8_t portButton[NUM_BUTTONS] = {1, 1, 1, 1, 1};
|
||||
static const uint8_t pinButton[NUM_BUTTONS] = {4, 6, 8, 7, 5};
|
||||
static const uint8_t stateButton[NUM_BUTTONS] = {JOY_UP, JOY_DOWN, JOY_LEFT,
|
||||
JOY_RIGHT, JOY_PRESS};
|
||||
|
||||
/* Initialize Joystick */
|
||||
void Board_Joystick_Init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* IOCON states already selected in SystemInit(), GPIO setup only. Pullups
|
||||
are external, so IOCON with no states */
|
||||
for (i = 0; i < NUM_BUTTONS; i++) {
|
||||
Chip_GPIO_SetPinDIRInput(LPC_GPIO, portButton[i], pinButton[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get Joystick status */
|
||||
uint8_t Joystick_GetStatus(void)
|
||||
{
|
||||
uint8_t i, ret = 0;
|
||||
|
||||
for (i = 0; i < NUM_BUTTONS; i++) {
|
||||
if ((Chip_GPIO_GetPinState(LPC_GPIO, portButton[i], pinButton[i])) == 0x00) {
|
||||
ret |= stateButton[i];
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
183
lpc_board_nxp_lpcxpresso_1549/src/board_sysinit.c
Normal file
183
lpc_board_nxp_lpcxpresso_1549/src/board_sysinit.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* @brief LPCXPresso LPC1549 Sysinit file
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2014
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "string.h"
|
||||
|
||||
/* The System initialization code is called prior to the application and
|
||||
initializes the board for run-time operation. Board initialization
|
||||
includes clock setup and default pin muxing configuration. */
|
||||
|
||||
/*****************************************************************************
|
||||
* Private types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/* IOCON setup table, only items that need changing from their default pin
|
||||
state are in this table. */
|
||||
STATIC const PINMUX_GRP_T ioconSetup[] = {
|
||||
/* LEDs */
|
||||
{0, 25, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_25-BREAK_CTRL-RED (low enable) */
|
||||
{0, 3, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_3-SCT1_OUT4-GRN */
|
||||
{1, 1, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_1-BREAK_STS1-BLUE */
|
||||
|
||||
/* QEI, motor controler, I2C, CAN */
|
||||
{0, 2, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_2-QEI-SCT0_IN */
|
||||
{0, 30, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_30-QEI-SCT0_IN */
|
||||
{0, 17, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_17-QEI-SCT0_IN */
|
||||
{0, 25, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_25-BREAK_CTRL-RED */
|
||||
{1, 1, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_1-BREAK_STS1-BLUE */
|
||||
{0, 23, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_23-I2C_SDA */
|
||||
{0, 22, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_22-I2C_SCL */
|
||||
{0, 11, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_11-CAN_RD */
|
||||
{0, 31, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_31-CAN_TD */
|
||||
|
||||
/* ADC */
|
||||
{1, 3, (IOCON_MODE_INACT)}, /* PIO1_3-ADC1_5 */
|
||||
{0, 4, (IOCON_MODE_INACT)}, /* PIO0_4-ADC0_4 */
|
||||
{0, 5, (IOCON_MODE_INACT)}, /* PIO0_5-ADC0_3 */
|
||||
{0, 7, (IOCON_MODE_INACT)}, /* PIO0_7-ADC0_1 */
|
||||
{0, 8, (IOCON_MODE_INACT)}, /* PIO0_8-ADC0_0 */
|
||||
{0, 9, (IOCON_MODE_INACT)}, /* PIO0_9-ADC1_1 */
|
||||
{0, 10, (IOCON_MODE_INACT)}, /* PIO0_10-ADC1_2 */
|
||||
|
||||
/* Joystick */
|
||||
{1, 4, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_4-JOY_U */
|
||||
{1, 5, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_5-JOY_C */
|
||||
{1, 6, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_6-JOY_D */
|
||||
{1, 7, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_7-JOY_R */
|
||||
{1, 8, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO1_8-JOY_L */
|
||||
|
||||
/* UART */
|
||||
{0, 13, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_13-ISP_RX */
|
||||
{0, 18, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)}, /* PIO0_18-ISP_TX */
|
||||
{0, 11, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)},
|
||||
{0, 31, (IOCON_MODE_INACT | IOCON_DIGMODE_EN)},
|
||||
|
||||
/* USB related */
|
||||
{1, 11, (IOCON_MODE_PULLDOWN | IOCON_DIGMODE_EN)}, /* PIO1_11-ISP_1 (VBUS) */
|
||||
};
|
||||
|
||||
/* SWIM pin assignment definitions for pin assignment/muxing */
|
||||
typedef struct {
|
||||
uint16_t assignedpin : 9; /* Function and mode */
|
||||
uint16_t port : 2; /* Pin port */
|
||||
uint16_t pin : 5; /* Pin number */
|
||||
} SWM_GRP_T;
|
||||
|
||||
/* Pin muxing table, only items that need changing from their default pin
|
||||
state are in this table. */
|
||||
STATIC const SWM_GRP_T swmSetup[] = {
|
||||
/* USB related */
|
||||
{(uint16_t) SWM_USB_VBUS_I, 1, 11}, /* PIO1_11-ISP_1-AIN_CTRL */
|
||||
|
||||
/* UART */
|
||||
{(uint16_t) SWM_UART0_RXD_I, 0, 13}, /* PIO0_13-ISP_RX */
|
||||
{(uint16_t) SWM_UART0_TXD_O, 0, 18}, /* PIO0_18-ISP_TX */
|
||||
};
|
||||
|
||||
/* Setup fixed pin functions (GPIOs are fixed) */
|
||||
/* No fixed pins except GPIOs */
|
||||
#define PINENABLE0_VAL 0xFFFFFFFF
|
||||
|
||||
/* No fixed pins except GPIOs */
|
||||
#define PINENABLE1_VAL 0x00FFFFFF
|
||||
|
||||
/*****************************************************************************
|
||||
* Public types/enumerations/variables
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Private functions
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Public functions
|
||||
****************************************************************************/
|
||||
|
||||
/* Sets up system pin muxing */
|
||||
void Board_SetupMuxing(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Enable SWM and IOCON clocks */
|
||||
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
|
||||
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
|
||||
Chip_SYSCTL_PeriphReset(RESET_IOCON);
|
||||
|
||||
/* IOCON setup */
|
||||
Chip_IOCON_SetPinMuxing(LPC_IOCON, ioconSetup, sizeof(ioconSetup) / sizeof(PINMUX_GRP_T));
|
||||
|
||||
/* SWM assignable pin setup */
|
||||
for (i = 0; i < (sizeof(swmSetup) / sizeof(SWM_GRP_T)); i++) {
|
||||
Chip_SWM_MovablePortPinAssign((CHIP_SWM_PIN_MOVABLE_T) swmSetup[i].assignedpin,
|
||||
swmSetup[i].port, swmSetup[i].pin);
|
||||
}
|
||||
|
||||
/* SWM fixed pin setup */
|
||||
// LPC_SWM->PINENABLE[0] = PINENABLE0_VAL;
|
||||
// LPC_SWM->PINENABLE[1] = PINENABLE1_VAL;
|
||||
|
||||
/* Note SWM and IOCON clocks are left on */
|
||||
}
|
||||
|
||||
/* Set up and initialize clocking prior to call to main */
|
||||
void Board_SetupClocking(void)
|
||||
{
|
||||
Chip_SetupXtalClocking();
|
||||
|
||||
/* Set USB PLL input to main oscillator */
|
||||
Chip_Clock_SetUSBPLLSource(SYSCTL_PLLCLKSRC_MAINOSC);
|
||||
/* Setup USB PLL (FCLKIN = 12MHz) * 4 = 48MHz
|
||||
MSEL = 3 (this is pre-decremented), PSEL = 1 (for P = 2)
|
||||
FCLKOUT = FCLKIN * (MSEL + 1) = 12MHz * 4 = 48MHz
|
||||
FCCO = FCLKOUT * 2 * P = 48MHz * 2 * 2 = 192MHz (within FCCO range) */
|
||||
Chip_Clock_SetupUSBPLL(3, 1);
|
||||
|
||||
/* Powerup USB PLL */
|
||||
Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPLL_PD);
|
||||
|
||||
/* Wait for PLL to lock */
|
||||
while (!Chip_Clock_IsUSBPLLLocked()) {}
|
||||
|
||||
/* Set default system tick divder to 1 */
|
||||
Chip_Clock_SetSysTickClockDiv(1);
|
||||
}
|
||||
|
||||
/* Set up and initialize hardware prior to call to main */
|
||||
void Board_SystemInit(void)
|
||||
{
|
||||
/* Setup system clocking and muxing */
|
||||
Board_SetupMuxing();
|
||||
Board_SetupClocking();
|
||||
|
||||
/* Set SYSTICKDIV to 1 so CMSIS Systick functions work */
|
||||
LPC_SYSCTL->SYSTICKCLKDIV = 1;
|
||||
}
|
||||
275
lpc_board_nxp_lpcxpresso_1549/src/retarget.h
Normal file
275
lpc_board_nxp_lpcxpresso_1549/src/retarget.h
Normal file
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
* @brief IO redirection support
|
||||
*
|
||||
* This file adds re-direction support to the library for various
|
||||
* projects. It can be configured in one of 3 ways - no redirection,
|
||||
* redirection via a UART, or redirection via semihosting. If DEBUG
|
||||
* is not defined, all printf statements will do nothing with the
|
||||
* output being throw away. If DEBUG is defined, then the choice of
|
||||
* output is selected by the DEBUG_SEMIHOSTING define. If the
|
||||
* DEBUG_SEMIHOSTING is not defined, then output is redirected via
|
||||
* the UART. If DEBUG_SEMIHOSTING is defined, then output will be
|
||||
* attempted to be redirected via semihosting. If the UART method
|
||||
* is used, then the Board_UARTPutChar and Board_UARTGetChar
|
||||
* functions must be defined to be used by this driver and the UART
|
||||
* must already be initialized to the correct settings.
|
||||
*
|
||||
* @note
|
||||
* Copyright(C) NXP Semiconductors, 2012
|
||||
* All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* Software that is described herein is for illustrative purposes only
|
||||
* which provides customers with programming information regarding the
|
||||
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||
* all warranties, express or implied, including all implied warranties of
|
||||
* merchantability, fitness for a particular purpose and non-infringement of
|
||||
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||
* or liability for the use of the software, conveys no license or rights under any
|
||||
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||
* in the software without notification. NXP Semiconductors also makes no
|
||||
* representation or warranty that such application will be suitable for the
|
||||
* specified use without further testing or modification.
|
||||
*
|
||||
* @par
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||
* this code.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
||||
/* Keil (Realview) support */
|
||||
#if defined(__CC_ARM)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <rt_misc.h>
|
||||
|
||||
#if defined(DEBUG_ENABLE)
|
||||
#if defined(DEBUG_SEMIHOSTING)
|
||||
#define ITM_Port8(n) (*((volatile unsigned char *) (0xE0000000 + 4 * n)))
|
||||
#define ITM_Port16(n) (*((volatile unsigned short *) (0xE0000000 + 4 * n)))
|
||||
#define ITM_Port32(n) (*((volatile unsigned long *) (0xE0000000 + 4 * n)))
|
||||
|
||||
#define DEMCR (*((volatile unsigned long *) (0xE000EDFC)))
|
||||
#define TRCENA 0x01000000
|
||||
|
||||
/* Write to SWO */
|
||||
void _ttywrch(int ch)
|
||||
{
|
||||
if (DEMCR & TRCENA) {
|
||||
while (ITM_Port32(0) == 0) {}
|
||||
ITM_Port8(0) = ch;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
static INLINE void BoardOutChar(char ch)
|
||||
{
|
||||
Board_UARTPutChar(ch);
|
||||
}
|
||||
|
||||
#endif /* defined(DEBUG_SEMIHOSTING) */
|
||||
#endif /* defined(DEBUG_ENABLE) */
|
||||
|
||||
struct __FILE {
|
||||
int handle;
|
||||
};
|
||||
|
||||
FILE __stdout;
|
||||
FILE __stdin;
|
||||
FILE __stderr;
|
||||
|
||||
void *_sys_open(const char *name, int openmode)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fputc(int c, FILE *f)
|
||||
{
|
||||
#if defined(DEBUG_ENABLE)
|
||||
#if defined(DEBUG_SEMIHOSTING)
|
||||
_ttywrch(c);
|
||||
#else
|
||||
BoardOutChar((char) c);
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fgetc(FILE *f)
|
||||
{
|
||||
#if defined(DEBUG_ENABLE) && !defined(DEBUG_SEMIHOSTING)
|
||||
return Board_UARTGetChar();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int ferror(FILE *f)
|
||||
{
|
||||
return EOF;
|
||||
}
|
||||
|
||||
void _sys_exit(int return_code)
|
||||
{
|
||||
label:
|
||||
__WFI();
|
||||
goto label; /* endless loop */
|
||||
}
|
||||
|
||||
#endif /* defined (__CC_ARM) */
|
||||
|
||||
/* IAR support */
|
||||
#if defined(__ICCARM__)
|
||||
/*******************
|
||||
*
|
||||
* Copyright 1998-2003 IAR Systems. All rights reserved.
|
||||
*
|
||||
* $Revision: 30870 $
|
||||
*
|
||||
* This is a template implementation of the "__write" function used by
|
||||
* the standard library. Replace it with a system-specific
|
||||
* implementation.
|
||||
*
|
||||
* The "__write" function should output "size" number of bytes from
|
||||
* "buffer" in some application-specific way. It should return the
|
||||
* number of characters written, or _LLIO_ERROR on failure.
|
||||
*
|
||||
* If "buffer" is zero then __write should perform flushing of
|
||||
* internal buffers, if any. In this case "handle" can be -1 to
|
||||
* indicate that all handles should be flushed.
|
||||
*
|
||||
* The template implementation below assumes that the application
|
||||
* provides the function "MyLowLevelPutchar". It should return the
|
||||
* character written, or -1 on failure.
|
||||
*
|
||||
********************/
|
||||
|
||||
#include <yfuns.h>
|
||||
|
||||
#if defined(DEBUG_ENABLE) && !defined(DEBUG_SEMIHOSTING)
|
||||
|
||||
_STD_BEGIN
|
||||
|
||||
#pragma module_name = "?__write"
|
||||
|
||||
/*
|
||||
If the __write implementation uses internal buffering, uncomment
|
||||
the following line to ensure that we are called with "buffer" as 0
|
||||
(i.e. flush) when the application terminates. */
|
||||
size_t __write(int handle, const unsigned char *buffer, size_t size)
|
||||
{
|
||||
#if defined(DEBUG_ENABLE)
|
||||
size_t nChars = 0;
|
||||
|
||||
if (buffer == 0) {
|
||||
/*
|
||||
This means that we should flush internal buffers. Since we
|
||||
don't we just return. (Remember, "handle" == -1 means that all
|
||||
handles should be flushed.)
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This template only writes to "standard out" and "standard err",
|
||||
for all other file handles it returns failure. */
|
||||
if (( handle != _LLIO_STDOUT) && ( handle != _LLIO_STDERR) ) {
|
||||
return _LLIO_ERROR;
|
||||
}
|
||||
|
||||
for ( /* Empty */; size != 0; --size) {
|
||||
Board_UARTPutChar(*buffer++);
|
||||
++nChars;
|
||||
}
|
||||
|
||||
return nChars;
|
||||
#else
|
||||
return size;
|
||||
#endif /* defined(DEBUG_ENABLE) */
|
||||
}
|
||||
|
||||
_STD_END
|
||||
#endif
|
||||
|
||||
#endif /* defined (__ICCARM__) */
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
/* Include stdio.h to pull in __REDLIB_INTERFACE_VERSION__ */
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(__NEWLIB__)
|
||||
#define WRITEFUNC _write
|
||||
#define READFUNC _read
|
||||
#else
|
||||
#if (__REDLIB_INTERFACE_VERSION__ >= 20000)
|
||||
/* We are using new Redlib_v2 semihosting interface */
|
||||
#define WRITEFUNC __sys_write
|
||||
#define READFUNC __sys_readc
|
||||
#else
|
||||
/* We are using original Redlib semihosting interface */
|
||||
#define WRITEFUNC __write
|
||||
#define READFUNC __readc
|
||||
#endif
|
||||
#endif /* __NEWLIB__ */
|
||||
|
||||
#if defined(DEBUG_ENABLE)
|
||||
#if defined(DEBUG_SEMIHOSTING)
|
||||
/* Do nothing, semihosting is enabled by default in LPCXpresso */
|
||||
#endif /* defined(DEBUG_SEMIHOSTING) */
|
||||
#endif /* defined(DEBUG_ENABLE) */
|
||||
|
||||
#if !defined(DEBUG_SEMIHOSTING)
|
||||
int WRITEFUNC(int iFileHandle, char *pcBuffer, int iLength)
|
||||
{
|
||||
#if defined(DEBUG_ENABLE)
|
||||
unsigned int i;
|
||||
for (i = 0; i < iLength; i++) {
|
||||
Board_UARTPutChar(pcBuffer[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
return iLength;
|
||||
}
|
||||
|
||||
#if !defined(__NEWLIB__)
|
||||
/* Called by bottom level of scanf routine within RedLib C library to read
|
||||
a character. With the default semihosting stub, this would read the character
|
||||
from the debugger console window (which acts as stdin). But this version reads
|
||||
the character from the LPC1768/RDB1768 UART. */
|
||||
int READFUNC(void)
|
||||
{
|
||||
#if defined(DEBUG_ENABLE)
|
||||
int c = Board_UARTGetChar();
|
||||
return c;
|
||||
|
||||
#else
|
||||
return (int) -1;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* **WARNING**: THIS FUNCTION IS NON-BLOCKING
|
||||
* Not just STDIN all inputs handled via UART
|
||||
* Read function for newlib is added as a non-blocking function
|
||||
* the application should check for the size to identify the number
|
||||
* of bytes received */
|
||||
int READFUNC(int iFileHandle, char *pcBuffer, int iLength)
|
||||
{
|
||||
int idx;
|
||||
for (idx = 0; idx < iLength; idx++) {
|
||||
int c = Board_UARTGetChar();
|
||||
if (c == EOF) break;
|
||||
pcBuffer[idx] = c;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !defined(DEBUG_SEMIHOSTING) */
|
||||
#endif /* defined ( __GNUC__ ) */
|
||||
Reference in New Issue
Block a user