mirror of
https://github.com/QuantumLeaps/qpc.git
synced 2025-01-14 06:43:19 +08:00
Added QDK for EK-LM4F120XL (Cortex-M4F) with TI CCS5
Updated QDKs for PIC24/dsPIC to QP 4.5.04
This commit is contained in:
parent
b49b8c24bc
commit
c32466307e
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?ccsproject version="1.0"?>
|
||||
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.LM3S811"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="4.6.1"/>
|
||||
<isElfFormat value="true"/>
|
||||
<rts value="rtsv7M3_T_le_eabi.lib"/>
|
||||
<defaultAssemblyOnly value="false"/>
|
||||
<isTargetManual value="false"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
</projectOptions>
|
297
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/.cproject
Normal file
297
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/.cproject
Normal file
@ -0,0 +1,297 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.125056586" name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1716409358" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.934223113" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1611758648" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1143121742" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.1124808596" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.180816056" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.828998599" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.69457592" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.949278387" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.370856909" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.82319758" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.915912762" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.558479300" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.2024089942" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.238579306" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.1293657506" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.1033465017" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.1121431134" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1074317216" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.328308144" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.475841361" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.384693040" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.1751374675" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.1094428817" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.63083142" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.753765494" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.1643178508" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm/dbg""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.1231449111" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.86447584" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.132184793" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.275497851" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.1422631147" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781" moduleId="org.eclipse.cdt.core.settings" name="Spy">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781" name="Spy" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1433051124" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1222377594" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.513503655" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1738261499" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.965546943" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.1768291295" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.2073650057" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.1888517689" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.860827206" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.228973165" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.541668960" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.347869577" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
<listOptionValue builtIn="false" value="Q_SPY=1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.455908993" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.1241857520" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.1092728421" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.884455773" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.460071305" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.671169072" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1049849830" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.1124150309" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.1368275502" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.1693633075" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.123766415" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.223721228" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.1771905814" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.879949439" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.1652298111" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.347625353" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm/spy""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.600574631" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.1276765561" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.1143048046" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.664414988" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.697474988" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1080320893" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1931695420" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.2070425422" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1664971950" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.1069044512" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.620736059" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.775825092" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.1741549501" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.733340866" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.344918809" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.1964759972" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.1299773408" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="NDEBUG=1"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.2110390974" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.250984037" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.1256666369" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.1138064271" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.1131582044" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.1834594238" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1301625950" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED.967092832" name="Optimize for speed (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.2018341854" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.890302929" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.2111777112" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.2029792546" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1271693750" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.234772646" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.886999065" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.1036075456" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.565933276" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/qk/ti_arm/rel""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.282128790" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.485648781" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.535871043" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.248711679" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.1989361041" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="game-ev-lm3s811.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1859657595" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
</cproject>
|
33
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/.project
Normal file
33
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/.project
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>dpp-qk-ev-lm4f120xl</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<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.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>QPC</name>
|
||||
<value>file:/D:/qp/qpc</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
inEditor=false
|
||||
onBuild=false
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
|
@ -0,0 +1,5 @@
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168/internalBuilder/enabled=false
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168/internalBuilder/ignoreErr=true
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Release.1213787674/internalBuilder/enabled=false
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Release.1213787674/internalBuilder/ignoreErr=true
|
||||
eclipse.preferences.version=1
|
@ -0,0 +1,18 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//Debug/makefile=UTF-8
|
||||
encoding//Debug/objects.mk=UTF-8
|
||||
encoding//Debug/sources.mk=UTF-8
|
||||
encoding//Debug/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/subdir_vars.mk=UTF-8
|
||||
encoding//Release/cmsis/subdir_rules.mk=UTF-8
|
||||
encoding//Release/cmsis/subdir_vars.mk=UTF-8
|
||||
encoding//Release/makefile=UTF-8
|
||||
encoding//Release/objects.mk=UTF-8
|
||||
encoding//Release/sources.mk=UTF-8
|
||||
encoding//Release/subdir_rules.mk=UTF-8
|
||||
encoding//Release/subdir_vars.mk=UTF-8
|
||||
encoding//Spy/makefile=UTF-8
|
||||
encoding//Spy/objects.mk=UTF-8
|
||||
encoding//Spy/sources.mk=UTF-8
|
||||
encoding//Spy/subdir_rules.mk=UTF-8
|
||||
encoding//Spy/subdir_vars.mk=UTF-8
|
410
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/bsp.c
Normal file
410
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/bsp.c
Normal file
@ -0,0 +1,410 @@
|
||||
/*****************************************************************************
|
||||
* Product: "Dining Philosophers Problem" example, preemptive QK kernel
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 15, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
#include "lm4f_cmsis.h"
|
||||
#include "sysctl.h"
|
||||
#include "gpio.h"
|
||||
#include "rom.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
enum ISR_Priorities { /* ISR priorities starting from the highest urgency */
|
||||
GPIOPORTA_PRIO,
|
||||
SYSTICK_PRIO,
|
||||
/* ... */
|
||||
};
|
||||
|
||||
/* Local-scope objects -----------------------------------------------------*/
|
||||
static unsigned l_rnd; /* random seed */
|
||||
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
#define LED_BLUE (1U << 2)
|
||||
|
||||
#define USR_SW1 (1U << 4)
|
||||
#define USR_SW2 (1U << 0)
|
||||
|
||||
#ifdef Q_SPY
|
||||
|
||||
QSTimeCtr QS_tickTime_;
|
||||
QSTimeCtr QS_tickPeriod_;
|
||||
static uint8_t l_SysTick_Handler;
|
||||
static uint8_t l_GPIOPortA_IRQHandler;
|
||||
|
||||
#define UART_BAUD_RATE 115200U
|
||||
#define UART_FR_TXFE 0x80U
|
||||
#define UART_TXFIFO_DEPTH 16U
|
||||
|
||||
enum AppRecords { /* application-specific trace records */
|
||||
PHILO_STAT = QS_USER
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*..........................................................................*/
|
||||
void SysTick_Handler(void) {
|
||||
static uint32_t btn_debounced = USR_SW1;
|
||||
static uint8_t debounce_state = 0U;
|
||||
uint32_t btn;
|
||||
|
||||
QK_ISR_ENTRY(); /* infrom QK about entering an ISR */
|
||||
|
||||
#ifdef Q_SPY
|
||||
{
|
||||
uint32_t dummy = SysTick->CTRL; /* clear SysTick_CTRL_COUNTFLAG */
|
||||
QS_tickTime_ += QS_tickPeriod_; /* account for the clock rollover */
|
||||
}
|
||||
#endif
|
||||
|
||||
QF_TICK(&l_SysTick_Handler); /* process all armed time events */
|
||||
|
||||
/* debounce the SW1 button... */
|
||||
btn = GPIOF->DATA_Bits[USR_SW1]; /* read the push btn */
|
||||
switch (debounce_state) {
|
||||
case 0:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 1U; /* transition to the next state */
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 2U; /* transition to the next state */
|
||||
}
|
||||
else {
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 3U; /* transition to the next state */
|
||||
}
|
||||
else {
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (btn != btn_debounced) {
|
||||
btn_debounced = btn; /* save the debounced button value */
|
||||
|
||||
if (btn == 0U) { /* is the button depressed? */
|
||||
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
|
||||
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
|
||||
}
|
||||
else {
|
||||
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
|
||||
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
|
||||
}
|
||||
}
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
break;
|
||||
}
|
||||
|
||||
QK_ISR_EXIT(); /* infrom QK about exiting an ISR */
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void GPIOPortA_IRQHandler(void) {
|
||||
QK_ISR_ENTRY(); /* infrom QK about entering an ISR */
|
||||
|
||||
QACTIVE_POST(AO_Table, Q_NEW(QEvt, MAX_PUB_SIG), /* for testing... */
|
||||
&l_GPIOPortA_IRQHandler);
|
||||
|
||||
QK_ISR_EXIT(); /* infrom QK about exiting an ISR */
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void BSP_init(void) {
|
||||
/* Enable the floating-point unit */
|
||||
SCB->CPACR |= (0xFU << 20);
|
||||
|
||||
/* Enable lazy stacking for interrupt handlers. This allows FPU
|
||||
* instructions to be used within interrupt handlers, but at the
|
||||
* expense of extra stack and CPU usage.
|
||||
*/
|
||||
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
|
||||
|
||||
/* Set the clocking to run directly from the crystal */
|
||||
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC
|
||||
| SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
|
||||
|
||||
/* enable clock to the peripherals used by the application */
|
||||
SYSCTL->RCGC2 |= (1U << 5); /* enable clock to GPIOF */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
|
||||
/* configure the LEDs and push buttons */
|
||||
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE);/* set direction: output */
|
||||
GPIOF->DEN |= (LED_RED | LED_GREEN | LED_BLUE); /* digital enable */
|
||||
GPIOF->DATA_Bits[LED_RED] = 0; /* turn the LED off */
|
||||
GPIOF->DATA_Bits[LED_GREEN] = 0; /* turn the LED off */
|
||||
GPIOF->DATA_Bits[LED_BLUE] = 0; /* turn the LED off */
|
||||
|
||||
/* configure the User Switches */
|
||||
GPIOF->DIR &= ~(USR_SW1 | USR_SW2); /* set direction: input */
|
||||
ROM_GPIOPadConfigSet(GPIO_PORTF_BASE, (USR_SW1 | USR_SW2),
|
||||
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
|
||||
|
||||
BSP_randomSeed(1234U);
|
||||
|
||||
if (QS_INIT((void *)0) == 0) { /* initialize the QS software tracing */
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_RESET();
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_BLUE] = ((stat[0] == 'e') ? LED_BLUE : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) /* application-specific record begin */
|
||||
QS_U8(1, n); /* Philosopher number */
|
||||
QS_STR(stat); /* Philosopher status */
|
||||
QS_END()
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_displayPaused(uint8_t paused) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((paused != 0U) ? LED_RED : 0U);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
uint32_t BSP_random(void) { /* a very cheap pseudo-random-number generator */
|
||||
float volatile x = 3.1415926F;
|
||||
x = x + 2.7182818F;
|
||||
|
||||
/* "Super-Duper" Linear Congruential Generator (LCG)
|
||||
* LCG(2^32, 3*7*11*13*23, 0, seed)
|
||||
*/
|
||||
l_rnd = l_rnd * (3U*7U*11U*13U*23U);
|
||||
|
||||
return l_rnd >> 8;
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_randomSeed(uint32_t seed) {
|
||||
l_rnd = seed;
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_terminate(int16_t result) {
|
||||
(void)result;
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void QF_onStartup(void) {
|
||||
/* set up the SysTick timer to fire at BSP_TICKS_PER_SEC rate */
|
||||
SysTick_Config(ROM_SysCtlClockGet() / BSP_TICKS_PER_SEC);
|
||||
|
||||
/* set priorities of all interrupts in the system... */
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOPortA_IRQn, GPIOPORTA_PRIO);
|
||||
|
||||
NVIC_EnableIRQ(GPIOPortA_IRQn);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QF_onCleanup(void) {
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QK_onIdle(void) {
|
||||
|
||||
/* toggle the User LED on and then off, see NOTE02 */
|
||||
QF_INT_DISABLE();
|
||||
GPIOF->DATA_Bits[LED_GREEN] = LED_GREEN; /* turn the Green LED on */
|
||||
GPIOF->DATA_Bits[LED_GREEN] = 0; /* turn the Green LED off */
|
||||
QF_INT_ENABLE();
|
||||
|
||||
float volatile x = 3.1415926F;
|
||||
x = x + 2.7182818F;
|
||||
|
||||
#ifdef Q_SPY
|
||||
if ((UART0->FR & UART_FR_TXFE) != 0) { /* TX done? */
|
||||
uint16_t fifo = UART_TXFIFO_DEPTH; /* max bytes we can accept */
|
||||
uint8_t const *block;
|
||||
|
||||
QF_INT_DISABLE();
|
||||
block = QS_getBlock(&fifo); /* try to get next block to transmit */
|
||||
QF_INT_ENABLE();
|
||||
|
||||
while (fifo-- != 0) { /* any bytes in the block? */
|
||||
UART0->DR = *block++; /* put into the FIFO */
|
||||
}
|
||||
}
|
||||
#elif defined NDEBUG
|
||||
/* Put the CPU and peripherals to the low-power mode.
|
||||
* you might need to customize the clock management for your application,
|
||||
* see the datasheet for your particular Cortex-M3 MCU.
|
||||
*/
|
||||
asm(" WFI"); /* Wait-For-Interrupt */
|
||||
#endif
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
|
||||
(void)file; /* avoid compiler warning */
|
||||
(void)line; /* avoid compiler warning */
|
||||
QF_INT_DISABLE(); /* make sure that all interrupts are disabled */
|
||||
for (;;) { /* NOTE: replace the loop with reset for final version */
|
||||
}
|
||||
}
|
||||
/*..........................................................................*/
|
||||
/* error routine that is called if the CMSIS library encounters an error */
|
||||
void assert_failed(char const *file, int line) {
|
||||
Q_onAssert(file, line);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#ifdef Q_SPY
|
||||
/*..........................................................................*/
|
||||
uint8_t QS_onStartup(void const *arg) {
|
||||
static uint8_t qsBuf[2*1024]; /* buffer for Quantum Spy */
|
||||
uint32_t tmp;
|
||||
QS_initBuf(qsBuf, sizeof(qsBuf));
|
||||
|
||||
/* enable the peripherals used by the UART0 */
|
||||
SYSCTL->RCGC1 |= (1U << 0); /* enable clock to UART0 */
|
||||
SYSCTL->RCGC2 |= (1U << 0); /* enable clock to GPIOA */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
|
||||
/* configure UART0 pins for UART operation */
|
||||
tmp = (1U << 0) | (1U << 1);
|
||||
GPIOA->DIR &= ~tmp;
|
||||
GPIOA->AFSEL |= tmp;
|
||||
GPIOA->DR2R |= tmp; /* set 2mA drive, DR4R and DR8R are cleared */
|
||||
GPIOA->SLR &= ~tmp;
|
||||
GPIOA->ODR &= ~tmp;
|
||||
GPIOA->PUR &= ~tmp;
|
||||
GPIOA->PDR &= ~tmp;
|
||||
GPIOA->DEN |= tmp;
|
||||
|
||||
/* configure the UART for the desired baud rate, 8-N-1 operation */
|
||||
tmp = (((ROM_SysCtlClockGet() * 8U) / UART_BAUD_RATE) + 1U) / 2U;
|
||||
UART0->IBRD = tmp / 64U;
|
||||
UART0->FBRD = tmp % 64U;
|
||||
UART0->LCRH = 0x60U; /* configure 8-N-1 operation */
|
||||
UART0->LCRH |= 0x10U;
|
||||
UART0->CTL |= (1U << 0) | (1U << 8) | (1U << 9);
|
||||
|
||||
QS_tickPeriod_ = ROM_SysCtlClockGet() / BSP_TICKS_PER_SEC;
|
||||
QS_tickTime_ = QS_tickPeriod_; /* to start the timestamp at zero */
|
||||
|
||||
/* setup the QS filters... */
|
||||
QS_FILTER_ON(QS_ALL_RECORDS);
|
||||
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_EMPTY);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_ENTRY);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_EXIT);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_INIT);
|
||||
// QS_FILTER_OFF(QS_QEP_INIT_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_INTERN_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_IGNORED);
|
||||
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_ADD);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_REMOVE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_SUBSCRIBE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_UNSUBSCRIBE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_POST_FIFO);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_POST_LIFO);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_GET);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_GET_LAST);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_INIT);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_POST_FIFO);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_POST_LIFO);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_GET);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_GET_LAST);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_INIT);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_GET);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_PUT);
|
||||
// QS_FILTER_OFF(QS_QF_PUBLISH);
|
||||
// QS_FILTER_OFF(QS_QF_NEW);
|
||||
// QS_FILTER_OFF(QS_QF_GC_ATTEMPT);
|
||||
// QS_FILTER_OFF(QS_QF_GC);
|
||||
// QS_FILTER_OFF(QS_QF_TICK);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_ARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_AUTO_DISARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_DISARM_ATTEMPT);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_DISARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_REARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_POST);
|
||||
QS_FILTER_OFF(QS_QF_CRIT_ENTRY);
|
||||
QS_FILTER_OFF(QS_QF_CRIT_EXIT);
|
||||
QS_FILTER_OFF(QS_QF_ISR_ENTRY);
|
||||
QS_FILTER_OFF(QS_QF_ISR_EXIT);
|
||||
|
||||
return (uint8_t)1; /* return success */
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QS_onCleanup(void) {
|
||||
}
|
||||
/*..........................................................................*/
|
||||
QSTimeCtr QS_onGetTime(void) { /* invoked with interrupts locked */
|
||||
if ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) { /* not set? */
|
||||
return QS_tickTime_ - (QSTimeCtr)SysTick->VAL;
|
||||
}
|
||||
else { /* the rollover occured, but the SysTick_ISR did not run yet */
|
||||
return QS_tickTime_ + QS_tickPeriod_ - (QSTimeCtr)SysTick->VAL;
|
||||
}
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QS_onFlush(void) {
|
||||
uint16_t fifo = UART_TXFIFO_DEPTH; /* Tx FIFO depth */
|
||||
uint8_t const *block;
|
||||
QF_INT_DISABLE();
|
||||
while ((block = QS_getBlock(&fifo)) != (uint8_t *)0) {
|
||||
QF_INT_ENABLE();
|
||||
/* busy-wait until TX FIFO empty */
|
||||
while ((UART0->FR & UART_FR_TXFE) == 0) {
|
||||
}
|
||||
|
||||
while (fifo-- != 0) { /* any bytes in the block? */
|
||||
UART0->DR = *block++; /* put into the TX FIFO */
|
||||
}
|
||||
fifo = UART_TXFIFO_DEPTH; /* re-load the Tx FIFO depth */
|
||||
QF_INT_DISABLE();
|
||||
}
|
||||
QF_INT_ENABLE();
|
||||
}
|
||||
#endif /* Q_SPY */
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE02:
|
||||
* The User LED is used to visualize the idle loop activity. The brightness
|
||||
* of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
* Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
* execution time contributes to the brightness of the User LED.
|
||||
*/
|
48
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/bsp.h
Normal file
48
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/bsp.h
Normal file
@ -0,0 +1,48 @@
|
||||
/*****************************************************************************
|
||||
* Product: DPP example
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Jul 04, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef bsp_h
|
||||
#define bsp_h
|
||||
|
||||
#define BSP_TICKS_PER_SEC 50U
|
||||
|
||||
void BSP_init(void);
|
||||
void BSP_displayPaused(uint8_t paused);
|
||||
void BSP_displayPhilStat(uint8_t n, char_t const *stat);
|
||||
void BSP_terminate(int16_t result);
|
||||
|
||||
void BSP_randomSeed(uint32_t seed); /* random seed */
|
||||
uint32_t BSP_random(void); /* pseudo-random generator */
|
||||
|
||||
#endif /* bsp_h */
|
@ -0,0 +1,148 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// cmsis_ccs.h - Include file containing #defines necessary to build the CMSIS
|
||||
// dsp libraries using compiler intrinsics for the TMS470 compiler.
|
||||
//
|
||||
// Copyright (c) 2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// Texas Instruments (TI) is supplying this software for use solely and
|
||||
// exclusively on TI's microcontroller products. The software is owned by
|
||||
// TI and/or its suppliers, and is protected under applicable copyright
|
||||
// laws. You may not combine this software with "viral" open-source
|
||||
// software in order to form a larger program.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
|
||||
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
|
||||
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
|
||||
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
|
||||
// DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
//
|
||||
// This is part of revision 8542 of the CMSIS DSP Application Note.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef CMSIS_CCS_H_
|
||||
#define CMSIS_CCS_H_
|
||||
|
||||
|
||||
//
|
||||
// v5e, v6, Cortex-M3, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __CLZ _norm
|
||||
#define __SXTB _sxtb
|
||||
#define __SXTH _sxth
|
||||
#define __UXTB _uxtb
|
||||
#define __UXTH _uxth
|
||||
#define __DSB() asm(" DSB")
|
||||
|
||||
// CCS supports intrinsics to take advantage of the shift operand left/right
|
||||
// before saturation extension of SSAT, but CMSIS does not take advantage
|
||||
// of those, so tell the compiler to use a sat & shift left with a shift
|
||||
// value of 0 whenever it encounters an SSAT
|
||||
#define __SSAT(VAL, BITPOS) \
|
||||
_ssatl(VAL , 0, BITPOS)
|
||||
|
||||
//
|
||||
// Only define M4 based intrinsics if we're not using an M4
|
||||
//
|
||||
#if defined (__TI_TMS470_V7M4__)
|
||||
//
|
||||
// V5E, V6, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __QADD _sadd
|
||||
#define __QDADD _sdadd
|
||||
#define __QDSUB _sdsub
|
||||
#define __SMLABB _smlabb
|
||||
#define __SMLABT _smlabt
|
||||
#define __SMLALBB _smlalbb
|
||||
#define __SMLALBT _smlalbt
|
||||
#define __SMLALTB _smlaltb
|
||||
#define __SMLALTT _smlaltt
|
||||
#define __SMLATB _smlatb
|
||||
#define __SMLATT _smlatt
|
||||
#define __SMLAWB _smlawb
|
||||
#define __SMLAWT _smlawt
|
||||
|
||||
#define __SMULBB _smulbb
|
||||
#define __SMULBT _smulbt
|
||||
#define __SMULTB _smultb
|
||||
#define __SMULTT _smultt
|
||||
#define __SMULWB _smulwb
|
||||
#define __SMULWT _smulwt
|
||||
#define __QSUB _ssub
|
||||
#define __SUBC _subc
|
||||
|
||||
//
|
||||
// v6, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __SHASX _shaddsubx
|
||||
#define __SHSAX _shsubaddx
|
||||
#define __PKHBT _pkhbt
|
||||
#define __PKHTB _pkhtb
|
||||
#define __QADD16 _qadd16
|
||||
#define __QADD8 _qadd8
|
||||
#define __QSUB16 _qsub16
|
||||
#define __QSUB8 _qsub8
|
||||
#define __QASX _saddsubx
|
||||
#define __QSAX _qsubaddx
|
||||
#define __SADD16 _sadd16
|
||||
#define __SADD8 _sadd8
|
||||
#define __SASX _saddsubx
|
||||
#define __SEL _sel
|
||||
#define __SHADD16 _shadd16
|
||||
#define __SHADD8 _shadd8
|
||||
#define __SHSUB16 _shsub16
|
||||
#define __SHSUB8 _shsub8
|
||||
#define __SMLAD _smlad
|
||||
#define __SMLADX _smladx
|
||||
#define __SMLALD _smlald
|
||||
#define __SMLALDX _smlaldx
|
||||
#define __SMLSD _smlsd
|
||||
#define __SMLSDX _smlsdx
|
||||
#define __SMLSLD _smlsld
|
||||
#define __SMLSLDX _smlsldx
|
||||
#define __SMMLA _smmla
|
||||
#define __SMMLAR _smmlar
|
||||
#define __SMMLS _smmls
|
||||
#define __SMMLSR _smmlsr
|
||||
#define __SMMUL _smmul
|
||||
#define __SMMULR _smmulr
|
||||
#define __SMUAD _smuad
|
||||
#define __SMUADX _smuadx
|
||||
#define __SMUSD _smusd
|
||||
#define __SMUSDX _smusd
|
||||
#define __SSAT16 _ssat16
|
||||
#define __SSUB16 _ssub16
|
||||
#define __SSUB8 _ssub8
|
||||
#define __SSAX _ssubaddx
|
||||
#define __SXTAB _sxtab
|
||||
#define __SXTAB16 _sxtab16
|
||||
#define __SXTAH _sxtah
|
||||
#define __UMAAL _umaal
|
||||
#define __UADD16 _uadd16
|
||||
#define __UADD8 _uadd8
|
||||
#define __UHADD16 _uhadd16
|
||||
#define __UHADD8 _uhadd8
|
||||
#define __UASX _uaddsubx
|
||||
#define __UHSUB16 _uhsub16
|
||||
#define __UHSUB8 _uhsub8
|
||||
#define __UQADD16 _uqadd16
|
||||
#define __UQADD8 _uqadd8
|
||||
#define __UQASX _uqaddsubx
|
||||
#define __UQSUB16 _uqsub16
|
||||
#define __UQSUB8 _uqsub8
|
||||
#define __UQSAX _uqsubaddx
|
||||
#define __USAD8 _usad8
|
||||
#define __USAT16 _usat16
|
||||
#define __USUB16 _usub16
|
||||
#define __USUB8 _usub8
|
||||
#define __USAX _usubaddx
|
||||
#define __UXTAB _uxtab
|
||||
#define __UXTAB16 _uxtab16
|
||||
#define __UXTAH _uxtah
|
||||
#define __UXTB16 _uxtb16
|
||||
#endif /*__TI_TMS470_V7M4__*/
|
||||
|
||||
#endif /*CMSIS_CCS_H_*/
|
1757
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/cmsis/core_cm4.h
Normal file
1757
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/cmsis/core_cm4.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,649 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cm4_simd.h
|
||||
* @brief CMSIS Cortex-M4 SIMD Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CM4_SIMD_H
|
||||
#define __CORE_CM4_SIMD_H
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Hardware Abstraction Layer
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/* ################### Compiler specific Intrinsics ########################### */
|
||||
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
|
||||
Access to dedicated SIMD instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#define __SADD8 __sadd8
|
||||
#define __QADD8 __qadd8
|
||||
#define __SHADD8 __shadd8
|
||||
#define __UADD8 __uadd8
|
||||
#define __UQADD8 __uqadd8
|
||||
#define __UHADD8 __uhadd8
|
||||
#define __SSUB8 __ssub8
|
||||
#define __QSUB8 __qsub8
|
||||
#define __SHSUB8 __shsub8
|
||||
#define __USUB8 __usub8
|
||||
#define __UQSUB8 __uqsub8
|
||||
#define __UHSUB8 __uhsub8
|
||||
#define __SADD16 __sadd16
|
||||
#define __QADD16 __qadd16
|
||||
#define __SHADD16 __shadd16
|
||||
#define __UADD16 __uadd16
|
||||
#define __UQADD16 __uqadd16
|
||||
#define __UHADD16 __uhadd16
|
||||
#define __SSUB16 __ssub16
|
||||
#define __QSUB16 __qsub16
|
||||
#define __SHSUB16 __shsub16
|
||||
#define __USUB16 __usub16
|
||||
#define __UQSUB16 __uqsub16
|
||||
#define __UHSUB16 __uhsub16
|
||||
#define __SASX __sasx
|
||||
#define __QASX __qasx
|
||||
#define __SHASX __shasx
|
||||
#define __UASX __uasx
|
||||
#define __UQASX __uqasx
|
||||
#define __UHASX __uhasx
|
||||
#define __SSAX __ssax
|
||||
#define __QSAX __qsax
|
||||
#define __SHSAX __shsax
|
||||
#define __USAX __usax
|
||||
#define __UQSAX __uqsax
|
||||
#define __UHSAX __uhsax
|
||||
#define __USAD8 __usad8
|
||||
#define __USADA8 __usada8
|
||||
#define __SSAT16 __ssat16
|
||||
#define __USAT16 __usat16
|
||||
#define __UXTB16 __uxtb16
|
||||
#define __UXTAB16 __uxtab16
|
||||
#define __SXTB16 __sxtb16
|
||||
#define __SXTAB16 __sxtab16
|
||||
#define __SMUAD __smuad
|
||||
#define __SMUADX __smuadx
|
||||
#define __SMLAD __smlad
|
||||
#define __SMLADX __smladx
|
||||
#define __SMLALD __smlald
|
||||
#define __SMLALDX __smlaldx
|
||||
#define __SMUSD __smusd
|
||||
#define __SMUSDX __smusdx
|
||||
#define __SMLSD __smlsd
|
||||
#define __SMLSDX __smlsdx
|
||||
#define __SMLSLD __smlsld
|
||||
#define __SMLSLDX __smlsldx
|
||||
#define __SEL __sel
|
||||
#define __QADD __qadd
|
||||
#define __QSUB __qsub
|
||||
|
||||
#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
|
||||
((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
|
||||
|
||||
#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
|
||||
((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
|
||||
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SSAT16(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
#define __USAT16(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SMLALD(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlald %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
#define __SMLALDX(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SMLSLD(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
#define __SMLSLDX(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __PKHBT(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
|
||||
__ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
#define __PKHTB(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
|
||||
if (ARG3 == 0) \
|
||||
__ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \
|
||||
else \
|
||||
__ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
/* not yet supported */
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of group CMSIS_SIMD_intrinsics */
|
||||
|
||||
|
||||
#endif /* __CORE_CM4_SIMD_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -0,0 +1,616 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmFunc.h
|
||||
* @brief CMSIS Cortex-M Core Function Access Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2009-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CORE_CMFUNC_H
|
||||
#define __CORE_CMFUNC_H
|
||||
|
||||
|
||||
/* ########################### Core Function Access ########################### */
|
||||
/** \ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
#if (__ARMCC_VERSION < 400677)
|
||||
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
|
||||
#endif
|
||||
|
||||
/* intrinsic void __enable_irq(); */
|
||||
/* intrinsic void __disable_irq(); */
|
||||
|
||||
/** \brief Get Control Register
|
||||
|
||||
This function returns the content of the Control Register.
|
||||
|
||||
\return Control Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
return(__regControl);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Control Register
|
||||
|
||||
This function writes the given value to the Control Register.
|
||||
|
||||
\param [in] control Control Register value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
__regControl = control;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get IPSR Register
|
||||
|
||||
This function returns the content of the IPSR Register.
|
||||
|
||||
\return IPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_IPSR(void)
|
||||
{
|
||||
register uint32_t __regIPSR __ASM("ipsr");
|
||||
return(__regIPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get APSR Register
|
||||
|
||||
This function returns the content of the APSR Register.
|
||||
|
||||
\return APSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
register uint32_t __regAPSR __ASM("apsr");
|
||||
return(__regAPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get xPSR Register
|
||||
|
||||
This function returns the content of the xPSR Register.
|
||||
|
||||
\return xPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_xPSR(void)
|
||||
{
|
||||
register uint32_t __regXPSR __ASM("xpsr");
|
||||
return(__regXPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Process Stack Pointer
|
||||
|
||||
This function returns the current value of the Process Stack Pointer (PSP).
|
||||
|
||||
\return PSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PSP(void)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
return(__regProcessStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Process Stack Pointer
|
||||
|
||||
This function assigns the given value to the Process Stack Pointer (PSP).
|
||||
|
||||
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
__regProcessStackPointer = topOfProcStack;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Main Stack Pointer
|
||||
|
||||
This function returns the current value of the Main Stack Pointer (MSP).
|
||||
|
||||
\return MSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_MSP(void)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
return(__regMainStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Main Stack Pointer
|
||||
|
||||
This function assigns the given value to the Main Stack Pointer (MSP).
|
||||
|
||||
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
__regMainStackPointer = topOfMainStack;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Priority Mask
|
||||
|
||||
This function returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
return(__regPriMask);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Priority Mask
|
||||
|
||||
This function assigns the given value to the Priority Mask Register.
|
||||
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
__regPriMask = (priMask);
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Enable FIQ
|
||||
|
||||
This function enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __enable_fault_irq __enable_fiq
|
||||
|
||||
|
||||
/** \brief Disable FIQ
|
||||
|
||||
This function disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __disable_fault_irq __disable_fiq
|
||||
|
||||
|
||||
/** \brief Get Base Priority
|
||||
|
||||
This function returns the current value of the Base Priority register.
|
||||
|
||||
\return Base Priority register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
return(__regBasePri);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Base Priority
|
||||
|
||||
This function assigns the given value to the Base Priority register.
|
||||
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
__regBasePri = (basePri & 0xff);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Fault Mask
|
||||
|
||||
This function returns the current value of the Fault Mask register.
|
||||
|
||||
\return Fault Mask register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
return(__regFaultMask);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Fault Mask
|
||||
|
||||
This function assigns the given value to the Fault Mask register.
|
||||
|
||||
\param [in] faultMask Fault Mask value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
__regFaultMask = (faultMask & (uint32_t)1);
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
#if (__CORTEX_M == 0x04)
|
||||
|
||||
/** \brief Get FPSCR
|
||||
|
||||
This function returns the current value of the Floating Point Status/Control register.
|
||||
|
||||
\return Floating Point Status/Control register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
return(__regfpscr);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set FPSCR
|
||||
|
||||
This function assigns the given value to the Floating Point Status/Control register.
|
||||
|
||||
\param [in] fpscr Floating Point Status/Control value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
__regfpscr = (fpscr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M == 0x04) */
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/** \brief Enable IRQ Interrupts
|
||||
|
||||
This function enables IRQ interrupts by clearing the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsie i");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Disable IRQ Interrupts
|
||||
|
||||
This function disables IRQ interrupts by setting the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsid i");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Control Register
|
||||
|
||||
This function returns the content of the Control Register.
|
||||
|
||||
\return Control Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, control" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Control Register
|
||||
|
||||
This function writes the given value to the Control Register.
|
||||
|
||||
\param [in] control Control Register value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
__ASM volatile ("MSR control, %0" : : "r" (control) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get IPSR Register
|
||||
|
||||
This function returns the content of the IPSR Register.
|
||||
|
||||
\return IPSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, ipsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get APSR Register
|
||||
|
||||
This function returns the content of the APSR Register.
|
||||
|
||||
\return APSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, apsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get xPSR Register
|
||||
|
||||
This function returns the content of the xPSR Register.
|
||||
|
||||
\return xPSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, xpsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Process Stack Pointer
|
||||
|
||||
This function returns the current value of the Process Stack Pointer (PSP).
|
||||
|
||||
\return PSP Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
|
||||
{
|
||||
register uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, psp\n" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Process Stack Pointer
|
||||
|
||||
This function assigns the given value to the Process Stack Pointer (PSP).
|
||||
|
||||
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||
{
|
||||
__ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Main Stack Pointer
|
||||
|
||||
This function returns the current value of the Main Stack Pointer (MSP).
|
||||
|
||||
\return MSP Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
|
||||
{
|
||||
register uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, msp\n" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Main Stack Pointer
|
||||
|
||||
This function assigns the given value to the Main Stack Pointer (MSP).
|
||||
|
||||
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||
{
|
||||
__ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Priority Mask
|
||||
|
||||
This function returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, primask" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Priority Mask
|
||||
|
||||
This function assigns the given value to the Priority Mask Register.
|
||||
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
__ASM volatile ("MSR primask, %0" : : "r" (priMask) );
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Enable FIQ
|
||||
|
||||
This function enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsie f");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Disable FIQ
|
||||
|
||||
This function disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsid f");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Base Priority
|
||||
|
||||
This function returns the current value of the Base Priority register.
|
||||
|
||||
\return Base Priority register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, basepri_max" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Base Priority
|
||||
|
||||
This function assigns the given value to the Base Priority register.
|
||||
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value)
|
||||
{
|
||||
__ASM volatile ("MSR basepri, %0" : : "r" (value) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Fault Mask
|
||||
|
||||
This function returns the current value of the Fault Mask register.
|
||||
|
||||
\return Fault Mask register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, faultmask" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Fault Mask
|
||||
|
||||
This function assigns the given value to the Fault Mask register.
|
||||
|
||||
\param [in] faultMask Fault Mask value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||
{
|
||||
__ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) );
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
#if (__CORTEX_M == 0x04)
|
||||
|
||||
/** \brief Get FPSCR
|
||||
|
||||
This function returns the current value of the Floating Point Status/Control register.
|
||||
|
||||
\return Floating Point Status/Control register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
|
||||
return(result);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set FPSCR
|
||||
|
||||
This function assigns the given value to the Floating Point Status/Control register.
|
||||
|
||||
\param [in] fpscr Floating Point Status/Control value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
__ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M == 0x04) */
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all instrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of CMSIS_Core_RegAccFunctions */
|
||||
|
||||
|
||||
#endif /* __CORE_CMFUNC_H */
|
@ -0,0 +1,618 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmInstr.h
|
||||
* @brief CMSIS Cortex-M Core Instruction Access Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2009-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CORE_CMINSTR_H
|
||||
#define __CORE_CMINSTR_H
|
||||
|
||||
|
||||
/* ########################## Core Instruction Access ######################### */
|
||||
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
|
||||
Access to dedicated instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
#if (__ARMCC_VERSION < 400677)
|
||||
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
|
||||
#endif
|
||||
|
||||
|
||||
/** \brief No Operation
|
||||
|
||||
No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||
*/
|
||||
#define __NOP __nop
|
||||
|
||||
|
||||
/** \brief Wait For Interrupt
|
||||
|
||||
Wait For Interrupt is a hint instruction that suspends execution
|
||||
until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFI __wfi
|
||||
|
||||
|
||||
/** \brief Wait For Event
|
||||
|
||||
Wait For Event is a hint instruction that permits the processor to enter
|
||||
a low-power state until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFE __wfe
|
||||
|
||||
|
||||
/** \brief Send Event
|
||||
|
||||
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||
*/
|
||||
#define __SEV __sev
|
||||
|
||||
|
||||
/** \brief Instruction Synchronization Barrier
|
||||
|
||||
Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
so that all instructions following the ISB are fetched from cache or
|
||||
memory, after the instruction has been completed.
|
||||
*/
|
||||
#define __ISB() __isb(0xF)
|
||||
|
||||
|
||||
/** \brief Data Synchronization Barrier
|
||||
|
||||
This function acts as a special kind of Data Memory Barrier.
|
||||
It completes when all explicit memory accesses before this instruction complete.
|
||||
*/
|
||||
#define __DSB() __dsb(0xF)
|
||||
|
||||
|
||||
/** \brief Data Memory Barrier
|
||||
|
||||
This function ensures the apparent order of the explicit memory operations before
|
||||
and after the instruction, without ensuring their completion.
|
||||
*/
|
||||
#define __DMB() __dmb(0xF)
|
||||
|
||||
|
||||
/** \brief Reverse byte order (32 bit)
|
||||
|
||||
This function reverses the byte order in integer value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#define __REV __rev
|
||||
|
||||
|
||||
/** \brief Reverse byte order (16 bit)
|
||||
|
||||
This function reverses the byte order in two unsigned short values.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
|
||||
{
|
||||
rev16 r0, r0
|
||||
bx lr
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order in signed short value
|
||||
|
||||
This function reverses the byte order in a signed short value with sign extension to integer.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
|
||||
{
|
||||
revsh r0, r0
|
||||
bx lr
|
||||
}
|
||||
|
||||
|
||||
/** \brief Rotate Right in unsigned value (32 bit)
|
||||
|
||||
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||
|
||||
\param [in] value Value to rotate
|
||||
\param [in] value Number of Bits to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
#define __ROR __ror
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Reverse bit order of value
|
||||
|
||||
This function reverses the bit order of the given value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#define __RBIT __rbit
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 8 bit value.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 16 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 32 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief STR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive STR command for 8 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXB(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief STR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive STR command for 16 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXH(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief STR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive STR command for 32 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXW(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief Remove the exclusive lock
|
||||
|
||||
This function removes the exclusive lock which is created by LDREX.
|
||||
|
||||
*/
|
||||
#define __CLREX __clrex
|
||||
|
||||
|
||||
/** \brief Signed Saturate
|
||||
|
||||
This function saturates a signed value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __SSAT __ssat
|
||||
|
||||
|
||||
/** \brief Unsigned Saturate
|
||||
|
||||
This function saturates an unsigned value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __USAT __usat
|
||||
|
||||
|
||||
/** \brief Count leading zeros
|
||||
|
||||
This function counts the number of leading zeros of a data value.
|
||||
|
||||
\param [in] value Value to count the leading zeros
|
||||
\return number of leading zeros in value
|
||||
*/
|
||||
#define __CLZ __clz
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/** \brief No Operation
|
||||
|
||||
No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void)
|
||||
{
|
||||
__ASM volatile ("nop");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Wait For Interrupt
|
||||
|
||||
Wait For Interrupt is a hint instruction that suspends execution
|
||||
until one of a number of events occurs.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void)
|
||||
{
|
||||
__ASM volatile ("wfi");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Wait For Event
|
||||
|
||||
Wait For Event is a hint instruction that permits the processor to enter
|
||||
a low-power state until one of a number of events occurs.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void)
|
||||
{
|
||||
__ASM volatile ("wfe");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Send Event
|
||||
|
||||
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void)
|
||||
{
|
||||
__ASM volatile ("sev");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Instruction Synchronization Barrier
|
||||
|
||||
Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
so that all instructions following the ISB are fetched from cache or
|
||||
memory, after the instruction has been completed.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void)
|
||||
{
|
||||
__ASM volatile ("isb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Data Synchronization Barrier
|
||||
|
||||
This function acts as a special kind of Data Memory Barrier.
|
||||
It completes when all explicit memory accesses before this instruction complete.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
|
||||
{
|
||||
__ASM volatile ("dsb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Data Memory Barrier
|
||||
|
||||
This function ensures the apparent order of the explicit memory operations before
|
||||
and after the instruction, without ensuring their completion.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void)
|
||||
{
|
||||
__ASM volatile ("dmb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order (32 bit)
|
||||
|
||||
This function reverses the byte order in integer value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rev %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order (16 bit)
|
||||
|
||||
This function reverses the byte order in two unsigned short values.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order in signed short value
|
||||
|
||||
This function reverses the byte order in a signed short value with sign extension to integer.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("revsh %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Rotate Right in unsigned value (32 bit)
|
||||
|
||||
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||
|
||||
\param [in] value Value to rotate
|
||||
\param [in] value Number of Bits to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
|
||||
__ASM volatile ("ror %0, %0, %1" : "+r" (op1) : "r" (op2) );
|
||||
return(op1);
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Reverse bit order of value
|
||||
|
||||
This function reverses the bit order of the given value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 8 bit value.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr)
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
__ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 16 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr)
|
||||
{
|
||||
uint16_t result;
|
||||
|
||||
__ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 32 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ldrex %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive STR command for 8 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive STR command for 16 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive STR command for 32 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strex %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Remove the exclusive lock
|
||||
|
||||
This function removes the exclusive lock which is created by LDREX.
|
||||
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void)
|
||||
{
|
||||
__ASM volatile ("clrex");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Signed Saturate
|
||||
|
||||
This function saturates a signed value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __SSAT(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
|
||||
/** \brief Unsigned Saturate
|
||||
|
||||
This function saturates an unsigned value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __USAT(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
|
||||
/** \brief Count leading zeros
|
||||
|
||||
This function counts the number of leading zeros of a data value.
|
||||
|
||||
\param [in] value Value to count the leading zeros
|
||||
\return number of leading zeros in value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value)
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
__ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
||||
|
||||
#endif /* __CORE_CMINSTR_H */
|
1083
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/cmsis/lm4f_cmsis.h
Normal file
1083
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/cmsis/lm4f_cmsis.h
Normal file
File diff suppressed because it is too large
Load Diff
47
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/dpp.h
Normal file
47
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/dpp.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./dpp.h
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
|
||||
DONE_SIG, /* published by Philosopher when done eating */
|
||||
PAUSE_SIG, /* published by BSP to pause the application */
|
||||
TERMINATE_SIG, /* published by BSP to terminate the application */
|
||||
MAX_PUB_SIG, /* the last published signal */
|
||||
|
||||
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
|
||||
MAX_SIG /* the last signal */
|
||||
};
|
||||
|
||||
/* @(/1/0) .................................................................*/
|
||||
typedef struct TableEvtTag {
|
||||
/* protected: */
|
||||
QEvt super;
|
||||
|
||||
/* public: */
|
||||
uint8_t philoNum;
|
||||
} TableEvt;
|
||||
|
||||
|
||||
/* number of philosophers */
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
/* @(/2/4) .................................................................*/
|
||||
void Philo_ctor(void);
|
||||
|
||||
/* @(/2/5) .................................................................*/
|
||||
void Table_ctor(void);
|
||||
|
||||
|
||||
extern QActive * const AO_Philo[N_PHILO];
|
||||
extern QActive * const AO_Table;
|
||||
|
||||
#endif /* dpp_h */
|
428
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/dpp.qm
Normal file
428
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/dpp.qm
Normal file
@ -0,0 +1,428 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<model version="2.2.00">
|
||||
<documentation>Dining Philosopher Problem example</documentation>
|
||||
<framework name="qpc"/>
|
||||
<package name="Events" stereotype="0x01">
|
||||
<class name="TableEvt" superclass="qpc::QEvt">
|
||||
<attribute name="philoNum" type="uint8_t" visibility="0x00" properties="0x00"/>
|
||||
</class>
|
||||
</package>
|
||||
<package name="AOs" stereotype="0x02">
|
||||
<class name="Philo" superclass="qpc::QActive">
|
||||
<attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
|
||||
<statechart>
|
||||
<initial target="../1">
|
||||
<action>static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
if (registered == (uint8_t)0) {
|
||||
registered = (uint8_t)1;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo_initial);
|
||||
QS_FUN_DICTIONARY(&Philo_thinking);
|
||||
QS_FUN_DICTIONARY(&Philo_hungry);
|
||||
QS_FUN_DICTIONARY(&Philo_eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
|
||||
|
||||
QActive_subscribe(&me->super, EAT_SIG);</action>
|
||||
<initial_glyph conn="2,3,5,1,20,5,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="thinking">
|
||||
<entry>QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);</entry>
|
||||
<tran trig="TIMEOUT" target="../../2">
|
||||
<tran_glyph conn="2,12,3,1,20,13,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,17,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,5,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="hungry">
|
||||
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QACTIVE_POST(AO_Table, &pe->super, me);</entry>
|
||||
<tran trig="EAT">
|
||||
<choice target="../../../3">
|
||||
<guard>Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)</guard>
|
||||
<choice_glyph conn="15,30,5,1,7,13,-3">
|
||||
<action box="1,0,19,4"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="2,30,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,36,3,-1,14">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,23,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="eating">
|
||||
<entry>QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);</entry>
|
||||
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QF_PUBLISH(&pe->super, me);</exit>
|
||||
<tran trig="TIMEOUT" target="../../1">
|
||||
<tran_glyph conn="2,51,3,1,22,-41,-5">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,55,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,41,17,18">
|
||||
<entry box="1,2,5,2"/>
|
||||
<exit box="1,4,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_diagram size="37,61"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<class name="Table" superclass="qpc::QActive">
|
||||
<attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||||
<attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||||
<statechart>
|
||||
<initial target="../1/2">
|
||||
<action>uint8_t n;
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QHsm_top);
|
||||
QS_FUN_DICTIONARY(&Table_initial);
|
||||
QS_FUN_DICTIONARY(&Table_serving);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TERMINATE_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
|
||||
|
||||
QActive_subscribe(&me->super, DONE_SIG);
|
||||
QActive_subscribe(&me->super, PAUSE_SIG);
|
||||
QActive_subscribe(&me->super, TERMINATE_SIG);
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
}</action>
|
||||
<initial_glyph conn="3,3,5,1,44,18,-9">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="active">
|
||||
<tran trig="TERMINATE">
|
||||
<action>BSP_terminate(0);</action>
|
||||
<tran_glyph conn="2,11,3,-1,14">
|
||||
<action box="0,-2,11,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="2,15,3,-1,14">
|
||||
<action box="0,-2,10,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state name="serving">
|
||||
<entry brief="give pending permitions to eat">uint8_t n;
|
||||
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
|
||||
if ((me->isHungry[n] != 0U)
|
||||
&& (me->fork[LEFT(n)] == FREE)
|
||||
&& (me->fork[n] == FREE))
|
||||
{
|
||||
TableEvt *te;
|
||||
|
||||
me->fork[LEFT(n)] = USED;
|
||||
me->fork[n] = USED;
|
||||
te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QF_PUBLISH(&te->super, me);
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
}
|
||||
}</entry>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
m = LEFT(n);</action>
|
||||
<choice>
|
||||
<guard brief="both free">(me->fork[m] == FREE) && (me->fork[n] == FREE)</guard>
|
||||
<action>TableEvt *pe;
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(n, "eating ");</action>
|
||||
<choice_glyph conn="19,26,5,-1,10">
|
||||
<action box="1,0,10,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<choice>
|
||||
<guard>else</guard>
|
||||
<action>me->isHungry[n] = 1U;</action>
|
||||
<choice_glyph conn="19,26,4,-1,5,10">
|
||||
<action box="1,5,6,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="4,26,3,-1,15">
|
||||
<action box="0,-2,8,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n, m;
|
||||
TableEvt *pe;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
m = RIGHT(n); /* check the right neighbor */
|
||||
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[m] == FREE)) {
|
||||
me->fork[n] = USED;
|
||||
me->fork[m] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
m = LEFT(n); /* check the left neighbor */
|
||||
n = LEFT(m); /* left fork of the left neighbor */
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[n] == FREE)) {
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}</action>
|
||||
<tran_glyph conn="4,34,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="4,37,3,-1,15">
|
||||
<action box="0,-2,12,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="PAUSE" target="../../3">
|
||||
<tran_glyph conn="4,41,3,1,37,6,-3">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,19,34,24">
|
||||
<entry box="1,2,27,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="paused">
|
||||
<entry>BSP_displayPaused(1U);</entry>
|
||||
<exit>BSP_displayPaused(0U);</exit>
|
||||
<tran trig="PAUSE" target="../../2">
|
||||
<tran_glyph conn="4,57,3,1,39,-20,-5">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* philo ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
me->isHungry[n] = 1U;
|
||||
BSP_displayPhilStat(n, "hungry ");</action>
|
||||
<tran_glyph conn="4,60,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;</action>
|
||||
<tran_glyph conn="4,63,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,45,34,20">
|
||||
<entry box="1,2,18,4"/>
|
||||
<exit box="1,6,18,4"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_glyph node="2,5,43,62"/>
|
||||
</state>
|
||||
<state_diagram size="49,69"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<attribute name="AO_Philo[N_PHILO]" type="QActive * const" visibility="0x00" properties="0x00"/>
|
||||
<attribute name="AO_Table" type="QActive * const" visibility="0x00" properties="0x00"/>
|
||||
<operation name="Philo_ctor" type="void" visibility="0x00" properties="0x00">
|
||||
<code>uint8_t n;
|
||||
Philo *me;
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me = &l_philo[n];
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
|
||||
QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
|
||||
}</code>
|
||||
</operation>
|
||||
<operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
|
||||
<code>uint8_t n;
|
||||
Table *me = &l_table;
|
||||
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
}</code>
|
||||
</operation>
|
||||
</package>
|
||||
<directory name=".">
|
||||
<file name="dpp.h">
|
||||
<text>#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
|
||||
DONE_SIG, /* published by Philosopher when done eating */
|
||||
PAUSE_SIG, /* published by BSP to pause the application */
|
||||
TERMINATE_SIG, /* published by BSP to terminate the application */
|
||||
MAX_PUB_SIG, /* the last published signal */
|
||||
|
||||
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
|
||||
MAX_SIG /* the last signal */
|
||||
};
|
||||
|
||||
$declare(Events::TableEvt)
|
||||
|
||||
/* number of philosophers */
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
$declare(AOs::Philo_ctor)
|
||||
$declare(AOs::Table_ctor)
|
||||
|
||||
$declare(AOs::AO_Philo[N_PHILO])
|
||||
$declare(AOs::AO_Table)
|
||||
|
||||
#endif /* dpp_h */</text>
|
||||
</file>
|
||||
<file name="philo.c">
|
||||
<text>#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
$declare(AOs::Philo)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Philo l_philo[N_PHILO]; /* storage for all Philos */
|
||||
|
||||
#define THINK_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
|
||||
#define EAT_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
|
||||
|
||||
/* helper macro to provide the ID of Philo "me_" */
|
||||
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
|
||||
|
||||
enum InternalSignals { /* internal signals */
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
/* Global objects ----------------------------------------------------------*/
|
||||
QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
|
||||
&l_philo[0].super,
|
||||
&l_philo[1].super,
|
||||
&l_philo[2].super,
|
||||
&l_philo[3].super,
|
||||
&l_philo[4].super
|
||||
};
|
||||
|
||||
/* Philo definition --------------------------------------------------------*/
|
||||
$define(AOs::Philo_ctor)
|
||||
$define(AOs::Philo)</text>
|
||||
</file>
|
||||
<file name="table.c">
|
||||
<text>#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
$declare(AOs::Table)
|
||||
|
||||
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
|
||||
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
|
||||
#define FREE ((uint8_t)0)
|
||||
#define USED ((uint8_t)1)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Table l_table; /* the single instance of the Table active object */
|
||||
|
||||
/* Global-scope objects ----------------------------------------------------*/
|
||||
QActive * const AO_Table = &l_table.super; /* "opaque" AO pointer */
|
||||
|
||||
/*..........................................................................*/
|
||||
$define(AOs::Table_ctor)
|
||||
$define(AOs::Table)</text>
|
||||
</file>
|
||||
</directory>
|
||||
</model>
|
184
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/gpio.h
Normal file
184
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/gpio.h
Normal file
@ -0,0 +1,184 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// gpio.h - Defines and Macros for GPIO API.
|
||||
//
|
||||
// Copyright (c) 2005-2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This is part of revision 9453 of the Stellaris Peripheral Driver Library.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef __GPIO_H__
|
||||
#define __GPIO_H__
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// If building with a C++ compiler, make all of the definitions in this header
|
||||
// have a C binding.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following values define the bit field for the ucPins argument to several
|
||||
// of the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_PIN_0 0x00000001 // GPIO pin 0
|
||||
#define GPIO_PIN_1 0x00000002 // GPIO pin 1
|
||||
#define GPIO_PIN_2 0x00000004 // GPIO pin 2
|
||||
#define GPIO_PIN_3 0x00000008 // GPIO pin 3
|
||||
#define GPIO_PIN_4 0x00000010 // GPIO pin 4
|
||||
#define GPIO_PIN_5 0x00000020 // GPIO pin 5
|
||||
#define GPIO_PIN_6 0x00000040 // GPIO pin 6
|
||||
#define GPIO_PIN_7 0x00000080 // GPIO pin 7
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIODirModeSet as the ulPinIO parameter, and
|
||||
// returned from GPIODirModeGet.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_DIR_MODE_IN 0x00000000 // Pin is a GPIO input
|
||||
#define GPIO_DIR_MODE_OUT 0x00000001 // Pin is a GPIO output
|
||||
#define GPIO_DIR_MODE_HW 0x00000002 // Pin is a peripheral function
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOIntTypeSet as the ulIntType parameter, and
|
||||
// returned from GPIOIntTypeGet.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_FALLING_EDGE 0x00000000 // Interrupt on falling edge
|
||||
#define GPIO_RISING_EDGE 0x00000004 // Interrupt on rising edge
|
||||
#define GPIO_BOTH_EDGES 0x00000001 // Interrupt on both edges
|
||||
#define GPIO_LOW_LEVEL 0x00000002 // Interrupt on low level
|
||||
#define GPIO_HIGH_LEVEL 0x00000007 // Interrupt on high level
|
||||
#define GPIO_DISCRETE_INT 0x00010000 // Interrupt for individual pins
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOPadConfigSet as the ulStrength parameter,
|
||||
// and returned by GPIOPadConfigGet in the *pulStrength parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_STRENGTH_2MA 0x00000001 // 2mA drive strength
|
||||
#define GPIO_STRENGTH_4MA 0x00000002 // 4mA drive strength
|
||||
#define GPIO_STRENGTH_8MA 0x00000004 // 8mA drive strength
|
||||
#define GPIO_STRENGTH_8MA_SC 0x0000000C // 8mA drive with slew rate control
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOPadConfigSet as the ulPadType parameter,
|
||||
// and returned by GPIOPadConfigGet in the *pulPadType parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_PIN_TYPE_STD 0x00000008 // Push-pull
|
||||
#define GPIO_PIN_TYPE_STD_WPU 0x0000000A // Push-pull with weak pull-up
|
||||
#define GPIO_PIN_TYPE_STD_WPD 0x0000000C // Push-pull with weak pull-down
|
||||
#define GPIO_PIN_TYPE_OD 0x00000009 // Open-drain
|
||||
#define GPIO_PIN_TYPE_OD_WPU 0x0000000B // Open-drain with weak pull-up
|
||||
#define GPIO_PIN_TYPE_OD_WPD 0x0000000D // Open-drain with weak pull-down
|
||||
#define GPIO_PIN_TYPE_ANALOG 0x00000000 // Analog comparator
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Prototypes for the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulPinIO);
|
||||
extern unsigned long GPIODirModeGet(unsigned long ulPort, unsigned char ucPin);
|
||||
extern void GPIOIntTypeSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulIntType);
|
||||
extern unsigned long GPIOIntTypeGet(unsigned long ulPort, unsigned char ucPin);
|
||||
extern void GPIOPadConfigSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulStrength,
|
||||
unsigned long ulPadType);
|
||||
extern void GPIOPadConfigGet(unsigned long ulPort, unsigned char ucPin,
|
||||
unsigned long *pulStrength,
|
||||
unsigned long *pulPadType);
|
||||
extern void GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern long GPIOPinIntStatus(unsigned long ulPort, tBoolean bMasked);
|
||||
extern void GPIOPinIntClear(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPortIntRegister(unsigned long ulPort,
|
||||
void (*pfnIntHandler)(void));
|
||||
extern void GPIOPortIntUnregister(unsigned long ulPort);
|
||||
extern long GPIOPinRead(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned char ucVal);
|
||||
extern void GPIOPinConfigure(unsigned long ulPinConfig);
|
||||
extern void GPIOPinTypeADC(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeCAN(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeComparator(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEPI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEthernetLED(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEthernetMII(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeFan(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOInput(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOOutputOD(unsigned long ulPort,
|
||||
unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2C(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2CSCL(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeLPC(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePECIRx(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePECITx(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePWM(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeQEI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeTimer(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUART(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUSBAnalog(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUSBDigital(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIODMATriggerEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIODMATriggerDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOADCTriggerEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOADCTriggerDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Mark the end of the C bindings section for C++ compilers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __GPIO_H__
|
@ -0,0 +1,44 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Default Linker Command file for the Texas Instruments LM4F111H5QR
|
||||
*
|
||||
* This is part of revision 9385 of the Stellaris Peripheral Driver Library.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
--retain=g_pfnVectors
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (RX) : origin = 0x00000000, length = 0x00040000
|
||||
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
|
||||
}
|
||||
|
||||
/* The following command line options are set as part of the CCS project. */
|
||||
/* If you are building using the command line, or for some reason want to */
|
||||
/* define them here, you can uncomment and modify these lines as needed. */
|
||||
/* If you are using CCS for building, it is probably better to make any such */
|
||||
/* modifications in your CCS project and leave this file alone. */
|
||||
/* */
|
||||
/* --heap_size=0 */
|
||||
/* --stack_size=256 */
|
||||
/* --library=rtsv7M4_T_le_eabi.lib */
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs: > 0x00000000
|
||||
.text : > FLASH
|
||||
.const : > FLASH
|
||||
.cinit : > FLASH
|
||||
.pinit : > FLASH
|
||||
|
||||
.vtable : > 0x20000000
|
||||
.data : > SRAM
|
||||
.bss : > SRAM
|
||||
.sysmem : > SRAM
|
||||
.stack : > SRAM
|
||||
}
|
||||
|
||||
__STACK_TOP = __stack + 256;
|
81
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/main.c
Normal file
81
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/main.c
Normal file
@ -0,0 +1,81 @@
|
||||
/*****************************************************************************
|
||||
* Product: DPP example
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Jul 04, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
/* Local-scope objects -----------------------------------------------------*/
|
||||
static QEvt const *l_tableQueueSto[N_PHILO];
|
||||
static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
|
||||
static QSubscrList l_subscrSto[MAX_PUB_SIG];
|
||||
|
||||
/* storage for event pools... */
|
||||
static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO]; /* small pool */
|
||||
|
||||
/*..........................................................................*/
|
||||
int main(void) {
|
||||
uint8_t n;
|
||||
|
||||
Philo_ctor(); /* instantiate all Philosopher active objects */
|
||||
Table_ctor(); /* instantiate the Table active object */
|
||||
|
||||
QF_init(); /* initialize the framework and the underlying RT kernel */
|
||||
BSP_init(); /* initialize the BSP */
|
||||
|
||||
/* object dictionaries... */
|
||||
QS_OBJ_DICTIONARY(l_smlPoolSto);
|
||||
QS_OBJ_DICTIONARY(l_tableQueueSto);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
|
||||
|
||||
QF_psInit(l_subscrSto, Q_DIM(l_subscrSto)); /* init publish-subscribe */
|
||||
|
||||
/* initialize event pools... */
|
||||
QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
|
||||
|
||||
for (n = 0; n < N_PHILO; ++n) { /* start the active objects... */
|
||||
QActive_start(AO_Philo[n], (uint8_t)(n + 1),
|
||||
l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
|
||||
(void *)0, 0U, (QEvt *)0);
|
||||
}
|
||||
QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
|
||||
l_tableQueueSto, Q_DIM(l_tableQueueSto),
|
||||
(void *)0, 0U, (QEvt *)0);
|
||||
|
||||
return QF_run(); /* run the QF application */
|
||||
}
|
204
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/philo.c
Normal file
204
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/philo.c
Normal file
@ -0,0 +1,204 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./philo.c
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
/* @(/2/0) .................................................................*/
|
||||
typedef struct PhiloTag {
|
||||
/* protected: */
|
||||
QActive super;
|
||||
|
||||
/* private: */
|
||||
QTimeEvt timeEvt;
|
||||
} Philo;
|
||||
|
||||
/* protected: */
|
||||
static QState Philo_initial(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_thinking(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_hungry(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_eating(Philo * const me, QEvt const * const e);
|
||||
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Philo l_philo[N_PHILO]; /* storage for all Philos */
|
||||
|
||||
#define THINK_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
|
||||
#define EAT_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
|
||||
|
||||
/* helper macro to provide the ID of Philo "me_" */
|
||||
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
|
||||
|
||||
enum InternalSignals { /* internal signals */
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
/* Global objects ----------------------------------------------------------*/
|
||||
QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
|
||||
&l_philo[0].super,
|
||||
&l_philo[1].super,
|
||||
&l_philo[2].super,
|
||||
&l_philo[3].super,
|
||||
&l_philo[4].super
|
||||
};
|
||||
|
||||
/* Philo definition --------------------------------------------------------*/
|
||||
/* @(/2/4) .................................................................*/
|
||||
void Philo_ctor(void) {
|
||||
uint8_t n;
|
||||
Philo *me;
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me = &l_philo[n];
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
|
||||
QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
|
||||
}
|
||||
}
|
||||
/* @(/2/0) .................................................................*/
|
||||
/* @(/2/0/1) ...............................................................*/
|
||||
/* @(/2/0/1/0) */
|
||||
static QState Philo_initial(Philo * const me, QEvt const * const e) {
|
||||
static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
if (registered == (uint8_t)0) {
|
||||
registered = (uint8_t)1;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo_initial);
|
||||
QS_FUN_DICTIONARY(&Philo_thinking);
|
||||
QS_FUN_DICTIONARY(&Philo_hungry);
|
||||
QS_FUN_DICTIONARY(&Philo_eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
|
||||
|
||||
QActive_subscribe(&me->super, EAT_SIG);
|
||||
return Q_TRAN(&Philo_thinking);
|
||||
}
|
||||
/* @(/2/0/1/1) .............................................................*/
|
||||
static QState Philo_thinking(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/1) */
|
||||
case Q_ENTRY_SIG: {
|
||||
QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/1/0) */
|
||||
case TIMEOUT_SIG: {
|
||||
status = Q_TRAN(&Philo_hungry);
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/1/1) */
|
||||
case EAT_SIG: /* intentionally fall through */
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/0/1/2) .............................................................*/
|
||||
static QState Philo_hungry(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/2) */
|
||||
case Q_ENTRY_SIG: {
|
||||
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QACTIVE_POST(AO_Table, &pe->super, me);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/2/0) */
|
||||
case EAT_SIG: {
|
||||
/* @(/2/0/1/2/0/0) */
|
||||
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
|
||||
status = Q_TRAN(&Philo_eating);
|
||||
}
|
||||
else {
|
||||
status = Q_UNHANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/2/1) */
|
||||
case DONE_SIG: {
|
||||
/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/0/1/3) .............................................................*/
|
||||
static QState Philo_eating(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/3) */
|
||||
case Q_ENTRY_SIG: {
|
||||
QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3) */
|
||||
case Q_EXIT_SIG: {
|
||||
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3/0) */
|
||||
case TIMEOUT_SIG: {
|
||||
status = Q_TRAN(&Philo_thinking);
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3/1) */
|
||||
case EAT_SIG: /* intentionally fall through */
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
6744
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/rom.h
Normal file
6744
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/rom.h
Normal file
File diff suppressed because it is too large
Load Diff
201
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/startup_ccs.c
Normal file
201
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/startup_ccs.c
Normal file
@ -0,0 +1,201 @@
|
||||
//*****************************************************************************
|
||||
// Modified for CMSIS compliance by Quantum Leaps
|
||||
// Preemptive QK kernel
|
||||
// Jan 26, 2013
|
||||
//*****************************************************************************
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// startup_ccs.c - Startup code for use with TI's Code Composer Studio.
|
||||
//
|
||||
// Copyright (c) 2005-2010 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// Texas Instruments (TI) is supplying this software for use solely and
|
||||
// exclusively on TI's microcontroller products. The software is owned by
|
||||
// TI and/or its suppliers, and is protected under applicable copyright
|
||||
// laws. You may not combine this software with "viral" open-source
|
||||
// software in order to form a larger program.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
|
||||
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
|
||||
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
|
||||
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
|
||||
// DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
//
|
||||
// This is part of revision 5961 of the DK-LM3S811 Firmware Package.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
//*****************************************************************************
|
||||
// prototypes of the IRQ handlers defined in the application
|
||||
//*****************************************************************************
|
||||
void SysTick_Handler(void);
|
||||
void GPIOPortA_IRQHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
// prototypes of the default fault handlers.
|
||||
//*****************************************************************************
|
||||
void ResetISR(void);
|
||||
static void NMI_Handler(void);
|
||||
static void HardFault_Handler(void);
|
||||
static void MemManage_Handler(void);
|
||||
static void BusFault_Handler(void);
|
||||
static void UsageFault_Handler(void);
|
||||
static void Reserved_Handler(void);
|
||||
static void MemManage_Handler(void);
|
||||
static void Reserved_Handler(void);
|
||||
void SVC_Handler(void);
|
||||
static void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
|
||||
static void Unused_IRQHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// External declaration for the reset handler that is to be called when the
|
||||
// processor is started
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void _c_int00(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Linker variable that marks the top of the stack.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern unsigned long __STACK_TOP;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The vector table. Note that the proper constructs must be placed on this to
|
||||
// ensure that it ends up at physical address 0x0000.0000 or at the start of
|
||||
// the program if located at a start address other than 0.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
|
||||
void (* const g_pfnVectors[])(void) =
|
||||
{
|
||||
(void (*)(void))((unsigned long)&__STACK_TOP),
|
||||
// The initial stack pointer
|
||||
ResetISR, // The reset handler
|
||||
NMI_Handler, // The NMI handler
|
||||
HardFault_Handler, // The hard fault handler
|
||||
MemManage_Handler, // The MPU fault handler
|
||||
BusFault_Handler, // The bus fault handler
|
||||
UsageFault_Handler, // The usage fault handler
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
SVC_Handler, // SVCall handler
|
||||
DebugMon_Handler, // Debug monitor handler
|
||||
Reserved_Handler, // Reserved
|
||||
PendSV_Handler, // The PendSV handler
|
||||
SysTick_Handler, // The SysTick handler
|
||||
GPIOPortA_IRQHandler, // GPIO Port A
|
||||
Unused_IRQHandler, // GPIO Port B
|
||||
Unused_IRQHandler, // GPIO Port C
|
||||
Unused_IRQHandler, // GPIO Port D
|
||||
Unused_IRQHandler, // GPIO Port E
|
||||
Unused_IRQHandler, // UART0 Rx and Tx
|
||||
Unused_IRQHandler, // UART1 Rx and Tx
|
||||
Unused_IRQHandler, // SSI0 Rx and Tx
|
||||
Unused_IRQHandler, // I2C0 Master and Slave
|
||||
Unused_IRQHandler, // PWM Fault
|
||||
Unused_IRQHandler, // PWM Generator 0
|
||||
Unused_IRQHandler, // PWM Generator 1
|
||||
Unused_IRQHandler, // PWM Generator 2
|
||||
Unused_IRQHandler, // Quadrature Encoder 0
|
||||
Unused_IRQHandler, // ADC Sequence 0
|
||||
Unused_IRQHandler, // ADC Sequence 1
|
||||
Unused_IRQHandler, // ADC Sequence 2
|
||||
Unused_IRQHandler, // ADC Sequence 3
|
||||
Unused_IRQHandler, // Watchdog timer
|
||||
Unused_IRQHandler, // Timer 0 subtimer A
|
||||
Unused_IRQHandler, // Timer 0 subtimer B
|
||||
Unused_IRQHandler, // Timer 1 subtimer A
|
||||
Unused_IRQHandler, // Timer 1 subtimer B
|
||||
Unused_IRQHandler, // Timer 2 subtimer A
|
||||
Unused_IRQHandler, // Timer 2 subtimer B
|
||||
Unused_IRQHandler, // Analog Comparator 0
|
||||
Unused_IRQHandler, // Analog Comparator 1
|
||||
Unused_IRQHandler, // Analog Comparator 2
|
||||
Unused_IRQHandler, // System Control (PLL, OSC, BO)
|
||||
Unused_IRQHandler // FLASH Control
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor first starts execution
|
||||
// following a reset event. Only the absolutely necessary set is performed,
|
||||
// after which the application supplied entry() routine is called. Any fancy
|
||||
// actions (such as making decisions based on the reset cause register, and
|
||||
// resetting the bits in that register) are left solely in the hands of the
|
||||
// application.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void ResetISR(void) {
|
||||
//
|
||||
// Jump to the CCS C Initialization Routine.
|
||||
//
|
||||
__asm(" .global _c_int00\n"
|
||||
" b.w _c_int00");
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// These dummy handlers simply enter an infinite loop, preserving the system
|
||||
// state for examination by a debugger.
|
||||
//*****************************************************************************
|
||||
|
||||
static void NMI_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void HardFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MemManage_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void BusFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void UsageFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void Reserved_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
//static void SVC_Handler(void) {
|
||||
// while(1) {
|
||||
// }
|
||||
//}
|
||||
|
||||
static void DebugMon_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
//static void PendSV_Handler(void) {
|
||||
// while(1) {
|
||||
// }
|
||||
//}
|
||||
|
||||
static void Unused_IRQHandler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
644
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/sysctl.h
Normal file
644
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/sysctl.h
Normal file
@ -0,0 +1,644 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// sysctl.h - Prototypes for the system control driver.
|
||||
//
|
||||
// Copyright (c) 2005-2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This is part of revision 9453 of the Stellaris Peripheral Driver Library.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef __SYSCTL_H__
|
||||
#define __SYSCTL_H__
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// If building with a C++ compiler, make all of the definitions in this header
|
||||
// have a C binding.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef unsigned char tBoolean;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the
|
||||
// SysCtlPeripheralPresent(), SysCtlPeripheralEnable(),
|
||||
// SysCtlPeripheralDisable(), and SysCtlPeripheralReset() APIs as the
|
||||
// ulPeripheral parameter. The peripherals in the fourth group (upper nibble
|
||||
// is 3) can only be used with the SysCtlPeripheralPresent() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_WDOG 0x00000008 // Watchdog
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_WDOG0 0x00000008 // Watchdog 0
|
||||
#define SYSCTL_PERIPH_HIBERNATE 0x00000040 // Hibernation module
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_ADC 0x00100001 // ADC
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_ADC0 0x00100001 // ADC0
|
||||
#define SYSCTL_PERIPH_ADC1 0x00100002 // ADC1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_PWM 0x00100010 // PWM
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_PWM0 0x00100010 // PWM
|
||||
#define SYSCTL_PERIPH_CAN0 0x00100100 // CAN 0
|
||||
#define SYSCTL_PERIPH_CAN1 0x00100200 // CAN 1
|
||||
#define SYSCTL_PERIPH_CAN2 0x00100400 // CAN 2
|
||||
#define SYSCTL_PERIPH_WDOG1 0x00101000 // Watchdog 1
|
||||
#define SYSCTL_PERIPH_UART0 0x10000001 // UART 0
|
||||
#define SYSCTL_PERIPH_UART1 0x10000002 // UART 1
|
||||
#define SYSCTL_PERIPH_UART2 0x10000004 // UART 2
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_SSI 0x10000010 // SSI
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_SSI0 0x10000010 // SSI 0
|
||||
#define SYSCTL_PERIPH_SSI1 0x10000020 // SSI 1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_QEI 0x10000100 // QEI
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_QEI0 0x10000100 // QEI 0
|
||||
#define SYSCTL_PERIPH_QEI1 0x10000200 // QEI 1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_I2C 0x10001000 // I2C
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_I2C0 0x10001000 // I2C 0
|
||||
#define SYSCTL_PERIPH_I2C1 0x10004000 // I2C 1
|
||||
#define SYSCTL_PERIPH_TIMER0 0x10100001 // Timer 0
|
||||
#define SYSCTL_PERIPH_TIMER1 0x10100002 // Timer 1
|
||||
#define SYSCTL_PERIPH_TIMER2 0x10100004 // Timer 2
|
||||
#define SYSCTL_PERIPH_TIMER3 0x10100008 // Timer 3
|
||||
#define SYSCTL_PERIPH_COMP0 0x10100100 // Analog comparator 0
|
||||
#define SYSCTL_PERIPH_COMP1 0x10100200 // Analog comparator 1
|
||||
#define SYSCTL_PERIPH_COMP2 0x10100400 // Analog comparator 2
|
||||
#define SYSCTL_PERIPH_I2S0 0x10101000 // I2S0
|
||||
#define SYSCTL_PERIPH_EPI0 0x10104000 // EPI0
|
||||
#define SYSCTL_PERIPH_GPIOA 0x20000001 // GPIO A
|
||||
#define SYSCTL_PERIPH_GPIOB 0x20000002 // GPIO B
|
||||
#define SYSCTL_PERIPH_GPIOC 0x20000004 // GPIO C
|
||||
#define SYSCTL_PERIPH_GPIOD 0x20000008 // GPIO D
|
||||
#define SYSCTL_PERIPH_GPIOE 0x20000010 // GPIO E
|
||||
#define SYSCTL_PERIPH_GPIOF 0x20000020 // GPIO F
|
||||
#define SYSCTL_PERIPH_GPIOG 0x20000040 // GPIO G
|
||||
#define SYSCTL_PERIPH_GPIOH 0x20000080 // GPIO H
|
||||
#define SYSCTL_PERIPH_GPIOJ 0x20000100 // GPIO J
|
||||
#define SYSCTL_PERIPH_UDMA 0x20002000 // uDMA
|
||||
#define SYSCTL_PERIPH_USB0 0x20100001 // USB0
|
||||
#define SYSCTL_PERIPH_ETH 0x20105000 // Ethernet
|
||||
#define SYSCTL_PERIPH_IEEE1588 0x20100100 // IEEE1588
|
||||
#define SYSCTL_PERIPH_PLL 0x30000010 // PLL
|
||||
#define SYSCTL_PERIPH_TEMP 0x30000020 // Temperature sensor
|
||||
#define SYSCTL_PERIPH_MPU 0x30000080 // Cortex M3 MPU
|
||||
#define SYSCTL_PERIPH2_ADC0 0xf0003800 // ADC 0
|
||||
#define SYSCTL_PERIPH2_ADC1 0xf0003801 // ADC 1
|
||||
#define SYSCTL_PERIPH2_CAN0 0xf0003400 // CAN 0
|
||||
#define SYSCTL_PERIPH2_CAN1 0xf0003401 // CAN 1
|
||||
#define SYSCTL_PERIPH2_CAN2 0xf0003402 // CAN 2
|
||||
#define SYSCTL_PERIPH2_COMP0 0xf0003c00 // Analog comparator 0
|
||||
#define SYSCTL_PERIPH_EEPROM0 0xf0005800 // EEPROM 0
|
||||
#define SYSCTL_PERIPH2_EPI0 0xf0001000 // EPI0
|
||||
#define SYSCTL_PERIPH2_ETH 0xf0002c00 // ETH
|
||||
#define SYSCTL_PERIPH_FAN0 0xf0005400 // FAN 0
|
||||
#define SYSCTL_PERIPH2_GPIOA 0xf0000800 // GPIO A
|
||||
#define SYSCTL_PERIPH2_GPIOB 0xf0000801 // GPIO B
|
||||
#define SYSCTL_PERIPH2_GPIOC 0xf0000802 // GPIO C
|
||||
#define SYSCTL_PERIPH2_GPIOD 0xf0000803 // GPIO D
|
||||
#define SYSCTL_PERIPH2_GPIOE 0xf0000804 // GPIO E
|
||||
#define SYSCTL_PERIPH2_GPIOF 0xf0000805 // GPIO F
|
||||
#define SYSCTL_PERIPH2_GPIOG 0xf0000806 // GPIO G
|
||||
#define SYSCTL_PERIPH2_GPIOH 0xf0000807 // GPIO H
|
||||
#define SYSCTL_PERIPH2_GPIOJ 0xf0000808 // GPIO J
|
||||
#define SYSCTL_PERIPH_GPIOK 0xf0000809 // GPIO K
|
||||
#define SYSCTL_PERIPH_GPIOL 0xf000080a // GPIO L
|
||||
#define SYSCTL_PERIPH_GPIOM 0xf000080b // GPIO M
|
||||
#define SYSCTL_PERIPH_GPION 0xf000080c // GPIO N
|
||||
#define SYSCTL_PERIPH_GPIOP 0xf000080d // GPIO P
|
||||
#define SYSCTL_PERIPH_GPIOQ 0xf000080e // GPIO Q
|
||||
#define SYSCTL_PERIPH_GPIOR 0xf000080f // GPIO R
|
||||
#define SYSCTL_PERIPH_GPIOS 0xf0000810 // GPIO S
|
||||
#define SYSCTL_PERIPH2_HIB 0xf0001400 // Hibernation module
|
||||
#define SYSCTL_PERIPH2_I2C0 0xf0002000 // I2C 0
|
||||
#define SYSCTL_PERIPH2_I2C1 0xf0002001 // I2C 1
|
||||
#define SYSCTL_PERIPH_I2C2 0xf0002002 // I2C 2
|
||||
#define SYSCTL_PERIPH_I2C3 0xf0002003 // I2C 3
|
||||
#define SYSCTL_PERIPH_I2C4 0xf0002004 // I2C 4
|
||||
#define SYSCTL_PERIPH_I2C5 0xf0002005 // I2C 5
|
||||
#define SYSCTL_PERIPH2_I2S0 0xf0002400 // I2S0
|
||||
#define SYSCTL_PERIPH_LPC0 0xf0004800 // LPC 0
|
||||
#define SYSCTL_PERIPH_PECI0 0xf0005000 // PECI 0
|
||||
#define SYSCTL_PERIPH2_PWM0 0xf0004000 // PWM 0
|
||||
#define SYSCTL_PERIPH_PWM1 0xf0004001 // PWM 1
|
||||
#define SYSCTL_PERIPH2_QEI0 0xf0004400 // QEI 0
|
||||
#define SYSCTL_PERIPH2_QEI1 0xf0004401 // QEI 1
|
||||
#define SYSCTL_PERIPH2_SSI0 0xf0001c00 // SSI 0
|
||||
#define SYSCTL_PERIPH2_SSI1 0xf0001c01 // SSI 1
|
||||
#define SYSCTL_PERIPH_SSI2 0xf0001c02 // SSI 2
|
||||
#define SYSCTL_PERIPH_SSI3 0xf0001c03 // SSI 3
|
||||
#define SYSCTL_PERIPH2_TIMER0 0xf0000400 // Timer 0
|
||||
#define SYSCTL_PERIPH2_TIMER1 0xf0000401 // Timer 1
|
||||
#define SYSCTL_PERIPH2_TIMER2 0xf0000402 // Timer 2
|
||||
#define SYSCTL_PERIPH2_TIMER3 0xf0000403 // Timer 3
|
||||
#define SYSCTL_PERIPH_TIMER4 0xf0000404 // Timer 4
|
||||
#define SYSCTL_PERIPH_TIMER5 0xf0000405 // Timer 5
|
||||
#define SYSCTL_PERIPH_WTIMER0 0xf0005c00 // Wide Timer 0
|
||||
#define SYSCTL_PERIPH_WTIMER1 0xf0005c01 // Wide Timer 1
|
||||
#define SYSCTL_PERIPH_WTIMER2 0xf0005c02 // Wide Timer 2
|
||||
#define SYSCTL_PERIPH_WTIMER3 0xf0005c03 // Wide Timer 3
|
||||
#define SYSCTL_PERIPH_WTIMER4 0xf0005c04 // Wide Timer 4
|
||||
#define SYSCTL_PERIPH_WTIMER5 0xf0005c05 // Wide Timer 5
|
||||
#define SYSCTL_PERIPH2_UART0 0xf0001800 // UART 0
|
||||
#define SYSCTL_PERIPH2_UART1 0xf0001801 // UART 1
|
||||
#define SYSCTL_PERIPH2_UART2 0xf0001802 // UART 2
|
||||
#define SYSCTL_PERIPH_UART3 0xf0001803 // UART 3
|
||||
#define SYSCTL_PERIPH_UART4 0xf0001804 // UART 4
|
||||
#define SYSCTL_PERIPH_UART5 0xf0001805 // UART 5
|
||||
#define SYSCTL_PERIPH_UART6 0xf0001806 // UART 6
|
||||
#define SYSCTL_PERIPH_UART7 0xf0001807 // UART 7
|
||||
#define SYSCTL_PERIPH2_UDMA 0xf0000c00 // uDMA
|
||||
#define SYSCTL_PERIPH2_USB0 0xf0002800 // USB 0
|
||||
#define SYSCTL_PERIPH2_WDOG0 0xf0000000 // Watchdog 0
|
||||
#define SYSCTL_PERIPH2_WDOG1 0xf0000001 // Watchdog 1
|
||||
#define SYSCTL_PERIPH2_HIBERNATE \
|
||||
0xf0001400 // Hibernate
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlPinPresent() API
|
||||
// as the ulPin parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_PIN_PWM0 0x00000001 // PWM0 pin
|
||||
#define SYSCTL_PIN_PWM1 0x00000002 // PWM1 pin
|
||||
#define SYSCTL_PIN_PWM2 0x00000004 // PWM2 pin
|
||||
#define SYSCTL_PIN_PWM3 0x00000008 // PWM3 pin
|
||||
#define SYSCTL_PIN_PWM4 0x00000010 // PWM4 pin
|
||||
#define SYSCTL_PIN_PWM5 0x00000020 // PWM5 pin
|
||||
#define SYSCTL_PIN_PWM6 0x00000040 // PWM6 pin
|
||||
#define SYSCTL_PIN_PWM7 0x00000080 // PWM7 pin
|
||||
#define SYSCTL_PIN_C0MINUS 0x00000040 // C0- pin
|
||||
#define SYSCTL_PIN_C0PLUS 0x00000080 // C0+ pin
|
||||
#define SYSCTL_PIN_C0O 0x00000100 // C0o pin
|
||||
#define SYSCTL_PIN_C1MINUS 0x00000200 // C1- pin
|
||||
#define SYSCTL_PIN_C1PLUS 0x00000400 // C1+ pin
|
||||
#define SYSCTL_PIN_C1O 0x00000800 // C1o pin
|
||||
#define SYSCTL_PIN_C2MINUS 0x00001000 // C2- pin
|
||||
#define SYSCTL_PIN_C2PLUS 0x00002000 // C2+ pin
|
||||
#define SYSCTL_PIN_C2O 0x00004000 // C2o pin
|
||||
#define SYSCTL_PIN_MC_FAULT0 0x00008000 // MC0 Fault pin
|
||||
#define SYSCTL_PIN_ADC0 0x00010000 // ADC0 pin
|
||||
#define SYSCTL_PIN_ADC1 0x00020000 // ADC1 pin
|
||||
#define SYSCTL_PIN_ADC2 0x00040000 // ADC2 pin
|
||||
#define SYSCTL_PIN_ADC3 0x00080000 // ADC3 pin
|
||||
#define SYSCTL_PIN_ADC4 0x00100000 // ADC4 pin
|
||||
#define SYSCTL_PIN_ADC5 0x00200000 // ADC5 pin
|
||||
#define SYSCTL_PIN_ADC6 0x00400000 // ADC6 pin
|
||||
#define SYSCTL_PIN_ADC7 0x00800000 // ADC7 pin
|
||||
#define SYSCTL_PIN_CCP0 0x01000000 // CCP0 pin
|
||||
#define SYSCTL_PIN_CCP1 0x02000000 // CCP1 pin
|
||||
#define SYSCTL_PIN_CCP2 0x04000000 // CCP2 pin
|
||||
#define SYSCTL_PIN_CCP3 0x08000000 // CCP3 pin
|
||||
#define SYSCTL_PIN_CCP4 0x10000000 // CCP4 pin
|
||||
#define SYSCTL_PIN_CCP5 0x20000000 // CCP5 pin
|
||||
#define SYSCTL_PIN_32KHZ 0x80000000 // 32kHz pin
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlLDOSet() API as
|
||||
// the ulVoltage value, or returned by the SysCtlLDOGet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_LDO_2_25V 0x00000005 // LDO output of 2.25V
|
||||
#define SYSCTL_LDO_2_30V 0x00000004 // LDO output of 2.30V
|
||||
#define SYSCTL_LDO_2_35V 0x00000003 // LDO output of 2.35V
|
||||
#define SYSCTL_LDO_2_40V 0x00000002 // LDO output of 2.40V
|
||||
#define SYSCTL_LDO_2_45V 0x00000001 // LDO output of 2.45V
|
||||
#define SYSCTL_LDO_2_50V 0x00000000 // LDO output of 2.50V
|
||||
#define SYSCTL_LDO_2_55V 0x0000001f // LDO output of 2.55V
|
||||
#define SYSCTL_LDO_2_60V 0x0000001e // LDO output of 2.60V
|
||||
#define SYSCTL_LDO_2_65V 0x0000001d // LDO output of 2.65V
|
||||
#define SYSCTL_LDO_2_70V 0x0000001c // LDO output of 2.70V
|
||||
#define SYSCTL_LDO_2_75V 0x0000001b // LDO output of 2.75V
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlLDOConfigSet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_LDOCFG_ARST 0x00000001 // Allow LDO failure to reset
|
||||
#define SYSCTL_LDOCFG_NORST 0x00000000 // Do not reset on LDO failure
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlIntEnable(),
|
||||
// SysCtlIntDisable(), and SysCtlIntClear() APIs, or returned in the bit mask
|
||||
// by the SysCtlIntStatus() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_INT_MOSC_PUP 0x00000100 // MOSC power-up interrupt
|
||||
#define SYSCTL_INT_USBPLL_LOCK 0x00000080 // USB PLL lock interrupt
|
||||
#define SYSCTL_INT_PLL_LOCK 0x00000040 // PLL lock interrupt
|
||||
#define SYSCTL_INT_CUR_LIMIT 0x00000020 // Current limit interrupt
|
||||
#define SYSCTL_INT_IOSC_FAIL 0x00000010 // Internal oscillator failure int
|
||||
#define SYSCTL_INT_MOSC_FAIL 0x00000008 // Main oscillator failure int
|
||||
#define SYSCTL_INT_POR 0x00000004 // Power on reset interrupt
|
||||
#define SYSCTL_INT_BOR 0x00000002 // Brown out interrupt
|
||||
#define SYSCTL_INT_PLL_FAIL 0x00000001 // PLL failure interrupt
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlResetCauseClear()
|
||||
// API or returned by the SysCtlResetCauseGet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_CAUSE_LDO 0x00000020 // LDO power not OK reset
|
||||
#define SYSCTL_CAUSE_WDOG1 0x00000020 // Watchdog 1 reset
|
||||
#define SYSCTL_CAUSE_SW 0x00000010 // Software reset
|
||||
#define SYSCTL_CAUSE_WDOG0 0x00000008 // Watchdog 0 reset
|
||||
#define SYSCTL_CAUSE_WDOG 0x00000008 // Watchdog reset
|
||||
#define SYSCTL_CAUSE_BOR 0x00000004 // Brown-out reset
|
||||
#define SYSCTL_CAUSE_POR 0x00000002 // Power on reset
|
||||
#define SYSCTL_CAUSE_EXT 0x00000001 // External reset
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlBrownOutConfigSet()
|
||||
// API as the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_BOR_RESET 0x00000002 // Reset instead of interrupting
|
||||
#define SYSCTL_BOR_RESAMPLE 0x00000001 // Resample BOR before asserting
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlPWMClockSet() API
|
||||
// as the ulConfig parameter, and can be returned by the SysCtlPWMClockGet()
|
||||
// API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_PWMDIV_1 0x00000000 // PWM clock is processor clock /1
|
||||
#define SYSCTL_PWMDIV_2 0x00100000 // PWM clock is processor clock /2
|
||||
#define SYSCTL_PWMDIV_4 0x00120000 // PWM clock is processor clock /4
|
||||
#define SYSCTL_PWMDIV_8 0x00140000 // PWM clock is processor clock /8
|
||||
#define SYSCTL_PWMDIV_16 0x00160000 // PWM clock is processor clock /16
|
||||
#define SYSCTL_PWMDIV_32 0x00180000 // PWM clock is processor clock /32
|
||||
#define SYSCTL_PWMDIV_64 0x001A0000 // PWM clock is processor clock /64
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlADCSpeedSet() API
|
||||
// as the ulSpeed parameter, and can be returned by the SyCtlADCSpeedGet()
|
||||
// API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_ADCSPEED_1MSPS 0x00000F00 // 1,000,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_500KSPS 0x00000A00 // 500,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_250KSPS 0x00000500 // 250,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_125KSPS 0x00000000 // 125,000 samples per second
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlClockSet() API as
|
||||
// the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_SYSDIV_1 0x07800000 // Processor clock is osc/pll /1
|
||||
#define SYSCTL_SYSDIV_2 0x00C00000 // Processor clock is osc/pll /2
|
||||
#define SYSCTL_SYSDIV_3 0x01400000 // Processor clock is osc/pll /3
|
||||
#define SYSCTL_SYSDIV_4 0x01C00000 // Processor clock is osc/pll /4
|
||||
#define SYSCTL_SYSDIV_5 0x02400000 // Processor clock is osc/pll /5
|
||||
#define SYSCTL_SYSDIV_6 0x02C00000 // Processor clock is osc/pll /6
|
||||
#define SYSCTL_SYSDIV_7 0x03400000 // Processor clock is osc/pll /7
|
||||
#define SYSCTL_SYSDIV_8 0x03C00000 // Processor clock is osc/pll /8
|
||||
#define SYSCTL_SYSDIV_9 0x04400000 // Processor clock is osc/pll /9
|
||||
#define SYSCTL_SYSDIV_10 0x04C00000 // Processor clock is osc/pll /10
|
||||
#define SYSCTL_SYSDIV_11 0x05400000 // Processor clock is osc/pll /11
|
||||
#define SYSCTL_SYSDIV_12 0x05C00000 // Processor clock is osc/pll /12
|
||||
#define SYSCTL_SYSDIV_13 0x06400000 // Processor clock is osc/pll /13
|
||||
#define SYSCTL_SYSDIV_14 0x06C00000 // Processor clock is osc/pll /14
|
||||
#define SYSCTL_SYSDIV_15 0x07400000 // Processor clock is osc/pll /15
|
||||
#define SYSCTL_SYSDIV_16 0x07C00000 // Processor clock is osc/pll /16
|
||||
#define SYSCTL_SYSDIV_17 0x88400000 // Processor clock is osc/pll /17
|
||||
#define SYSCTL_SYSDIV_18 0x88C00000 // Processor clock is osc/pll /18
|
||||
#define SYSCTL_SYSDIV_19 0x89400000 // Processor clock is osc/pll /19
|
||||
#define SYSCTL_SYSDIV_20 0x89C00000 // Processor clock is osc/pll /20
|
||||
#define SYSCTL_SYSDIV_21 0x8A400000 // Processor clock is osc/pll /21
|
||||
#define SYSCTL_SYSDIV_22 0x8AC00000 // Processor clock is osc/pll /22
|
||||
#define SYSCTL_SYSDIV_23 0x8B400000 // Processor clock is osc/pll /23
|
||||
#define SYSCTL_SYSDIV_24 0x8BC00000 // Processor clock is osc/pll /24
|
||||
#define SYSCTL_SYSDIV_25 0x8C400000 // Processor clock is osc/pll /25
|
||||
#define SYSCTL_SYSDIV_26 0x8CC00000 // Processor clock is osc/pll /26
|
||||
#define SYSCTL_SYSDIV_27 0x8D400000 // Processor clock is osc/pll /27
|
||||
#define SYSCTL_SYSDIV_28 0x8DC00000 // Processor clock is osc/pll /28
|
||||
#define SYSCTL_SYSDIV_29 0x8E400000 // Processor clock is osc/pll /29
|
||||
#define SYSCTL_SYSDIV_30 0x8EC00000 // Processor clock is osc/pll /30
|
||||
#define SYSCTL_SYSDIV_31 0x8F400000 // Processor clock is osc/pll /31
|
||||
#define SYSCTL_SYSDIV_32 0x8FC00000 // Processor clock is osc/pll /32
|
||||
#define SYSCTL_SYSDIV_33 0x90400000 // Processor clock is osc/pll /33
|
||||
#define SYSCTL_SYSDIV_34 0x90C00000 // Processor clock is osc/pll /34
|
||||
#define SYSCTL_SYSDIV_35 0x91400000 // Processor clock is osc/pll /35
|
||||
#define SYSCTL_SYSDIV_36 0x91C00000 // Processor clock is osc/pll /36
|
||||
#define SYSCTL_SYSDIV_37 0x92400000 // Processor clock is osc/pll /37
|
||||
#define SYSCTL_SYSDIV_38 0x92C00000 // Processor clock is osc/pll /38
|
||||
#define SYSCTL_SYSDIV_39 0x93400000 // Processor clock is osc/pll /39
|
||||
#define SYSCTL_SYSDIV_40 0x93C00000 // Processor clock is osc/pll /40
|
||||
#define SYSCTL_SYSDIV_41 0x94400000 // Processor clock is osc/pll /41
|
||||
#define SYSCTL_SYSDIV_42 0x94C00000 // Processor clock is osc/pll /42
|
||||
#define SYSCTL_SYSDIV_43 0x95400000 // Processor clock is osc/pll /43
|
||||
#define SYSCTL_SYSDIV_44 0x95C00000 // Processor clock is osc/pll /44
|
||||
#define SYSCTL_SYSDIV_45 0x96400000 // Processor clock is osc/pll /45
|
||||
#define SYSCTL_SYSDIV_46 0x96C00000 // Processor clock is osc/pll /46
|
||||
#define SYSCTL_SYSDIV_47 0x97400000 // Processor clock is osc/pll /47
|
||||
#define SYSCTL_SYSDIV_48 0x97C00000 // Processor clock is osc/pll /48
|
||||
#define SYSCTL_SYSDIV_49 0x98400000 // Processor clock is osc/pll /49
|
||||
#define SYSCTL_SYSDIV_50 0x98C00000 // Processor clock is osc/pll /50
|
||||
#define SYSCTL_SYSDIV_51 0x99400000 // Processor clock is osc/pll /51
|
||||
#define SYSCTL_SYSDIV_52 0x99C00000 // Processor clock is osc/pll /52
|
||||
#define SYSCTL_SYSDIV_53 0x9A400000 // Processor clock is osc/pll /53
|
||||
#define SYSCTL_SYSDIV_54 0x9AC00000 // Processor clock is osc/pll /54
|
||||
#define SYSCTL_SYSDIV_55 0x9B400000 // Processor clock is osc/pll /55
|
||||
#define SYSCTL_SYSDIV_56 0x9BC00000 // Processor clock is osc/pll /56
|
||||
#define SYSCTL_SYSDIV_57 0x9C400000 // Processor clock is osc/pll /57
|
||||
#define SYSCTL_SYSDIV_58 0x9CC00000 // Processor clock is osc/pll /58
|
||||
#define SYSCTL_SYSDIV_59 0x9D400000 // Processor clock is osc/pll /59
|
||||
#define SYSCTL_SYSDIV_60 0x9DC00000 // Processor clock is osc/pll /60
|
||||
#define SYSCTL_SYSDIV_61 0x9E400000 // Processor clock is osc/pll /61
|
||||
#define SYSCTL_SYSDIV_62 0x9EC00000 // Processor clock is osc/pll /62
|
||||
#define SYSCTL_SYSDIV_63 0x9F400000 // Processor clock is osc/pll /63
|
||||
#define SYSCTL_SYSDIV_64 0x9FC00000 // Processor clock is osc/pll /64
|
||||
#define SYSCTL_SYSDIV_2_5 0xC1000000 // Processor clock is pll / 2.5
|
||||
#define SYSCTL_SYSDIV_3_5 0xC1800000 // Processor clock is pll / 3.5
|
||||
#define SYSCTL_SYSDIV_4_5 0xC2000000 // Processor clock is pll / 4.5
|
||||
#define SYSCTL_SYSDIV_5_5 0xC2800000 // Processor clock is pll / 5.5
|
||||
#define SYSCTL_SYSDIV_6_5 0xC3000000 // Processor clock is pll / 6.5
|
||||
#define SYSCTL_SYSDIV_7_5 0xC3800000 // Processor clock is pll / 7.5
|
||||
#define SYSCTL_SYSDIV_8_5 0xC4000000 // Processor clock is pll / 8.5
|
||||
#define SYSCTL_SYSDIV_9_5 0xC4800000 // Processor clock is pll / 9.5
|
||||
#define SYSCTL_SYSDIV_10_5 0xC5000000 // Processor clock is pll / 10.5
|
||||
#define SYSCTL_SYSDIV_11_5 0xC5800000 // Processor clock is pll / 11.5
|
||||
#define SYSCTL_SYSDIV_12_5 0xC6000000 // Processor clock is pll / 12.5
|
||||
#define SYSCTL_SYSDIV_13_5 0xC6800000 // Processor clock is pll / 13.5
|
||||
#define SYSCTL_SYSDIV_14_5 0xC7000000 // Processor clock is pll / 14.5
|
||||
#define SYSCTL_SYSDIV_15_5 0xC7800000 // Processor clock is pll / 15.5
|
||||
#define SYSCTL_SYSDIV_16_5 0xC8000000 // Processor clock is pll / 16.5
|
||||
#define SYSCTL_SYSDIV_17_5 0xC8800000 // Processor clock is pll / 17.5
|
||||
#define SYSCTL_SYSDIV_18_5 0xC9000000 // Processor clock is pll / 18.5
|
||||
#define SYSCTL_SYSDIV_19_5 0xC9800000 // Processor clock is pll / 19.5
|
||||
#define SYSCTL_SYSDIV_20_5 0xCA000000 // Processor clock is pll / 20.5
|
||||
#define SYSCTL_SYSDIV_21_5 0xCA800000 // Processor clock is pll / 21.5
|
||||
#define SYSCTL_SYSDIV_22_5 0xCB000000 // Processor clock is pll / 22.5
|
||||
#define SYSCTL_SYSDIV_23_5 0xCB800000 // Processor clock is pll / 23.5
|
||||
#define SYSCTL_SYSDIV_24_5 0xCC000000 // Processor clock is pll / 24.5
|
||||
#define SYSCTL_SYSDIV_25_5 0xCC800000 // Processor clock is pll / 25.5
|
||||
#define SYSCTL_SYSDIV_26_5 0xCD000000 // Processor clock is pll / 26.5
|
||||
#define SYSCTL_SYSDIV_27_5 0xCD800000 // Processor clock is pll / 27.5
|
||||
#define SYSCTL_SYSDIV_28_5 0xCE000000 // Processor clock is pll / 28.5
|
||||
#define SYSCTL_SYSDIV_29_5 0xCE800000 // Processor clock is pll / 29.5
|
||||
#define SYSCTL_SYSDIV_30_5 0xCF000000 // Processor clock is pll / 30.5
|
||||
#define SYSCTL_SYSDIV_31_5 0xCF800000 // Processor clock is pll / 31.5
|
||||
#define SYSCTL_SYSDIV_32_5 0xD0000000 // Processor clock is pll / 32.5
|
||||
#define SYSCTL_SYSDIV_33_5 0xD0800000 // Processor clock is pll / 33.5
|
||||
#define SYSCTL_SYSDIV_34_5 0xD1000000 // Processor clock is pll / 34.5
|
||||
#define SYSCTL_SYSDIV_35_5 0xD1800000 // Processor clock is pll / 35.5
|
||||
#define SYSCTL_SYSDIV_36_5 0xD2000000 // Processor clock is pll / 36.5
|
||||
#define SYSCTL_SYSDIV_37_5 0xD2800000 // Processor clock is pll / 37.5
|
||||
#define SYSCTL_SYSDIV_38_5 0xD3000000 // Processor clock is pll / 38.5
|
||||
#define SYSCTL_SYSDIV_39_5 0xD3800000 // Processor clock is pll / 39.5
|
||||
#define SYSCTL_SYSDIV_40_5 0xD4000000 // Processor clock is pll / 40.5
|
||||
#define SYSCTL_SYSDIV_41_5 0xD4800000 // Processor clock is pll / 41.5
|
||||
#define SYSCTL_SYSDIV_42_5 0xD5000000 // Processor clock is pll / 42.5
|
||||
#define SYSCTL_SYSDIV_43_5 0xD5800000 // Processor clock is pll / 43.5
|
||||
#define SYSCTL_SYSDIV_44_5 0xD6000000 // Processor clock is pll / 44.5
|
||||
#define SYSCTL_SYSDIV_45_5 0xD6800000 // Processor clock is pll / 45.5
|
||||
#define SYSCTL_SYSDIV_46_5 0xD7000000 // Processor clock is pll / 46.5
|
||||
#define SYSCTL_SYSDIV_47_5 0xD7800000 // Processor clock is pll / 47.5
|
||||
#define SYSCTL_SYSDIV_48_5 0xD8000000 // Processor clock is pll / 48.5
|
||||
#define SYSCTL_SYSDIV_49_5 0xD8800000 // Processor clock is pll / 49.5
|
||||
#define SYSCTL_SYSDIV_50_5 0xD9000000 // Processor clock is pll / 50.5
|
||||
#define SYSCTL_SYSDIV_51_5 0xD9800000 // Processor clock is pll / 51.5
|
||||
#define SYSCTL_SYSDIV_52_5 0xDA000000 // Processor clock is pll / 52.5
|
||||
#define SYSCTL_SYSDIV_53_5 0xDA800000 // Processor clock is pll / 53.5
|
||||
#define SYSCTL_SYSDIV_54_5 0xDB000000 // Processor clock is pll / 54.5
|
||||
#define SYSCTL_SYSDIV_55_5 0xDB800000 // Processor clock is pll / 55.5
|
||||
#define SYSCTL_SYSDIV_56_5 0xDC000000 // Processor clock is pll / 56.5
|
||||
#define SYSCTL_SYSDIV_57_5 0xDC800000 // Processor clock is pll / 57.5
|
||||
#define SYSCTL_SYSDIV_58_5 0xDD000000 // Processor clock is pll / 58.5
|
||||
#define SYSCTL_SYSDIV_59_5 0xDD800000 // Processor clock is pll / 59.5
|
||||
#define SYSCTL_SYSDIV_60_5 0xDE000000 // Processor clock is pll / 60.5
|
||||
#define SYSCTL_SYSDIV_61_5 0xDE800000 // Processor clock is pll / 61.5
|
||||
#define SYSCTL_SYSDIV_62_5 0xDF000000 // Processor clock is pll / 62.5
|
||||
#define SYSCTL_SYSDIV_63_5 0xDF800000 // Processor clock is pll / 63.5
|
||||
#define SYSCTL_USE_PLL 0x00000000 // System clock is the PLL clock
|
||||
#define SYSCTL_USE_OSC 0x00003800 // System clock is the osc clock
|
||||
#define SYSCTL_XTAL_1MHZ 0x00000000 // External crystal is 1MHz
|
||||
#define SYSCTL_XTAL_1_84MHZ 0x00000040 // External crystal is 1.8432MHz
|
||||
#define SYSCTL_XTAL_2MHZ 0x00000080 // External crystal is 2MHz
|
||||
#define SYSCTL_XTAL_2_45MHZ 0x000000C0 // External crystal is 2.4576MHz
|
||||
#define SYSCTL_XTAL_3_57MHZ 0x00000100 // External crystal is 3.579545MHz
|
||||
#define SYSCTL_XTAL_3_68MHZ 0x00000140 // External crystal is 3.6864MHz
|
||||
#define SYSCTL_XTAL_4MHZ 0x00000180 // External crystal is 4MHz
|
||||
#define SYSCTL_XTAL_4_09MHZ 0x000001C0 // External crystal is 4.096MHz
|
||||
#define SYSCTL_XTAL_4_91MHZ 0x00000200 // External crystal is 4.9152MHz
|
||||
#define SYSCTL_XTAL_5MHZ 0x00000240 // External crystal is 5MHz
|
||||
#define SYSCTL_XTAL_5_12MHZ 0x00000280 // External crystal is 5.12MHz
|
||||
#define SYSCTL_XTAL_6MHZ 0x000002C0 // External crystal is 6MHz
|
||||
#define SYSCTL_XTAL_6_14MHZ 0x00000300 // External crystal is 6.144MHz
|
||||
#define SYSCTL_XTAL_7_37MHZ 0x00000340 // External crystal is 7.3728MHz
|
||||
#define SYSCTL_XTAL_8MHZ 0x00000380 // External crystal is 8MHz
|
||||
#define SYSCTL_XTAL_8_19MHZ 0x000003C0 // External crystal is 8.192MHz
|
||||
#define SYSCTL_XTAL_10MHZ 0x00000400 // External crystal is 10 MHz
|
||||
#define SYSCTL_XTAL_12MHZ 0x00000440 // External crystal is 12 MHz
|
||||
#define SYSCTL_XTAL_12_2MHZ 0x00000480 // External crystal is 12.288 MHz
|
||||
#define SYSCTL_XTAL_13_5MHZ 0x000004C0 // External crystal is 13.56 MHz
|
||||
#define SYSCTL_XTAL_14_3MHZ 0x00000500 // External crystal is 14.31818 MHz
|
||||
#define SYSCTL_XTAL_16MHZ 0x00000540 // External crystal is 16 MHz
|
||||
#define SYSCTL_XTAL_16_3MHZ 0x00000580 // External crystal is 16.384 MHz
|
||||
#define SYSCTL_XTAL_18MHZ 0x000005C0 // External crystal is 18.0 MHz
|
||||
#define SYSCTL_XTAL_20MHZ 0x00000600 // External crystal is 20.0 MHz
|
||||
#define SYSCTL_XTAL_24MHZ 0x00000640 // External crystal is 24.0 MHz
|
||||
#define SYSCTL_XTAL_25MHZ 0x00000680 // External crystal is 25.0 MHz
|
||||
#define SYSCTL_OSC_MAIN 0x00000000 // Osc source is main osc
|
||||
#define SYSCTL_OSC_INT 0x00000010 // Osc source is int. osc
|
||||
#define SYSCTL_OSC_INT4 0x00000020 // Osc source is int. osc /4
|
||||
#define SYSCTL_OSC_INT30 0x00000030 // Osc source is int. 30 KHz
|
||||
#define SYSCTL_OSC_EXT4_19 0x80000028 // Osc source is ext. 4.19 MHz
|
||||
#define SYSCTL_OSC_EXT32 0x80000038 // Osc source is ext. 32 KHz
|
||||
#define SYSCTL_INT_OSC_DIS 0x00000002 // Disable internal oscillator
|
||||
#define SYSCTL_MAIN_OSC_DIS 0x00000001 // Disable main oscillator
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlDeepSleepClockSet()
|
||||
// API as the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_DSLP_DIV_1 0x00000000 // Deep-sleep clock is osc /1
|
||||
#define SYSCTL_DSLP_DIV_2 0x00800000 // Deep-sleep clock is osc /2
|
||||
#define SYSCTL_DSLP_DIV_3 0x01000000 // Deep-sleep clock is osc /3
|
||||
#define SYSCTL_DSLP_DIV_4 0x01800000 // Deep-sleep clock is osc /4
|
||||
#define SYSCTL_DSLP_DIV_5 0x02000000 // Deep-sleep clock is osc /5
|
||||
#define SYSCTL_DSLP_DIV_6 0x02800000 // Deep-sleep clock is osc /6
|
||||
#define SYSCTL_DSLP_DIV_7 0x03000000 // Deep-sleep clock is osc /7
|
||||
#define SYSCTL_DSLP_DIV_8 0x03800000 // Deep-sleep clock is osc /8
|
||||
#define SYSCTL_DSLP_DIV_9 0x04000000 // Deep-sleep clock is osc /9
|
||||
#define SYSCTL_DSLP_DIV_10 0x04800000 // Deep-sleep clock is osc /10
|
||||
#define SYSCTL_DSLP_DIV_11 0x05000000 // Deep-sleep clock is osc /11
|
||||
#define SYSCTL_DSLP_DIV_12 0x05800000 // Deep-sleep clock is osc /12
|
||||
#define SYSCTL_DSLP_DIV_13 0x06000000 // Deep-sleep clock is osc /13
|
||||
#define SYSCTL_DSLP_DIV_14 0x06800000 // Deep-sleep clock is osc /14
|
||||
#define SYSCTL_DSLP_DIV_15 0x07000000 // Deep-sleep clock is osc /15
|
||||
#define SYSCTL_DSLP_DIV_16 0x07800000 // Deep-sleep clock is osc /16
|
||||
#define SYSCTL_DSLP_DIV_17 0x08000000 // Deep-sleep clock is osc /17
|
||||
#define SYSCTL_DSLP_DIV_18 0x08800000 // Deep-sleep clock is osc /18
|
||||
#define SYSCTL_DSLP_DIV_19 0x09000000 // Deep-sleep clock is osc /19
|
||||
#define SYSCTL_DSLP_DIV_20 0x09800000 // Deep-sleep clock is osc /20
|
||||
#define SYSCTL_DSLP_DIV_21 0x0A000000 // Deep-sleep clock is osc /21
|
||||
#define SYSCTL_DSLP_DIV_22 0x0A800000 // Deep-sleep clock is osc /22
|
||||
#define SYSCTL_DSLP_DIV_23 0x0B000000 // Deep-sleep clock is osc /23
|
||||
#define SYSCTL_DSLP_DIV_24 0x0B800000 // Deep-sleep clock is osc /24
|
||||
#define SYSCTL_DSLP_DIV_25 0x0C000000 // Deep-sleep clock is osc /25
|
||||
#define SYSCTL_DSLP_DIV_26 0x0C800000 // Deep-sleep clock is osc /26
|
||||
#define SYSCTL_DSLP_DIV_27 0x0D000000 // Deep-sleep clock is osc /27
|
||||
#define SYSCTL_DSLP_DIV_28 0x0D800000 // Deep-sleep clock is osc /28
|
||||
#define SYSCTL_DSLP_DIV_29 0x0E000000 // Deep-sleep clock is osc /29
|
||||
#define SYSCTL_DSLP_DIV_30 0x0E800000 // Deep-sleep clock is osc /30
|
||||
#define SYSCTL_DSLP_DIV_31 0x0F000000 // Deep-sleep clock is osc /31
|
||||
#define SYSCTL_DSLP_DIV_32 0x0F800000 // Deep-sleep clock is osc /32
|
||||
#define SYSCTL_DSLP_DIV_33 0x10000000 // Deep-sleep clock is osc /33
|
||||
#define SYSCTL_DSLP_DIV_34 0x10800000 // Deep-sleep clock is osc /34
|
||||
#define SYSCTL_DSLP_DIV_35 0x11000000 // Deep-sleep clock is osc /35
|
||||
#define SYSCTL_DSLP_DIV_36 0x11800000 // Deep-sleep clock is osc /36
|
||||
#define SYSCTL_DSLP_DIV_37 0x12000000 // Deep-sleep clock is osc /37
|
||||
#define SYSCTL_DSLP_DIV_38 0x12800000 // Deep-sleep clock is osc /38
|
||||
#define SYSCTL_DSLP_DIV_39 0x13000000 // Deep-sleep clock is osc /39
|
||||
#define SYSCTL_DSLP_DIV_40 0x13800000 // Deep-sleep clock is osc /40
|
||||
#define SYSCTL_DSLP_DIV_41 0x14000000 // Deep-sleep clock is osc /41
|
||||
#define SYSCTL_DSLP_DIV_42 0x14800000 // Deep-sleep clock is osc /42
|
||||
#define SYSCTL_DSLP_DIV_43 0x15000000 // Deep-sleep clock is osc /43
|
||||
#define SYSCTL_DSLP_DIV_44 0x15800000 // Deep-sleep clock is osc /44
|
||||
#define SYSCTL_DSLP_DIV_45 0x16000000 // Deep-sleep clock is osc /45
|
||||
#define SYSCTL_DSLP_DIV_46 0x16800000 // Deep-sleep clock is osc /46
|
||||
#define SYSCTL_DSLP_DIV_47 0x17000000 // Deep-sleep clock is osc /47
|
||||
#define SYSCTL_DSLP_DIV_48 0x17800000 // Deep-sleep clock is osc /48
|
||||
#define SYSCTL_DSLP_DIV_49 0x18000000 // Deep-sleep clock is osc /49
|
||||
#define SYSCTL_DSLP_DIV_50 0x18800000 // Deep-sleep clock is osc /50
|
||||
#define SYSCTL_DSLP_DIV_51 0x19000000 // Deep-sleep clock is osc /51
|
||||
#define SYSCTL_DSLP_DIV_52 0x19800000 // Deep-sleep clock is osc /52
|
||||
#define SYSCTL_DSLP_DIV_53 0x1A000000 // Deep-sleep clock is osc /53
|
||||
#define SYSCTL_DSLP_DIV_54 0x1A800000 // Deep-sleep clock is osc /54
|
||||
#define SYSCTL_DSLP_DIV_55 0x1B000000 // Deep-sleep clock is osc /55
|
||||
#define SYSCTL_DSLP_DIV_56 0x1B800000 // Deep-sleep clock is osc /56
|
||||
#define SYSCTL_DSLP_DIV_57 0x1C000000 // Deep-sleep clock is osc /57
|
||||
#define SYSCTL_DSLP_DIV_58 0x1C800000 // Deep-sleep clock is osc /58
|
||||
#define SYSCTL_DSLP_DIV_59 0x1D000000 // Deep-sleep clock is osc /59
|
||||
#define SYSCTL_DSLP_DIV_60 0x1D800000 // Deep-sleep clock is osc /60
|
||||
#define SYSCTL_DSLP_DIV_61 0x1E000000 // Deep-sleep clock is osc /61
|
||||
#define SYSCTL_DSLP_DIV_62 0x1E800000 // Deep-sleep clock is osc /62
|
||||
#define SYSCTL_DSLP_DIV_63 0x1F000000 // Deep-sleep clock is osc /63
|
||||
#define SYSCTL_DSLP_DIV_64 0x1F800000 // Deep-sleep clock is osc /64
|
||||
#define SYSCTL_DSLP_OSC_MAIN 0x00000000 // Osc source is main osc
|
||||
#define SYSCTL_DSLP_OSC_INT 0x00000010 // Osc source is int. osc
|
||||
#define SYSCTL_DSLP_OSC_INT30 0x00000030 // Osc source is int. 30 KHz
|
||||
#define SYSCTL_DSLP_OSC_EXT32 0x00000070 // Osc source is ext. 32 KHz
|
||||
#define SYSCTL_DSLP_PIOSC_PD 0x00000002 // Power down PIOSC in deep-sleep
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Prototypes for the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern unsigned long SysCtlSRAMSizeGet(void);
|
||||
extern unsigned long SysCtlFlashSizeGet(void);
|
||||
extern tBoolean SysCtlPinPresent(unsigned long ulPin);
|
||||
extern tBoolean SysCtlPeripheralPresent(unsigned long ulPeripheral);
|
||||
extern tBoolean SysCtlPeripheralReady(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralPowerOn(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralPowerOff(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralReset(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralSleepEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralSleepDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDeepSleepEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDeepSleepDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralClockGating(tBoolean bEnable);
|
||||
extern void SysCtlIntRegister(void (*pfnHandler)(void));
|
||||
extern void SysCtlIntUnregister(void);
|
||||
extern void SysCtlIntEnable(unsigned long ulInts);
|
||||
extern void SysCtlIntDisable(unsigned long ulInts);
|
||||
extern void SysCtlIntClear(unsigned long ulInts);
|
||||
extern unsigned long SysCtlIntStatus(tBoolean bMasked);
|
||||
extern void SysCtlLDOSet(unsigned long ulVoltage);
|
||||
extern unsigned long SysCtlLDOGet(void);
|
||||
extern void SysCtlLDOConfigSet(unsigned long ulConfig);
|
||||
extern void SysCtlReset(void);
|
||||
extern void SysCtlSleep(void);
|
||||
extern void SysCtlDeepSleep(void);
|
||||
extern unsigned long SysCtlResetCauseGet(void);
|
||||
extern void SysCtlResetCauseClear(unsigned long ulCauses);
|
||||
extern void SysCtlBrownOutConfigSet(unsigned long ulConfig,
|
||||
unsigned long ulDelay);
|
||||
extern void SysCtlDelay(unsigned long ulCount);
|
||||
extern void SysCtlMOSCConfigSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlPIOSCCalibrate(unsigned long ulType);
|
||||
extern void SysCtlClockSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlClockGet(void);
|
||||
extern void SysCtlDeepSleepClockSet(unsigned long ulConfig);
|
||||
extern void SysCtlPWMClockSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlPWMClockGet(void);
|
||||
extern void SysCtlADCSpeedSet(unsigned long ulSpeed);
|
||||
extern unsigned long SysCtlADCSpeedGet(void);
|
||||
extern void SysCtlIOSCVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlMOSCVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlPLLVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlClkVerificationClear(void);
|
||||
extern void SysCtlGPIOAHBEnable(unsigned long ulGPIOPeripheral);
|
||||
extern void SysCtlGPIOAHBDisable(unsigned long ulGPIOPeripheral);
|
||||
extern void SysCtlUSBPLLEnable(void);
|
||||
extern void SysCtlUSBPLLDisable(void);
|
||||
extern unsigned long SysCtlI2SMClkSet(unsigned long ulInputClock,
|
||||
unsigned long ulMClk);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Mark the end of the C bindings section for C++ compilers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SYSCTL_H__
|
280
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/table.c
Normal file
280
examples/arm-cortex/qk/ti_arm/dpp-qk-ev-lm4f120xl/table.c
Normal file
@ -0,0 +1,280 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./table.c
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
/* @(/2/1) .................................................................*/
|
||||
typedef struct TableTag {
|
||||
/* protected: */
|
||||
QActive super;
|
||||
|
||||
/* private: */
|
||||
uint8_t fork[N_PHILO];
|
||||
uint8_t isHungry[N_PHILO];
|
||||
} Table;
|
||||
|
||||
/* protected: */
|
||||
static QState Table_initial(Table * const me, QEvt const * const e);
|
||||
static QState Table_active(Table * const me, QEvt const * const e);
|
||||
static QState Table_serving(Table * const me, QEvt const * const e);
|
||||
static QState Table_paused(Table * const me, QEvt const * const e);
|
||||
|
||||
|
||||
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
|
||||
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
|
||||
#define FREE ((uint8_t)0)
|
||||
#define USED ((uint8_t)1)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Table l_table; /* the single instance of the Table active object */
|
||||
|
||||
/* Global-scope objects ----------------------------------------------------*/
|
||||
QActive * const AO_Table = &l_table.super; /* "opaque" AO pointer */
|
||||
|
||||
/*..........................................................................*/
|
||||
/* @(/2/5) .................................................................*/
|
||||
void Table_ctor(void) {
|
||||
uint8_t n;
|
||||
Table *me = &l_table;
|
||||
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
}
|
||||
}
|
||||
/* @(/2/1) .................................................................*/
|
||||
/* @(/2/1/2) ...............................................................*/
|
||||
/* @(/2/1/2/0) */
|
||||
static QState Table_initial(Table * const me, QEvt const * const e) {
|
||||
uint8_t n;
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QHsm_top);
|
||||
QS_FUN_DICTIONARY(&Table_initial);
|
||||
QS_FUN_DICTIONARY(&Table_serving);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TERMINATE_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
|
||||
|
||||
QActive_subscribe(&me->super, DONE_SIG);
|
||||
QActive_subscribe(&me->super, PAUSE_SIG);
|
||||
QActive_subscribe(&me->super, TERMINATE_SIG);
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
}
|
||||
return Q_TRAN(&Table_serving);
|
||||
}
|
||||
/* @(/2/1/2/1) .............................................................*/
|
||||
static QState Table_active(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/0) */
|
||||
case TERMINATE_SIG: {
|
||||
BSP_terminate(0);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/1) */
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/1/2/1/2) ...........................................................*/
|
||||
static QState Table_serving(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/2) */
|
||||
case Q_ENTRY_SIG: {
|
||||
uint8_t n;
|
||||
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
|
||||
if ((me->isHungry[n] != 0U)
|
||||
&& (me->fork[LEFT(n)] == FREE)
|
||||
&& (me->fork[n] == FREE))
|
||||
{
|
||||
TableEvt *te;
|
||||
|
||||
me->fork[LEFT(n)] = USED;
|
||||
me->fork[n] = USED;
|
||||
te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QF_PUBLISH(&te->super, me);
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
}
|
||||
}
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/0) */
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
m = LEFT(n);
|
||||
/* @(/2/1/2/1/2/0/0) */
|
||||
if ((me->fork[m] == FREE) && (me->fork[n] == FREE)) {
|
||||
TableEvt *pe;
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
status = Q_HANDLED();
|
||||
}
|
||||
/* @(/2/1/2/1/2/0/1) */
|
||||
else {
|
||||
me->isHungry[n] = 1U;
|
||||
status = Q_HANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/1) */
|
||||
case DONE_SIG: {
|
||||
uint8_t n, m;
|
||||
TableEvt *pe;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
m = RIGHT(n); /* check the right neighbor */
|
||||
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[m] == FREE)) {
|
||||
me->fork[n] = USED;
|
||||
me->fork[m] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
m = LEFT(n); /* check the left neighbor */
|
||||
n = LEFT(m); /* left fork of the left neighbor */
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[n] == FREE)) {
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/2) */
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/3) */
|
||||
case PAUSE_SIG: {
|
||||
status = Q_TRAN(&Table_paused);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&Table_active);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/1/2/1/3) ...........................................................*/
|
||||
static QState Table_paused(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/3) */
|
||||
case Q_ENTRY_SIG: {
|
||||
BSP_displayPaused(1U);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3) */
|
||||
case Q_EXIT_SIG: {
|
||||
BSP_displayPaused(0U);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/0) */
|
||||
case PAUSE_SIG: {
|
||||
status = Q_TRAN(&Table_serving);
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/1) */
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* philo ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
me->isHungry[n] = 1U;
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/2) */
|
||||
case DONE_SIG: {
|
||||
uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&Table_active);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cortex_m3.xml" id="drivers" xml="stellaris_cortex_m3.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="Stellaris LM3S811" href="devices/lm3s811.xml" id="Stellaris LM3S811" xml="lm3s811.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cortex_m4.xml" id="drivers" xml="stellaris_cortex_m4.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="Stellaris LM4F120H5QR" href="devices/lm4f120h5qr.xml" id="Stellaris LM4F120H5QR" xml="lm4f120h5qr.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?ccsproject version="1.0"?>
|
||||
|
||||
<projectOptions>
|
||||
<deviceVariant value="Cortex M.LM3S811"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="4.6.1"/>
|
||||
<isElfFormat value="true"/>
|
||||
<rts value="rtsv7M3_T_le_eabi.lib"/>
|
||||
<defaultAssemblyOnly value="false"/>
|
||||
<isTargetManual value="false"/>
|
||||
<deviceFamily value="TMS470"/>
|
||||
<connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/>
|
||||
</projectOptions>
|
297
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/.cproject
Normal file
297
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/.cproject
Normal file
@ -0,0 +1,297 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.125056586" name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1716409358" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.934223113" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1611758648" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1143121742" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.1124808596" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.180816056" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.828998599" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.69457592" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.949278387" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.370856909" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.82319758" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.915912762" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.558479300" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.2024089942" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.238579306" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.1293657506" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.1033465017" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.1121431134" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1074317216" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.328308144" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.475841361" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.384693040" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.1751374675" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.1094428817" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.63083142" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.753765494" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.1643178508" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm/dbg""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.1231449111" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.86447584" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.132184793" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.275497851" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.1422631147" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781" moduleId="org.eclipse.cdt.core.settings" name="Spy">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781" name="Spy" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.2095793781." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1433051124" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1222377594" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.513503655" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1738261499" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.965546943" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.1768291295" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.2073650057" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.1888517689" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.860827206" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.228973165" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.541668960" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.347869577" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
<listOptionValue builtIn="false" value="Q_SPY=1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.455908993" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.1241857520" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.1092728421" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.884455773" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.460071305" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.671169072" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1049849830" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.1124150309" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.1368275502" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.1693633075" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.123766415" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.223721228" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.1771905814" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.879949439" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.1652298111" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.347625353" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm/spy""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.600574631" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.1276765561" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.1143048046" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.664414988" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.697474988" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<macros>
|
||||
<stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${PROJECT_ROOT}/../../../.."/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168.1742314841." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain.1080320893" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1153813364">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1931695420" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
|
||||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lm4f111h5qr.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="IS_ELF=true"/>
|
||||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/>
|
||||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.2070425422" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.0.1" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug.1664971950" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug.1069044512" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug.620736059" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.compilerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN.775825092" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.1741549501" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_LEVEL.2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.733340866" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH.344918809" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/>
|
||||
<listOptionValue builtIn="false" value=""${PROJECT_ROOT}/cmsis""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC.1964759972" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GCC" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE.1299773408" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="ccs"/>
|
||||
<listOptionValue builtIn="false" value="NDEBUG=1"/>
|
||||
<listOptionValue builtIn="false" value="PART_LM4F120H5QR"/>
|
||||
<listOptionValue builtIn="false" value="__FPU_PRESENT=1"/>
|
||||
<listOptionValue builtIn="false" value="TARGET_IS_BLIZZARD_RA1"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING.2110390974" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.DIAG_WARNING" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.250984037" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL.1256666369" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.UAL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.1138064271" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.1131582044" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.CODE_STATE.16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.1834594238" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.ABI.eabi" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.1301625950" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED.967092832" name="Optimize for speed (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS.2018341854" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS.890302929" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS.2111777112" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS.2029792546" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug.1271693750" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE.234772646" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE.886999065" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.STACK_SIZE" value="1024" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE.1036075456" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH.565933276" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.SEARCH_PATH" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||
<listOptionValue builtIn="false" value=""${QPC}/ports/arm-cortex/vanilla/ti_arm/rel""/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE.282128790" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.HEAP_SIZE" value="0" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY.485648781" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.linkerID.LIBRARY" valueType="libs">
|
||||
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||
<listOptionValue builtIn="false" value=""qp_cortex-m4f_ti.lib""/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS.535871043" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS.248711679" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS.1989361041" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.0.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="lm3s811.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="game-ev-lm3s811.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1859657595" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
</cproject>
|
33
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/.project
Normal file
33
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/.project
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>dpp-ev-lm4f120xl</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<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.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>QPC</name>
|
||||
<value>file:/D:/qp/qpc</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
inEditor=false
|
||||
onBuild=false
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
|
@ -0,0 +1,5 @@
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168/internalBuilder/enabled=false
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Debug.752531168/internalBuilder/ignoreErr=true
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Release.1213787674/internalBuilder/enabled=false
|
||||
com.ti.ccstudio.buildDefinitions.TMS470.Release.1213787674/internalBuilder/ignoreErr=true
|
||||
eclipse.preferences.version=1
|
@ -0,0 +1,18 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//Debug/makefile=UTF-8
|
||||
encoding//Debug/objects.mk=UTF-8
|
||||
encoding//Debug/sources.mk=UTF-8
|
||||
encoding//Debug/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/subdir_vars.mk=UTF-8
|
||||
encoding//Release/cmsis/subdir_rules.mk=UTF-8
|
||||
encoding//Release/cmsis/subdir_vars.mk=UTF-8
|
||||
encoding//Release/makefile=UTF-8
|
||||
encoding//Release/objects.mk=UTF-8
|
||||
encoding//Release/sources.mk=UTF-8
|
||||
encoding//Release/subdir_rules.mk=UTF-8
|
||||
encoding//Release/subdir_vars.mk=UTF-8
|
||||
encoding//Spy/makefile=UTF-8
|
||||
encoding//Spy/objects.mk=UTF-8
|
||||
encoding//Spy/sources.mk=UTF-8
|
||||
encoding//Spy/subdir_rules.mk=UTF-8
|
||||
encoding//Spy/subdir_vars.mk=UTF-8
|
409
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/bsp.c
Normal file
409
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/bsp.c
Normal file
@ -0,0 +1,409 @@
|
||||
/*****************************************************************************
|
||||
* Product: "Dining Philosophers Problem" example, cooperative Vanilla kernel
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 15, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
#include "lm4f_cmsis.h"
|
||||
#include "sysctl.h"
|
||||
#include "gpio.h"
|
||||
#include "rom.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
enum ISR_Priorities { /* ISR priorities starting from the highest urgency */
|
||||
GPIOPORTA_PRIO,
|
||||
SYSTICK_PRIO,
|
||||
/* ... */
|
||||
};
|
||||
|
||||
/* Local-scope objects -----------------------------------------------------*/
|
||||
static unsigned l_rnd; /* random seed */
|
||||
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
#define LED_BLUE (1U << 2)
|
||||
|
||||
#define USR_SW1 (1U << 4)
|
||||
#define USR_SW2 (1U << 0)
|
||||
|
||||
#ifdef Q_SPY
|
||||
|
||||
QSTimeCtr QS_tickTime_;
|
||||
QSTimeCtr QS_tickPeriod_;
|
||||
static uint8_t l_SysTick_Handler;
|
||||
static uint8_t l_GPIOPortA_IRQHandler;
|
||||
|
||||
#define UART_BAUD_RATE 115200U
|
||||
#define UART_FR_TXFE 0x80U
|
||||
#define UART_TXFIFO_DEPTH 16U
|
||||
|
||||
enum AppRecords { /* application-specific trace records */
|
||||
PHILO_STAT = QS_USER
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*..........................................................................*/
|
||||
void SysTick_Handler(void) {
|
||||
static uint32_t btn_debounced = USR_SW1;
|
||||
static uint8_t debounce_state = 0U;
|
||||
uint32_t btn;
|
||||
|
||||
#ifdef Q_SPY
|
||||
{
|
||||
uint32_t dummy = SysTick->CTRL; /* clear SysTick_CTRL_COUNTFLAG */
|
||||
QS_tickTime_ += QS_tickPeriod_; /* account for the clock rollover */
|
||||
}
|
||||
#endif
|
||||
|
||||
QF_TICK(&l_SysTick_Handler); /* process all armed time events */
|
||||
|
||||
/* debounce the SW1 button... */
|
||||
btn = GPIOF->DATA_Bits[USR_SW1]; /* read the push btn */
|
||||
switch (debounce_state) {
|
||||
case 0:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 1U; /* transition to the next state */
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 2U; /* transition to the next state */
|
||||
}
|
||||
else {
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (btn != btn_debounced) {
|
||||
debounce_state = 3U; /* transition to the next state */
|
||||
}
|
||||
else {
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (btn != btn_debounced) {
|
||||
btn_debounced = btn; /* save the debounced button value */
|
||||
|
||||
if (btn == 0U) { /* is the button depressed? */
|
||||
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
|
||||
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
|
||||
}
|
||||
else {
|
||||
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
|
||||
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
|
||||
}
|
||||
}
|
||||
debounce_state = 0U; /* transition back to state 0 */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void GPIOPortA_IRQHandler(void) {
|
||||
QACTIVE_POST(AO_Table, Q_NEW(QEvt, MAX_PUB_SIG), /* for testing... */
|
||||
&l_GPIOPortA_IRQHandler);
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void BSP_init(void) {
|
||||
/* Enable the floating-point unit */
|
||||
SCB->CPACR |= (0xFU << 20);
|
||||
|
||||
/* Enable lazy stacking for interrupt handlers. This allows FPU
|
||||
* instructions to be used within interrupt handlers, but at the
|
||||
* expense of extra stack and CPU usage.
|
||||
*/
|
||||
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
|
||||
|
||||
/* Set the clocking to run directly from the crystal */
|
||||
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC
|
||||
| SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
|
||||
|
||||
/* enable clock to the peripherals used by the application */
|
||||
SYSCTL->RCGC2 |= (1U << 5); /* enable clock to GPIOF */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
|
||||
/* configure the LEDs and push buttons */
|
||||
GPIOF->DIR |= (LED_RED | LED_GREEN | LED_BLUE);/* set direction: output */
|
||||
GPIOF->DEN |= (LED_RED | LED_GREEN | LED_BLUE); /* digital enable */
|
||||
GPIOF->DATA_Bits[LED_RED] = 0; /* turn the LED off */
|
||||
GPIOF->DATA_Bits[LED_GREEN] = 0; /* turn the LED off */
|
||||
GPIOF->DATA_Bits[LED_BLUE] = 0; /* turn the LED off */
|
||||
|
||||
/* configure the User Switches */
|
||||
GPIOF->DIR &= ~(USR_SW1 | USR_SW2); /* set direction: input */
|
||||
ROM_GPIOPadConfigSet(GPIO_PORTF_BASE, (USR_SW1 | USR_SW2),
|
||||
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
|
||||
|
||||
BSP_randomSeed(1234U);
|
||||
|
||||
if (QS_INIT((void *)0) == 0) { /* initialize the QS software tracing */
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_RESET();
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_BLUE] = ((stat[0] == 'e') ? LED_BLUE : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) /* application-specific record begin */
|
||||
QS_U8(1, n); /* Philosopher number */
|
||||
QS_STR(stat); /* Philosopher status */
|
||||
QS_END()
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_displayPaused(uint8_t paused) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((paused != 0U) ? LED_RED : 0U);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
uint32_t BSP_random(void) { /* a very cheap pseudo-random-number generator */
|
||||
float volatile x = 3.1415926F;
|
||||
x = x + 2.7182818F;
|
||||
|
||||
/* "Super-Duper" Linear Congruential Generator (LCG)
|
||||
* LCG(2^32, 3*7*11*13*23, 0, seed)
|
||||
*/
|
||||
l_rnd = l_rnd * (3U*7U*11U*13U*23U);
|
||||
|
||||
return l_rnd >> 8;
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_randomSeed(uint32_t seed) {
|
||||
l_rnd = seed;
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP_terminate(int16_t result) {
|
||||
(void)result;
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void QF_onStartup(void) {
|
||||
/* set up the SysTick timer to fire at BSP_TICKS_PER_SEC rate */
|
||||
SysTick_Config(ROM_SysCtlClockGet() / BSP_TICKS_PER_SEC);
|
||||
|
||||
/* set priorities of all interrupts in the system... */
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOPortA_IRQn, GPIOPORTA_PRIO);
|
||||
|
||||
NVIC_EnableIRQ(GPIOPortA_IRQn);
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QF_onCleanup(void) {
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QF_onIdle(void) { /* entered with interrupts DISABLED, see NOTE01 */
|
||||
|
||||
/* toggle the Green LED on and then off, see NOTE02 */
|
||||
GPIOF->DATA_Bits[LED_GREEN] = LED_GREEN; /* turn the Green LED on */
|
||||
GPIOF->DATA_Bits[LED_GREEN] = 0; /* turn the Green LED off */
|
||||
|
||||
float volatile x = 3.1415926F;
|
||||
x = x + 2.7182818F;
|
||||
|
||||
#ifdef Q_SPY
|
||||
QF_INT_ENABLE();
|
||||
if ((UART0->FR & UART_FR_TXFE) != 0) { /* TX done? */
|
||||
uint16_t fifo = UART_TXFIFO_DEPTH; /* max bytes we can accept */
|
||||
uint8_t const *block;
|
||||
|
||||
QF_INT_DISABLE();
|
||||
block = QS_getBlock(&fifo); /* try to get next block to transmit */
|
||||
QF_INT_ENABLE();
|
||||
|
||||
while (fifo-- != 0) { /* any bytes in the block? */
|
||||
UART0->DR = *block++; /* put into the FIFO */
|
||||
}
|
||||
}
|
||||
#elif defined NDEBUG
|
||||
/* Put the CPU and peripherals to the low-power mode.
|
||||
* you might need to customize the clock management for your application,
|
||||
* see the datasheet for your particular Cortex-M3 MCU.
|
||||
*/
|
||||
asm(" WFI"); /* Wait-For-Interrupt */
|
||||
#endif
|
||||
|
||||
QF_INT_ENABLE(); /* always enable interrupts */
|
||||
}
|
||||
|
||||
/*..........................................................................*/
|
||||
void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
|
||||
(void)file; /* avoid compiler warning */
|
||||
(void)line; /* avoid compiler warning */
|
||||
QF_INT_DISABLE(); /* make sure that all interrupts are disabled */
|
||||
for (;;) { /* NOTE: replace the loop with reset for final version */
|
||||
}
|
||||
}
|
||||
/*..........................................................................*/
|
||||
/* error routine that is called if the CMSIS library encounters an error */
|
||||
void assert_failed(char const *file, int line) {
|
||||
Q_onAssert(file, line);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#ifdef Q_SPY
|
||||
/*..........................................................................*/
|
||||
uint8_t QS_onStartup(void const *arg) {
|
||||
static uint8_t qsBuf[2*1024]; /* buffer for Quantum Spy */
|
||||
uint32_t tmp;
|
||||
QS_initBuf(qsBuf, sizeof(qsBuf));
|
||||
|
||||
/* enable the peripherals used by the UART0 */
|
||||
SYSCTL->RCGC1 |= (1U << 0); /* enable clock to UART0 */
|
||||
SYSCTL->RCGC2 |= (1U << 0); /* enable clock to GPIOA */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
asm(" MOV R0,R0"); /* wait after enabling clocks */
|
||||
|
||||
/* configure UART0 pins for UART operation */
|
||||
tmp = (1U << 0) | (1U << 1);
|
||||
GPIOA->DIR &= ~tmp;
|
||||
GPIOA->AFSEL |= tmp;
|
||||
GPIOA->DR2R |= tmp; /* set 2mA drive, DR4R and DR8R are cleared */
|
||||
GPIOA->SLR &= ~tmp;
|
||||
GPIOA->ODR &= ~tmp;
|
||||
GPIOA->PUR &= ~tmp;
|
||||
GPIOA->PDR &= ~tmp;
|
||||
GPIOA->DEN |= tmp;
|
||||
|
||||
/* configure the UART for the desired baud rate, 8-N-1 operation */
|
||||
tmp = (((ROM_SysCtlClockGet() * 8U) / UART_BAUD_RATE) + 1U) / 2U;
|
||||
UART0->IBRD = tmp / 64U;
|
||||
UART0->FBRD = tmp % 64U;
|
||||
UART0->LCRH = 0x60U; /* configure 8-N-1 operation */
|
||||
UART0->LCRH |= 0x10U;
|
||||
UART0->CTL |= (1U << 0) | (1U << 8) | (1U << 9);
|
||||
|
||||
QS_tickPeriod_ = ROM_SysCtlClockGet() / BSP_TICKS_PER_SEC;
|
||||
QS_tickTime_ = QS_tickPeriod_; /* to start the timestamp at zero */
|
||||
|
||||
/* setup the QS filters... */
|
||||
QS_FILTER_ON(QS_ALL_RECORDS);
|
||||
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_EMPTY);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_ENTRY);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_EXIT);
|
||||
// QS_FILTER_OFF(QS_QEP_STATE_INIT);
|
||||
// QS_FILTER_OFF(QS_QEP_INIT_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_INTERN_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_TRAN);
|
||||
// QS_FILTER_OFF(QS_QEP_IGNORED);
|
||||
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_ADD);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_REMOVE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_SUBSCRIBE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_UNSUBSCRIBE);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_POST_FIFO);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_POST_LIFO);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_GET);
|
||||
// QS_FILTER_OFF(QS_QF_ACTIVE_GET_LAST);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_INIT);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_POST_FIFO);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_POST_LIFO);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_GET);
|
||||
// QS_FILTER_OFF(QS_QF_EQUEUE_GET_LAST);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_INIT);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_GET);
|
||||
// QS_FILTER_OFF(QS_QF_MPOOL_PUT);
|
||||
// QS_FILTER_OFF(QS_QF_PUBLISH);
|
||||
// QS_FILTER_OFF(QS_QF_NEW);
|
||||
// QS_FILTER_OFF(QS_QF_GC_ATTEMPT);
|
||||
// QS_FILTER_OFF(QS_QF_GC);
|
||||
// QS_FILTER_OFF(QS_QF_TICK);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_ARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_AUTO_DISARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_DISARM_ATTEMPT);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_DISARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_REARM);
|
||||
// QS_FILTER_OFF(QS_QF_TIMEEVT_POST);
|
||||
QS_FILTER_OFF(QS_QF_CRIT_ENTRY);
|
||||
QS_FILTER_OFF(QS_QF_CRIT_EXIT);
|
||||
QS_FILTER_OFF(QS_QF_ISR_ENTRY);
|
||||
QS_FILTER_OFF(QS_QF_ISR_EXIT);
|
||||
|
||||
return (uint8_t)1; /* return success */
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QS_onCleanup(void) {
|
||||
}
|
||||
/*..........................................................................*/
|
||||
QSTimeCtr QS_onGetTime(void) { /* invoked with interrupts locked */
|
||||
if ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) { /* not set? */
|
||||
return QS_tickTime_ - (QSTimeCtr)SysTick->VAL;
|
||||
}
|
||||
else { /* the rollover occured, but the SysTick_ISR did not run yet */
|
||||
return QS_tickTime_ + QS_tickPeriod_ - (QSTimeCtr)SysTick->VAL;
|
||||
}
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void QS_onFlush(void) {
|
||||
uint16_t fifo = UART_TXFIFO_DEPTH; /* Tx FIFO depth */
|
||||
uint8_t const *block;
|
||||
QF_INT_DISABLE();
|
||||
while ((block = QS_getBlock(&fifo)) != (uint8_t *)0) {
|
||||
QF_INT_ENABLE();
|
||||
/* busy-wait until TX FIFO empty */
|
||||
while ((UART0->FR & UART_FR_TXFE) == 0) {
|
||||
}
|
||||
|
||||
while (fifo-- != 0) { /* any bytes in the block? */
|
||||
UART0->DR = *block++; /* put into the TX FIFO */
|
||||
}
|
||||
fifo = UART_TXFIFO_DEPTH; /* re-load the Tx FIFO depth */
|
||||
QF_INT_DISABLE();
|
||||
}
|
||||
QF_INT_ENABLE();
|
||||
}
|
||||
#endif /* Q_SPY */
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE01:
|
||||
* The QF_onIdle() callback is called with interrupts disabled, because the
|
||||
* determination of the idle condition might change by any interrupt posting
|
||||
* an event. QF_onIdle() must internally enable interrupts, ideally atomically
|
||||
* with putting the CPU to the power-saving mode.
|
||||
*
|
||||
* NOTE02:
|
||||
* The Green LED is used to visualize the idle loop activity. The brightness
|
||||
* of the LED is proportional to the frequency of invocations of the idle loop.
|
||||
* Please note that the LED is toggled with interrupts disabled, so no
|
||||
* interrupt execution time contributes to the brightness of the Green LED.
|
||||
*/
|
48
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/bsp.h
Normal file
48
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/bsp.h
Normal file
@ -0,0 +1,48 @@
|
||||
/*****************************************************************************
|
||||
* Product: DPP example
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Jul 04, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef bsp_h
|
||||
#define bsp_h
|
||||
|
||||
#define BSP_TICKS_PER_SEC 50U
|
||||
|
||||
void BSP_init(void);
|
||||
void BSP_displayPaused(uint8_t paused);
|
||||
void BSP_displayPhilStat(uint8_t n, char_t const *stat);
|
||||
void BSP_terminate(int16_t result);
|
||||
|
||||
void BSP_randomSeed(uint32_t seed); /* random seed */
|
||||
uint32_t BSP_random(void); /* pseudo-random generator */
|
||||
|
||||
#endif /* bsp_h */
|
@ -0,0 +1,148 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// cmsis_ccs.h - Include file containing #defines necessary to build the CMSIS
|
||||
// dsp libraries using compiler intrinsics for the TMS470 compiler.
|
||||
//
|
||||
// Copyright (c) 2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// Texas Instruments (TI) is supplying this software for use solely and
|
||||
// exclusively on TI's microcontroller products. The software is owned by
|
||||
// TI and/or its suppliers, and is protected under applicable copyright
|
||||
// laws. You may not combine this software with "viral" open-source
|
||||
// software in order to form a larger program.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
|
||||
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
|
||||
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
|
||||
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
|
||||
// DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
//
|
||||
// This is part of revision 8542 of the CMSIS DSP Application Note.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef CMSIS_CCS_H_
|
||||
#define CMSIS_CCS_H_
|
||||
|
||||
|
||||
//
|
||||
// v5e, v6, Cortex-M3, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __CLZ _norm
|
||||
#define __SXTB _sxtb
|
||||
#define __SXTH _sxth
|
||||
#define __UXTB _uxtb
|
||||
#define __UXTH _uxth
|
||||
#define __DSB() asm(" DSB")
|
||||
|
||||
// CCS supports intrinsics to take advantage of the shift operand left/right
|
||||
// before saturation extension of SSAT, but CMSIS does not take advantage
|
||||
// of those, so tell the compiler to use a sat & shift left with a shift
|
||||
// value of 0 whenever it encounters an SSAT
|
||||
#define __SSAT(VAL, BITPOS) \
|
||||
_ssatl(VAL , 0, BITPOS)
|
||||
|
||||
//
|
||||
// Only define M4 based intrinsics if we're not using an M4
|
||||
//
|
||||
#if defined (__TI_TMS470_V7M4__)
|
||||
//
|
||||
// V5E, V6, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __QADD _sadd
|
||||
#define __QDADD _sdadd
|
||||
#define __QDSUB _sdsub
|
||||
#define __SMLABB _smlabb
|
||||
#define __SMLABT _smlabt
|
||||
#define __SMLALBB _smlalbb
|
||||
#define __SMLALBT _smlalbt
|
||||
#define __SMLALTB _smlaltb
|
||||
#define __SMLALTT _smlaltt
|
||||
#define __SMLATB _smlatb
|
||||
#define __SMLATT _smlatt
|
||||
#define __SMLAWB _smlawb
|
||||
#define __SMLAWT _smlawt
|
||||
|
||||
#define __SMULBB _smulbb
|
||||
#define __SMULBT _smulbt
|
||||
#define __SMULTB _smultb
|
||||
#define __SMULTT _smultt
|
||||
#define __SMULWB _smulwb
|
||||
#define __SMULWT _smulwt
|
||||
#define __QSUB _ssub
|
||||
#define __SUBC _subc
|
||||
|
||||
//
|
||||
// v6, Cortex-M4, Cortex-R4, and Cortex-A8 compiler intrinsics
|
||||
//
|
||||
#define __SHASX _shaddsubx
|
||||
#define __SHSAX _shsubaddx
|
||||
#define __PKHBT _pkhbt
|
||||
#define __PKHTB _pkhtb
|
||||
#define __QADD16 _qadd16
|
||||
#define __QADD8 _qadd8
|
||||
#define __QSUB16 _qsub16
|
||||
#define __QSUB8 _qsub8
|
||||
#define __QASX _saddsubx
|
||||
#define __QSAX _qsubaddx
|
||||
#define __SADD16 _sadd16
|
||||
#define __SADD8 _sadd8
|
||||
#define __SASX _saddsubx
|
||||
#define __SEL _sel
|
||||
#define __SHADD16 _shadd16
|
||||
#define __SHADD8 _shadd8
|
||||
#define __SHSUB16 _shsub16
|
||||
#define __SHSUB8 _shsub8
|
||||
#define __SMLAD _smlad
|
||||
#define __SMLADX _smladx
|
||||
#define __SMLALD _smlald
|
||||
#define __SMLALDX _smlaldx
|
||||
#define __SMLSD _smlsd
|
||||
#define __SMLSDX _smlsdx
|
||||
#define __SMLSLD _smlsld
|
||||
#define __SMLSLDX _smlsldx
|
||||
#define __SMMLA _smmla
|
||||
#define __SMMLAR _smmlar
|
||||
#define __SMMLS _smmls
|
||||
#define __SMMLSR _smmlsr
|
||||
#define __SMMUL _smmul
|
||||
#define __SMMULR _smmulr
|
||||
#define __SMUAD _smuad
|
||||
#define __SMUADX _smuadx
|
||||
#define __SMUSD _smusd
|
||||
#define __SMUSDX _smusd
|
||||
#define __SSAT16 _ssat16
|
||||
#define __SSUB16 _ssub16
|
||||
#define __SSUB8 _ssub8
|
||||
#define __SSAX _ssubaddx
|
||||
#define __SXTAB _sxtab
|
||||
#define __SXTAB16 _sxtab16
|
||||
#define __SXTAH _sxtah
|
||||
#define __UMAAL _umaal
|
||||
#define __UADD16 _uadd16
|
||||
#define __UADD8 _uadd8
|
||||
#define __UHADD16 _uhadd16
|
||||
#define __UHADD8 _uhadd8
|
||||
#define __UASX _uaddsubx
|
||||
#define __UHSUB16 _uhsub16
|
||||
#define __UHSUB8 _uhsub8
|
||||
#define __UQADD16 _uqadd16
|
||||
#define __UQADD8 _uqadd8
|
||||
#define __UQASX _uqaddsubx
|
||||
#define __UQSUB16 _uqsub16
|
||||
#define __UQSUB8 _uqsub8
|
||||
#define __UQSAX _uqsubaddx
|
||||
#define __USAD8 _usad8
|
||||
#define __USAT16 _usat16
|
||||
#define __USUB16 _usub16
|
||||
#define __USUB8 _usub8
|
||||
#define __USAX _usubaddx
|
||||
#define __UXTAB _uxtab
|
||||
#define __UXTAB16 _uxtab16
|
||||
#define __UXTAH _uxtah
|
||||
#define __UXTB16 _uxtb16
|
||||
#endif /*__TI_TMS470_V7M4__*/
|
||||
|
||||
#endif /*CMSIS_CCS_H_*/
|
1757
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/cmsis/core_cm4.h
Normal file
1757
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/cmsis/core_cm4.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,649 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cm4_simd.h
|
||||
* @brief CMSIS Cortex-M4 SIMD Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CM4_SIMD_H
|
||||
#define __CORE_CM4_SIMD_H
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Hardware Abstraction Layer
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/* ################### Compiler specific Intrinsics ########################### */
|
||||
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
|
||||
Access to dedicated SIMD instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#define __SADD8 __sadd8
|
||||
#define __QADD8 __qadd8
|
||||
#define __SHADD8 __shadd8
|
||||
#define __UADD8 __uadd8
|
||||
#define __UQADD8 __uqadd8
|
||||
#define __UHADD8 __uhadd8
|
||||
#define __SSUB8 __ssub8
|
||||
#define __QSUB8 __qsub8
|
||||
#define __SHSUB8 __shsub8
|
||||
#define __USUB8 __usub8
|
||||
#define __UQSUB8 __uqsub8
|
||||
#define __UHSUB8 __uhsub8
|
||||
#define __SADD16 __sadd16
|
||||
#define __QADD16 __qadd16
|
||||
#define __SHADD16 __shadd16
|
||||
#define __UADD16 __uadd16
|
||||
#define __UQADD16 __uqadd16
|
||||
#define __UHADD16 __uhadd16
|
||||
#define __SSUB16 __ssub16
|
||||
#define __QSUB16 __qsub16
|
||||
#define __SHSUB16 __shsub16
|
||||
#define __USUB16 __usub16
|
||||
#define __UQSUB16 __uqsub16
|
||||
#define __UHSUB16 __uhsub16
|
||||
#define __SASX __sasx
|
||||
#define __QASX __qasx
|
||||
#define __SHASX __shasx
|
||||
#define __UASX __uasx
|
||||
#define __UQASX __uqasx
|
||||
#define __UHASX __uhasx
|
||||
#define __SSAX __ssax
|
||||
#define __QSAX __qsax
|
||||
#define __SHSAX __shsax
|
||||
#define __USAX __usax
|
||||
#define __UQSAX __uqsax
|
||||
#define __UHSAX __uhsax
|
||||
#define __USAD8 __usad8
|
||||
#define __USADA8 __usada8
|
||||
#define __SSAT16 __ssat16
|
||||
#define __USAT16 __usat16
|
||||
#define __UXTB16 __uxtb16
|
||||
#define __UXTAB16 __uxtab16
|
||||
#define __SXTB16 __sxtb16
|
||||
#define __SXTAB16 __sxtab16
|
||||
#define __SMUAD __smuad
|
||||
#define __SMUADX __smuadx
|
||||
#define __SMLAD __smlad
|
||||
#define __SMLADX __smladx
|
||||
#define __SMLALD __smlald
|
||||
#define __SMLALDX __smlaldx
|
||||
#define __SMUSD __smusd
|
||||
#define __SMUSDX __smusdx
|
||||
#define __SMLSD __smlsd
|
||||
#define __SMLSDX __smlsdx
|
||||
#define __SMLSLD __smlsld
|
||||
#define __SMLSLDX __smlsldx
|
||||
#define __SEL __sel
|
||||
#define __QADD __qadd
|
||||
#define __QSUB __qsub
|
||||
|
||||
#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
|
||||
((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
|
||||
|
||||
#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
|
||||
((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
|
||||
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SSAT16(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
#define __USAT16(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SMLALD(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlald %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
#define __SMLALDX(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __SMLSLD(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
#define __SMLSLDX(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
|
||||
__ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
|
||||
(uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
|
||||
})
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#define __PKHBT(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
|
||||
__ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
#define __PKHTB(ARG1,ARG2,ARG3) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
|
||||
if (ARG3 == 0) \
|
||||
__ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \
|
||||
else \
|
||||
__ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
|
||||
/*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
/* not yet supported */
|
||||
/*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of group CMSIS_SIMD_intrinsics */
|
||||
|
||||
|
||||
#endif /* __CORE_CM4_SIMD_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -0,0 +1,616 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmFunc.h
|
||||
* @brief CMSIS Cortex-M Core Function Access Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2009-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CORE_CMFUNC_H
|
||||
#define __CORE_CMFUNC_H
|
||||
|
||||
|
||||
/* ########################### Core Function Access ########################### */
|
||||
/** \ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
#if (__ARMCC_VERSION < 400677)
|
||||
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
|
||||
#endif
|
||||
|
||||
/* intrinsic void __enable_irq(); */
|
||||
/* intrinsic void __disable_irq(); */
|
||||
|
||||
/** \brief Get Control Register
|
||||
|
||||
This function returns the content of the Control Register.
|
||||
|
||||
\return Control Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
return(__regControl);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Control Register
|
||||
|
||||
This function writes the given value to the Control Register.
|
||||
|
||||
\param [in] control Control Register value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
__regControl = control;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get IPSR Register
|
||||
|
||||
This function returns the content of the IPSR Register.
|
||||
|
||||
\return IPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_IPSR(void)
|
||||
{
|
||||
register uint32_t __regIPSR __ASM("ipsr");
|
||||
return(__regIPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get APSR Register
|
||||
|
||||
This function returns the content of the APSR Register.
|
||||
|
||||
\return APSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
register uint32_t __regAPSR __ASM("apsr");
|
||||
return(__regAPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get xPSR Register
|
||||
|
||||
This function returns the content of the xPSR Register.
|
||||
|
||||
\return xPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_xPSR(void)
|
||||
{
|
||||
register uint32_t __regXPSR __ASM("xpsr");
|
||||
return(__regXPSR);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Process Stack Pointer
|
||||
|
||||
This function returns the current value of the Process Stack Pointer (PSP).
|
||||
|
||||
\return PSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PSP(void)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
return(__regProcessStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Process Stack Pointer
|
||||
|
||||
This function assigns the given value to the Process Stack Pointer (PSP).
|
||||
|
||||
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
__regProcessStackPointer = topOfProcStack;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Main Stack Pointer
|
||||
|
||||
This function returns the current value of the Main Stack Pointer (MSP).
|
||||
|
||||
\return MSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_MSP(void)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
return(__regMainStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Main Stack Pointer
|
||||
|
||||
This function assigns the given value to the Main Stack Pointer (MSP).
|
||||
|
||||
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
__regMainStackPointer = topOfMainStack;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Priority Mask
|
||||
|
||||
This function returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
return(__regPriMask);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Priority Mask
|
||||
|
||||
This function assigns the given value to the Priority Mask Register.
|
||||
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
__regPriMask = (priMask);
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Enable FIQ
|
||||
|
||||
This function enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __enable_fault_irq __enable_fiq
|
||||
|
||||
|
||||
/** \brief Disable FIQ
|
||||
|
||||
This function disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __disable_fault_irq __disable_fiq
|
||||
|
||||
|
||||
/** \brief Get Base Priority
|
||||
|
||||
This function returns the current value of the Base Priority register.
|
||||
|
||||
\return Base Priority register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
return(__regBasePri);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Base Priority
|
||||
|
||||
This function assigns the given value to the Base Priority register.
|
||||
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
__regBasePri = (basePri & 0xff);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Fault Mask
|
||||
|
||||
This function returns the current value of the Fault Mask register.
|
||||
|
||||
\return Fault Mask register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
return(__regFaultMask);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Fault Mask
|
||||
|
||||
This function assigns the given value to the Fault Mask register.
|
||||
|
||||
\param [in] faultMask Fault Mask value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
__regFaultMask = (faultMask & (uint32_t)1);
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
#if (__CORTEX_M == 0x04)
|
||||
|
||||
/** \brief Get FPSCR
|
||||
|
||||
This function returns the current value of the Floating Point Status/Control register.
|
||||
|
||||
\return Floating Point Status/Control register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
return(__regfpscr);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set FPSCR
|
||||
|
||||
This function assigns the given value to the Floating Point Status/Control register.
|
||||
|
||||
\param [in] fpscr Floating Point Status/Control value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
__regfpscr = (fpscr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M == 0x04) */
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/** \brief Enable IRQ Interrupts
|
||||
|
||||
This function enables IRQ interrupts by clearing the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsie i");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Disable IRQ Interrupts
|
||||
|
||||
This function disables IRQ interrupts by setting the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsid i");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Control Register
|
||||
|
||||
This function returns the content of the Control Register.
|
||||
|
||||
\return Control Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, control" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Control Register
|
||||
|
||||
This function writes the given value to the Control Register.
|
||||
|
||||
\param [in] control Control Register value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
__ASM volatile ("MSR control, %0" : : "r" (control) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get IPSR Register
|
||||
|
||||
This function returns the content of the IPSR Register.
|
||||
|
||||
\return IPSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, ipsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get APSR Register
|
||||
|
||||
This function returns the content of the APSR Register.
|
||||
|
||||
\return APSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, apsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get xPSR Register
|
||||
|
||||
This function returns the content of the xPSR Register.
|
||||
|
||||
\return xPSR Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, xpsr" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Process Stack Pointer
|
||||
|
||||
This function returns the current value of the Process Stack Pointer (PSP).
|
||||
|
||||
\return PSP Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
|
||||
{
|
||||
register uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, psp\n" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Process Stack Pointer
|
||||
|
||||
This function assigns the given value to the Process Stack Pointer (PSP).
|
||||
|
||||
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||
{
|
||||
__ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Main Stack Pointer
|
||||
|
||||
This function returns the current value of the Main Stack Pointer (MSP).
|
||||
|
||||
\return MSP Register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
|
||||
{
|
||||
register uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, msp\n" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Main Stack Pointer
|
||||
|
||||
This function assigns the given value to the Main Stack Pointer (MSP).
|
||||
|
||||
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||
{
|
||||
__ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Priority Mask
|
||||
|
||||
This function returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, primask" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Priority Mask
|
||||
|
||||
This function assigns the given value to the Priority Mask Register.
|
||||
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
__ASM volatile ("MSR primask, %0" : : "r" (priMask) );
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Enable FIQ
|
||||
|
||||
This function enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsie f");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Disable FIQ
|
||||
|
||||
This function disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void)
|
||||
{
|
||||
__ASM volatile ("cpsid f");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Base Priority
|
||||
|
||||
This function returns the current value of the Base Priority register.
|
||||
|
||||
\return Base Priority register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, basepri_max" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Base Priority
|
||||
|
||||
This function assigns the given value to the Base Priority register.
|
||||
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value)
|
||||
{
|
||||
__ASM volatile ("MSR basepri, %0" : : "r" (value) );
|
||||
}
|
||||
|
||||
|
||||
/** \brief Get Fault Mask
|
||||
|
||||
This function returns the current value of the Fault Mask register.
|
||||
|
||||
\return Fault Mask register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("MRS %0, faultmask" : "=r" (result) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set Fault Mask
|
||||
|
||||
This function assigns the given value to the Fault Mask register.
|
||||
|
||||
\param [in] faultMask Fault Mask value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||
{
|
||||
__ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) );
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
#if (__CORTEX_M == 0x04)
|
||||
|
||||
/** \brief Get FPSCR
|
||||
|
||||
This function returns the current value of the Floating Point Status/Control register.
|
||||
|
||||
\return Floating Point Status/Control register value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
|
||||
return(result);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** \brief Set FPSCR
|
||||
|
||||
This function assigns the given value to the Floating Point Status/Control register.
|
||||
|
||||
\param [in] fpscr Floating Point Status/Control value to set
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||
{
|
||||
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||
__ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M == 0x04) */
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all instrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of CMSIS_Core_RegAccFunctions */
|
||||
|
||||
|
||||
#endif /* __CORE_CMFUNC_H */
|
@ -0,0 +1,618 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmInstr.h
|
||||
* @brief CMSIS Cortex-M Core Instruction Access Header File
|
||||
* @version V3.01
|
||||
* @date 06. March 2012
|
||||
*
|
||||
* @note
|
||||
* Copyright (C) 2009-2012 ARM Limited. All rights reserved.
|
||||
*
|
||||
* @par
|
||||
* ARM Limited (ARM) is supplying this software for use with Cortex-M
|
||||
* processor based microcontrollers. This file can be freely distributed
|
||||
* within development tools that are supporting such ARM based processors.
|
||||
*
|
||||
* @par
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CORE_CMINSTR_H
|
||||
#define __CORE_CMINSTR_H
|
||||
|
||||
|
||||
/* ########################## Core Instruction Access ######################### */
|
||||
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
|
||||
Access to dedicated instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
|
||||
/* ARM armcc specific functions */
|
||||
|
||||
#if (__ARMCC_VERSION < 400677)
|
||||
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
|
||||
#endif
|
||||
|
||||
|
||||
/** \brief No Operation
|
||||
|
||||
No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||
*/
|
||||
#define __NOP __nop
|
||||
|
||||
|
||||
/** \brief Wait For Interrupt
|
||||
|
||||
Wait For Interrupt is a hint instruction that suspends execution
|
||||
until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFI __wfi
|
||||
|
||||
|
||||
/** \brief Wait For Event
|
||||
|
||||
Wait For Event is a hint instruction that permits the processor to enter
|
||||
a low-power state until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFE __wfe
|
||||
|
||||
|
||||
/** \brief Send Event
|
||||
|
||||
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||
*/
|
||||
#define __SEV __sev
|
||||
|
||||
|
||||
/** \brief Instruction Synchronization Barrier
|
||||
|
||||
Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
so that all instructions following the ISB are fetched from cache or
|
||||
memory, after the instruction has been completed.
|
||||
*/
|
||||
#define __ISB() __isb(0xF)
|
||||
|
||||
|
||||
/** \brief Data Synchronization Barrier
|
||||
|
||||
This function acts as a special kind of Data Memory Barrier.
|
||||
It completes when all explicit memory accesses before this instruction complete.
|
||||
*/
|
||||
#define __DSB() __dsb(0xF)
|
||||
|
||||
|
||||
/** \brief Data Memory Barrier
|
||||
|
||||
This function ensures the apparent order of the explicit memory operations before
|
||||
and after the instruction, without ensuring their completion.
|
||||
*/
|
||||
#define __DMB() __dmb(0xF)
|
||||
|
||||
|
||||
/** \brief Reverse byte order (32 bit)
|
||||
|
||||
This function reverses the byte order in integer value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#define __REV __rev
|
||||
|
||||
|
||||
/** \brief Reverse byte order (16 bit)
|
||||
|
||||
This function reverses the byte order in two unsigned short values.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
|
||||
{
|
||||
rev16 r0, r0
|
||||
bx lr
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order in signed short value
|
||||
|
||||
This function reverses the byte order in a signed short value with sign extension to integer.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
|
||||
{
|
||||
revsh r0, r0
|
||||
bx lr
|
||||
}
|
||||
|
||||
|
||||
/** \brief Rotate Right in unsigned value (32 bit)
|
||||
|
||||
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||
|
||||
\param [in] value Value to rotate
|
||||
\param [in] value Number of Bits to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
#define __ROR __ror
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Reverse bit order of value
|
||||
|
||||
This function reverses the bit order of the given value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#define __RBIT __rbit
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 8 bit value.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 16 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 32 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
|
||||
|
||||
|
||||
/** \brief STR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive STR command for 8 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXB(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief STR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive STR command for 16 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXH(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief STR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive STR command for 32 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#define __STREXW(value, ptr) __strex(value, ptr)
|
||||
|
||||
|
||||
/** \brief Remove the exclusive lock
|
||||
|
||||
This function removes the exclusive lock which is created by LDREX.
|
||||
|
||||
*/
|
||||
#define __CLREX __clrex
|
||||
|
||||
|
||||
/** \brief Signed Saturate
|
||||
|
||||
This function saturates a signed value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __SSAT __ssat
|
||||
|
||||
|
||||
/** \brief Unsigned Saturate
|
||||
|
||||
This function saturates an unsigned value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __USAT __usat
|
||||
|
||||
|
||||
/** \brief Count leading zeros
|
||||
|
||||
This function counts the number of leading zeros of a data value.
|
||||
|
||||
\param [in] value Value to count the leading zeros
|
||||
\return number of leading zeros in value
|
||||
*/
|
||||
#define __CLZ __clz
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
|
||||
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
|
||||
/* IAR iccarm specific functions */
|
||||
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
|
||||
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
|
||||
/* TI CCS specific functions */
|
||||
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
|
||||
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
|
||||
/* GNU gcc specific functions */
|
||||
|
||||
/** \brief No Operation
|
||||
|
||||
No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void)
|
||||
{
|
||||
__ASM volatile ("nop");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Wait For Interrupt
|
||||
|
||||
Wait For Interrupt is a hint instruction that suspends execution
|
||||
until one of a number of events occurs.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void)
|
||||
{
|
||||
__ASM volatile ("wfi");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Wait For Event
|
||||
|
||||
Wait For Event is a hint instruction that permits the processor to enter
|
||||
a low-power state until one of a number of events occurs.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void)
|
||||
{
|
||||
__ASM volatile ("wfe");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Send Event
|
||||
|
||||
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void)
|
||||
{
|
||||
__ASM volatile ("sev");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Instruction Synchronization Barrier
|
||||
|
||||
Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
so that all instructions following the ISB are fetched from cache or
|
||||
memory, after the instruction has been completed.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void)
|
||||
{
|
||||
__ASM volatile ("isb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Data Synchronization Barrier
|
||||
|
||||
This function acts as a special kind of Data Memory Barrier.
|
||||
It completes when all explicit memory accesses before this instruction complete.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
|
||||
{
|
||||
__ASM volatile ("dsb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Data Memory Barrier
|
||||
|
||||
This function ensures the apparent order of the explicit memory operations before
|
||||
and after the instruction, without ensuring their completion.
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void)
|
||||
{
|
||||
__ASM volatile ("dmb");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order (32 bit)
|
||||
|
||||
This function reverses the byte order in integer value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rev %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order (16 bit)
|
||||
|
||||
This function reverses the byte order in two unsigned short values.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Reverse byte order in signed short value
|
||||
|
||||
This function reverses the byte order in a signed short value with sign extension to integer.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("revsh %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Rotate Right in unsigned value (32 bit)
|
||||
|
||||
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||
|
||||
\param [in] value Value to rotate
|
||||
\param [in] value Number of Bits to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
|
||||
__ASM volatile ("ror %0, %0, %1" : "+r" (op1) : "r" (op2) );
|
||||
return(op1);
|
||||
}
|
||||
|
||||
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
/** \brief Reverse bit order of value
|
||||
|
||||
This function reverses the bit order of the given value.
|
||||
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 8 bit value.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr)
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
__ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 16 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr)
|
||||
{
|
||||
uint16_t result;
|
||||
|
||||
__ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief LDR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive LDR command for 32 bit values.
|
||||
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("ldrex %0, [%1]" : "=r" (result) : "r" (addr) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (8 bit)
|
||||
|
||||
This function performs a exclusive STR command for 8 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (16 bit)
|
||||
|
||||
This function performs a exclusive STR command for 16 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief STR Exclusive (32 bit)
|
||||
|
||||
This function performs a exclusive STR command for 32 bit values.
|
||||
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__ASM volatile ("strex %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
/** \brief Remove the exclusive lock
|
||||
|
||||
This function removes the exclusive lock which is created by LDREX.
|
||||
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void)
|
||||
{
|
||||
__ASM volatile ("clrex");
|
||||
}
|
||||
|
||||
|
||||
/** \brief Signed Saturate
|
||||
|
||||
This function saturates a signed value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __SSAT(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
|
||||
/** \brief Unsigned Saturate
|
||||
|
||||
This function saturates an unsigned value.
|
||||
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __USAT(ARG1,ARG2) \
|
||||
({ \
|
||||
uint32_t __RES, __ARG1 = (ARG1); \
|
||||
__ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
|
||||
__RES; \
|
||||
})
|
||||
|
||||
|
||||
/** \brief Count leading zeros
|
||||
|
||||
This function counts the number of leading zeros of a data value.
|
||||
|
||||
\param [in] value Value to count the leading zeros
|
||||
\return number of leading zeros in value
|
||||
*/
|
||||
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value)
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
__ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) );
|
||||
return(result);
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
|
||||
|
||||
|
||||
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
|
||||
/* TASKING carm specific functions */
|
||||
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
||||
|
||||
#endif /* __CORE_CMINSTR_H */
|
File diff suppressed because it is too large
Load Diff
47
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/dpp.h
Normal file
47
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/dpp.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./dpp.h
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
|
||||
DONE_SIG, /* published by Philosopher when done eating */
|
||||
PAUSE_SIG, /* published by BSP to pause the application */
|
||||
TERMINATE_SIG, /* published by BSP to terminate the application */
|
||||
MAX_PUB_SIG, /* the last published signal */
|
||||
|
||||
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
|
||||
MAX_SIG /* the last signal */
|
||||
};
|
||||
|
||||
/* @(/1/0) .................................................................*/
|
||||
typedef struct TableEvtTag {
|
||||
/* protected: */
|
||||
QEvt super;
|
||||
|
||||
/* public: */
|
||||
uint8_t philoNum;
|
||||
} TableEvt;
|
||||
|
||||
|
||||
/* number of philosophers */
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
/* @(/2/4) .................................................................*/
|
||||
void Philo_ctor(void);
|
||||
|
||||
/* @(/2/5) .................................................................*/
|
||||
void Table_ctor(void);
|
||||
|
||||
|
||||
extern QActive * const AO_Philo[N_PHILO];
|
||||
extern QActive * const AO_Table;
|
||||
|
||||
#endif /* dpp_h */
|
428
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/dpp.qm
Normal file
428
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/dpp.qm
Normal file
@ -0,0 +1,428 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<model version="2.2.00">
|
||||
<documentation>Dining Philosopher Problem example</documentation>
|
||||
<framework name="qpc"/>
|
||||
<package name="Events" stereotype="0x01">
|
||||
<class name="TableEvt" superclass="qpc::QEvt">
|
||||
<attribute name="philoNum" type="uint8_t" visibility="0x00" properties="0x00"/>
|
||||
</class>
|
||||
</package>
|
||||
<package name="AOs" stereotype="0x02">
|
||||
<class name="Philo" superclass="qpc::QActive">
|
||||
<attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
|
||||
<statechart>
|
||||
<initial target="../1">
|
||||
<action>static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
if (registered == (uint8_t)0) {
|
||||
registered = (uint8_t)1;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo_initial);
|
||||
QS_FUN_DICTIONARY(&Philo_thinking);
|
||||
QS_FUN_DICTIONARY(&Philo_hungry);
|
||||
QS_FUN_DICTIONARY(&Philo_eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
|
||||
|
||||
QActive_subscribe(&me->super, EAT_SIG);</action>
|
||||
<initial_glyph conn="2,3,5,1,20,5,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="thinking">
|
||||
<entry>QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);</entry>
|
||||
<tran trig="TIMEOUT" target="../../2">
|
||||
<tran_glyph conn="2,12,3,1,20,13,-3">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,17,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,5,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="hungry">
|
||||
<entry>TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QACTIVE_POST(AO_Table, &pe->super, me);</entry>
|
||||
<tran trig="EAT">
|
||||
<choice target="../../../3">
|
||||
<guard>Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)</guard>
|
||||
<choice_glyph conn="15,30,5,1,7,13,-3">
|
||||
<action box="1,0,19,4"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="2,30,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,36,3,-1,14">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,23,17,16">
|
||||
<entry box="1,2,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="eating">
|
||||
<entry>QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);</entry>
|
||||
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QF_PUBLISH(&pe->super, me);</exit>
|
||||
<tran trig="TIMEOUT" target="../../1">
|
||||
<tran_glyph conn="2,51,3,1,22,-41,-5">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT, DONE">
|
||||
<action>/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));</action>
|
||||
<tran_glyph conn="2,55,3,-1,13">
|
||||
<action box="0,-2,14,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="2,41,17,18">
|
||||
<entry box="1,2,5,2"/>
|
||||
<exit box="1,4,5,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_diagram size="37,61"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<class name="Table" superclass="qpc::QActive">
|
||||
<attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||||
<attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||||
<statechart>
|
||||
<initial target="../1/2">
|
||||
<action>uint8_t n;
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QHsm_top);
|
||||
QS_FUN_DICTIONARY(&Table_initial);
|
||||
QS_FUN_DICTIONARY(&Table_serving);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TERMINATE_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
|
||||
|
||||
QActive_subscribe(&me->super, DONE_SIG);
|
||||
QActive_subscribe(&me->super, PAUSE_SIG);
|
||||
QActive_subscribe(&me->super, TERMINATE_SIG);
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
}</action>
|
||||
<initial_glyph conn="3,3,5,1,44,18,-9">
|
||||
<action box="0,-2,6,2"/>
|
||||
</initial_glyph>
|
||||
</initial>
|
||||
<state name="active">
|
||||
<tran trig="TERMINATE">
|
||||
<action>BSP_terminate(0);</action>
|
||||
<tran_glyph conn="2,11,3,-1,14">
|
||||
<action box="0,-2,11,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="2,15,3,-1,14">
|
||||
<action box="0,-2,10,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state name="serving">
|
||||
<entry brief="give pending permitions to eat">uint8_t n;
|
||||
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
|
||||
if ((me->isHungry[n] != 0U)
|
||||
&& (me->fork[LEFT(n)] == FREE)
|
||||
&& (me->fork[n] == FREE))
|
||||
{
|
||||
TableEvt *te;
|
||||
|
||||
me->fork[LEFT(n)] = USED;
|
||||
me->fork[n] = USED;
|
||||
te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QF_PUBLISH(&te->super, me);
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
}
|
||||
}</entry>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
m = LEFT(n);</action>
|
||||
<choice>
|
||||
<guard brief="both free">(me->fork[m] == FREE) && (me->fork[n] == FREE)</guard>
|
||||
<action>TableEvt *pe;
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(n, "eating ");</action>
|
||||
<choice_glyph conn="19,26,5,-1,10">
|
||||
<action box="1,0,10,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<choice>
|
||||
<guard>else</guard>
|
||||
<action>me->isHungry[n] = 1U;</action>
|
||||
<choice_glyph conn="19,26,4,-1,5,10">
|
||||
<action box="1,5,6,2"/>
|
||||
</choice_glyph>
|
||||
</choice>
|
||||
<tran_glyph conn="4,26,3,-1,15">
|
||||
<action box="0,-2,8,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n, m;
|
||||
TableEvt *pe;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
m = RIGHT(n); /* check the right neighbor */
|
||||
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[m] == FREE)) {
|
||||
me->fork[n] = USED;
|
||||
me->fork[m] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
m = LEFT(n); /* check the left neighbor */
|
||||
n = LEFT(m); /* left fork of the left neighbor */
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[n] == FREE)) {
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}</action>
|
||||
<tran_glyph conn="4,34,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="EAT">
|
||||
<action>Q_ERROR();</action>
|
||||
<tran_glyph conn="4,37,3,-1,15">
|
||||
<action box="0,-2,12,4"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="PAUSE" target="../../3">
|
||||
<tran_glyph conn="4,41,3,1,37,6,-3">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,19,34,24">
|
||||
<entry box="1,2,27,2"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state name="paused">
|
||||
<entry>BSP_displayPaused(1U);</entry>
|
||||
<exit>BSP_displayPaused(0U);</exit>
|
||||
<tran trig="PAUSE" target="../../2">
|
||||
<tran_glyph conn="4,57,3,1,39,-20,-5">
|
||||
<action box="0,-2,7,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="HUNGRY">
|
||||
<action>uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* philo ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
me->isHungry[n] = 1U;
|
||||
BSP_displayPhilStat(n, "hungry ");</action>
|
||||
<tran_glyph conn="4,60,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<tran trig="DONE">
|
||||
<action>uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;</action>
|
||||
<tran_glyph conn="4,63,3,-1,15">
|
||||
<action box="0,-2,6,2"/>
|
||||
</tran_glyph>
|
||||
</tran>
|
||||
<state_glyph node="4,45,34,20">
|
||||
<entry box="1,2,18,4"/>
|
||||
<exit box="1,6,18,4"/>
|
||||
</state_glyph>
|
||||
</state>
|
||||
<state_glyph node="2,5,43,62"/>
|
||||
</state>
|
||||
<state_diagram size="49,69"/>
|
||||
</statechart>
|
||||
</class>
|
||||
<attribute name="AO_Philo[N_PHILO]" type="QActive * const" visibility="0x00" properties="0x00"/>
|
||||
<attribute name="AO_Table" type="QActive * const" visibility="0x00" properties="0x00"/>
|
||||
<operation name="Philo_ctor" type="void" visibility="0x00" properties="0x00">
|
||||
<code>uint8_t n;
|
||||
Philo *me;
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me = &l_philo[n];
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
|
||||
QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
|
||||
}</code>
|
||||
</operation>
|
||||
<operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
|
||||
<code>uint8_t n;
|
||||
Table *me = &l_table;
|
||||
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
}</code>
|
||||
</operation>
|
||||
</package>
|
||||
<directory name=".">
|
||||
<file name="dpp.h">
|
||||
<text>#ifndef dpp_h
|
||||
#define dpp_h
|
||||
|
||||
enum DPPSignals {
|
||||
EAT_SIG = Q_USER_SIG, /* published by Table to let a philosopher eat */
|
||||
DONE_SIG, /* published by Philosopher when done eating */
|
||||
PAUSE_SIG, /* published by BSP to pause the application */
|
||||
TERMINATE_SIG, /* published by BSP to terminate the application */
|
||||
MAX_PUB_SIG, /* the last published signal */
|
||||
|
||||
HUNGRY_SIG, /* posted direclty to Table from hungry Philo */
|
||||
MAX_SIG /* the last signal */
|
||||
};
|
||||
|
||||
$declare(Events::TableEvt)
|
||||
|
||||
/* number of philosophers */
|
||||
#define N_PHILO ((uint8_t)5)
|
||||
|
||||
$declare(AOs::Philo_ctor)
|
||||
$declare(AOs::Table_ctor)
|
||||
|
||||
$declare(AOs::AO_Philo[N_PHILO])
|
||||
$declare(AOs::AO_Table)
|
||||
|
||||
#endif /* dpp_h */</text>
|
||||
</file>
|
||||
<file name="philo.c">
|
||||
<text>#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
$declare(AOs::Philo)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Philo l_philo[N_PHILO]; /* storage for all Philos */
|
||||
|
||||
#define THINK_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
|
||||
#define EAT_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
|
||||
|
||||
/* helper macro to provide the ID of Philo "me_" */
|
||||
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
|
||||
|
||||
enum InternalSignals { /* internal signals */
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
/* Global objects ----------------------------------------------------------*/
|
||||
QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
|
||||
&l_philo[0].super,
|
||||
&l_philo[1].super,
|
||||
&l_philo[2].super,
|
||||
&l_philo[3].super,
|
||||
&l_philo[4].super
|
||||
};
|
||||
|
||||
/* Philo definition --------------------------------------------------------*/
|
||||
$define(AOs::Philo_ctor)
|
||||
$define(AOs::Philo)</text>
|
||||
</file>
|
||||
<file name="table.c">
|
||||
<text>#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
$declare(AOs::Table)
|
||||
|
||||
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
|
||||
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
|
||||
#define FREE ((uint8_t)0)
|
||||
#define USED ((uint8_t)1)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Table l_table; /* the single instance of the Table active object */
|
||||
|
||||
/* Global-scope objects ----------------------------------------------------*/
|
||||
QActive * const AO_Table = &l_table.super; /* "opaque" AO pointer */
|
||||
|
||||
/*..........................................................................*/
|
||||
$define(AOs::Table_ctor)
|
||||
$define(AOs::Table)</text>
|
||||
</file>
|
||||
</directory>
|
||||
</model>
|
184
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/gpio.h
Normal file
184
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/gpio.h
Normal file
@ -0,0 +1,184 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// gpio.h - Defines and Macros for GPIO API.
|
||||
//
|
||||
// Copyright (c) 2005-2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This is part of revision 9453 of the Stellaris Peripheral Driver Library.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef __GPIO_H__
|
||||
#define __GPIO_H__
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// If building with a C++ compiler, make all of the definitions in this header
|
||||
// have a C binding.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following values define the bit field for the ucPins argument to several
|
||||
// of the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_PIN_0 0x00000001 // GPIO pin 0
|
||||
#define GPIO_PIN_1 0x00000002 // GPIO pin 1
|
||||
#define GPIO_PIN_2 0x00000004 // GPIO pin 2
|
||||
#define GPIO_PIN_3 0x00000008 // GPIO pin 3
|
||||
#define GPIO_PIN_4 0x00000010 // GPIO pin 4
|
||||
#define GPIO_PIN_5 0x00000020 // GPIO pin 5
|
||||
#define GPIO_PIN_6 0x00000040 // GPIO pin 6
|
||||
#define GPIO_PIN_7 0x00000080 // GPIO pin 7
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIODirModeSet as the ulPinIO parameter, and
|
||||
// returned from GPIODirModeGet.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_DIR_MODE_IN 0x00000000 // Pin is a GPIO input
|
||||
#define GPIO_DIR_MODE_OUT 0x00000001 // Pin is a GPIO output
|
||||
#define GPIO_DIR_MODE_HW 0x00000002 // Pin is a peripheral function
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOIntTypeSet as the ulIntType parameter, and
|
||||
// returned from GPIOIntTypeGet.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_FALLING_EDGE 0x00000000 // Interrupt on falling edge
|
||||
#define GPIO_RISING_EDGE 0x00000004 // Interrupt on rising edge
|
||||
#define GPIO_BOTH_EDGES 0x00000001 // Interrupt on both edges
|
||||
#define GPIO_LOW_LEVEL 0x00000002 // Interrupt on low level
|
||||
#define GPIO_HIGH_LEVEL 0x00000007 // Interrupt on high level
|
||||
#define GPIO_DISCRETE_INT 0x00010000 // Interrupt for individual pins
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOPadConfigSet as the ulStrength parameter,
|
||||
// and returned by GPIOPadConfigGet in the *pulStrength parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_STRENGTH_2MA 0x00000001 // 2mA drive strength
|
||||
#define GPIO_STRENGTH_4MA 0x00000002 // 4mA drive strength
|
||||
#define GPIO_STRENGTH_8MA 0x00000004 // 8mA drive strength
|
||||
#define GPIO_STRENGTH_8MA_SC 0x0000000C // 8mA drive with slew rate control
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Values that can be passed to GPIOPadConfigSet as the ulPadType parameter,
|
||||
// and returned by GPIOPadConfigGet in the *pulPadType parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define GPIO_PIN_TYPE_STD 0x00000008 // Push-pull
|
||||
#define GPIO_PIN_TYPE_STD_WPU 0x0000000A // Push-pull with weak pull-up
|
||||
#define GPIO_PIN_TYPE_STD_WPD 0x0000000C // Push-pull with weak pull-down
|
||||
#define GPIO_PIN_TYPE_OD 0x00000009 // Open-drain
|
||||
#define GPIO_PIN_TYPE_OD_WPU 0x0000000B // Open-drain with weak pull-up
|
||||
#define GPIO_PIN_TYPE_OD_WPD 0x0000000D // Open-drain with weak pull-down
|
||||
#define GPIO_PIN_TYPE_ANALOG 0x00000000 // Analog comparator
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Prototypes for the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulPinIO);
|
||||
extern unsigned long GPIODirModeGet(unsigned long ulPort, unsigned char ucPin);
|
||||
extern void GPIOIntTypeSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulIntType);
|
||||
extern unsigned long GPIOIntTypeGet(unsigned long ulPort, unsigned char ucPin);
|
||||
extern void GPIOPadConfigSet(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned long ulStrength,
|
||||
unsigned long ulPadType);
|
||||
extern void GPIOPadConfigGet(unsigned long ulPort, unsigned char ucPin,
|
||||
unsigned long *pulStrength,
|
||||
unsigned long *pulPadType);
|
||||
extern void GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern long GPIOPinIntStatus(unsigned long ulPort, tBoolean bMasked);
|
||||
extern void GPIOPinIntClear(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPortIntRegister(unsigned long ulPort,
|
||||
void (*pfnIntHandler)(void));
|
||||
extern void GPIOPortIntUnregister(unsigned long ulPort);
|
||||
extern long GPIOPinRead(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins,
|
||||
unsigned char ucVal);
|
||||
extern void GPIOPinConfigure(unsigned long ulPinConfig);
|
||||
extern void GPIOPinTypeADC(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeCAN(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeComparator(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEPI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEthernetLED(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeEthernetMII(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeFan(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOInput(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeGPIOOutputOD(unsigned long ulPort,
|
||||
unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2C(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2CSCL(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeLPC(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePECIRx(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePECITx(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypePWM(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeQEI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeTimer(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUART(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUSBAnalog(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOPinTypeUSBDigital(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIODMATriggerEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIODMATriggerDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOADCTriggerEnable(unsigned long ulPort, unsigned char ucPins);
|
||||
extern void GPIOADCTriggerDisable(unsigned long ulPort, unsigned char ucPins);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Mark the end of the C bindings section for C++ compilers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __GPIO_H__
|
@ -0,0 +1,44 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Default Linker Command file for the Texas Instruments LM4F111H5QR
|
||||
*
|
||||
* This is part of revision 9385 of the Stellaris Peripheral Driver Library.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
--retain=g_pfnVectors
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (RX) : origin = 0x00000000, length = 0x00040000
|
||||
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
|
||||
}
|
||||
|
||||
/* The following command line options are set as part of the CCS project. */
|
||||
/* If you are building using the command line, or for some reason want to */
|
||||
/* define them here, you can uncomment and modify these lines as needed. */
|
||||
/* If you are using CCS for building, it is probably better to make any such */
|
||||
/* modifications in your CCS project and leave this file alone. */
|
||||
/* */
|
||||
/* --heap_size=0 */
|
||||
/* --stack_size=256 */
|
||||
/* --library=rtsv7M4_T_le_eabi.lib */
|
||||
|
||||
/* Section allocation in memory */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.intvecs: > 0x00000000
|
||||
.text : > FLASH
|
||||
.const : > FLASH
|
||||
.cinit : > FLASH
|
||||
.pinit : > FLASH
|
||||
|
||||
.vtable : > 0x20000000
|
||||
.data : > SRAM
|
||||
.bss : > SRAM
|
||||
.sysmem : > SRAM
|
||||
.stack : > SRAM
|
||||
}
|
||||
|
||||
__STACK_TOP = __stack + 256;
|
81
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/main.c
Normal file
81
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/main.c
Normal file
@ -0,0 +1,81 @@
|
||||
/*****************************************************************************
|
||||
* Product: DPP example
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Jul 04, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
/* Local-scope objects -----------------------------------------------------*/
|
||||
static QEvt const *l_tableQueueSto[N_PHILO];
|
||||
static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
|
||||
static QSubscrList l_subscrSto[MAX_PUB_SIG];
|
||||
|
||||
/* storage for event pools... */
|
||||
static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO]; /* small pool */
|
||||
|
||||
/*..........................................................................*/
|
||||
int main(void) {
|
||||
uint8_t n;
|
||||
|
||||
Philo_ctor(); /* instantiate all Philosopher active objects */
|
||||
Table_ctor(); /* instantiate the Table active object */
|
||||
|
||||
QF_init(); /* initialize the framework and the underlying RT kernel */
|
||||
BSP_init(); /* initialize the BSP */
|
||||
|
||||
/* object dictionaries... */
|
||||
QS_OBJ_DICTIONARY(l_smlPoolSto);
|
||||
QS_OBJ_DICTIONARY(l_tableQueueSto);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
|
||||
QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
|
||||
|
||||
QF_psInit(l_subscrSto, Q_DIM(l_subscrSto)); /* init publish-subscribe */
|
||||
|
||||
/* initialize event pools... */
|
||||
QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
|
||||
|
||||
for (n = 0; n < N_PHILO; ++n) { /* start the active objects... */
|
||||
QActive_start(AO_Philo[n], (uint8_t)(n + 1),
|
||||
l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
|
||||
(void *)0, 0U, (QEvt *)0);
|
||||
}
|
||||
QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
|
||||
l_tableQueueSto, Q_DIM(l_tableQueueSto),
|
||||
(void *)0, 0U, (QEvt *)0);
|
||||
|
||||
return QF_run(); /* run the QF application */
|
||||
}
|
204
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/philo.c
Normal file
204
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/philo.c
Normal file
@ -0,0 +1,204 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./philo.c
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
/* @(/2/0) .................................................................*/
|
||||
typedef struct PhiloTag {
|
||||
/* protected: */
|
||||
QActive super;
|
||||
|
||||
/* private: */
|
||||
QTimeEvt timeEvt;
|
||||
} Philo;
|
||||
|
||||
/* protected: */
|
||||
static QState Philo_initial(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_thinking(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_hungry(Philo * const me, QEvt const * const e);
|
||||
static QState Philo_eating(Philo * const me, QEvt const * const e);
|
||||
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Philo l_philo[N_PHILO]; /* storage for all Philos */
|
||||
|
||||
#define THINK_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
|
||||
#define EAT_TIME \
|
||||
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + BSP_TICKS_PER_SEC)
|
||||
|
||||
/* helper macro to provide the ID of Philo "me_" */
|
||||
#define PHILO_ID(me_) ((uint8_t)((me_) - l_philo))
|
||||
|
||||
enum InternalSignals { /* internal signals */
|
||||
TIMEOUT_SIG = MAX_SIG
|
||||
};
|
||||
|
||||
/* Global objects ----------------------------------------------------------*/
|
||||
QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
|
||||
&l_philo[0].super,
|
||||
&l_philo[1].super,
|
||||
&l_philo[2].super,
|
||||
&l_philo[3].super,
|
||||
&l_philo[4].super
|
||||
};
|
||||
|
||||
/* Philo definition --------------------------------------------------------*/
|
||||
/* @(/2/4) .................................................................*/
|
||||
void Philo_ctor(void) {
|
||||
uint8_t n;
|
||||
Philo *me;
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me = &l_philo[n];
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
|
||||
QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
|
||||
}
|
||||
}
|
||||
/* @(/2/0) .................................................................*/
|
||||
/* @(/2/0/1) ...............................................................*/
|
||||
/* @(/2/0/1/0) */
|
||||
static QState Philo_initial(Philo * const me, QEvt const * const e) {
|
||||
static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
if (registered == (uint8_t)0) {
|
||||
registered = (uint8_t)1;
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_philo[0]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[0].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[1].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[2].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[3].timeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4]);
|
||||
QS_OBJ_DICTIONARY(&l_philo[4].timeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Philo_initial);
|
||||
QS_FUN_DICTIONARY(&Philo_thinking);
|
||||
QS_FUN_DICTIONARY(&Philo_hungry);
|
||||
QS_FUN_DICTIONARY(&Philo_eating);
|
||||
}
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal for each Philos */
|
||||
QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
|
||||
|
||||
QActive_subscribe(&me->super, EAT_SIG);
|
||||
return Q_TRAN(&Philo_thinking);
|
||||
}
|
||||
/* @(/2/0/1/1) .............................................................*/
|
||||
static QState Philo_thinking(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/1) */
|
||||
case Q_ENTRY_SIG: {
|
||||
QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/1/0) */
|
||||
case TIMEOUT_SIG: {
|
||||
status = Q_TRAN(&Philo_hungry);
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/1/1) */
|
||||
case EAT_SIG: /* intentionally fall through */
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/0/1/2) .............................................................*/
|
||||
static QState Philo_hungry(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/2) */
|
||||
case Q_ENTRY_SIG: {
|
||||
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QACTIVE_POST(AO_Table, &pe->super, me);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/2/0) */
|
||||
case EAT_SIG: {
|
||||
/* @(/2/0/1/2/0/0) */
|
||||
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
|
||||
status = Q_TRAN(&Philo_eating);
|
||||
}
|
||||
else {
|
||||
status = Q_UNHANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/2/1) */
|
||||
case DONE_SIG: {
|
||||
/* DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/0/1/3) .............................................................*/
|
||||
static QState Philo_eating(Philo * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/0/1/3) */
|
||||
case Q_ENTRY_SIG: {
|
||||
QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3) */
|
||||
case Q_EXIT_SIG: {
|
||||
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
|
||||
pe->philoNum = PHILO_ID(me);
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3/0) */
|
||||
case TIMEOUT_SIG: {
|
||||
status = Q_TRAN(&Philo_thinking);
|
||||
break;
|
||||
}
|
||||
/* @(/2/0/1/3/1) */
|
||||
case EAT_SIG: /* intentionally fall through */
|
||||
case DONE_SIG: {
|
||||
/* EAT or DONE must be for other Philos than this one */
|
||||
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
6744
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/rom.h
Normal file
6744
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/rom.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,201 @@
|
||||
//*****************************************************************************
|
||||
// Modified for CMSIS compliance by Quantum Leaps
|
||||
// Vanilla kernel
|
||||
// Jan 26, 2013
|
||||
//*****************************************************************************
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// startup_ccs.c - Startup code for use with TI's Code Composer Studio.
|
||||
//
|
||||
// Copyright (c) 2005-2010 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// Texas Instruments (TI) is supplying this software for use solely and
|
||||
// exclusively on TI's microcontroller products. The software is owned by
|
||||
// TI and/or its suppliers, and is protected under applicable copyright
|
||||
// laws. You may not combine this software with "viral" open-source
|
||||
// software in order to form a larger program.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
|
||||
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
|
||||
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
|
||||
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
|
||||
// DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
//
|
||||
// This is part of revision 5961 of the DK-LM3S811 Firmware Package.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
//*****************************************************************************
|
||||
// prototypes of the IRQ handlers defined in the application
|
||||
//*****************************************************************************
|
||||
void SysTick_Handler(void);
|
||||
void GPIOPortA_IRQHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
// prototypes of the default fault handlers.
|
||||
//*****************************************************************************
|
||||
void ResetISR(void);
|
||||
static void NMI_Handler(void);
|
||||
static void HardFault_Handler(void);
|
||||
static void MemManage_Handler(void);
|
||||
static void BusFault_Handler(void);
|
||||
static void UsageFault_Handler(void);
|
||||
static void Reserved_Handler(void);
|
||||
static void MemManage_Handler(void);
|
||||
static void Reserved_Handler(void);
|
||||
void SVC_Handler(void);
|
||||
static void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
|
||||
static void Unused_IRQHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// External declaration for the reset handler that is to be called when the
|
||||
// processor is started
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void _c_int00(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Linker variable that marks the top of the stack.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern unsigned long __STACK_TOP;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The vector table. Note that the proper constructs must be placed on this to
|
||||
// ensure that it ends up at physical address 0x0000.0000 or at the start of
|
||||
// the program if located at a start address other than 0.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
|
||||
void (* const g_pfnVectors[])(void) =
|
||||
{
|
||||
(void (*)(void))((unsigned long)&__STACK_TOP),
|
||||
// The initial stack pointer
|
||||
ResetISR, // The reset handler
|
||||
NMI_Handler, // The NMI handler
|
||||
HardFault_Handler, // The hard fault handler
|
||||
MemManage_Handler, // The MPU fault handler
|
||||
BusFault_Handler, // The bus fault handler
|
||||
UsageFault_Handler, // The usage fault handler
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
Reserved_Handler, // Reserved
|
||||
SVC_Handler, // SVCall handler
|
||||
DebugMon_Handler, // Debug monitor handler
|
||||
Reserved_Handler, // Reserved
|
||||
PendSV_Handler, // The PendSV handler
|
||||
SysTick_Handler, // The SysTick handler
|
||||
GPIOPortA_IRQHandler, // GPIO Port A
|
||||
Unused_IRQHandler, // GPIO Port B
|
||||
Unused_IRQHandler, // GPIO Port C
|
||||
Unused_IRQHandler, // GPIO Port D
|
||||
Unused_IRQHandler, // GPIO Port E
|
||||
Unused_IRQHandler, // UART0 Rx and Tx
|
||||
Unused_IRQHandler, // UART1 Rx and Tx
|
||||
Unused_IRQHandler, // SSI0 Rx and Tx
|
||||
Unused_IRQHandler, // I2C0 Master and Slave
|
||||
Unused_IRQHandler, // PWM Fault
|
||||
Unused_IRQHandler, // PWM Generator 0
|
||||
Unused_IRQHandler, // PWM Generator 1
|
||||
Unused_IRQHandler, // PWM Generator 2
|
||||
Unused_IRQHandler, // Quadrature Encoder 0
|
||||
Unused_IRQHandler, // ADC Sequence 0
|
||||
Unused_IRQHandler, // ADC Sequence 1
|
||||
Unused_IRQHandler, // ADC Sequence 2
|
||||
Unused_IRQHandler, // ADC Sequence 3
|
||||
Unused_IRQHandler, // Watchdog timer
|
||||
Unused_IRQHandler, // Timer 0 subtimer A
|
||||
Unused_IRQHandler, // Timer 0 subtimer B
|
||||
Unused_IRQHandler, // Timer 1 subtimer A
|
||||
Unused_IRQHandler, // Timer 1 subtimer B
|
||||
Unused_IRQHandler, // Timer 2 subtimer A
|
||||
Unused_IRQHandler, // Timer 2 subtimer B
|
||||
Unused_IRQHandler, // Analog Comparator 0
|
||||
Unused_IRQHandler, // Analog Comparator 1
|
||||
Unused_IRQHandler, // Analog Comparator 2
|
||||
Unused_IRQHandler, // System Control (PLL, OSC, BO)
|
||||
Unused_IRQHandler // FLASH Control
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor first starts execution
|
||||
// following a reset event. Only the absolutely necessary set is performed,
|
||||
// after which the application supplied entry() routine is called. Any fancy
|
||||
// actions (such as making decisions based on the reset cause register, and
|
||||
// resetting the bits in that register) are left solely in the hands of the
|
||||
// application.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void ResetISR(void) {
|
||||
//
|
||||
// Jump to the CCS C Initialization Routine.
|
||||
//
|
||||
__asm(" .global _c_int00\n"
|
||||
" b.w _c_int00");
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// These dummy handlers simply enter an infinite loop, preserving the system
|
||||
// state for examination by a debugger.
|
||||
//*****************************************************************************
|
||||
|
||||
static void NMI_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void HardFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MemManage_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void BusFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void UsageFault_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void Reserved_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void SVC_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void DebugMon_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void PendSV_Handler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void Unused_IRQHandler(void) {
|
||||
while(1) {
|
||||
}
|
||||
}
|
644
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/sysctl.h
Normal file
644
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/sysctl.h
Normal file
@ -0,0 +1,644 @@
|
||||
//*****************************************************************************
|
||||
//
|
||||
// sysctl.h - Prototypes for the system control driver.
|
||||
//
|
||||
// Copyright (c) 2005-2012 Texas Instruments Incorporated. All rights reserved.
|
||||
// Software License Agreement
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// This is part of revision 9453 of the Stellaris Peripheral Driver Library.
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef __SYSCTL_H__
|
||||
#define __SYSCTL_H__
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// If building with a C++ compiler, make all of the definitions in this header
|
||||
// have a C binding.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef unsigned char tBoolean;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the
|
||||
// SysCtlPeripheralPresent(), SysCtlPeripheralEnable(),
|
||||
// SysCtlPeripheralDisable(), and SysCtlPeripheralReset() APIs as the
|
||||
// ulPeripheral parameter. The peripherals in the fourth group (upper nibble
|
||||
// is 3) can only be used with the SysCtlPeripheralPresent() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_WDOG 0x00000008 // Watchdog
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_WDOG0 0x00000008 // Watchdog 0
|
||||
#define SYSCTL_PERIPH_HIBERNATE 0x00000040 // Hibernation module
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_ADC 0x00100001 // ADC
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_ADC0 0x00100001 // ADC0
|
||||
#define SYSCTL_PERIPH_ADC1 0x00100002 // ADC1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_PWM 0x00100010 // PWM
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_PWM0 0x00100010 // PWM
|
||||
#define SYSCTL_PERIPH_CAN0 0x00100100 // CAN 0
|
||||
#define SYSCTL_PERIPH_CAN1 0x00100200 // CAN 1
|
||||
#define SYSCTL_PERIPH_CAN2 0x00100400 // CAN 2
|
||||
#define SYSCTL_PERIPH_WDOG1 0x00101000 // Watchdog 1
|
||||
#define SYSCTL_PERIPH_UART0 0x10000001 // UART 0
|
||||
#define SYSCTL_PERIPH_UART1 0x10000002 // UART 1
|
||||
#define SYSCTL_PERIPH_UART2 0x10000004 // UART 2
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_SSI 0x10000010 // SSI
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_SSI0 0x10000010 // SSI 0
|
||||
#define SYSCTL_PERIPH_SSI1 0x10000020 // SSI 1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_QEI 0x10000100 // QEI
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_QEI0 0x10000100 // QEI 0
|
||||
#define SYSCTL_PERIPH_QEI1 0x10000200 // QEI 1
|
||||
#ifndef DEPRECATED
|
||||
#define SYSCTL_PERIPH_I2C 0x10001000 // I2C
|
||||
#endif
|
||||
#define SYSCTL_PERIPH_I2C0 0x10001000 // I2C 0
|
||||
#define SYSCTL_PERIPH_I2C1 0x10004000 // I2C 1
|
||||
#define SYSCTL_PERIPH_TIMER0 0x10100001 // Timer 0
|
||||
#define SYSCTL_PERIPH_TIMER1 0x10100002 // Timer 1
|
||||
#define SYSCTL_PERIPH_TIMER2 0x10100004 // Timer 2
|
||||
#define SYSCTL_PERIPH_TIMER3 0x10100008 // Timer 3
|
||||
#define SYSCTL_PERIPH_COMP0 0x10100100 // Analog comparator 0
|
||||
#define SYSCTL_PERIPH_COMP1 0x10100200 // Analog comparator 1
|
||||
#define SYSCTL_PERIPH_COMP2 0x10100400 // Analog comparator 2
|
||||
#define SYSCTL_PERIPH_I2S0 0x10101000 // I2S0
|
||||
#define SYSCTL_PERIPH_EPI0 0x10104000 // EPI0
|
||||
#define SYSCTL_PERIPH_GPIOA 0x20000001 // GPIO A
|
||||
#define SYSCTL_PERIPH_GPIOB 0x20000002 // GPIO B
|
||||
#define SYSCTL_PERIPH_GPIOC 0x20000004 // GPIO C
|
||||
#define SYSCTL_PERIPH_GPIOD 0x20000008 // GPIO D
|
||||
#define SYSCTL_PERIPH_GPIOE 0x20000010 // GPIO E
|
||||
#define SYSCTL_PERIPH_GPIOF 0x20000020 // GPIO F
|
||||
#define SYSCTL_PERIPH_GPIOG 0x20000040 // GPIO G
|
||||
#define SYSCTL_PERIPH_GPIOH 0x20000080 // GPIO H
|
||||
#define SYSCTL_PERIPH_GPIOJ 0x20000100 // GPIO J
|
||||
#define SYSCTL_PERIPH_UDMA 0x20002000 // uDMA
|
||||
#define SYSCTL_PERIPH_USB0 0x20100001 // USB0
|
||||
#define SYSCTL_PERIPH_ETH 0x20105000 // Ethernet
|
||||
#define SYSCTL_PERIPH_IEEE1588 0x20100100 // IEEE1588
|
||||
#define SYSCTL_PERIPH_PLL 0x30000010 // PLL
|
||||
#define SYSCTL_PERIPH_TEMP 0x30000020 // Temperature sensor
|
||||
#define SYSCTL_PERIPH_MPU 0x30000080 // Cortex M3 MPU
|
||||
#define SYSCTL_PERIPH2_ADC0 0xf0003800 // ADC 0
|
||||
#define SYSCTL_PERIPH2_ADC1 0xf0003801 // ADC 1
|
||||
#define SYSCTL_PERIPH2_CAN0 0xf0003400 // CAN 0
|
||||
#define SYSCTL_PERIPH2_CAN1 0xf0003401 // CAN 1
|
||||
#define SYSCTL_PERIPH2_CAN2 0xf0003402 // CAN 2
|
||||
#define SYSCTL_PERIPH2_COMP0 0xf0003c00 // Analog comparator 0
|
||||
#define SYSCTL_PERIPH_EEPROM0 0xf0005800 // EEPROM 0
|
||||
#define SYSCTL_PERIPH2_EPI0 0xf0001000 // EPI0
|
||||
#define SYSCTL_PERIPH2_ETH 0xf0002c00 // ETH
|
||||
#define SYSCTL_PERIPH_FAN0 0xf0005400 // FAN 0
|
||||
#define SYSCTL_PERIPH2_GPIOA 0xf0000800 // GPIO A
|
||||
#define SYSCTL_PERIPH2_GPIOB 0xf0000801 // GPIO B
|
||||
#define SYSCTL_PERIPH2_GPIOC 0xf0000802 // GPIO C
|
||||
#define SYSCTL_PERIPH2_GPIOD 0xf0000803 // GPIO D
|
||||
#define SYSCTL_PERIPH2_GPIOE 0xf0000804 // GPIO E
|
||||
#define SYSCTL_PERIPH2_GPIOF 0xf0000805 // GPIO F
|
||||
#define SYSCTL_PERIPH2_GPIOG 0xf0000806 // GPIO G
|
||||
#define SYSCTL_PERIPH2_GPIOH 0xf0000807 // GPIO H
|
||||
#define SYSCTL_PERIPH2_GPIOJ 0xf0000808 // GPIO J
|
||||
#define SYSCTL_PERIPH_GPIOK 0xf0000809 // GPIO K
|
||||
#define SYSCTL_PERIPH_GPIOL 0xf000080a // GPIO L
|
||||
#define SYSCTL_PERIPH_GPIOM 0xf000080b // GPIO M
|
||||
#define SYSCTL_PERIPH_GPION 0xf000080c // GPIO N
|
||||
#define SYSCTL_PERIPH_GPIOP 0xf000080d // GPIO P
|
||||
#define SYSCTL_PERIPH_GPIOQ 0xf000080e // GPIO Q
|
||||
#define SYSCTL_PERIPH_GPIOR 0xf000080f // GPIO R
|
||||
#define SYSCTL_PERIPH_GPIOS 0xf0000810 // GPIO S
|
||||
#define SYSCTL_PERIPH2_HIB 0xf0001400 // Hibernation module
|
||||
#define SYSCTL_PERIPH2_I2C0 0xf0002000 // I2C 0
|
||||
#define SYSCTL_PERIPH2_I2C1 0xf0002001 // I2C 1
|
||||
#define SYSCTL_PERIPH_I2C2 0xf0002002 // I2C 2
|
||||
#define SYSCTL_PERIPH_I2C3 0xf0002003 // I2C 3
|
||||
#define SYSCTL_PERIPH_I2C4 0xf0002004 // I2C 4
|
||||
#define SYSCTL_PERIPH_I2C5 0xf0002005 // I2C 5
|
||||
#define SYSCTL_PERIPH2_I2S0 0xf0002400 // I2S0
|
||||
#define SYSCTL_PERIPH_LPC0 0xf0004800 // LPC 0
|
||||
#define SYSCTL_PERIPH_PECI0 0xf0005000 // PECI 0
|
||||
#define SYSCTL_PERIPH2_PWM0 0xf0004000 // PWM 0
|
||||
#define SYSCTL_PERIPH_PWM1 0xf0004001 // PWM 1
|
||||
#define SYSCTL_PERIPH2_QEI0 0xf0004400 // QEI 0
|
||||
#define SYSCTL_PERIPH2_QEI1 0xf0004401 // QEI 1
|
||||
#define SYSCTL_PERIPH2_SSI0 0xf0001c00 // SSI 0
|
||||
#define SYSCTL_PERIPH2_SSI1 0xf0001c01 // SSI 1
|
||||
#define SYSCTL_PERIPH_SSI2 0xf0001c02 // SSI 2
|
||||
#define SYSCTL_PERIPH_SSI3 0xf0001c03 // SSI 3
|
||||
#define SYSCTL_PERIPH2_TIMER0 0xf0000400 // Timer 0
|
||||
#define SYSCTL_PERIPH2_TIMER1 0xf0000401 // Timer 1
|
||||
#define SYSCTL_PERIPH2_TIMER2 0xf0000402 // Timer 2
|
||||
#define SYSCTL_PERIPH2_TIMER3 0xf0000403 // Timer 3
|
||||
#define SYSCTL_PERIPH_TIMER4 0xf0000404 // Timer 4
|
||||
#define SYSCTL_PERIPH_TIMER5 0xf0000405 // Timer 5
|
||||
#define SYSCTL_PERIPH_WTIMER0 0xf0005c00 // Wide Timer 0
|
||||
#define SYSCTL_PERIPH_WTIMER1 0xf0005c01 // Wide Timer 1
|
||||
#define SYSCTL_PERIPH_WTIMER2 0xf0005c02 // Wide Timer 2
|
||||
#define SYSCTL_PERIPH_WTIMER3 0xf0005c03 // Wide Timer 3
|
||||
#define SYSCTL_PERIPH_WTIMER4 0xf0005c04 // Wide Timer 4
|
||||
#define SYSCTL_PERIPH_WTIMER5 0xf0005c05 // Wide Timer 5
|
||||
#define SYSCTL_PERIPH2_UART0 0xf0001800 // UART 0
|
||||
#define SYSCTL_PERIPH2_UART1 0xf0001801 // UART 1
|
||||
#define SYSCTL_PERIPH2_UART2 0xf0001802 // UART 2
|
||||
#define SYSCTL_PERIPH_UART3 0xf0001803 // UART 3
|
||||
#define SYSCTL_PERIPH_UART4 0xf0001804 // UART 4
|
||||
#define SYSCTL_PERIPH_UART5 0xf0001805 // UART 5
|
||||
#define SYSCTL_PERIPH_UART6 0xf0001806 // UART 6
|
||||
#define SYSCTL_PERIPH_UART7 0xf0001807 // UART 7
|
||||
#define SYSCTL_PERIPH2_UDMA 0xf0000c00 // uDMA
|
||||
#define SYSCTL_PERIPH2_USB0 0xf0002800 // USB 0
|
||||
#define SYSCTL_PERIPH2_WDOG0 0xf0000000 // Watchdog 0
|
||||
#define SYSCTL_PERIPH2_WDOG1 0xf0000001 // Watchdog 1
|
||||
#define SYSCTL_PERIPH2_HIBERNATE \
|
||||
0xf0001400 // Hibernate
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlPinPresent() API
|
||||
// as the ulPin parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_PIN_PWM0 0x00000001 // PWM0 pin
|
||||
#define SYSCTL_PIN_PWM1 0x00000002 // PWM1 pin
|
||||
#define SYSCTL_PIN_PWM2 0x00000004 // PWM2 pin
|
||||
#define SYSCTL_PIN_PWM3 0x00000008 // PWM3 pin
|
||||
#define SYSCTL_PIN_PWM4 0x00000010 // PWM4 pin
|
||||
#define SYSCTL_PIN_PWM5 0x00000020 // PWM5 pin
|
||||
#define SYSCTL_PIN_PWM6 0x00000040 // PWM6 pin
|
||||
#define SYSCTL_PIN_PWM7 0x00000080 // PWM7 pin
|
||||
#define SYSCTL_PIN_C0MINUS 0x00000040 // C0- pin
|
||||
#define SYSCTL_PIN_C0PLUS 0x00000080 // C0+ pin
|
||||
#define SYSCTL_PIN_C0O 0x00000100 // C0o pin
|
||||
#define SYSCTL_PIN_C1MINUS 0x00000200 // C1- pin
|
||||
#define SYSCTL_PIN_C1PLUS 0x00000400 // C1+ pin
|
||||
#define SYSCTL_PIN_C1O 0x00000800 // C1o pin
|
||||
#define SYSCTL_PIN_C2MINUS 0x00001000 // C2- pin
|
||||
#define SYSCTL_PIN_C2PLUS 0x00002000 // C2+ pin
|
||||
#define SYSCTL_PIN_C2O 0x00004000 // C2o pin
|
||||
#define SYSCTL_PIN_MC_FAULT0 0x00008000 // MC0 Fault pin
|
||||
#define SYSCTL_PIN_ADC0 0x00010000 // ADC0 pin
|
||||
#define SYSCTL_PIN_ADC1 0x00020000 // ADC1 pin
|
||||
#define SYSCTL_PIN_ADC2 0x00040000 // ADC2 pin
|
||||
#define SYSCTL_PIN_ADC3 0x00080000 // ADC3 pin
|
||||
#define SYSCTL_PIN_ADC4 0x00100000 // ADC4 pin
|
||||
#define SYSCTL_PIN_ADC5 0x00200000 // ADC5 pin
|
||||
#define SYSCTL_PIN_ADC6 0x00400000 // ADC6 pin
|
||||
#define SYSCTL_PIN_ADC7 0x00800000 // ADC7 pin
|
||||
#define SYSCTL_PIN_CCP0 0x01000000 // CCP0 pin
|
||||
#define SYSCTL_PIN_CCP1 0x02000000 // CCP1 pin
|
||||
#define SYSCTL_PIN_CCP2 0x04000000 // CCP2 pin
|
||||
#define SYSCTL_PIN_CCP3 0x08000000 // CCP3 pin
|
||||
#define SYSCTL_PIN_CCP4 0x10000000 // CCP4 pin
|
||||
#define SYSCTL_PIN_CCP5 0x20000000 // CCP5 pin
|
||||
#define SYSCTL_PIN_32KHZ 0x80000000 // 32kHz pin
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlLDOSet() API as
|
||||
// the ulVoltage value, or returned by the SysCtlLDOGet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_LDO_2_25V 0x00000005 // LDO output of 2.25V
|
||||
#define SYSCTL_LDO_2_30V 0x00000004 // LDO output of 2.30V
|
||||
#define SYSCTL_LDO_2_35V 0x00000003 // LDO output of 2.35V
|
||||
#define SYSCTL_LDO_2_40V 0x00000002 // LDO output of 2.40V
|
||||
#define SYSCTL_LDO_2_45V 0x00000001 // LDO output of 2.45V
|
||||
#define SYSCTL_LDO_2_50V 0x00000000 // LDO output of 2.50V
|
||||
#define SYSCTL_LDO_2_55V 0x0000001f // LDO output of 2.55V
|
||||
#define SYSCTL_LDO_2_60V 0x0000001e // LDO output of 2.60V
|
||||
#define SYSCTL_LDO_2_65V 0x0000001d // LDO output of 2.65V
|
||||
#define SYSCTL_LDO_2_70V 0x0000001c // LDO output of 2.70V
|
||||
#define SYSCTL_LDO_2_75V 0x0000001b // LDO output of 2.75V
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlLDOConfigSet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_LDOCFG_ARST 0x00000001 // Allow LDO failure to reset
|
||||
#define SYSCTL_LDOCFG_NORST 0x00000000 // Do not reset on LDO failure
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlIntEnable(),
|
||||
// SysCtlIntDisable(), and SysCtlIntClear() APIs, or returned in the bit mask
|
||||
// by the SysCtlIntStatus() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_INT_MOSC_PUP 0x00000100 // MOSC power-up interrupt
|
||||
#define SYSCTL_INT_USBPLL_LOCK 0x00000080 // USB PLL lock interrupt
|
||||
#define SYSCTL_INT_PLL_LOCK 0x00000040 // PLL lock interrupt
|
||||
#define SYSCTL_INT_CUR_LIMIT 0x00000020 // Current limit interrupt
|
||||
#define SYSCTL_INT_IOSC_FAIL 0x00000010 // Internal oscillator failure int
|
||||
#define SYSCTL_INT_MOSC_FAIL 0x00000008 // Main oscillator failure int
|
||||
#define SYSCTL_INT_POR 0x00000004 // Power on reset interrupt
|
||||
#define SYSCTL_INT_BOR 0x00000002 // Brown out interrupt
|
||||
#define SYSCTL_INT_PLL_FAIL 0x00000001 // PLL failure interrupt
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlResetCauseClear()
|
||||
// API or returned by the SysCtlResetCauseGet() API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_CAUSE_LDO 0x00000020 // LDO power not OK reset
|
||||
#define SYSCTL_CAUSE_WDOG1 0x00000020 // Watchdog 1 reset
|
||||
#define SYSCTL_CAUSE_SW 0x00000010 // Software reset
|
||||
#define SYSCTL_CAUSE_WDOG0 0x00000008 // Watchdog 0 reset
|
||||
#define SYSCTL_CAUSE_WDOG 0x00000008 // Watchdog reset
|
||||
#define SYSCTL_CAUSE_BOR 0x00000004 // Brown-out reset
|
||||
#define SYSCTL_CAUSE_POR 0x00000002 // Power on reset
|
||||
#define SYSCTL_CAUSE_EXT 0x00000001 // External reset
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlBrownOutConfigSet()
|
||||
// API as the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_BOR_RESET 0x00000002 // Reset instead of interrupting
|
||||
#define SYSCTL_BOR_RESAMPLE 0x00000001 // Resample BOR before asserting
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlPWMClockSet() API
|
||||
// as the ulConfig parameter, and can be returned by the SysCtlPWMClockGet()
|
||||
// API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_PWMDIV_1 0x00000000 // PWM clock is processor clock /1
|
||||
#define SYSCTL_PWMDIV_2 0x00100000 // PWM clock is processor clock /2
|
||||
#define SYSCTL_PWMDIV_4 0x00120000 // PWM clock is processor clock /4
|
||||
#define SYSCTL_PWMDIV_8 0x00140000 // PWM clock is processor clock /8
|
||||
#define SYSCTL_PWMDIV_16 0x00160000 // PWM clock is processor clock /16
|
||||
#define SYSCTL_PWMDIV_32 0x00180000 // PWM clock is processor clock /32
|
||||
#define SYSCTL_PWMDIV_64 0x001A0000 // PWM clock is processor clock /64
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlADCSpeedSet() API
|
||||
// as the ulSpeed parameter, and can be returned by the SyCtlADCSpeedGet()
|
||||
// API.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_ADCSPEED_1MSPS 0x00000F00 // 1,000,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_500KSPS 0x00000A00 // 500,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_250KSPS 0x00000500 // 250,000 samples per second
|
||||
#define SYSCTL_ADCSPEED_125KSPS 0x00000000 // 125,000 samples per second
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlClockSet() API as
|
||||
// the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_SYSDIV_1 0x07800000 // Processor clock is osc/pll /1
|
||||
#define SYSCTL_SYSDIV_2 0x00C00000 // Processor clock is osc/pll /2
|
||||
#define SYSCTL_SYSDIV_3 0x01400000 // Processor clock is osc/pll /3
|
||||
#define SYSCTL_SYSDIV_4 0x01C00000 // Processor clock is osc/pll /4
|
||||
#define SYSCTL_SYSDIV_5 0x02400000 // Processor clock is osc/pll /5
|
||||
#define SYSCTL_SYSDIV_6 0x02C00000 // Processor clock is osc/pll /6
|
||||
#define SYSCTL_SYSDIV_7 0x03400000 // Processor clock is osc/pll /7
|
||||
#define SYSCTL_SYSDIV_8 0x03C00000 // Processor clock is osc/pll /8
|
||||
#define SYSCTL_SYSDIV_9 0x04400000 // Processor clock is osc/pll /9
|
||||
#define SYSCTL_SYSDIV_10 0x04C00000 // Processor clock is osc/pll /10
|
||||
#define SYSCTL_SYSDIV_11 0x05400000 // Processor clock is osc/pll /11
|
||||
#define SYSCTL_SYSDIV_12 0x05C00000 // Processor clock is osc/pll /12
|
||||
#define SYSCTL_SYSDIV_13 0x06400000 // Processor clock is osc/pll /13
|
||||
#define SYSCTL_SYSDIV_14 0x06C00000 // Processor clock is osc/pll /14
|
||||
#define SYSCTL_SYSDIV_15 0x07400000 // Processor clock is osc/pll /15
|
||||
#define SYSCTL_SYSDIV_16 0x07C00000 // Processor clock is osc/pll /16
|
||||
#define SYSCTL_SYSDIV_17 0x88400000 // Processor clock is osc/pll /17
|
||||
#define SYSCTL_SYSDIV_18 0x88C00000 // Processor clock is osc/pll /18
|
||||
#define SYSCTL_SYSDIV_19 0x89400000 // Processor clock is osc/pll /19
|
||||
#define SYSCTL_SYSDIV_20 0x89C00000 // Processor clock is osc/pll /20
|
||||
#define SYSCTL_SYSDIV_21 0x8A400000 // Processor clock is osc/pll /21
|
||||
#define SYSCTL_SYSDIV_22 0x8AC00000 // Processor clock is osc/pll /22
|
||||
#define SYSCTL_SYSDIV_23 0x8B400000 // Processor clock is osc/pll /23
|
||||
#define SYSCTL_SYSDIV_24 0x8BC00000 // Processor clock is osc/pll /24
|
||||
#define SYSCTL_SYSDIV_25 0x8C400000 // Processor clock is osc/pll /25
|
||||
#define SYSCTL_SYSDIV_26 0x8CC00000 // Processor clock is osc/pll /26
|
||||
#define SYSCTL_SYSDIV_27 0x8D400000 // Processor clock is osc/pll /27
|
||||
#define SYSCTL_SYSDIV_28 0x8DC00000 // Processor clock is osc/pll /28
|
||||
#define SYSCTL_SYSDIV_29 0x8E400000 // Processor clock is osc/pll /29
|
||||
#define SYSCTL_SYSDIV_30 0x8EC00000 // Processor clock is osc/pll /30
|
||||
#define SYSCTL_SYSDIV_31 0x8F400000 // Processor clock is osc/pll /31
|
||||
#define SYSCTL_SYSDIV_32 0x8FC00000 // Processor clock is osc/pll /32
|
||||
#define SYSCTL_SYSDIV_33 0x90400000 // Processor clock is osc/pll /33
|
||||
#define SYSCTL_SYSDIV_34 0x90C00000 // Processor clock is osc/pll /34
|
||||
#define SYSCTL_SYSDIV_35 0x91400000 // Processor clock is osc/pll /35
|
||||
#define SYSCTL_SYSDIV_36 0x91C00000 // Processor clock is osc/pll /36
|
||||
#define SYSCTL_SYSDIV_37 0x92400000 // Processor clock is osc/pll /37
|
||||
#define SYSCTL_SYSDIV_38 0x92C00000 // Processor clock is osc/pll /38
|
||||
#define SYSCTL_SYSDIV_39 0x93400000 // Processor clock is osc/pll /39
|
||||
#define SYSCTL_SYSDIV_40 0x93C00000 // Processor clock is osc/pll /40
|
||||
#define SYSCTL_SYSDIV_41 0x94400000 // Processor clock is osc/pll /41
|
||||
#define SYSCTL_SYSDIV_42 0x94C00000 // Processor clock is osc/pll /42
|
||||
#define SYSCTL_SYSDIV_43 0x95400000 // Processor clock is osc/pll /43
|
||||
#define SYSCTL_SYSDIV_44 0x95C00000 // Processor clock is osc/pll /44
|
||||
#define SYSCTL_SYSDIV_45 0x96400000 // Processor clock is osc/pll /45
|
||||
#define SYSCTL_SYSDIV_46 0x96C00000 // Processor clock is osc/pll /46
|
||||
#define SYSCTL_SYSDIV_47 0x97400000 // Processor clock is osc/pll /47
|
||||
#define SYSCTL_SYSDIV_48 0x97C00000 // Processor clock is osc/pll /48
|
||||
#define SYSCTL_SYSDIV_49 0x98400000 // Processor clock is osc/pll /49
|
||||
#define SYSCTL_SYSDIV_50 0x98C00000 // Processor clock is osc/pll /50
|
||||
#define SYSCTL_SYSDIV_51 0x99400000 // Processor clock is osc/pll /51
|
||||
#define SYSCTL_SYSDIV_52 0x99C00000 // Processor clock is osc/pll /52
|
||||
#define SYSCTL_SYSDIV_53 0x9A400000 // Processor clock is osc/pll /53
|
||||
#define SYSCTL_SYSDIV_54 0x9AC00000 // Processor clock is osc/pll /54
|
||||
#define SYSCTL_SYSDIV_55 0x9B400000 // Processor clock is osc/pll /55
|
||||
#define SYSCTL_SYSDIV_56 0x9BC00000 // Processor clock is osc/pll /56
|
||||
#define SYSCTL_SYSDIV_57 0x9C400000 // Processor clock is osc/pll /57
|
||||
#define SYSCTL_SYSDIV_58 0x9CC00000 // Processor clock is osc/pll /58
|
||||
#define SYSCTL_SYSDIV_59 0x9D400000 // Processor clock is osc/pll /59
|
||||
#define SYSCTL_SYSDIV_60 0x9DC00000 // Processor clock is osc/pll /60
|
||||
#define SYSCTL_SYSDIV_61 0x9E400000 // Processor clock is osc/pll /61
|
||||
#define SYSCTL_SYSDIV_62 0x9EC00000 // Processor clock is osc/pll /62
|
||||
#define SYSCTL_SYSDIV_63 0x9F400000 // Processor clock is osc/pll /63
|
||||
#define SYSCTL_SYSDIV_64 0x9FC00000 // Processor clock is osc/pll /64
|
||||
#define SYSCTL_SYSDIV_2_5 0xC1000000 // Processor clock is pll / 2.5
|
||||
#define SYSCTL_SYSDIV_3_5 0xC1800000 // Processor clock is pll / 3.5
|
||||
#define SYSCTL_SYSDIV_4_5 0xC2000000 // Processor clock is pll / 4.5
|
||||
#define SYSCTL_SYSDIV_5_5 0xC2800000 // Processor clock is pll / 5.5
|
||||
#define SYSCTL_SYSDIV_6_5 0xC3000000 // Processor clock is pll / 6.5
|
||||
#define SYSCTL_SYSDIV_7_5 0xC3800000 // Processor clock is pll / 7.5
|
||||
#define SYSCTL_SYSDIV_8_5 0xC4000000 // Processor clock is pll / 8.5
|
||||
#define SYSCTL_SYSDIV_9_5 0xC4800000 // Processor clock is pll / 9.5
|
||||
#define SYSCTL_SYSDIV_10_5 0xC5000000 // Processor clock is pll / 10.5
|
||||
#define SYSCTL_SYSDIV_11_5 0xC5800000 // Processor clock is pll / 11.5
|
||||
#define SYSCTL_SYSDIV_12_5 0xC6000000 // Processor clock is pll / 12.5
|
||||
#define SYSCTL_SYSDIV_13_5 0xC6800000 // Processor clock is pll / 13.5
|
||||
#define SYSCTL_SYSDIV_14_5 0xC7000000 // Processor clock is pll / 14.5
|
||||
#define SYSCTL_SYSDIV_15_5 0xC7800000 // Processor clock is pll / 15.5
|
||||
#define SYSCTL_SYSDIV_16_5 0xC8000000 // Processor clock is pll / 16.5
|
||||
#define SYSCTL_SYSDIV_17_5 0xC8800000 // Processor clock is pll / 17.5
|
||||
#define SYSCTL_SYSDIV_18_5 0xC9000000 // Processor clock is pll / 18.5
|
||||
#define SYSCTL_SYSDIV_19_5 0xC9800000 // Processor clock is pll / 19.5
|
||||
#define SYSCTL_SYSDIV_20_5 0xCA000000 // Processor clock is pll / 20.5
|
||||
#define SYSCTL_SYSDIV_21_5 0xCA800000 // Processor clock is pll / 21.5
|
||||
#define SYSCTL_SYSDIV_22_5 0xCB000000 // Processor clock is pll / 22.5
|
||||
#define SYSCTL_SYSDIV_23_5 0xCB800000 // Processor clock is pll / 23.5
|
||||
#define SYSCTL_SYSDIV_24_5 0xCC000000 // Processor clock is pll / 24.5
|
||||
#define SYSCTL_SYSDIV_25_5 0xCC800000 // Processor clock is pll / 25.5
|
||||
#define SYSCTL_SYSDIV_26_5 0xCD000000 // Processor clock is pll / 26.5
|
||||
#define SYSCTL_SYSDIV_27_5 0xCD800000 // Processor clock is pll / 27.5
|
||||
#define SYSCTL_SYSDIV_28_5 0xCE000000 // Processor clock is pll / 28.5
|
||||
#define SYSCTL_SYSDIV_29_5 0xCE800000 // Processor clock is pll / 29.5
|
||||
#define SYSCTL_SYSDIV_30_5 0xCF000000 // Processor clock is pll / 30.5
|
||||
#define SYSCTL_SYSDIV_31_5 0xCF800000 // Processor clock is pll / 31.5
|
||||
#define SYSCTL_SYSDIV_32_5 0xD0000000 // Processor clock is pll / 32.5
|
||||
#define SYSCTL_SYSDIV_33_5 0xD0800000 // Processor clock is pll / 33.5
|
||||
#define SYSCTL_SYSDIV_34_5 0xD1000000 // Processor clock is pll / 34.5
|
||||
#define SYSCTL_SYSDIV_35_5 0xD1800000 // Processor clock is pll / 35.5
|
||||
#define SYSCTL_SYSDIV_36_5 0xD2000000 // Processor clock is pll / 36.5
|
||||
#define SYSCTL_SYSDIV_37_5 0xD2800000 // Processor clock is pll / 37.5
|
||||
#define SYSCTL_SYSDIV_38_5 0xD3000000 // Processor clock is pll / 38.5
|
||||
#define SYSCTL_SYSDIV_39_5 0xD3800000 // Processor clock is pll / 39.5
|
||||
#define SYSCTL_SYSDIV_40_5 0xD4000000 // Processor clock is pll / 40.5
|
||||
#define SYSCTL_SYSDIV_41_5 0xD4800000 // Processor clock is pll / 41.5
|
||||
#define SYSCTL_SYSDIV_42_5 0xD5000000 // Processor clock is pll / 42.5
|
||||
#define SYSCTL_SYSDIV_43_5 0xD5800000 // Processor clock is pll / 43.5
|
||||
#define SYSCTL_SYSDIV_44_5 0xD6000000 // Processor clock is pll / 44.5
|
||||
#define SYSCTL_SYSDIV_45_5 0xD6800000 // Processor clock is pll / 45.5
|
||||
#define SYSCTL_SYSDIV_46_5 0xD7000000 // Processor clock is pll / 46.5
|
||||
#define SYSCTL_SYSDIV_47_5 0xD7800000 // Processor clock is pll / 47.5
|
||||
#define SYSCTL_SYSDIV_48_5 0xD8000000 // Processor clock is pll / 48.5
|
||||
#define SYSCTL_SYSDIV_49_5 0xD8800000 // Processor clock is pll / 49.5
|
||||
#define SYSCTL_SYSDIV_50_5 0xD9000000 // Processor clock is pll / 50.5
|
||||
#define SYSCTL_SYSDIV_51_5 0xD9800000 // Processor clock is pll / 51.5
|
||||
#define SYSCTL_SYSDIV_52_5 0xDA000000 // Processor clock is pll / 52.5
|
||||
#define SYSCTL_SYSDIV_53_5 0xDA800000 // Processor clock is pll / 53.5
|
||||
#define SYSCTL_SYSDIV_54_5 0xDB000000 // Processor clock is pll / 54.5
|
||||
#define SYSCTL_SYSDIV_55_5 0xDB800000 // Processor clock is pll / 55.5
|
||||
#define SYSCTL_SYSDIV_56_5 0xDC000000 // Processor clock is pll / 56.5
|
||||
#define SYSCTL_SYSDIV_57_5 0xDC800000 // Processor clock is pll / 57.5
|
||||
#define SYSCTL_SYSDIV_58_5 0xDD000000 // Processor clock is pll / 58.5
|
||||
#define SYSCTL_SYSDIV_59_5 0xDD800000 // Processor clock is pll / 59.5
|
||||
#define SYSCTL_SYSDIV_60_5 0xDE000000 // Processor clock is pll / 60.5
|
||||
#define SYSCTL_SYSDIV_61_5 0xDE800000 // Processor clock is pll / 61.5
|
||||
#define SYSCTL_SYSDIV_62_5 0xDF000000 // Processor clock is pll / 62.5
|
||||
#define SYSCTL_SYSDIV_63_5 0xDF800000 // Processor clock is pll / 63.5
|
||||
#define SYSCTL_USE_PLL 0x00000000 // System clock is the PLL clock
|
||||
#define SYSCTL_USE_OSC 0x00003800 // System clock is the osc clock
|
||||
#define SYSCTL_XTAL_1MHZ 0x00000000 // External crystal is 1MHz
|
||||
#define SYSCTL_XTAL_1_84MHZ 0x00000040 // External crystal is 1.8432MHz
|
||||
#define SYSCTL_XTAL_2MHZ 0x00000080 // External crystal is 2MHz
|
||||
#define SYSCTL_XTAL_2_45MHZ 0x000000C0 // External crystal is 2.4576MHz
|
||||
#define SYSCTL_XTAL_3_57MHZ 0x00000100 // External crystal is 3.579545MHz
|
||||
#define SYSCTL_XTAL_3_68MHZ 0x00000140 // External crystal is 3.6864MHz
|
||||
#define SYSCTL_XTAL_4MHZ 0x00000180 // External crystal is 4MHz
|
||||
#define SYSCTL_XTAL_4_09MHZ 0x000001C0 // External crystal is 4.096MHz
|
||||
#define SYSCTL_XTAL_4_91MHZ 0x00000200 // External crystal is 4.9152MHz
|
||||
#define SYSCTL_XTAL_5MHZ 0x00000240 // External crystal is 5MHz
|
||||
#define SYSCTL_XTAL_5_12MHZ 0x00000280 // External crystal is 5.12MHz
|
||||
#define SYSCTL_XTAL_6MHZ 0x000002C0 // External crystal is 6MHz
|
||||
#define SYSCTL_XTAL_6_14MHZ 0x00000300 // External crystal is 6.144MHz
|
||||
#define SYSCTL_XTAL_7_37MHZ 0x00000340 // External crystal is 7.3728MHz
|
||||
#define SYSCTL_XTAL_8MHZ 0x00000380 // External crystal is 8MHz
|
||||
#define SYSCTL_XTAL_8_19MHZ 0x000003C0 // External crystal is 8.192MHz
|
||||
#define SYSCTL_XTAL_10MHZ 0x00000400 // External crystal is 10 MHz
|
||||
#define SYSCTL_XTAL_12MHZ 0x00000440 // External crystal is 12 MHz
|
||||
#define SYSCTL_XTAL_12_2MHZ 0x00000480 // External crystal is 12.288 MHz
|
||||
#define SYSCTL_XTAL_13_5MHZ 0x000004C0 // External crystal is 13.56 MHz
|
||||
#define SYSCTL_XTAL_14_3MHZ 0x00000500 // External crystal is 14.31818 MHz
|
||||
#define SYSCTL_XTAL_16MHZ 0x00000540 // External crystal is 16 MHz
|
||||
#define SYSCTL_XTAL_16_3MHZ 0x00000580 // External crystal is 16.384 MHz
|
||||
#define SYSCTL_XTAL_18MHZ 0x000005C0 // External crystal is 18.0 MHz
|
||||
#define SYSCTL_XTAL_20MHZ 0x00000600 // External crystal is 20.0 MHz
|
||||
#define SYSCTL_XTAL_24MHZ 0x00000640 // External crystal is 24.0 MHz
|
||||
#define SYSCTL_XTAL_25MHZ 0x00000680 // External crystal is 25.0 MHz
|
||||
#define SYSCTL_OSC_MAIN 0x00000000 // Osc source is main osc
|
||||
#define SYSCTL_OSC_INT 0x00000010 // Osc source is int. osc
|
||||
#define SYSCTL_OSC_INT4 0x00000020 // Osc source is int. osc /4
|
||||
#define SYSCTL_OSC_INT30 0x00000030 // Osc source is int. 30 KHz
|
||||
#define SYSCTL_OSC_EXT4_19 0x80000028 // Osc source is ext. 4.19 MHz
|
||||
#define SYSCTL_OSC_EXT32 0x80000038 // Osc source is ext. 32 KHz
|
||||
#define SYSCTL_INT_OSC_DIS 0x00000002 // Disable internal oscillator
|
||||
#define SYSCTL_MAIN_OSC_DIS 0x00000001 // Disable main oscillator
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are values that can be passed to the SysCtlDeepSleepClockSet()
|
||||
// API as the ulConfig parameter.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#define SYSCTL_DSLP_DIV_1 0x00000000 // Deep-sleep clock is osc /1
|
||||
#define SYSCTL_DSLP_DIV_2 0x00800000 // Deep-sleep clock is osc /2
|
||||
#define SYSCTL_DSLP_DIV_3 0x01000000 // Deep-sleep clock is osc /3
|
||||
#define SYSCTL_DSLP_DIV_4 0x01800000 // Deep-sleep clock is osc /4
|
||||
#define SYSCTL_DSLP_DIV_5 0x02000000 // Deep-sleep clock is osc /5
|
||||
#define SYSCTL_DSLP_DIV_6 0x02800000 // Deep-sleep clock is osc /6
|
||||
#define SYSCTL_DSLP_DIV_7 0x03000000 // Deep-sleep clock is osc /7
|
||||
#define SYSCTL_DSLP_DIV_8 0x03800000 // Deep-sleep clock is osc /8
|
||||
#define SYSCTL_DSLP_DIV_9 0x04000000 // Deep-sleep clock is osc /9
|
||||
#define SYSCTL_DSLP_DIV_10 0x04800000 // Deep-sleep clock is osc /10
|
||||
#define SYSCTL_DSLP_DIV_11 0x05000000 // Deep-sleep clock is osc /11
|
||||
#define SYSCTL_DSLP_DIV_12 0x05800000 // Deep-sleep clock is osc /12
|
||||
#define SYSCTL_DSLP_DIV_13 0x06000000 // Deep-sleep clock is osc /13
|
||||
#define SYSCTL_DSLP_DIV_14 0x06800000 // Deep-sleep clock is osc /14
|
||||
#define SYSCTL_DSLP_DIV_15 0x07000000 // Deep-sleep clock is osc /15
|
||||
#define SYSCTL_DSLP_DIV_16 0x07800000 // Deep-sleep clock is osc /16
|
||||
#define SYSCTL_DSLP_DIV_17 0x08000000 // Deep-sleep clock is osc /17
|
||||
#define SYSCTL_DSLP_DIV_18 0x08800000 // Deep-sleep clock is osc /18
|
||||
#define SYSCTL_DSLP_DIV_19 0x09000000 // Deep-sleep clock is osc /19
|
||||
#define SYSCTL_DSLP_DIV_20 0x09800000 // Deep-sleep clock is osc /20
|
||||
#define SYSCTL_DSLP_DIV_21 0x0A000000 // Deep-sleep clock is osc /21
|
||||
#define SYSCTL_DSLP_DIV_22 0x0A800000 // Deep-sleep clock is osc /22
|
||||
#define SYSCTL_DSLP_DIV_23 0x0B000000 // Deep-sleep clock is osc /23
|
||||
#define SYSCTL_DSLP_DIV_24 0x0B800000 // Deep-sleep clock is osc /24
|
||||
#define SYSCTL_DSLP_DIV_25 0x0C000000 // Deep-sleep clock is osc /25
|
||||
#define SYSCTL_DSLP_DIV_26 0x0C800000 // Deep-sleep clock is osc /26
|
||||
#define SYSCTL_DSLP_DIV_27 0x0D000000 // Deep-sleep clock is osc /27
|
||||
#define SYSCTL_DSLP_DIV_28 0x0D800000 // Deep-sleep clock is osc /28
|
||||
#define SYSCTL_DSLP_DIV_29 0x0E000000 // Deep-sleep clock is osc /29
|
||||
#define SYSCTL_DSLP_DIV_30 0x0E800000 // Deep-sleep clock is osc /30
|
||||
#define SYSCTL_DSLP_DIV_31 0x0F000000 // Deep-sleep clock is osc /31
|
||||
#define SYSCTL_DSLP_DIV_32 0x0F800000 // Deep-sleep clock is osc /32
|
||||
#define SYSCTL_DSLP_DIV_33 0x10000000 // Deep-sleep clock is osc /33
|
||||
#define SYSCTL_DSLP_DIV_34 0x10800000 // Deep-sleep clock is osc /34
|
||||
#define SYSCTL_DSLP_DIV_35 0x11000000 // Deep-sleep clock is osc /35
|
||||
#define SYSCTL_DSLP_DIV_36 0x11800000 // Deep-sleep clock is osc /36
|
||||
#define SYSCTL_DSLP_DIV_37 0x12000000 // Deep-sleep clock is osc /37
|
||||
#define SYSCTL_DSLP_DIV_38 0x12800000 // Deep-sleep clock is osc /38
|
||||
#define SYSCTL_DSLP_DIV_39 0x13000000 // Deep-sleep clock is osc /39
|
||||
#define SYSCTL_DSLP_DIV_40 0x13800000 // Deep-sleep clock is osc /40
|
||||
#define SYSCTL_DSLP_DIV_41 0x14000000 // Deep-sleep clock is osc /41
|
||||
#define SYSCTL_DSLP_DIV_42 0x14800000 // Deep-sleep clock is osc /42
|
||||
#define SYSCTL_DSLP_DIV_43 0x15000000 // Deep-sleep clock is osc /43
|
||||
#define SYSCTL_DSLP_DIV_44 0x15800000 // Deep-sleep clock is osc /44
|
||||
#define SYSCTL_DSLP_DIV_45 0x16000000 // Deep-sleep clock is osc /45
|
||||
#define SYSCTL_DSLP_DIV_46 0x16800000 // Deep-sleep clock is osc /46
|
||||
#define SYSCTL_DSLP_DIV_47 0x17000000 // Deep-sleep clock is osc /47
|
||||
#define SYSCTL_DSLP_DIV_48 0x17800000 // Deep-sleep clock is osc /48
|
||||
#define SYSCTL_DSLP_DIV_49 0x18000000 // Deep-sleep clock is osc /49
|
||||
#define SYSCTL_DSLP_DIV_50 0x18800000 // Deep-sleep clock is osc /50
|
||||
#define SYSCTL_DSLP_DIV_51 0x19000000 // Deep-sleep clock is osc /51
|
||||
#define SYSCTL_DSLP_DIV_52 0x19800000 // Deep-sleep clock is osc /52
|
||||
#define SYSCTL_DSLP_DIV_53 0x1A000000 // Deep-sleep clock is osc /53
|
||||
#define SYSCTL_DSLP_DIV_54 0x1A800000 // Deep-sleep clock is osc /54
|
||||
#define SYSCTL_DSLP_DIV_55 0x1B000000 // Deep-sleep clock is osc /55
|
||||
#define SYSCTL_DSLP_DIV_56 0x1B800000 // Deep-sleep clock is osc /56
|
||||
#define SYSCTL_DSLP_DIV_57 0x1C000000 // Deep-sleep clock is osc /57
|
||||
#define SYSCTL_DSLP_DIV_58 0x1C800000 // Deep-sleep clock is osc /58
|
||||
#define SYSCTL_DSLP_DIV_59 0x1D000000 // Deep-sleep clock is osc /59
|
||||
#define SYSCTL_DSLP_DIV_60 0x1D800000 // Deep-sleep clock is osc /60
|
||||
#define SYSCTL_DSLP_DIV_61 0x1E000000 // Deep-sleep clock is osc /61
|
||||
#define SYSCTL_DSLP_DIV_62 0x1E800000 // Deep-sleep clock is osc /62
|
||||
#define SYSCTL_DSLP_DIV_63 0x1F000000 // Deep-sleep clock is osc /63
|
||||
#define SYSCTL_DSLP_DIV_64 0x1F800000 // Deep-sleep clock is osc /64
|
||||
#define SYSCTL_DSLP_OSC_MAIN 0x00000000 // Osc source is main osc
|
||||
#define SYSCTL_DSLP_OSC_INT 0x00000010 // Osc source is int. osc
|
||||
#define SYSCTL_DSLP_OSC_INT30 0x00000030 // Osc source is int. 30 KHz
|
||||
#define SYSCTL_DSLP_OSC_EXT32 0x00000070 // Osc source is ext. 32 KHz
|
||||
#define SYSCTL_DSLP_PIOSC_PD 0x00000002 // Power down PIOSC in deep-sleep
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Prototypes for the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern unsigned long SysCtlSRAMSizeGet(void);
|
||||
extern unsigned long SysCtlFlashSizeGet(void);
|
||||
extern tBoolean SysCtlPinPresent(unsigned long ulPin);
|
||||
extern tBoolean SysCtlPeripheralPresent(unsigned long ulPeripheral);
|
||||
extern tBoolean SysCtlPeripheralReady(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralPowerOn(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralPowerOff(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralReset(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralSleepEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralSleepDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDeepSleepEnable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralDeepSleepDisable(unsigned long ulPeripheral);
|
||||
extern void SysCtlPeripheralClockGating(tBoolean bEnable);
|
||||
extern void SysCtlIntRegister(void (*pfnHandler)(void));
|
||||
extern void SysCtlIntUnregister(void);
|
||||
extern void SysCtlIntEnable(unsigned long ulInts);
|
||||
extern void SysCtlIntDisable(unsigned long ulInts);
|
||||
extern void SysCtlIntClear(unsigned long ulInts);
|
||||
extern unsigned long SysCtlIntStatus(tBoolean bMasked);
|
||||
extern void SysCtlLDOSet(unsigned long ulVoltage);
|
||||
extern unsigned long SysCtlLDOGet(void);
|
||||
extern void SysCtlLDOConfigSet(unsigned long ulConfig);
|
||||
extern void SysCtlReset(void);
|
||||
extern void SysCtlSleep(void);
|
||||
extern void SysCtlDeepSleep(void);
|
||||
extern unsigned long SysCtlResetCauseGet(void);
|
||||
extern void SysCtlResetCauseClear(unsigned long ulCauses);
|
||||
extern void SysCtlBrownOutConfigSet(unsigned long ulConfig,
|
||||
unsigned long ulDelay);
|
||||
extern void SysCtlDelay(unsigned long ulCount);
|
||||
extern void SysCtlMOSCConfigSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlPIOSCCalibrate(unsigned long ulType);
|
||||
extern void SysCtlClockSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlClockGet(void);
|
||||
extern void SysCtlDeepSleepClockSet(unsigned long ulConfig);
|
||||
extern void SysCtlPWMClockSet(unsigned long ulConfig);
|
||||
extern unsigned long SysCtlPWMClockGet(void);
|
||||
extern void SysCtlADCSpeedSet(unsigned long ulSpeed);
|
||||
extern unsigned long SysCtlADCSpeedGet(void);
|
||||
extern void SysCtlIOSCVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlMOSCVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlPLLVerificationSet(tBoolean bEnable);
|
||||
extern void SysCtlClkVerificationClear(void);
|
||||
extern void SysCtlGPIOAHBEnable(unsigned long ulGPIOPeripheral);
|
||||
extern void SysCtlGPIOAHBDisable(unsigned long ulGPIOPeripheral);
|
||||
extern void SysCtlUSBPLLEnable(void);
|
||||
extern void SysCtlUSBPLLDisable(void);
|
||||
extern unsigned long SysCtlI2SMClkSet(unsigned long ulInputClock,
|
||||
unsigned long ulMClk);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Mark the end of the C bindings section for C++ compilers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SYSCTL_H__
|
280
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/table.c
Normal file
280
examples/arm-cortex/vanilla/ti_arm/dpp-ev-lm4f120xl/table.c
Normal file
@ -0,0 +1,280 @@
|
||||
/*****************************************************************************
|
||||
* Model: dpp.qm
|
||||
* File: ./table.c
|
||||
*
|
||||
* This file has been generated automatically by QP Modeler (QM).
|
||||
* DO NOT EDIT THIS FILE MANUALLY.
|
||||
*
|
||||
* Please visit www.state-machine.com/qm for more information.
|
||||
*****************************************************************************/
|
||||
#include "qp_port.h"
|
||||
#include "dpp.h"
|
||||
#include "bsp.h"
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
/* Active object class -----------------------------------------------------*/
|
||||
/* @(/2/1) .................................................................*/
|
||||
typedef struct TableTag {
|
||||
/* protected: */
|
||||
QActive super;
|
||||
|
||||
/* private: */
|
||||
uint8_t fork[N_PHILO];
|
||||
uint8_t isHungry[N_PHILO];
|
||||
} Table;
|
||||
|
||||
/* protected: */
|
||||
static QState Table_initial(Table * const me, QEvt const * const e);
|
||||
static QState Table_active(Table * const me, QEvt const * const e);
|
||||
static QState Table_serving(Table * const me, QEvt const * const e);
|
||||
static QState Table_paused(Table * const me, QEvt const * const e);
|
||||
|
||||
|
||||
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
|
||||
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
|
||||
#define FREE ((uint8_t)0)
|
||||
#define USED ((uint8_t)1)
|
||||
|
||||
/* Local objects -----------------------------------------------------------*/
|
||||
static Table l_table; /* the single instance of the Table active object */
|
||||
|
||||
/* Global-scope objects ----------------------------------------------------*/
|
||||
QActive * const AO_Table = &l_table.super; /* "opaque" AO pointer */
|
||||
|
||||
/*..........................................................................*/
|
||||
/* @(/2/5) .................................................................*/
|
||||
void Table_ctor(void) {
|
||||
uint8_t n;
|
||||
Table *me = &l_table;
|
||||
|
||||
QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
}
|
||||
}
|
||||
/* @(/2/1) .................................................................*/
|
||||
/* @(/2/1/2) ...............................................................*/
|
||||
/* @(/2/1/2/0) */
|
||||
static QState Table_initial(Table * const me, QEvt const * const e) {
|
||||
uint8_t n;
|
||||
(void)e; /* suppress the compiler warning about unused parameter */
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_table);
|
||||
QS_FUN_DICTIONARY(&QHsm_top);
|
||||
QS_FUN_DICTIONARY(&Table_initial);
|
||||
QS_FUN_DICTIONARY(&Table_serving);
|
||||
|
||||
QS_SIG_DICTIONARY(DONE_SIG, (void *)0); /* global signals */
|
||||
QS_SIG_DICTIONARY(EAT_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(PAUSE_SIG, (void *)0);
|
||||
QS_SIG_DICTIONARY(TERMINATE_SIG, (void *)0);
|
||||
|
||||
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* signal just for Table */
|
||||
|
||||
QActive_subscribe(&me->super, DONE_SIG);
|
||||
QActive_subscribe(&me->super, PAUSE_SIG);
|
||||
QActive_subscribe(&me->super, TERMINATE_SIG);
|
||||
|
||||
for (n = 0U; n < N_PHILO; ++n) {
|
||||
me->fork[n] = FREE;
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
}
|
||||
return Q_TRAN(&Table_serving);
|
||||
}
|
||||
/* @(/2/1/2/1) .............................................................*/
|
||||
static QState Table_active(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/0) */
|
||||
case TERMINATE_SIG: {
|
||||
BSP_terminate(0);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/1) */
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&QHsm_top);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/1/2/1/2) ...........................................................*/
|
||||
static QState Table_serving(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/2) */
|
||||
case Q_ENTRY_SIG: {
|
||||
uint8_t n;
|
||||
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
|
||||
if ((me->isHungry[n] != 0U)
|
||||
&& (me->fork[LEFT(n)] == FREE)
|
||||
&& (me->fork[n] == FREE))
|
||||
{
|
||||
TableEvt *te;
|
||||
|
||||
me->fork[LEFT(n)] = USED;
|
||||
me->fork[n] = USED;
|
||||
te = Q_NEW(TableEvt, EAT_SIG);
|
||||
te->philoNum = n;
|
||||
QF_PUBLISH(&te->super, me);
|
||||
me->isHungry[n] = 0U;
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
}
|
||||
}
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/0) */
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
m = LEFT(n);
|
||||
/* @(/2/1/2/1/2/0/0) */
|
||||
if ((me->fork[m] == FREE) && (me->fork[n] == FREE)) {
|
||||
TableEvt *pe;
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = n;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(n, "eating ");
|
||||
status = Q_HANDLED();
|
||||
}
|
||||
/* @(/2/1/2/1/2/0/1) */
|
||||
else {
|
||||
me->isHungry[n] = 1U;
|
||||
status = Q_HANDLED();
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/1) */
|
||||
case DONE_SIG: {
|
||||
uint8_t n, m;
|
||||
TableEvt *pe;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
m = RIGHT(n); /* check the right neighbor */
|
||||
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[m] == FREE)) {
|
||||
me->fork[n] = USED;
|
||||
me->fork[m] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
m = LEFT(n); /* check the left neighbor */
|
||||
n = LEFT(m); /* left fork of the left neighbor */
|
||||
if ((me->isHungry[m] != 0U) && (me->fork[n] == FREE)) {
|
||||
me->fork[m] = USED;
|
||||
me->fork[n] = USED;
|
||||
me->isHungry[m] = 0U;
|
||||
pe = Q_NEW(TableEvt, EAT_SIG);
|
||||
pe->philoNum = m;
|
||||
QF_PUBLISH(&pe->super, me);
|
||||
BSP_displayPhilStat(m, "eating ");
|
||||
}
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/2) */
|
||||
case EAT_SIG: {
|
||||
Q_ERROR();
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/2/3) */
|
||||
case PAUSE_SIG: {
|
||||
status = Q_TRAN(&Table_paused);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&Table_active);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/* @(/2/1/2/1/3) ...........................................................*/
|
||||
static QState Table_paused(Table * const me, QEvt const * const e) {
|
||||
QState status;
|
||||
switch (e->sig) {
|
||||
/* @(/2/1/2/1/3) */
|
||||
case Q_ENTRY_SIG: {
|
||||
BSP_displayPaused(1U);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3) */
|
||||
case Q_EXIT_SIG: {
|
||||
BSP_displayPaused(0U);
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/0) */
|
||||
case PAUSE_SIG: {
|
||||
status = Q_TRAN(&Table_serving);
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/1) */
|
||||
case HUNGRY_SIG: {
|
||||
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* philo ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
me->isHungry[n] = 1U;
|
||||
BSP_displayPhilStat(n, "hungry ");
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
/* @(/2/1/2/1/3/2) */
|
||||
case DONE_SIG: {
|
||||
uint8_t n, m;
|
||||
|
||||
n = Q_EVT_CAST(TableEvt)->philoNum;
|
||||
/* phil ID must be in range and he must be not hungry */
|
||||
Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
|
||||
|
||||
BSP_displayPhilStat(n, "thinking");
|
||||
m = LEFT(n);
|
||||
/* both forks of Phil[n] must be used */
|
||||
Q_ASSERT((me->fork[n] == USED) && (me->fork[m] == USED));
|
||||
|
||||
me->fork[m] = FREE;
|
||||
me->fork[n] = FREE;
|
||||
status = Q_HANDLED();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
status = Q_SUPER(&Table_active);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cortex_m3.xml" id="drivers" xml="stellaris_cortex_m3.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="Stellaris LM3S811" href="devices/lm3s811.xml" id="Stellaris LM3S811" xml="lm3s811.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface">
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cs_dap.xml" id="drivers" xml="stellaris_cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/stellaris_cortex_m4.xml" id="drivers" xml="stellaris_cortex_m4.xml" xmlpath="drivers"/>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="Stellaris LM4F120H5QR" href="devices/lm4f120h5qr.xml" id="Stellaris LM4F120H5QR" xml="lm4f120h5qr.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#
|
||||
#Mon Oct 22 20:04:48 EDT 2012
|
||||
#Wed Feb 20 14:53:22 EST 2013
|
||||
default.languagetoolchain.version=1.10
|
||||
release.languagetoolchain.dir=C\:\\tools\\Microchip\\xc16\\v1.10\\bin
|
||||
default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=ae49f27f321ad2fcdb4bf7eeffe95237
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#
|
||||
#Mon Oct 22 16:26:24 EDT 2012
|
||||
#Wed Feb 20 14:49:40 EST 2013
|
||||
default.languagetoolchain.version=1.10
|
||||
release.languagetoolchain.dir=C\:\\tools\\Microchip\\xc16\\v1.10\\bin
|
||||
default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=ae49f27f321ad2fcdb4bf7eeffe95237
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#
|
||||
#Mon Oct 22 20:35:39 EDT 2012
|
||||
#Wed Feb 20 14:54:20 EST 2013
|
||||
default.languagetoolchain.version=1.10
|
||||
release.languagetoolchain.dir=C\:\\tools\\Microchip\\xc16\\v1.10\\bin
|
||||
default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=ae49f27f321ad2fcdb4bf7eeffe95237
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#
|
||||
#Fri Oct 19 19:21:58 EDT 2012
|
||||
#Wed Feb 20 14:50:23 EST 2013
|
||||
default.languagetoolchain.version=1.10
|
||||
release.languagetoolchain.dir=C\:\\tools\\Microchip\\xc16\\v1.10\\bin
|
||||
default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=ae49f27f321ad2fcdb4bf7eeffe95237
|
||||
|
170
ports/arm-cortex/qk/ti_arm/make_cortex-m4f_ti.bat
Normal file
170
ports/arm-cortex/qk/ti_arm/make_cortex-m4f_ti.bat
Normal file
@ -0,0 +1,170 @@
|
||||
@echo off
|
||||
:: ===========================================================================
|
||||
:: Product: QP/C buld script for ARM Cortex-M4F, QK port, TI_ARM comiler
|
||||
:: Last Updated for Version: 4.5.04
|
||||
:: Date of the Last Update: Feb 15, 2013
|
||||
::
|
||||
:: Q u a n t u m L e a P s
|
||||
:: ---------------------------
|
||||
:: innovating embedded systems
|
||||
::
|
||||
:: Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
::
|
||||
:: This program is open source software: you can redistribute it and/or
|
||||
:: modify it under the terms of the GNU General Public License as published
|
||||
:: by the Free Software Foundation, either version 2 of the License, or
|
||||
:: (at your option) any later version.
|
||||
::
|
||||
:: Alternatively, this program may be distributed and modified under the
|
||||
:: terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
:: the GNU General Public License and are specifically designed for
|
||||
:: licensees interested in retaining the proprietary status of their code.
|
||||
::
|
||||
:: This program is distributed in the hope that it will be useful,
|
||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
:: GNU General Public License for more details.
|
||||
::
|
||||
:: You should have received a copy of the GNU General Public License
|
||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
::
|
||||
:: Contact information:
|
||||
:: Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
:: http://www.state-machine.com
|
||||
:: e-mail: info@quantum-leaps.com
|
||||
:: ===========================================================================
|
||||
setlocal
|
||||
|
||||
:: adjust the following path to the location where you've installed
|
||||
:: the TI_ARM toolset...
|
||||
::
|
||||
if "%TI_ARM%"=="" set TI_ARM="C:\tools\TI\ccsv5\ccsv5\tools\compiler\arm_5.0.1"
|
||||
|
||||
set CC=%TI_ARM%\bin\armcl
|
||||
set ASM=%TI_ARM%\bin\armcl
|
||||
set LIB=%TI_ARM%\bin\armar
|
||||
|
||||
set QP_INCDIR=..\..\..\..\include
|
||||
|
||||
set ARM_CORE=cortex-m4
|
||||
set ARM_ARCH=v7M4
|
||||
set ARM_FPU=FPv4SPD16
|
||||
|
||||
if "%1"=="" (
|
||||
echo default selected
|
||||
set BINDIR=dbg
|
||||
set CCFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
set ASMFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
if "%1"=="rel" (
|
||||
echo rel selected
|
||||
set BINDIR=rel
|
||||
set CCFLAGS=-c -O3 -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
set ASMFLAGS=-c -O3 -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
if "%1"=="spy" (
|
||||
echo spy selected
|
||||
set BINDIR=spy
|
||||
set CCFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include -DQ_SPY
|
||||
set ASMFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
|
||||
mkdir %BINDIR%
|
||||
set LIBDIR=%BINDIR%
|
||||
set LIBFLAGS=r
|
||||
erase %LIBDIR%\qp_%ARM_CORE%f_ti.lib
|
||||
|
||||
:: QEP ----------------------------------------------------------------------
|
||||
set SRCDIR=..\..\..\..\qep\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qep.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qfsm_ini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qfsm_dis.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_ini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_dis.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_top.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_in.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qep.obj %BINDIR%\qfsm_ini.obj %BINDIR%\qfsm_dis.obj %BINDIR%\qhsm_ini.obj %BINDIR%\qhsm_dis.obj %BINDIR%\qhsm_top.obj %BINDIR%\qhsm_in.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: QF -----------------------------------------------------------------------
|
||||
set SRCDIR=..\..\..\..\qf\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_defer.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_fifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_lifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_get_.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_sub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_usub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_usuba.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_fifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_get.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_init.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_lifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_act.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_gc.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_log2.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_new.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pool.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_psini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pspub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pwr2.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_tick.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_get.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_init.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_put.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_ctor.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_arm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_darm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_rarm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_ctr.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qa_defer.obj %BINDIR%\qa_fifo.obj %BINDIR%\qa_lifo.obj %BINDIR%\qa_get_.obj %BINDIR%\qa_sub.obj %BINDIR%\qa_usub.obj %BINDIR%\qa_usuba.obj %BINDIR%\qeq_fifo.obj %BINDIR%\qeq_get.obj %BINDIR%\qeq_init.obj %BINDIR%\qeq_lifo.obj %BINDIR%\qf_act.obj %BINDIR%\qf_gc.obj %BINDIR%\qf_log2.obj %BINDIR%\qf_new.obj %BINDIR%\qf_pool.obj %BINDIR%\qf_psini.obj %BINDIR%\qf_pspub.obj %BINDIR%\qf_pwr2.obj %BINDIR%\qf_tick.obj %BINDIR%\qmp_get.obj %BINDIR%\qmp_init.obj %BINDIR%\qmp_put.obj %BINDIR%\qte_ctor.obj %BINDIR%\qte_arm.obj %BINDIR%\qte_darm.obj %BINDIR%\qte_rarm.obj %BINDIR%\qte_ctr.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: QK -----------------------------------------------------------------------
|
||||
set SRCDIR=..\..\..\..\qk\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qk.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qk_sched.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qk_mutex.c
|
||||
%ASM% %ASMFLAGS% -fr%BINDIR% qk_port.s
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qk.obj %BINDIR%\qk_sched.obj %BINDIR%\qk_mutex.obj %BINDIR%\qk_port.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: QS -----------------------------------------------------------------------
|
||||
if not "%1"=="spy" goto clean
|
||||
|
||||
set SRCDIR=..\..\..\..\qs\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_blk.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_byte.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_f32.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_f64.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_mem.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_str.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qs.obj %BINDIR%\qs_.obj %BINDIR%\qs_blk.obj %BINDIR%\qs_byte.obj %BINDIR%\qs_f32.obj %BINDIR%\qs_f64.obj %BINDIR%\qs_mem.obj %BINDIR%\qs_str.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: --------------------------------------------------------------------------
|
||||
|
||||
:clean
|
||||
|
||||
endlocal
|
42
ports/arm-cortex/qk/ti_arm/qep_port.h
Normal file
42
ports/arm-cortex/qk/ti_arm/qep_port.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*****************************************************************************
|
||||
* Product: QEP/C port
|
||||
* Last Updated for Version: 4.4.02
|
||||
* Date of the Last Update: May 14, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qep_port_h
|
||||
#define qep_port_h
|
||||
|
||||
#include <stdint.h> /* exact-width integers, WG14/N843 C99, 7.18.1.1 */
|
||||
|
||||
#include "qep.h" /* QEP platform-independent public interface */
|
||||
|
||||
#endif /* qep_port_h */
|
68
ports/arm-cortex/qk/ti_arm/qf_port.h
Normal file
68
ports/arm-cortex/qk/ti_arm/qf_port.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*****************************************************************************
|
||||
* Product: QF/C, Cortex-M3, QK port, TI_ARM compiler
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 15, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qf_port_h
|
||||
#define qf_port_h
|
||||
|
||||
/* The maximum number of active objects in the application, see NOTE01 */
|
||||
#define QF_MAX_ACTIVE 32
|
||||
/* The maximum number of event pools in the application */
|
||||
#define QF_MAX_EPOOL 6
|
||||
|
||||
/* QF interrupt disable/enable */
|
||||
#define QF_INT_DISABLE() asm(" CPSID I")
|
||||
#define QF_INT_ENABLE() asm(" CPSIE I")
|
||||
|
||||
/* QF critical section entry/exit */
|
||||
/* QF_CRIT_STAT_TYPE not defined: unconditional interrupt unlocking" policy */
|
||||
#define QF_CRIT_ENTRY(dummy) asm(" CPSID I")
|
||||
#define QF_CRIT_EXIT(dummy) asm(" CPSIE I")
|
||||
|
||||
/* is the target M3 or M4? (M0/M0+/M1 don't support CLZ) */
|
||||
#if (defined __TI_TMS470_V7M3__) || (defined __TI_TMS470_V7M4__)
|
||||
/* the intrinsic function _norm() generates the CLZ instruction */
|
||||
#define QF_LOG2(n_) ((uint8_t)(32U - _norm(n_)))
|
||||
#endif
|
||||
|
||||
#include "qep_port.h" /* QEP port */
|
||||
#include "qk_port.h" /* QK port */
|
||||
#include "qf.h" /* QF platform-independent public interface */
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE01:
|
||||
* The maximum number of active objects QF_MAX_ACTIVE can be increased
|
||||
* up to 63, if necessary. Here it is set to a lower level to save some RAM.
|
||||
*/
|
||||
|
||||
#endif /* qf_port_h */
|
56
ports/arm-cortex/qk/ti_arm/qk_port.h
Normal file
56
ports/arm-cortex/qk/ti_arm/qk_port.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*****************************************************************************
|
||||
* Product: QK/C, Cortex-M3, QK port, TI_ARM compiler
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 15, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qk_port_h
|
||||
#define qk_port_h
|
||||
|
||||
/* QK interrupt entry and exit */
|
||||
#define QK_ISR_ENTRY() do { \
|
||||
asm(" CPSID I"); \
|
||||
++QK_intNest_; \
|
||||
QF_QS_ISR_ENTRY(QK_intNest_, QK_currPrio_); \
|
||||
asm(" CPSIE I"); \
|
||||
} while (0)
|
||||
|
||||
#define QK_ISR_EXIT() do { \
|
||||
asm(" CPSID I"); \
|
||||
QF_QS_ISR_EXIT(QK_intNest_, QK_currPrio_); \
|
||||
--QK_intNest_; \
|
||||
*Q_UINT2PTR_CAST(uint32_t, 0xE000ED04U) = (uint32_t)0x10000000U; \
|
||||
asm(" CPSIE I"); \
|
||||
} while (0)
|
||||
|
||||
#include "qk.h" /* QK platform-independent public interface */
|
||||
|
||||
#endif /* qk_port_h */
|
52
ports/arm-cortex/qk/ti_arm/qs_port.h
Normal file
52
ports/arm-cortex/qk/ti_arm/qs_port.h
Normal file
@ -0,0 +1,52 @@
|
||||
/*****************************************************************************
|
||||
* Product: QS/C port
|
||||
* Last Updated for Version: 4.4.02
|
||||
* Date of the Last Update: May 14, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qs_port_h
|
||||
#define qs_port_h
|
||||
|
||||
#define QS_TIME_SIZE 4
|
||||
#define QS_OBJ_PTR_SIZE 4
|
||||
#define QS_FUN_PTR_SIZE 4
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE: QS might be used with or without other QP components, in which
|
||||
* case the separate definitions of the macros Q_ROM, Q_ROM_VAR,
|
||||
* QF_CRIT_STAT_TYPE, QF_CRIT_ENTRY, and QF_CRIT_EXIT are needed. In this
|
||||
* port QS is configured to be used with the other QP component, by
|
||||
* simply including "qf_port.h" *before* "qs.h".
|
||||
*/
|
||||
#include "qf_port.h" /* use QS with QF */
|
||||
#include "qs.h" /* QS platform-independent public interface */
|
||||
|
||||
#endif /* qs_port_h */
|
157
ports/arm-cortex/vanilla/ti_arm/make_cortex-m4f_ti.bat
Normal file
157
ports/arm-cortex/vanilla/ti_arm/make_cortex-m4f_ti.bat
Normal file
@ -0,0 +1,157 @@
|
||||
@echo off
|
||||
:: ===========================================================================
|
||||
:: Product: QP/C buld script for ARM Cortex-M4F, Vanilla port, TI_ARM comiler
|
||||
:: Last Updated for Version: 4.5.04
|
||||
:: Date of the Last Update: Feb 15, 2013
|
||||
::
|
||||
:: Q u a n t u m L e a P s
|
||||
:: ---------------------------
|
||||
:: innovating embedded systems
|
||||
::
|
||||
:: Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
::
|
||||
:: This program is open source software: you can redistribute it and/or
|
||||
:: modify it under the terms of the GNU General Public License as published
|
||||
:: by the Free Software Foundation, either version 2 of the License, or
|
||||
:: (at your option) any later version.
|
||||
::
|
||||
:: Alternatively, this program may be distributed and modified under the
|
||||
:: terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
:: the GNU General Public License and are specifically designed for
|
||||
:: licensees interested in retaining the proprietary status of their code.
|
||||
::
|
||||
:: This program is distributed in the hope that it will be useful,
|
||||
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
:: GNU General Public License for more details.
|
||||
::
|
||||
:: You should have received a copy of the GNU General Public License
|
||||
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
::
|
||||
:: Contact information:
|
||||
:: Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
:: http://www.state-machine.com
|
||||
:: e-mail: info@quantum-leaps.com
|
||||
:: ===========================================================================
|
||||
setlocal
|
||||
|
||||
:: adjust the following path to the location where you've installed
|
||||
:: the TI_ARM toolset...
|
||||
::
|
||||
if "%TI_ARM%"=="" set TI_ARM="C:\tools\TI\ccsv5\ccsv5\tools\compiler\arm_5.0.1"
|
||||
|
||||
set CC=%TI_ARM%\bin\armcl
|
||||
set ASM=%TI_ARM%\bin\armcl
|
||||
set LIB=%TI_ARM%\bin\armar
|
||||
|
||||
set QP_INCDIR=..\..\..\..\include
|
||||
|
||||
set ARM_CORE=cortex-m4
|
||||
set ARM_ARCH=v7M4
|
||||
set ARM_FPU=FPv4SPD16
|
||||
|
||||
if "%1"=="" (
|
||||
echo default selected
|
||||
set BINDIR=dbg
|
||||
set CCFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
set ASMFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
if "%1"=="rel" (
|
||||
echo rel selected
|
||||
set BINDIR=rel
|
||||
set CCFLAGS=-c -O3 -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
set ASMFLAGS=-c -O3 -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
if "%1"=="spy" (
|
||||
echo spy selected
|
||||
set BINDIR=spy
|
||||
set CCFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include -DQ_SPY
|
||||
set ASMFLAGS=-c -g -O -m%ARM_ARCH% --float_support=%ARM_FPU% --code_state=16 --gcc --abi=eabi -me --gen_func_subsections=on --ual --preproc_with_compile -I%TI_ARM%\include
|
||||
)
|
||||
|
||||
mkdir %BINDIR%
|
||||
set LIBDIR=%BINDIR%
|
||||
set LIBFLAGS=r
|
||||
erase %LIBDIR%\qp_%ARM_CORE%f_ti.lib
|
||||
|
||||
:: QEP ----------------------------------------------------------------------
|
||||
set SRCDIR=..\..\..\..\qep\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qep.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qfsm_ini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qfsm_dis.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_ini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_dis.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_top.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qhsm_in.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qep.obj %BINDIR%\qfsm_ini.obj %BINDIR%\qfsm_dis.obj %BINDIR%\qhsm_ini.obj %BINDIR%\qhsm_dis.obj %BINDIR%\qhsm_top.obj %BINDIR%\qhsm_in.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: QF -----------------------------------------------------------------------
|
||||
set SRCDIR=..\..\..\..\qf\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_defer.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_fifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_lifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_get_.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_sub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_usub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qa_usuba.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_fifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_get.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_init.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qeq_lifo.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_act.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_gc.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_log2.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_new.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pool.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_psini.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pspub.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_pwr2.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qf_tick.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_get.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_init.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qmp_put.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_ctor.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_arm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_darm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_rarm.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qte_ctr.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qvanilla.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qa_defer.obj %BINDIR%\qa_fifo.obj %BINDIR%\qa_lifo.obj %BINDIR%\qa_get_.obj %BINDIR%\qa_sub.obj %BINDIR%\qa_usub.obj %BINDIR%\qa_usuba.obj %BINDIR%\qeq_fifo.obj %BINDIR%\qeq_get.obj %BINDIR%\qeq_init.obj %BINDIR%\qeq_lifo.obj %BINDIR%\qf_act.obj %BINDIR%\qf_gc.obj %BINDIR%\qf_log2.obj %BINDIR%\qf_new.obj %BINDIR%\qf_pool.obj %BINDIR%\qf_psini.obj %BINDIR%\qf_pspub.obj %BINDIR%\qf_pwr2.obj %BINDIR%\qf_tick.obj %BINDIR%\qmp_get.obj %BINDIR%\qmp_init.obj %BINDIR%\qmp_put.obj %BINDIR%\qte_ctor.obj %BINDIR%\qte_arm.obj %BINDIR%\qte_darm.obj %BINDIR%\qte_rarm.obj %BINDIR%\qte_ctr.obj %BINDIR%\qvanilla.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: QS -----------------------------------------------------------------------
|
||||
if not "%1"=="spy" goto clean
|
||||
|
||||
set SRCDIR=..\..\..\..\qs\source
|
||||
set CCINC=-I. -I%QP_INCDIR% -I%SRCDIR% -fr%BINDIR%
|
||||
|
||||
@echo on
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_blk.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_byte.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_f32.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_f64.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_mem.c
|
||||
%CC% %CCFLAGS% %CCINC% %SRCDIR%\qs_str.c
|
||||
|
||||
%LIB% %LIBFLAGS% %LIBDIR%\qp_%ARM_CORE%f_ti.lib %BINDIR%\qs.obj %BINDIR%\qs_.obj %BINDIR%\qs_blk.obj %BINDIR%\qs_byte.obj %BINDIR%\qs_f32.obj %BINDIR%\qs_f64.obj %BINDIR%\qs_mem.obj %BINDIR%\qs_str.obj
|
||||
@echo off
|
||||
erase %BINDIR%\*.obj
|
||||
|
||||
:: --------------------------------------------------------------------------
|
||||
|
||||
:clean
|
||||
|
||||
endlocal
|
42
ports/arm-cortex/vanilla/ti_arm/qep_port.h
Normal file
42
ports/arm-cortex/vanilla/ti_arm/qep_port.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*****************************************************************************
|
||||
* Product: QEP/C port
|
||||
* Last Updated for Version: 4.4.02
|
||||
* Date of the Last Update: May 14, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qep_port_h
|
||||
#define qep_port_h
|
||||
|
||||
#include <stdint.h> /* exact-width integers, WG14/N843 C99, 7.18.1.1 */
|
||||
|
||||
#include "qep.h" /* QEP platform-independent public interface */
|
||||
|
||||
#endif /* qep_port_h */
|
68
ports/arm-cortex/vanilla/ti_arm/qf_port.h
Normal file
68
ports/arm-cortex/vanilla/ti_arm/qf_port.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*****************************************************************************
|
||||
* Product: QF/C, Cortex-M3, Vanilla port, TI_ARM compiler
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 15, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qf_port_h
|
||||
#define qf_port_h
|
||||
|
||||
/* The maximum number of active objects in the application, see NOTE01 */
|
||||
#define QF_MAX_ACTIVE 32
|
||||
/* The maximum number of event pools in the application */
|
||||
#define QF_MAX_EPOOL 6
|
||||
|
||||
/* QF interrupt disable/enable */
|
||||
#define QF_INT_DISABLE() asm(" CPSID I")
|
||||
#define QF_INT_ENABLE() asm(" CPSIE I")
|
||||
|
||||
/* QF critical section entry/exit */
|
||||
/* QF_CRIT_STAT_TYPE not defined: unconditional interrupt unlocking" policy */
|
||||
#define QF_CRIT_ENTRY(dummy) asm(" CPSID I")
|
||||
#define QF_CRIT_EXIT(dummy) asm(" CPSIE I")
|
||||
|
||||
/* is the target M3 or M4? (M0/M0+/M1 don't support CLZ) */
|
||||
#if (defined __TI_TMS470_V7M3__) || (defined __TI_TMS470_V7M4__)
|
||||
/* the intrinsic function _norm() generates the CLZ instruction */
|
||||
#define QF_LOG2(n_) ((uint8_t)(32U - _norm(n_)))
|
||||
#endif
|
||||
|
||||
#include "qep_port.h" /* QEP port */
|
||||
#include "qvanilla.h" /* "Vanilla" cooperative kernel */
|
||||
#include "qf.h" /* QF platform-independent public interface */
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE01:
|
||||
* The maximum number of active objects QF_MAX_ACTIVE can be increased
|
||||
* up to 63, if necessary. Here it is set to a lower level to save some RAM.
|
||||
*/
|
||||
|
||||
#endif /* qf_port_h */
|
52
ports/arm-cortex/vanilla/ti_arm/qs_port.h
Normal file
52
ports/arm-cortex/vanilla/ti_arm/qs_port.h
Normal file
@ -0,0 +1,52 @@
|
||||
/*****************************************************************************
|
||||
* Product: QS/C port
|
||||
* Last Updated for Version: 4.4.02
|
||||
* Date of the Last Update: May 14, 2012
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alternatively, this program may be distributed and modified under the
|
||||
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
* the GNU General Public License and are specifically designed for
|
||||
* licensees interested in retaining the proprietary status of their code.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Contact information:
|
||||
* Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
* http://www.state-machine.com
|
||||
* e-mail: info@quantum-leaps.com
|
||||
*****************************************************************************/
|
||||
#ifndef qs_port_h
|
||||
#define qs_port_h
|
||||
|
||||
#define QS_TIME_SIZE 4
|
||||
#define QS_OBJ_PTR_SIZE 4
|
||||
#define QS_FUN_PTR_SIZE 4
|
||||
|
||||
/*****************************************************************************
|
||||
* NOTE: QS might be used with or without other QP components, in which
|
||||
* case the separate definitions of the macros Q_ROM, Q_ROM_VAR,
|
||||
* QF_CRIT_STAT_TYPE, QF_CRIT_ENTRY, and QF_CRIT_EXIT are needed. In this
|
||||
* port QS is configured to be used with the other QP component, by
|
||||
* simply including "qf_port.h" *before* "qs.h".
|
||||
*/
|
||||
#include "qf_port.h" /* use QS with QF */
|
||||
#include "qs.h" /* QS platform-independent public interface */
|
||||
|
||||
#endif /* qs_port_h */
|
6
ports/pic24_dspic/qk/xc16/c
Normal file
6
ports/pic24_dspic/qk/xc16/c
Normal file
@ -0,0 +1,6 @@
|
||||
spy\qs_str.o: ..\..\..\..\qs\source\qs_str.c \
|
||||
..\..\..\..\qs\source\/qs_pkg.h qs_port.h qf_port.h qep_port.h \
|
||||
..\..\..\..\include/qep.h ..\..\..\..\include/qevt.h qk_port.h \
|
||||
..\..\..\..\include/qk.h ..\..\..\..\include/qequeue.h \
|
||||
..\..\..\..\include/qmpool.h ..\..\..\..\include/qpset.h \
|
||||
..\..\..\..\include/qf.h ..\..\..\..\include/qs.h
|
@ -1,13 +1,13 @@
|
||||
/*****************************************************************************
|
||||
* Product: QF/C, PIC24/dsPIC, QK kernel, MPLABX-XC16 compiler
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Oct 15, 2012
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 20, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
@ -45,14 +45,16 @@
|
||||
#define QF_TIMEEVT_CTR_SIZE 2
|
||||
|
||||
/* QF interrupt disable/enable, see NOTE02 */
|
||||
#define QF_INT_DISABLE() __asm__ volatile("disi #0x3FFF")
|
||||
#define QF_INT_ENABLE() __asm__ volatile("disi #0x0000")
|
||||
#define QF_INT_DISABLE() __builtin_disi(0x3FFFU)
|
||||
#define QF_INT_ENABLE() __builtin_disi(0x0000U)
|
||||
|
||||
/* QF critical section entry/exit, see NOTE02 */
|
||||
/* QF_CRIT_STAT_TYPE not defined: unconditional interrupt unlocking" policy */
|
||||
#define QF_CRIT_ENTRY(dummy) __asm__ volatile("disi #0x3FFF")
|
||||
#define QF_CRIT_EXIT(dummy) __asm__ volatile("disi #0x0000")
|
||||
#define QF_CRIT_ENTRY(dummy) __builtin_disi(0x3FFFU)
|
||||
#define QF_CRIT_EXIT(dummy) __builtin_disi(0x0000U)
|
||||
|
||||
/* fast log-base-2 with FBCL instruction, NOTE03 */
|
||||
#define QF_LOG2(n_) ((uint8_t)(15 + __builtin_fbcl(n_)))
|
||||
|
||||
#include "qep_port.h" /* QEP port */
|
||||
#include "qk_port.h" /* QK preemptive kernel port */
|
||||
@ -86,6 +88,13 @@
|
||||
* level. For example, the default priority level for all interrupts is 4 out
|
||||
* of reset. If you don't change this level for any interrupt the nesting of
|
||||
* interrupt will not occur.
|
||||
*
|
||||
* NOTE03:
|
||||
* The FBCL instruction (Find First Bit Change Left) determines the exponent
|
||||
* of a value by detecting the first bit change starting from the value<EFBFBD>s sign
|
||||
* bit and working towards the LSB. Since the PIC24/dsPIC<EFBFBD>s barrel shifter
|
||||
* uses negative values to specify a left shift, the FBCL instruction returns
|
||||
* the negated exponent of a value. This value added to 15 gives the log-2.
|
||||
*/
|
||||
|
||||
#endif /* qf_port_h */
|
||||
|
6
ports/pic24_dspic/vanilla/xc16/c
Normal file
6
ports/pic24_dspic/vanilla/xc16/c
Normal file
@ -0,0 +1,6 @@
|
||||
spy\qs_str.o: ..\..\..\..\qs\source\qs_str.c \
|
||||
..\..\..\..\qs\source\/qs_pkg.h qs_port.h qf_port.h qep_port.h \
|
||||
..\..\..\..\include/qep.h ..\..\..\..\include/qevt.h \
|
||||
..\..\..\..\include/qvanilla.h ..\..\..\..\include/qequeue.h \
|
||||
..\..\..\..\include/qmpool.h ..\..\..\..\include/qpset.h \
|
||||
..\..\..\..\include/qf.h ..\..\..\..\include/qs.h
|
@ -1,13 +1,13 @@
|
||||
/*****************************************************************************
|
||||
* Product: QF/C, PIC24/dsPIC, vanilla kernel, MPLABX-XC16 compiler
|
||||
* Last Updated for Version: 4.5.02
|
||||
* Date of the Last Update: Oct 02, 2012
|
||||
* Last Updated for Version: 4.5.04
|
||||
* Date of the Last Update: Feb 20, 2013
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
|
||||
* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
*
|
||||
* This program is open source software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as published
|
||||
@ -45,13 +45,16 @@
|
||||
#define QF_TIMEEVT_CTR_SIZE 2
|
||||
|
||||
/* QF interrupt disable/enable, see NOTE02 */
|
||||
#define QF_INT_DISABLE() __asm__ volatile("disi #0x3FFF")
|
||||
#define QF_INT_ENABLE() __asm__ volatile("disi #0x0000")
|
||||
#define QF_INT_DISABLE() __builtin_disi(0x3FFFU)
|
||||
#define QF_INT_ENABLE() __builtin_disi(0x0000U)
|
||||
|
||||
/* QF critical section entry/exit, see NOTE02 */
|
||||
/* QF_CRIT_STAT_TYPE not defined: unconditional interrupt unlocking" policy */
|
||||
#define QF_CRIT_ENTRY(dummy) __asm__ volatile("disi #0x3FFF")
|
||||
#define QF_CRIT_EXIT(dummy) __asm__ volatile("disi #0x0000")
|
||||
#define QF_CRIT_ENTRY(dummy) __builtin_disi(0x3FFFU)
|
||||
#define QF_CRIT_EXIT(dummy) __builtin_disi(0x0000U)
|
||||
|
||||
/* fast log-base-2 with FBCL instruction, NOTE03 */
|
||||
#define QF_LOG2(n_) ((uint8_t)(15 + __builtin_fbcl(n_)))
|
||||
|
||||
|
||||
#include "qep_port.h" /* QEP port */
|
||||
@ -86,6 +89,13 @@
|
||||
* level. For example, the default priority level for all interrupts is 4 out
|
||||
* of reset. If you don't change this level for any interrupt the nesting of
|
||||
* interrupt will not occur.
|
||||
*
|
||||
* NOTE03:
|
||||
* The FBCL instruction (Find First Bit Change Left) determines the exponent
|
||||
* of a value by detecting the first bit change starting from the value<EFBFBD>s sign
|
||||
* bit and working towards the LSB. Since the PIC24/dsPIC<EFBFBD>s barrel shifter
|
||||
* uses negative values to specify a left shift, the FBCL instruction returns
|
||||
* the negated exponent of a value. This value added to 15 gives the log-2.
|
||||
*/
|
||||
|
||||
#endif /* qf_port_h */
|
||||
|
Loading…
x
Reference in New Issue
Block a user