diff options
Diffstat (limited to 'Software/Code_Composer')
46 files changed, 11814 insertions, 0 deletions
diff --git a/Software/Code_Composer/.gitignore b/Software/Code_Composer/.gitignore new file mode 100644 index 000000000..2a0f30a4a --- /dev/null +++ b/Software/Code_Composer/.gitignore @@ -0,0 +1,37 @@ +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Eclipse artefacts +.jxbrowser-data +.metadata +.launches +.settings +RemoteSystemsTempFiles +Debug
\ No newline at end of file diff --git a/Software/Code_Composer/driverlib/.ccsproject b/Software/Code_Composer/driverlib/.ccsproject new file mode 100644 index 000000000..59ecbc646 --- /dev/null +++ b/Software/Code_Composer/driverlib/.ccsproject @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <deviceVariant value="Cortex M.TM4C1230C3PM"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="5.2.6"/> + <isElfFormat value="true"/> + <createSlaveProjects value=""/> + <origin value="C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/ccs"/> +</projectOptions> diff --git a/Software/Code_Composer/driverlib/.cproject b/Software/Code_Composer/driverlib/.cproject new file mode 100644 index 000000000..d9a039bb1 --- /dev/null +++ b/Software/Code_Composer/driverlib/.cproject @@ -0,0 +1,151 @@ +<?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.685356839"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.685356839" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.685356839" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.685356839." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain.556860953" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.840863898"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1269380497" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1230C3PM"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.845879492" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug.1177924406" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug.822312293" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug.1682346048" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.336313940" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.121645756" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.150942486" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.2128821326" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.1979219081" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.400965060" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C1230C3PM"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.1110361838" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.228236424" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1762067020" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1403052508" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.432611225" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.793702323" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.729470734" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.78286368" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.109071449" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.2" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.1764567421" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1963772937" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.1707559591" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.389338619" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1702781897" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.840863898" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.308039594" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1147094528"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1147094528" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1147094528" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1147094528." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain.1600921137" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.1733835997"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1039779561" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1230C3PM"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.377539797" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease.926072005" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease.426122207" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease.807515775" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.152973868" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.2041302230" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.1356687106" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.647215386" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.1426938297" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.945925571" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C1230C3PM"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.1901130649" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.969033803" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1607498241" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.617214240" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1101931872" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1706714763" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.680579105" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.2002989717" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.438183656" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.875386775" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.87191398" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1727453496" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.1733835997" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.1031439932" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="driverlib.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1159852020" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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> +</cproject> diff --git a/Software/Code_Composer/driverlib/.project b/Software/Code_Composer/driverlib/.project new file mode 100644 index 000000000..e9d729b3d --- /dev/null +++ b/Software/Code_Composer/driverlib/.project @@ -0,0 +1,204 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>driverlib</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>adc.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/adc.c</locationURI> + </link> + <link> + <name>aes.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/aes.c</locationURI> + </link> + <link> + <name>can.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/can.c</locationURI> + </link> + <link> + <name>comp.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/comp.c</locationURI> + </link> + <link> + <name>cpu.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/cpu.c</locationURI> + </link> + <link> + <name>crc.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/crc.c</locationURI> + </link> + <link> + <name>des.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/des.c</locationURI> + </link> + <link> + <name>eeprom.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/eeprom.c</locationURI> + </link> + <link> + <name>emac.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/emac.c</locationURI> + </link> + <link> + <name>epi.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/epi.c</locationURI> + </link> + <link> + <name>epi_workaround_ccs.s</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/epi_workaround_ccs.s</locationURI> + </link> + <link> + <name>flash.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/flash.c</locationURI> + </link> + <link> + <name>fpu.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/fpu.c</locationURI> + </link> + <link> + <name>gpio.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/gpio.c</locationURI> + </link> + <link> + <name>hibernate.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/hibernate.c</locationURI> + </link> + <link> + <name>i2c.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/i2c.c</locationURI> + </link> + <link> + <name>interrupt.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/interrupt.c</locationURI> + </link> + <link> + <name>lcd.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/lcd.c</locationURI> + </link> + <link> + <name>mpu.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/mpu.c</locationURI> + </link> + <link> + <name>onewire.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/onewire.c</locationURI> + </link> + <link> + <name>pwm.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/pwm.c</locationURI> + </link> + <link> + <name>qei.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/qei.c</locationURI> + </link> + <link> + <name>shamd5.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/shamd5.c</locationURI> + </link> + <link> + <name>ssi.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/ssi.c</locationURI> + </link> + <link> + <name>sw_crc.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/sw_crc.c</locationURI> + </link> + <link> + <name>sysctl.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/sysctl.c</locationURI> + </link> + <link> + <name>sysexc.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/sysexc.c</locationURI> + </link> + <link> + <name>systick.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/systick.c</locationURI> + </link> + <link> + <name>timer.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/timer.c</locationURI> + </link> + <link> + <name>uart.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/uart.c</locationURI> + </link> + <link> + <name>udma.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/udma.c</locationURI> + </link> + <link> + <name>usb.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/usb.c</locationURI> + </link> + <link> + <name>watchdog.c</name> + <type>1</type> + <locationURI>SW_ROOT/driverlib/watchdog.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>ORIGINAL_PROJECT_ROOT</name> + <value>file:/C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/ccs</value> + </variable> + <variable> + <name>SW_ROOT</name> + <value>$%7BPARENT-2-ORIGINAL_PROJECT_ROOT%7D</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/driverlib/macros.ini_initial b/Software/Code_Composer/driverlib/macros.ini_initial new file mode 100644 index 000000000..89a26bd0c --- /dev/null +++ b/Software/Code_Composer/driverlib/macros.ini_initial @@ -0,0 +1 @@ +SW_ROOT = ../.. diff --git a/Software/Code_Composer/grlib/.ccsproject b/Software/Code_Composer/grlib/.ccsproject new file mode 100644 index 000000000..5668c930d --- /dev/null +++ b/Software/Code_Composer/grlib/.ccsproject @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <deviceVariant value="Cortex M.TM4C1230C3PM"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="5.2.6"/> + <isElfFormat value="true"/> + <createSlaveProjects value=""/> + <origin value="C:/ti/TivaWare_C_Series-2.1.4.178/grlib/ccs"/> +</projectOptions> diff --git a/Software/Code_Composer/grlib/.cproject b/Software/Code_Composer/grlib/.cproject new file mode 100644 index 000000000..aeca8398b --- /dev/null +++ b/Software/Code_Composer/grlib/.cproject @@ -0,0 +1,151 @@ +<?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.8469640"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.8469640" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.8469640" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.8469640." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain.613716274" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.1040227131"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1623591091" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1230C3PM"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1396229522" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug.479604260" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug.94105024" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug.1628954597" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.612458324" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1026258065" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.279997489" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.1203553848" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.926373751" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1175295039" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C1230C3PM"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.177941184" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.1254847416" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.624337068" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.804347363" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1181352709" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1443748811" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.306297170" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.1221151201" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.2052331034" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.2" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.2043071552" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1065518091" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.955171364" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1194133463" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.2948534" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug.1040227131" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.159921260" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.552980104"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.552980104" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.552980104" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep="" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.552980104." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain.457962084" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.375315226"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.797442524" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C1230C3PM"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1010503401" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease.98985026" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease.449235776" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease.2084303397" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.875004735" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1684613470" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.407350764" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.1152846226" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.704663931" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.700101351" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C1230C3PM"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.247480332" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1058998367" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.843094100" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1937114312" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1355299893" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.305177961" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.1958091874" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.2058165809" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1836142606" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.2147359138" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.746207430" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.2145470726" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease.375315226" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.library.librarianRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE.1795485172" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="grlib.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.255451283" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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> +</cproject> diff --git a/Software/Code_Composer/grlib/.project b/Software/Code_Composer/grlib/.project new file mode 100644 index 000000000..4ccdbcbd8 --- /dev/null +++ b/Software/Code_Composer/grlib/.project @@ -0,0 +1,904 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>grlib</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>canvas.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/canvas.c</locationURI> + </link> + <link> + <name>charmap.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/charmap.c</locationURI> + </link> + <link> + <name>checkbox.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/checkbox.c</locationURI> + </link> + <link> + <name>circle.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/circle.c</locationURI> + </link> + <link> + <name>container.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/container.c</locationURI> + </link> + <link> + <name>context.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/context.c</locationURI> + </link> + <link> + <name>image.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/image.c</locationURI> + </link> + <link> + <name>imgbutton.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/imgbutton.c</locationURI> + </link> + <link> + <name>keyboard.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/keyboard.c</locationURI> + </link> + <link> + <name>line.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/line.c</locationURI> + </link> + <link> + <name>listbox.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/listbox.c</locationURI> + </link> + <link> + <name>offscr1bpp.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/offscr1bpp.c</locationURI> + </link> + <link> + <name>offscr4bpp.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/offscr4bpp.c</locationURI> + </link> + <link> + <name>offscr8bpp.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/offscr8bpp.c</locationURI> + </link> + <link> + <name>pushbutton.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/pushbutton.c</locationURI> + </link> + <link> + <name>radiobutton.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/radiobutton.c</locationURI> + </link> + <link> + <name>rectangle.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/rectangle.c</locationURI> + </link> + <link> + <name>slider.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/slider.c</locationURI> + </link> + <link> + <name>string.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/string.c</locationURI> + </link> + <link> + <name>widget.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/widget.c</locationURI> + </link> + <link> + <name>fonts/fontcm12.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm12.c</locationURI> + </link> + <link> + <name>fonts/fontcm12b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm12b.c</locationURI> + </link> + <link> + <name>fonts/fontcm12i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm12i.c</locationURI> + </link> + <link> + <name>fonts/fontcm14.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm14.c</locationURI> + </link> + <link> + <name>fonts/fontcm14b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm14b.c</locationURI> + </link> + <link> + <name>fonts/fontcm14i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm14i.c</locationURI> + </link> + <link> + <name>fonts/fontcm16.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm16.c</locationURI> + </link> + <link> + <name>fonts/fontcm16b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm16b.c</locationURI> + </link> + <link> + <name>fonts/fontcm16i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm16i.c</locationURI> + </link> + <link> + <name>fonts/fontcm18.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm18.c</locationURI> + </link> + <link> + <name>fonts/fontcm18b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm18b.c</locationURI> + </link> + <link> + <name>fonts/fontcm18i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm18i.c</locationURI> + </link> + <link> + <name>fonts/fontcm20.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm20.c</locationURI> + </link> + <link> + <name>fonts/fontcm20b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm20b.c</locationURI> + </link> + <link> + <name>fonts/fontcm20i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm20i.c</locationURI> + </link> + <link> + <name>fonts/fontcm22.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm22.c</locationURI> + </link> + <link> + <name>fonts/fontcm22b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm22b.c</locationURI> + </link> + <link> + <name>fonts/fontcm22i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm22i.c</locationURI> + </link> + <link> + <name>fonts/fontcm24.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm24.c</locationURI> + </link> + <link> + <name>fonts/fontcm24b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm24b.c</locationURI> + </link> + <link> + <name>fonts/fontcm24i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm24i.c</locationURI> + </link> + <link> + <name>fonts/fontcm26.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm26.c</locationURI> + </link> + <link> + <name>fonts/fontcm26b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm26b.c</locationURI> + </link> + <link> + <name>fonts/fontcm26i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm26i.c</locationURI> + </link> + <link> + <name>fonts/fontcm28.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm28.c</locationURI> + </link> + <link> + <name>fonts/fontcm28b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm28b.c</locationURI> + </link> + <link> + <name>fonts/fontcm28i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm28i.c</locationURI> + </link> + <link> + <name>fonts/fontcm30.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm30.c</locationURI> + </link> + <link> + <name>fonts/fontcm30b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm30b.c</locationURI> + </link> + <link> + <name>fonts/fontcm30i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm30i.c</locationURI> + </link> + <link> + <name>fonts/fontcm32.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm32.c</locationURI> + </link> + <link> + <name>fonts/fontcm32b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm32b.c</locationURI> + </link> + <link> + <name>fonts/fontcm32i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm32i.c</locationURI> + </link> + <link> + <name>fonts/fontcm34.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm34.c</locationURI> + </link> + <link> + <name>fonts/fontcm34b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm34b.c</locationURI> + </link> + <link> + <name>fonts/fontcm34i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm34i.c</locationURI> + </link> + <link> + <name>fonts/fontcm36.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm36.c</locationURI> + </link> + <link> + <name>fonts/fontcm36b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm36b.c</locationURI> + </link> + <link> + <name>fonts/fontcm36i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm36i.c</locationURI> + </link> + <link> + <name>fonts/fontcm38.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm38.c</locationURI> + </link> + <link> + <name>fonts/fontcm38b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm38b.c</locationURI> + </link> + <link> + <name>fonts/fontcm38i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm38i.c</locationURI> + </link> + <link> + <name>fonts/fontcm40.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm40.c</locationURI> + </link> + <link> + <name>fonts/fontcm40b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm40b.c</locationURI> + </link> + <link> + <name>fonts/fontcm40i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm40i.c</locationURI> + </link> + <link> + <name>fonts/fontcm42.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm42.c</locationURI> + </link> + <link> + <name>fonts/fontcm42b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm42b.c</locationURI> + </link> + <link> + <name>fonts/fontcm42i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm42i.c</locationURI> + </link> + <link> + <name>fonts/fontcm44.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm44.c</locationURI> + </link> + <link> + <name>fonts/fontcm44b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm44b.c</locationURI> + </link> + <link> + <name>fonts/fontcm44i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm44i.c</locationURI> + </link> + <link> + <name>fonts/fontcm46.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm46.c</locationURI> + </link> + <link> + <name>fonts/fontcm46b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm46b.c</locationURI> + </link> + <link> + <name>fonts/fontcm46i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm46i.c</locationURI> + </link> + <link> + <name>fonts/fontcm48.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm48.c</locationURI> + </link> + <link> + <name>fonts/fontcm48b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm48b.c</locationURI> + </link> + <link> + <name>fonts/fontcm48i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcm48i.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc12.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc12.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc14.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc14.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc16.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc16.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc18.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc18.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc20.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc20.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc22.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc22.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc24.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc24.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc26.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc26.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc28.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc28.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc30.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc30.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc32.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc32.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc34.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc34.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc36.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc36.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc38.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc38.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc40.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc40.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc42.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc42.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc44.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc44.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc46.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc46.c</locationURI> + </link> + <link> + <name>fonts/fontcmsc48.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmsc48.c</locationURI> + </link> + <link> + <name>fonts/fontcmss12.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss12.c</locationURI> + </link> + <link> + <name>fonts/fontcmss12b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss12b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss12i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss12i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss14.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss14.c</locationURI> + </link> + <link> + <name>fonts/fontcmss14b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss14b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss14i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss14i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss16.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss16.c</locationURI> + </link> + <link> + <name>fonts/fontcmss16b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss16b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss16i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss16i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss18.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss18.c</locationURI> + </link> + <link> + <name>fonts/fontcmss18b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss18b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss18i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss18i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss20.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss20.c</locationURI> + </link> + <link> + <name>fonts/fontcmss20b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss20b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss20i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss20i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss22.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss22.c</locationURI> + </link> + <link> + <name>fonts/fontcmss22b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss22b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss22i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss22i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss24.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss24.c</locationURI> + </link> + <link> + <name>fonts/fontcmss24b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss24b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss24i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss24i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss26.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss26.c</locationURI> + </link> + <link> + <name>fonts/fontcmss26b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss26b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss26i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss26i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss28.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss28.c</locationURI> + </link> + <link> + <name>fonts/fontcmss28b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss28b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss28i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss28i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss30.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss30.c</locationURI> + </link> + <link> + <name>fonts/fontcmss30b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss30b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss30i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss30i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss32.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss32.c</locationURI> + </link> + <link> + <name>fonts/fontcmss32b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss32b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss32i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss32i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss34.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss34.c</locationURI> + </link> + <link> + <name>fonts/fontcmss34b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss34b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss34i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss34i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss36.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss36.c</locationURI> + </link> + <link> + <name>fonts/fontcmss36b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss36b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss36i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss36i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss38.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss38.c</locationURI> + </link> + <link> + <name>fonts/fontcmss38b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss38b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss38i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss38i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss40.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss40.c</locationURI> + </link> + <link> + <name>fonts/fontcmss40b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss40b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss40i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss40i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss42.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss42.c</locationURI> + </link> + <link> + <name>fonts/fontcmss42b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss42b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss42i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss42i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss44.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss44.c</locationURI> + </link> + <link> + <name>fonts/fontcmss44b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss44b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss44i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss44i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss46.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss46.c</locationURI> + </link> + <link> + <name>fonts/fontcmss46b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss46b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss46i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss46i.c</locationURI> + </link> + <link> + <name>fonts/fontcmss48.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss48.c</locationURI> + </link> + <link> + <name>fonts/fontcmss48b.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss48b.c</locationURI> + </link> + <link> + <name>fonts/fontcmss48i.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmss48i.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt12.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt12.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt14.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt14.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt16.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt16.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt18.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt18.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt20.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt20.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt22.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt22.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt24.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt24.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt26.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt26.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt28.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt28.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt30.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt30.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt32.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt32.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt34.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt34.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt36.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt36.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt38.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt38.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt40.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt40.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt42.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt42.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt44.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt44.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt46.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt46.c</locationURI> + </link> + <link> + <name>fonts/fontcmtt48.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontcmtt48.c</locationURI> + </link> + <link> + <name>fonts/fontfixed6x8.c</name> + <type>1</type> + <locationURI>SW_ROOT/grlib/fonts/fontfixed6x8.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>ORIGINAL_PROJECT_ROOT</name> + <value>file:/C:/ti/TivaWare_C_Series-2.1.4.178/grlib/ccs</value> + </variable> + <variable> + <name>SW_ROOT</name> + <value>$%7BPARENT-2-ORIGINAL_PROJECT_ROOT%7D</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/grlib/macros.ini_initial b/Software/Code_Composer/grlib/macros.ini_initial new file mode 100644 index 000000000..89a26bd0c --- /dev/null +++ b/Software/Code_Composer/grlib/macros.ini_initial @@ -0,0 +1 @@ +SW_ROOT = ../.. diff --git a/Software/Code_Composer/grlib_demo/.ccsproject b/Software/Code_Composer/grlib_demo/.ccsproject new file mode 100644 index 000000000..2894350ec --- /dev/null +++ b/Software/Code_Composer/grlib_demo/.ccsproject @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <deviceVariant value="Cortex M.TM4C129XNCZAD"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="5.2.6"/> + <isElfFormat value="true"/> + <rts value="libc.a"/> + <createSlaveProjects value=""/> + <origin value="C:/ti/TivaWare_C_Series-2.1.4.178/examples/boards/dk-tm4c129x/grlib_demo/ccs"/> + <isTargetManual value="true"/> +</projectOptions> diff --git a/Software/Code_Composer/grlib_demo/.cproject b/Software/Code_Composer/grlib_demo/.cproject new file mode 100644 index 000000000..dceafd093 --- /dev/null +++ b/Software/Code_Composer/grlib_demo/.cproject @@ -0,0 +1,197 @@ +<?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.1769310061"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1769310061" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1769310061" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1769310061." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain.586214476" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.1181597808"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.255038527" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/> + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1396546441" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug.1781700952" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug.1282727229" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug.1295261820" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.323853844" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1396647469" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.607707601" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.868859960" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.28839511" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.744359966" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="TARGET_IS_TM4C129_RA0"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.73727549" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.448048359" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.860249553" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.494083157" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1720098659" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1419707264" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1838251728" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.647571426" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.1124527822" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.OPT_LEVEL.2" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.1023800865" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.16837895" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.1040854502" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.698107601" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.171902875" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug.1181597808" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.1508491444" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""grlib_demo_ccs.map"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.608500376" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="1024" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.1560755754" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.1541160147" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.1508165567" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.437344545" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.1350248465" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.195625068" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.567447996" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs"> + <listOptionValue builtIn="false" value=""libc.a""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/grlib/ccs/Debug/grlib.lib""/> + </option> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.2080461062" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.1904194393" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1778196176" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.737837293" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.754823477"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.754823477" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_PATH_DIR" value="${ORIGINAL_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"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.754823477" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release" postbuildStep=""${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"" prebuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.754823477." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain.659788419" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.1487002857"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1546496660" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/> + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.754010989" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="5.2.6" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease.1032887332" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease.806401553" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease.134127773" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.1356474274" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.1301913195" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.1298970505" name="Application binary interface. [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.1009732192" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC.548070143" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE.1776330974" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="TARGET_IS_TM4C129_RA0"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER.1955861971" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING.1736325204" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER.1619212821" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.1775757639" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH.1808402809" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN.1885133389" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.966637878" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL.943268964" name="Use unified assembly language (--ual)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compilerID.UAL" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS.1645875669" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS.1958574172" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS.1656277672" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS.1678427504" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease.1487002857" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exe.linkerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE.659237729" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.MAP_FILE" value=""grlib_demo_ccs.map"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE.733767418" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.STACK_SIZE" value="1024" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE.1166444462" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.HEAP_SIZE" value="0" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE.156177593" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO.1195568977" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER.33364834" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.1746960521" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH.669448300" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.SEARCH_PATH" valueType="libPaths"> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY.2076630794" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.linkerID.LIBRARY" valueType="libs"> + <listOptionValue builtIn="false" value=""libc.a""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/grlib/ccs/Debug/grlib.lib""/> + </option> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS.1227905336" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS.485080876" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__CMD2_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS.1339494737" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.exeLinker.inputType__GEN_CMDS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex.987060730" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_5.2.hex"/> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="grlib_demo.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1800935962" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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> +</cproject> diff --git a/Software/Code_Composer/grlib_demo/.project b/Software/Code_Composer/grlib_demo/.project new file mode 100644 index 000000000..d70a09223 --- /dev/null +++ b/Software/Code_Composer/grlib_demo/.project @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>grlib_demo</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>drivers/frame.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/frame.c</locationURI> + </link> + <link> + <name>drivers/kentec320x240x16_ssd2119.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c</locationURI> + </link> + <link> + <name>drivers/pinout.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/pinout.c</locationURI> + </link> + <link> + <name>drivers/sound.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/sound.c</locationURI> + </link> + <link> + <name>drivers/touch.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/touch.c</locationURI> + </link> + <link> + <name>utils/sine.c</name> + <type>1</type> + <locationURI>SW_ROOT/utils/sine.c</locationURI> + </link> + <link> + <name>utils/ustdlib.c</name> + <type>1</type> + <locationURI>SW_ROOT/utils/ustdlib.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>ORIGINAL_PROJECT_ROOT</name> + <value>file:/C:/ti/TivaWare_C_Series-2.1.4.178/examples/boards/dk-tm4c129x/grlib_demo/ccs</value> + </variable> + <variable> + <name>SW_ROOT</name> + <value>$%7BPARENT-5-ORIGINAL_PROJECT_ROOT%7D</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/grlib_demo/grlib_demo.c b/Software/Code_Composer/grlib_demo/grlib_demo.c new file mode 100644 index 000000000..48f74fb42 --- /dev/null +++ b/Software/Code_Composer/grlib_demo/grlib_demo.c @@ -0,0 +1,1324 @@ +//***************************************************************************** +// +// grlib_demo.c - Demonstration of the TivaWare Graphics Library. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#include <stdbool.h> +#include <stdint.h> +#include "inc/hw_types.h" +#include "driverlib/rom.h" +#include "driverlib/rom_map.h" +#include "driverlib/sysctl.h" +#include "driverlib/udma.h" +#include "grlib/grlib.h" +#include "grlib/widget.h" +#include "grlib/canvas.h" +#include "grlib/checkbox.h" +#include "grlib/container.h" +#include "grlib/pushbutton.h" +#include "grlib/radiobutton.h" +#include "grlib/slider.h" +#include "utils/ustdlib.h" +#include "utils/sine.h" +#include "drivers/frame.h" +#include "drivers/kentec320x240x16_ssd2119.h" +#include "drivers/pinout.h" +#include "drivers/sound.h" +#include "drivers/touch.h" +#include "images.h" + +//***************************************************************************** +// +//! \addtogroup example_list +//! <h1>Graphics Library Demonstration (grlib_demo)</h1> +//! +//! This application provides a demonstration of the capabilities of the +//! TivaWare Graphics Library. A series of panels show different features of +//! the library. For each panel, the bottom provides a forward and back button +//! (when appropriate), along with a brief description of the contents of the +//! panel. +//! +//! The first panel provides some introductory text and basic instructions for +//! operation of the application. +//! +//! The second panel shows the available drawing primitives: lines, circles, +//! rectangles, strings, and images. +//! +//! The third panel shows the canvas widget, which provides a general drawing +//! surface within the widget hierarchy. A text, image, and application-drawn +//! canvas are displayed. +//! +//! The fourth panel shows the check box widget, which provides a means of +//! toggling the state of an item. Three check boxes are provided, with each +//! having a red ``LED'' to the right. The state of the LED tracks the state +//! of the check box via an application callback. +//! +//! The fifth panel shows the container widget, which provides a grouping +//! construct typically used for radio buttons. Containers with a title, a +//! centered title, and no title are displayed. +//! +//! The sixth panel shows the push button widget. Two rows of push buttons +//! are provided; the appearance of each row is the same but the top row +//! does not utilize auto-repeat while the bottom row does. Each push button +//! has a red ``LED'' beneath it, which is toggled via an application callback +//! each time the push button is pressed. While holding down any of +//! auto-repeat buttons, the ``LED'' for that button should be toggled as long +//! as the button is being held down. +//! +//! The seventh panel shows the radio button widget. Two groups of radio +//! buttons are displayed, the first using text and the second using images for +//! the selection value. Each radio button has a red ``LED'' to its right, +//! which tracks the selection state of the radio buttons via an application +//! callback. Only one radio button from each group can be selected at a time, +//! though the radio buttons in each group operate independently. +//! +//! The eighth and final panel shows the slider widget. Six sliders +//! constructed using the various supported style options are shown. The +//! slider value callback is used to update two widgets to reflect the values +//! reported by sliders. A canvas widget near the top right of the display +//! tracks the value of the red and green image-based slider to its left and +//! the text of the grey slider on the left side of the panel is update to show +//! its own value. The slider on the right is configured as an indicator +//! which tracks the state of the upper slider and ignores user input. +// +//***************************************************************************** + +//***************************************************************************** +// +// The error routine that is called if the driver library encounters an error. +// +//***************************************************************************** +#ifdef DEBUG +void +__error__(char *pcFilename, uint32_t ui32Line) +{ +} +#endif + +//***************************************************************************** +// +// The DMA control structure table. +// +//***************************************************************************** +#ifdef ewarm +#pragma data_alignment=1024 +tDMAControlTable psDMAControlTable[64]; +#elif defined(ccs) +#pragma DATA_ALIGN(psDMAControlTable, 1024) +tDMAControlTable psDMAControlTable[64]; +#else +tDMAControlTable psDMAControlTable[64] __attribute__ ((aligned(1024))); +#endif + +//***************************************************************************** +// +// The sound effect that is played when a key is pressed. +// +//***************************************************************************** +#define AUDIO_SIZE 2048 +static int16_t g_pi16AudioBuffer[AUDIO_SIZE]; + +//***************************************************************************** +// +// A set of flags that indicate the current state of the application. +// +//***************************************************************************** +static uint32_t g_ui32Flags; +#define FLAG_PING 0 // The "ping" half of the sound + // buffer needs to be filled +#define FLAG_PONG 1 // The "pong" half of the sound + // buffer needs to be filled + +//***************************************************************************** +// +// The screen offset of the upper left hand corner where we start to draw. +// +//***************************************************************************** +#define X_OFFSET 8 +#define Y_OFFSET 24 + +//***************************************************************************** +// +// Forward declarations for the globals required to define the widgets at +// compile-time. +// +//***************************************************************************** +void OnPrevious(tWidget *psWidget); +void OnNext(tWidget *psWidget); +void OnIntroPaint(tWidget *psWidget, tContext *psContext); +void OnPrimitivePaint(tWidget *psWidget, tContext *psContext); +void OnCanvasPaint(tWidget *psWidget, tContext *psContext); +void OnCheckChange(tWidget *psWidget, uint32_t bSelected); +void OnButtonPress(tWidget *psWidget); +void OnRadioChange(tWidget *psWidget, uint32_t bSelected); +void OnSliderChange(tWidget *psWidget, int32_t i32Value); +extern tCanvasWidget g_psPanels[]; +void SoundCallback(uint32_t ui32Half); + +//***************************************************************************** +// +// The first panel, which contains introductory text explaining the +// application. +// +//***************************************************************************** +Canvas(g_sIntroduction, g_psPanels, 0, 0, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_APP_DRAWN, 0, 0, 0, 0, 0, 0, OnIntroPaint); + +//***************************************************************************** +// +// The second panel, which demonstrates the graphics primitives. +// +//***************************************************************************** +Canvas(g_sPrimitives, g_psPanels + 1, 0, 0, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_APP_DRAWN, 0, 0, 0, 0, 0, 0, OnPrimitivePaint); + +//***************************************************************************** +// +// The third panel, which demonstrates the canvas widget. +// +//***************************************************************************** +Canvas(g_sCanvas3, g_psPanels + 2, 0, 0, &g_sKentec320x240x16_SSD2119, 200, + Y_OFFSET, 110, 152, CANVAS_STYLE_OUTLINE | CANVAS_STYLE_APP_DRAWN, 0, + ClrGray, 0, 0, 0, 0, OnCanvasPaint); +Canvas(g_sCanvas2, g_psPanels + 2, &g_sCanvas3, 0, + &g_sKentec320x240x16_SSD2119, X_OFFSET, (76+Y_OFFSET), 190, 76, + CANVAS_STYLE_OUTLINE | CANVAS_STYLE_IMG, 0, ClrGray, 0, 0, 0, + g_ui8Logo, 0); +Canvas(g_sCanvas1, g_psPanels + 2, &g_sCanvas2, 0, + &g_sKentec320x240x16_SSD2119, X_OFFSET, Y_OFFSET, 190, 76, + CANVAS_STYLE_FILL | CANVAS_STYLE_OUTLINE | CANVAS_STYLE_TEXT, + ClrMidnightBlue, ClrGray, ClrSilver, g_psFontCm22, "Text", 0, 0); + +//***************************************************************************** +// +// The fourth panel, which demonstrates the checkbox widget. +// +//***************************************************************************** +tCanvasWidget g_psCheckBoxIndicators[] = +{ + CanvasStruct(g_psPanels + 3, g_psCheckBoxIndicators + 1, 0, + &g_sKentec320x240x16_SSD2119, 230, 30, 50, 42, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 3, g_psCheckBoxIndicators + 2, 0, + &g_sKentec320x240x16_SSD2119, 230, 82, 50, 48, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 3, 0, 0, + &g_sKentec320x240x16_SSD2119, 230, 134, 50, 42, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0) +}; +tCheckBoxWidget g_psCheckBoxes[] = +{ + CheckBoxStruct(g_psPanels + 3, g_psCheckBoxes + 1, 0, + &g_sKentec320x240x16_SSD2119, 40, 25, 185, 42, + CB_STYLE_OUTLINE | CB_STYLE_FILL | CB_STYLE_TEXT, 16, + ClrMidnightBlue, ClrGray, ClrSilver, g_psFontCm22, + "Select", 0, OnCheckChange), + CheckBoxStruct(g_psPanels + 3, g_psCheckBoxes + 2, 0, + &g_sKentec320x240x16_SSD2119, 40, 78, 185, 48, + CB_STYLE_IMG, 16, 0, ClrGray, 0, 0, 0, g_ui8Logo, + OnCheckChange), + CheckBoxStruct(g_psPanels + 3, g_psCheckBoxIndicators, 0, + &g_sKentec320x240x16_SSD2119, 40, 129, 189, 42, + CB_STYLE_OUTLINE | CB_STYLE_TEXT, 16, + 0, ClrGray, ClrGreen, g_psFontCm20, "Select", + 0, OnCheckChange), +}; +#define NUM_CHECK_BOXES (sizeof(g_psCheckBoxes) / \ + sizeof(g_psCheckBoxes[0])) + +//***************************************************************************** +// +// The fifth panel, which demonstrates the container widget. +// +//***************************************************************************** +Container(g_sContainer3, g_psPanels + 4, 0, 0, &g_sKentec320x240x16_SSD2119, + 205, 47, 105, 118, CTR_STYLE_OUTLINE | CTR_STYLE_FILL, + ClrMidnightBlue, ClrGray, 0, 0, 0); +Container(g_sContainer2, g_psPanels + 4, &g_sContainer3, 0, + &g_sKentec320x240x16_SSD2119, X_OFFSET, 100, 190, 70, + (CTR_STYLE_OUTLINE | CTR_STYLE_FILL | CTR_STYLE_TEXT | + CTR_STYLE_TEXT_CENTER), ClrMidnightBlue, ClrGray, ClrSilver, + g_psFontCm22, "Group2"); +Container(g_sContainer1, g_psPanels + 4, &g_sContainer2, 0, + &g_sKentec320x240x16_SSD2119, X_OFFSET, Y_OFFSET, 190, 70, + CTR_STYLE_OUTLINE | CTR_STYLE_FILL | CTR_STYLE_TEXT, ClrMidnightBlue, + ClrGray, ClrSilver, g_psFontCm22, "Group1"); + +//***************************************************************************** +// +// The sixth panel, which contains a selection of push buttons. +// +//***************************************************************************** +tCanvasWidget g_psPushButtonIndicators[] = +{ + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 1, 0, + &g_sKentec320x240x16_SSD2119, 40, 80, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 2, 0, + &g_sKentec320x240x16_SSD2119, 90, 80, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 3, 0, + &g_sKentec320x240x16_SSD2119, 145, 80, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 4, 0, + &g_sKentec320x240x16_SSD2119, 40, 160, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 5, 0, + &g_sKentec320x240x16_SSD2119, 90, 160, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 6, 0, + &g_sKentec320x240x16_SSD2119, 145, 160, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 7, 0, + &g_sKentec320x240x16_SSD2119, 190, 30, 110, 24, + CANVAS_STYLE_TEXT, 0, 0, ClrSilver, g_psFontCm20, "Non-auto", + 0, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 8, 0, + &g_sKentec320x240x16_SSD2119, 190, 50, 110, 24, + CANVAS_STYLE_TEXT, 0, 0, ClrSilver, g_psFontCm20, "repeat", + 0, 0), + CanvasStruct(g_psPanels + 5, g_psPushButtonIndicators + 9, 0, + &g_sKentec320x240x16_SSD2119, 190, 110, 110, 24, + CANVAS_STYLE_TEXT, 0, 0, ClrSilver, g_psFontCm20, "Auto", + 0, 0), + CanvasStruct(g_psPanels + 5, 0, 0, + &g_sKentec320x240x16_SSD2119, 190, 130, 110, 24, + CANVAS_STYLE_TEXT, 0, 0, ClrSilver, g_psFontCm20, "repeat", + 0, 0), +}; +tPushButtonWidget g_psPushButtons[] = +{ + RectangularButtonStruct(g_psPanels + 5, g_psPushButtons + 1, 0, + &g_sKentec320x240x16_SSD2119, 30, 30, 40, 40, + PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, + ClrMidnightBlue, ClrBlack, ClrGray, ClrSilver, + g_psFontCm22, "1", 0, 0, 0, 0, OnButtonPress), + CircularButtonStruct(g_psPanels + 5, g_psPushButtons + 2, 0, + &g_sKentec320x240x16_SSD2119, 100, 50, 20, + PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT, + ClrMidnightBlue, ClrBlack, ClrGray, ClrSilver, + g_psFontCm22, "3", 0, 0, 0, 0, OnButtonPress), + RectangularButtonStruct(g_psPanels + 5, g_psPushButtons + 3, 0, + &g_sKentec320x240x16_SSD2119, 130, 25, 50, 50, + PB_STYLE_IMG | PB_STYLE_TEXT, 0, 0, 0, ClrSilver, + g_psFontCm22, "5", g_pui8Blue50x50, + g_pui8Blue50x50Press, 0, 0, OnButtonPress), + RectangularButtonStruct(g_psPanels + 5, g_psPushButtons + 4, 0, + &g_sKentec320x240x16_SSD2119, 30, 110, 40, 40, + (PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT | + PB_STYLE_AUTO_REPEAT), ClrMidnightBlue, ClrBlack, + ClrGray, ClrSilver, g_psFontCm22, "2", 0, 0, 125, + 25, OnButtonPress), + CircularButtonStruct(g_psPanels + 5, g_psPushButtons + 5, 0, + &g_sKentec320x240x16_SSD2119, 100, 130, 20, + (PB_STYLE_FILL | PB_STYLE_OUTLINE | PB_STYLE_TEXT | + PB_STYLE_AUTO_REPEAT), ClrMidnightBlue, ClrBlack, + ClrGray, ClrSilver, g_psFontCm22, "4", 0, 0, 125, 25, + OnButtonPress), + RectangularButtonStruct(g_psPanels + 5, g_psPushButtonIndicators, 0, + &g_sKentec320x240x16_SSD2119, 130, 105, 50, 50, + (PB_STYLE_IMG | PB_STYLE_TEXT | + PB_STYLE_AUTO_REPEAT), 0, 0, 0, ClrSilver, + g_psFontCm22, "6", g_pui8Blue50x50, + g_pui8Blue50x50Press, 125, 25, OnButtonPress), +}; +#define NUM_PUSH_BUTTONS (sizeof(g_psPushButtons) / \ + sizeof(g_psPushButtons[0])) +uint32_t g_ui32ButtonState; + +//***************************************************************************** +// +// The seventh panel, which contains a selection of radio buttons. +// +//***************************************************************************** +tContainerWidget g_psRadioContainers[]; +tCanvasWidget g_psRadioButtonIndicators[] = +{ + CanvasStruct(g_psRadioContainers, g_psRadioButtonIndicators + 1, 0, + &g_sKentec320x240x16_SSD2119, 95, 52, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psRadioContainers, g_psRadioButtonIndicators + 2, 0, + &g_sKentec320x240x16_SSD2119, 95, 97, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psRadioContainers, 0, 0, + &g_sKentec320x240x16_SSD2119, 95, 142, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psRadioContainers + 1, g_psRadioButtonIndicators + 4, 0, + &g_sKentec320x240x16_SSD2119, 260, 52, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psRadioContainers + 1, g_psRadioButtonIndicators + 5, 0, + &g_sKentec320x240x16_SSD2119, 260, 97, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), + CanvasStruct(g_psRadioContainers + 1, 0, 0, + &g_sKentec320x240x16_SSD2119, 260, 142, 20, 20, + CANVAS_STYLE_IMG, 0, 0, 0, 0, 0, g_pui8LightOff, 0), +}; +tRadioButtonWidget g_psRadioButtons1[] = +{ + RadioButtonStruct(g_psRadioContainers, g_psRadioButtons1 + 1, 0, + &g_sKentec320x240x16_SSD2119, 10, 40, 80, 45, + RB_STYLE_TEXT, 16, 0, ClrSilver, ClrSilver, g_psFontCm20, + "One", 0, OnRadioChange), + RadioButtonStruct(g_psRadioContainers, g_psRadioButtons1 + 2, 0, + &g_sKentec320x240x16_SSD2119, 10, 85, 80, 45, + RB_STYLE_TEXT, 16, 0, ClrSilver, ClrSilver, g_psFontCm20, + "Two", 0, OnRadioChange), + RadioButtonStruct(g_psRadioContainers, g_psRadioButtonIndicators, 0, + &g_sKentec320x240x16_SSD2119, 10, 130, 80, 45, + RB_STYLE_TEXT, 24, 0, ClrSilver, ClrSilver, g_psFontCm20, + "Three", 0, OnRadioChange) +}; +#define NUM_RADIO1_BUTTONS (sizeof(g_psRadioButtons1) / \ + sizeof(g_psRadioButtons1[0])) +tRadioButtonWidget g_psRadioButtons2[] = +{ + RadioButtonStruct(g_psRadioContainers + 1, g_psRadioButtons2 + 1, 0, + &g_sKentec320x240x16_SSD2119, 175, 40, 80, 45, + RB_STYLE_IMG, 16, 0, ClrSilver, 0, 0, 0, g_ui8Logo, + OnRadioChange), + RadioButtonStruct(g_psRadioContainers + 1, g_psRadioButtons2 + 2, 0, + &g_sKentec320x240x16_SSD2119, 175, 85, 80, 45, + RB_STYLE_IMG, 24, 0, ClrSilver, 0, 0, 0, g_ui8Logo, + OnRadioChange), + RadioButtonStruct(g_psRadioContainers + 1, g_psRadioButtonIndicators + 3, + 0, &g_sKentec320x240x16_SSD2119, 175, 130, 80, 45, + RB_STYLE_IMG, 24, 0, ClrSilver, 0, 0, 0, g_ui8Logo, + OnRadioChange) +}; +#define NUM_RADIO2_BUTTONS (sizeof(g_psRadioButtons2) / \ + sizeof(g_psRadioButtons2[0])) +tContainerWidget g_psRadioContainers[] = +{ + ContainerStruct(g_psPanels + 6, g_psRadioContainers + 1, g_psRadioButtons1, + &g_sKentec320x240x16_SSD2119, 8, 24, 145, 154, + CTR_STYLE_OUTLINE | CTR_STYLE_TEXT, 0, ClrGray, ClrSilver, + g_psFontCm20, "Group One"), + ContainerStruct(g_psPanels + 6, 0, g_psRadioButtons2, + &g_sKentec320x240x16_SSD2119, 167, 24, 145, 154, + CTR_STYLE_OUTLINE | CTR_STYLE_TEXT, 0, ClrGray, ClrSilver, + g_psFontCm20, "Group Two") +}; + +//***************************************************************************** +// +// The eighth panel, which demonstrates the slider widget. +// +//***************************************************************************** +Canvas(g_sSliderValueCanvas, g_psPanels + 7, 0, 0, + &g_sKentec320x240x16_SSD2119, 210, 30, 60, 40, + CANVAS_STYLE_TEXT | CANVAS_STYLE_TEXT_OPAQUE, ClrBlack, 0, ClrSilver, + g_psFontCm24, "50%", + 0, 0); + +tSliderWidget g_psSliders[] = +{ + SliderStruct(g_psPanels + 7, g_psSliders + 1, 0, + &g_sKentec320x240x16_SSD2119, 10, 105, 220, 30, 0, 100, 25, + (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_OUTLINE | + SL_STYLE_TEXT | SL_STYLE_BACKG_TEXT), + ClrGray, ClrBlack, ClrSilver, ClrWhite, ClrWhite, + g_psFontCm20, "25%", 0, 0, OnSliderChange), + SliderStruct(g_psPanels + 7, g_psSliders + 2, 0, + &g_sKentec320x240x16_SSD2119, 10, 145, 220, 25, 0, 100, 25, + (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_OUTLINE | + SL_STYLE_TEXT), + ClrWhite, ClrBlueViolet, ClrSilver, ClrBlack, 0, + g_psFontCm18, "Foreground Text Only", 0, 0, OnSliderChange), + SliderStruct(g_psPanels + 7, g_psSliders + 3, 0, + &g_sKentec320x240x16_SSD2119, 240, 70, 26, 110, 0, 100, 50, + (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_VERTICAL | + SL_STYLE_OUTLINE | SL_STYLE_LOCKED), ClrDarkGreen, + ClrDarkRed, ClrSilver, 0, 0, 0, 0, 0, 0, 0), + SliderStruct(g_psPanels + 7, g_psSliders + 4, 0, + &g_sKentec320x240x16_SSD2119, 275, 30, 30, 150, 0, 100, 75, + (SL_STYLE_IMG | SL_STYLE_BACKG_IMG | SL_STYLE_VERTICAL | + SL_STYLE_OUTLINE), 0, ClrBlack, ClrSilver, 0, 0, 0, + 0, g_pui8GettingHotter28x148, g_pui8GettingHotter28x148Mono, + OnSliderChange), + SliderStruct(g_psPanels + 7, g_psSliders + 5, 0, + &g_sKentec320x240x16_SSD2119, 10, 30, 195, 37, 0, 100, 50, + SL_STYLE_IMG | SL_STYLE_BACKG_IMG, 0, 0, 0, 0, 0, 0, + 0, g_pui8GreenSlider195x37, g_pui8RedSlider195x37, + OnSliderChange), + SliderStruct(g_psPanels + 7, &g_sSliderValueCanvas, 0, + &g_sKentec320x240x16_SSD2119, 10, 70, 220, 25, 0, 100, 50, + (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_TEXT | + SL_STYLE_BACKG_TEXT | SL_STYLE_TEXT_OPAQUE | + SL_STYLE_BACKG_TEXT_OPAQUE), + ClrBlue, ClrYellow, ClrSilver, ClrYellow, ClrBlue, + g_psFontCm18, "Text in both areas", 0, 0, + OnSliderChange), +}; + +#define SLIDER_TEXT_VAL_INDEX 0 +#define SLIDER_LOCKED_INDEX 2 +#define SLIDER_CANVAS_VAL_INDEX 4 + +#define NUM_SLIDERS (sizeof(g_psSliders) / sizeof(g_psSliders[0])) + +//***************************************************************************** +// +// An array of canvas widgets, one per panel. Each canvas is filled with +// black, overwriting the contents of the previous panel. +// +//***************************************************************************** +tCanvasWidget g_psPanels[] = +{ + CanvasStruct(0, 0, &g_sIntroduction, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, &g_sPrimitives, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, &g_sCanvas1, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, g_psCheckBoxes, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, &g_sContainer1, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, g_psPushButtons, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, g_psRadioContainers, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), + CanvasStruct(0, 0, g_psSliders, &g_sKentec320x240x16_SSD2119, + X_OFFSET, Y_OFFSET, (320 - (X_OFFSET*2)), 158, + CANVAS_STYLE_FILL, ClrBlack, 0, 0, 0, 0, 0, 0), +}; + +//***************************************************************************** +// +// The number of panels. +// +//***************************************************************************** +#define NUM_PANELS (sizeof(g_psPanels) / sizeof(g_psPanels[0])) + +//***************************************************************************** +// +// The names for each of the panels, which is displayed at the bottom of the +// screen. +// +//***************************************************************************** +char *g_pcPanelNames[] = +{ + " Introduction ", + " Primitives ", + " Canvas ", + " Checkbox ", + " Container ", + " Push Buttons ", + " Radio Buttons ", + " Sliders ", + " S/W Update " +}; + +//***************************************************************************** +// +// The buttons and text across the bottom of the screen. +// +//***************************************************************************** +RectangularButton(g_sPrevious, 0, 0, 0, &g_sKentec320x240x16_SSD2119, + X_OFFSET, 182, 50, 50, + PB_STYLE_FILL, ClrBlack, ClrBlack, 0, ClrSilver, + g_psFontCm20, "-", g_pui8Blue50x50, g_pui8Blue50x50Press, + 0, 0, OnPrevious); +Canvas(g_sTitle, 0, 0, 0, &g_sKentec320x240x16_SSD2119, + (X_OFFSET+50), 182, 204, 50, + CANVAS_STYLE_TEXT | CANVAS_STYLE_TEXT_OPAQUE, 0, 0, ClrSilver, + g_psFontCm20, 0, 0, 0); +RectangularButton(g_sNext, 0, 0, 0, &g_sKentec320x240x16_SSD2119, + (320-50-X_OFFSET), 182, 50, 50, + PB_STYLE_IMG | PB_STYLE_TEXT, ClrBlack, ClrBlack, 0, + ClrSilver, g_psFontCm20, "+", g_pui8Blue50x50, + g_pui8Blue50x50Press, 0, 0, OnNext); + +//***************************************************************************** +// +// The panel that is currently being displayed. +// +//***************************************************************************** +uint32_t g_ui32Panel; + +//***************************************************************************** +// +// The position within the waveform of the click sound. +// +//***************************************************************************** +uint32_t g_ui32AudioPos; + +//***************************************************************************** +// +// The step rate of the waveform for the click sound. +// +//***************************************************************************** +uint32_t g_ui32AudioStep; + +//***************************************************************************** +// +// The amplitude of the waveformfor the click sound. +// +//***************************************************************************** +uint32_t g_ui32Amp; + +//***************************************************************************** +// +// The step rate of the amplitude for the click sound. +// +//***************************************************************************** +uint32_t g_ui32AmpStep; + +//***************************************************************************** +// +// Initialize the variables for generating the click sound waveform +// +//***************************************************************************** +void +PlayClick(void) +{ + // + // Start the new waveform at zero. + // + g_ui32AudioPos = 0; + + // + // Set the fixed Audio step + // + g_ui32AudioStep = ((265 * 65536) / 64000) * 65536; + + // + // Set the amplitude of the waveform generator to full volume. + // + g_ui32Amp = 2048; + + // + // Set the decreasing step of amplitude. + // + g_ui32AmpStep = 1; +} + +//***************************************************************************** +// +// Handles presses of the previous panel button. +// +//***************************************************************************** +void +OnPrevious(tWidget *psWidget) +{ + // + // There is nothing to be done if the first panel is already being + // displayed. + // + if(g_ui32Panel == 0) + { + return; + } + + // + // Remove the current panel. + // + WidgetRemove((tWidget *)(g_psPanels + g_ui32Panel)); + + // + // Decrement the panel index. + // + g_ui32Panel--; + + // + // Add and draw the new panel. + // + WidgetAdd(WIDGET_ROOT, (tWidget *)(g_psPanels + g_ui32Panel)); + WidgetPaint((tWidget *)(g_psPanels + g_ui32Panel)); + + // + // Set the title of this panel. + // + CanvasTextSet(&g_sTitle, g_pcPanelNames[g_ui32Panel]); + WidgetPaint((tWidget *)&g_sTitle); + + // + // See if this is the first panel. + // + if(g_ui32Panel == 0) + { + // + // Clear the previous button from the display since the first panel is + // being displayed. + // + PushButtonImageOff(&g_sPrevious); + PushButtonTextOff(&g_sPrevious); + PushButtonFillOn(&g_sPrevious); + WidgetPaint((tWidget *)&g_sPrevious); + } + + // + // See if the previous panel was the last panel. + // + if(g_ui32Panel == (NUM_PANELS - 2)) + { + // + // Display the next button. + // + PushButtonImageOn(&g_sNext); + PushButtonTextOn(&g_sNext); + PushButtonFillOff(&g_sNext); + WidgetPaint((tWidget *)&g_sNext); + } + + // + // Play the key click sound. + // + PlayClick(); +} + +//***************************************************************************** +// +// Handles presses of the next panel button. +// +//***************************************************************************** +void +OnNext(tWidget *psWidget) +{ + // + // There is nothing to be done if the last panel is already being + // displayed. + // + if(g_ui32Panel == (NUM_PANELS - 1)) + { + return; + } + + // + // Remove the current panel. + // + WidgetRemove((tWidget *)(g_psPanels + g_ui32Panel)); + + // + // Increment the panel index. + // + g_ui32Panel++; + + // + // Add and draw the new panel. + // + WidgetAdd(WIDGET_ROOT, (tWidget *)(g_psPanels + g_ui32Panel)); + WidgetPaint((tWidget *)(g_psPanels + g_ui32Panel)); + + // + // Set the title of this panel. + // + CanvasTextSet(&g_sTitle, g_pcPanelNames[g_ui32Panel]); + WidgetPaint((tWidget *)&g_sTitle); + + // + // See if the previous panel was the first panel. + // + if(g_ui32Panel == 1) + { + // + // Display the previous button. + // + PushButtonImageOn(&g_sPrevious); + PushButtonTextOn(&g_sPrevious); + PushButtonFillOff(&g_sPrevious); + WidgetPaint((tWidget *)&g_sPrevious); + } + + // + // See if this is the last panel. + // + if(g_ui32Panel == (NUM_PANELS - 1)) + { + // + // Clear the next button from the display since the last panel is being + // displayed. + // + PushButtonImageOff(&g_sNext); + PushButtonTextOff(&g_sNext); + PushButtonFillOn(&g_sNext); + WidgetPaint((tWidget *)&g_sNext); + } + + // + // Play the key click sound. + // + PlayClick(); +} + +//***************************************************************************** +// +// Handles paint requests for the introduction canvas widget. +// +//***************************************************************************** +void +OnIntroPaint(tWidget *psWidget, tContext *psContext) +{ + // + // Display the introduction text in the canvas. + // + GrContextFontSet(psContext, g_psFontCm16); + GrContextForegroundSet(psContext, ClrSilver); + GrStringDraw(psContext, "This application demonstrates the ", -1, + 10, 30, 0); + GrStringDraw(psContext, "TivaWare Graphics Library.", -1, + 10, (30+16), 0); + GrStringDraw(psContext, "Each panel shows a different feature of", -1, + 10, (30+(16*2)), 0); + GrStringDraw(psContext, "the graphics library. Widgets on the panels", -1, + 10, (30+(16*3)), 0); + GrStringDraw(psContext, "are fully operational; pressing them will", -1, + 10, (30+(16*4)), 0); + GrStringDraw(psContext, "result in visible feedback of some kind.", -1, + 10, (30+(16*5)), 0); + GrStringDraw(psContext, "Press the + and - buttons at the bottom", -1, + 10, (30+(16*6)), 0); + GrStringDraw(psContext, "of the screen to move between the panels.", -1, + 10, (30+(16*7)), 0); +} + +//***************************************************************************** +// +// Handles paint requests for the primitives canvas widget. +// +//***************************************************************************** +void +OnPrimitivePaint(tWidget *psWidget, tContext *psContext) +{ + uint32_t ui32Idx; + tRectangle sRect; + + // + // Draw a vertical sweep of lines from red to green. + // + for(ui32Idx = 0; ui32Idx <= 8; ui32Idx++) + { + GrContextForegroundSet(psContext, + (((((10 - ui32Idx) * 255) / 10) << ClrRedShift) | + (((ui32Idx * 255) / 10) << ClrGreenShift))); + GrLineDraw(psContext, 115, 120, 5, 120 - (11 * ui32Idx)); + } + + // + // Draw a horizontal sweep of lines from green to blue. + // + for(ui32Idx = 1; ui32Idx <= 10; ui32Idx++) + { + GrContextForegroundSet(psContext, + (((((10 - ui32Idx) * 255) / 10) << + ClrGreenShift) | + (((ui32Idx * 255) / 10) << ClrBlueShift))); + GrLineDraw(psContext, 115, 120, 5 + (ui32Idx * 11), 29); + } + + // + // Draw a filled circle with an overlapping circle. + // + GrContextForegroundSet(psContext, ClrBrown); + GrCircleFill(psContext, 185, 69, 40); + GrContextForegroundSet(psContext, ClrSkyBlue); + GrCircleDraw(psContext, 205, 99, 30); + + // + // Draw a filled rectangle with an overlapping rectangle. + // + GrContextForegroundSet(psContext, ClrSlateGray); + sRect.i16XMin = 20; + sRect.i16YMin = 100; + sRect.i16XMax = 75; + sRect.i16YMax = 160; + GrRectFill(psContext, &sRect); + GrContextForegroundSet(psContext, ClrSlateBlue); + sRect.i16XMin += 40; + sRect.i16YMin += 30; + sRect.i16XMax += 30; + sRect.i16YMax += 18; + GrRectDraw(psContext, &sRect); + + // + // Draw a piece of text in fonts of increasing size. + // + GrContextForegroundSet(psContext, ClrSilver); + GrContextFontSet(psContext, g_psFontCm14); + GrStringDraw(psContext, "Strings", -1, 120, 104, 0); + GrContextFontSet(psContext, g_psFontCm18); + GrStringDraw(psContext, "Strings", -1, 140, 118, 0); + GrContextFontSet(psContext, g_psFontCm22); + GrStringDraw(psContext, "Strings", -1, 160, 136, 0); + GrContextFontSet(psContext, g_psFontCm24); + GrStringDraw(psContext, "Strings", -1, 180, 158, 0); + + // + // Draw an image. + // + GrImageDraw(psContext, g_ui8Logo, 262, 80); +} + +//***************************************************************************** +// +// Handles paint requests for the canvas demonstration widget. +// +//***************************************************************************** +void +OnCanvasPaint(tWidget *psWidget, tContext *psContext) +{ + uint32_t ui32Idx; + + // + // Draw a set of radiating lines. + // + GrContextForegroundSet(psContext, ClrGoldenrod); + for(ui32Idx = 50; ui32Idx <= 180; ui32Idx += 10) + { + GrLineDraw(psContext, 210, ui32Idx, 310, 230 - ui32Idx); + } + + // + // Indicate that the contents of this canvas were drawn by the application. + // + GrContextFontSet(psContext, g_psFontCm12); + GrStringDrawCentered(psContext, "App Drawn", -1, 260, 50, 1); +} + +//***************************************************************************** +// +// Handles change notifications for the check box widgets. +// +//***************************************************************************** +void +OnCheckChange(tWidget *psWidget, uint32_t bSelected) +{ + uint32_t ui32Idx; + + // + // Find the index of this check box. + // + for(ui32Idx = 0; ui32Idx < NUM_CHECK_BOXES; ui32Idx++) + { + if(psWidget == (tWidget *)(g_psCheckBoxes + ui32Idx)) + { + break; + } + } + + // + // Return if the check box could not be found. + // + if(ui32Idx == NUM_CHECK_BOXES) + { + return; + } + + // + // Set the matching indicator based on the selected state of the check box. + // + CanvasImageSet(g_psCheckBoxIndicators + ui32Idx, + bSelected ? g_pui8LightOn : g_pui8LightOff); + WidgetPaint((tWidget *)(g_psCheckBoxIndicators + ui32Idx)); + + // + // Play the key click sound. + // + PlayClick(); +} + +//***************************************************************************** +// +// Handles press notifications for the push button widgets. +// +//***************************************************************************** +void +OnButtonPress(tWidget *psWidget) +{ + uint32_t ui32Idx; + + // + // Find the index of this push button. + // + for(ui32Idx = 0; ui32Idx < NUM_PUSH_BUTTONS; ui32Idx++) + { + if(psWidget == (tWidget *)(g_psPushButtons + ui32Idx)) + { + break; + } + } + + // + // Return if the push button could not be found. + // + if(ui32Idx == NUM_PUSH_BUTTONS) + { + return; + } + + // + // Toggle the state of this push button indicator. + // + g_ui32ButtonState ^= 1 << ui32Idx; + + // + // Set the matching indicator based on the selected state of the check box. + // + CanvasImageSet(g_psPushButtonIndicators + ui32Idx, + (g_ui32ButtonState & (1 << ui32Idx)) ? g_pui8LightOn : + g_pui8LightOff); + WidgetPaint((tWidget *)(g_psPushButtonIndicators + ui32Idx)); + + // + // Play the key click sound. + // + PlayClick(); +} + +//***************************************************************************** +// +// Handles notifications from the slider controls. +// +//***************************************************************************** +void +OnSliderChange(tWidget *psWidget, int32_t i32Value) +{ + static char pcCanvasText[5]; + static char pcSliderText[5]; + + // + // Is this the widget whose value we mirror in the canvas widget and the + // locked slider? + // + if(psWidget == (tWidget *)&g_psSliders[SLIDER_CANVAS_VAL_INDEX]) + { + // + // Yes - update the canvas to show the slider value. + // + usprintf(pcCanvasText, "%3d%%", i32Value); + CanvasTextSet(&g_sSliderValueCanvas, pcCanvasText); + WidgetPaint((tWidget *)&g_sSliderValueCanvas); + + // + // Also update the value of the locked slider to reflect this one. + // + SliderValueSet(&g_psSliders[SLIDER_LOCKED_INDEX], i32Value); + WidgetPaint((tWidget *)&g_psSliders[SLIDER_LOCKED_INDEX]); + } + + if(psWidget == (tWidget *)&g_psSliders[SLIDER_TEXT_VAL_INDEX]) + { + // + // Yes - update the canvas to show the slider value. + // + usprintf(pcSliderText, "%3d%%", i32Value); + SliderTextSet(&g_psSliders[SLIDER_TEXT_VAL_INDEX], pcSliderText); + WidgetPaint((tWidget *)&g_psSliders[SLIDER_TEXT_VAL_INDEX]); + } +} + +//***************************************************************************** +// +// Handles change notifications for the radio button widgets. +// +//***************************************************************************** +void +OnRadioChange(tWidget *psWidget, uint32_t bSelected) +{ + uint32_t ui32Idx; + + // + // Find the index of this radio button in the first group. + // + for(ui32Idx = 0; ui32Idx < NUM_RADIO1_BUTTONS; ui32Idx++) + { + if(psWidget == (tWidget *)(g_psRadioButtons1 + ui32Idx)) + { + break; + } + } + + // + // See if the radio button was found. + // + if(ui32Idx == NUM_RADIO1_BUTTONS) + { + // + // Find the index of this radio button in the second group. + // + for(ui32Idx = 0; ui32Idx < NUM_RADIO2_BUTTONS; ui32Idx++) + { + if(psWidget == (tWidget *)(g_psRadioButtons2 + ui32Idx)) + { + break; + } + } + + // + // Return if the radio button could not be found. + // + if(ui32Idx == NUM_RADIO2_BUTTONS) + { + return; + } + + // + // Sind the radio button is in the second group, offset the index to + // the indicators associated with the second group. + // + ui32Idx += NUM_RADIO1_BUTTONS; + } + + // + // Set the matching indicator based on the selected state of the radio + // button. + // + CanvasImageSet(g_psRadioButtonIndicators + ui32Idx, + bSelected ? g_pui8LightOn : g_pui8LightOff); + WidgetPaint((tWidget *)(g_psRadioButtonIndicators + ui32Idx)); + + // + // Play the key click sound. + // + PlayClick(); +} + +//***************************************************************************** +// +// The callback function that is called by the sound driver to indicate that +// half of the sound buffer has been played. +// +//***************************************************************************** +void +SoundCallback(uint32_t ui32Half) +{ + // + // See which half of the sound buffer has been played. + // + if(ui32Half == 0) + { + // + // The first half of the sound buffer needs to be filled. + // + HWREGBITW(&g_ui32Flags, FLAG_PING) = 1; + } + else + { + // + // The second half of the sound buffer needs to be filled. + // + HWREGBITW(&g_ui32Flags, FLAG_PONG) = 1; + } +} + +//***************************************************************************** +// +// Generates an additional section of the audio output +// +//***************************************************************************** +void +GenerateAudio(int16_t *pi16Buffer, uint32_t ui32Count) +{ + int32_t i32Val; + + // + // if g_ui32Amp is down to 0, fill the buffer with silence. + // + if(g_ui32Amp == 0) + { + // + // Fill the buffer with silence. + // + while(ui32Count--) + { + *pi16Buffer++ = 0; + } + return; + } + + // + // Loop through the samples to be generated. + // + while(ui32Count--) + { + // + // Compute the value of the waveform. + // + i32Val = sine(g_ui32AudioPos + (sine(g_ui32AudioPos * 3) * 10922)); + + // + // Increment the position of the waveform. + // + g_ui32AudioPos += g_ui32AudioStep; + + // + // Scale the waveform value by the volume. + // + i32Val = (i32Val * g_ui32Amp) / 1024; + + // + // Decrement the waveform amplitude by the step. + // + g_ui32Amp -= g_ui32AmpStep; + + // + // Cilp the waveform to min/max if required. + // + i32Val /= 2; + if(i32Val > 32767) + { + i32Val = 32767; + } + if(i32Val < -32768) + { + i32Val = -32768; + } + + // + // Add the new waveform value to the sample buffer. + // + *pi16Buffer++ = (int16_t)i32Val; + } +} +//***************************************************************************** +// +// A simple demonstration of the features of the TivaWare Graphics Library. +// +//***************************************************************************** +int +main(void) +{ + tContext sContext; + uint32_t ui32SysClock; + + // + // Run from the PLL at 120 MHz. + // + ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | + SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | + SYSCTL_CFG_VCO_480), 120000000); + + // + // Configure the device pins. + // + PinoutSet(); + + // + // Initialize the display driver. + // + Kentec320x240x16_SSD2119Init(ui32SysClock); + + // + // Initialize the graphics context. + // + GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119); + + // + // Draw the application frame. + // + FrameDraw(&sContext, "grlib-demo"); + + // + // Configure and enable uDMA + // + ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA); + SysCtlDelay(10); + ROM_uDMAControlBaseSet(&psDMAControlTable[0]); + ROM_uDMAEnable(); + + // + // Initialize the sound driver. + // + SoundInit(ui32SysClock); + SoundVolumeSet(128); + SoundStart(g_pi16AudioBuffer, AUDIO_SIZE, 64000, SoundCallback); + + // + // Initialize the touch screen driver and have it route its messages to the + // widget tree. + // + TouchScreenInit(ui32SysClock); + TouchScreenCallbackSet(WidgetPointerMessage); + + // + // Add the title block and the previous and next buttons to the widget + // tree. + // + WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sPrevious); + WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sTitle); + WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sNext); + + // + // Add the first panel to the widget tree. + // + g_ui32Panel = 0; + WidgetAdd(WIDGET_ROOT, (tWidget *)g_psPanels); + CanvasTextSet(&g_sTitle, g_pcPanelNames[0]); + + // + // Issue the initial paint request to the widgets. + // + WidgetPaint(WIDGET_ROOT); + + // + // Loop forever handling widget messages. + // + while(1) + { + // + // Process any messages in the widget message queue. + // + WidgetMessageQueueProcess(); + + // + // See if the first half of the sound buffer needs to be filled. + // + if(HWREGBITW(&g_ui32Flags, FLAG_PING) == 1) + { + // + // generate new audio into the first half of the sound buffer. + // + GenerateAudio(g_pi16AudioBuffer, AUDIO_SIZE / 2); + + // + // Clear the flag for the first half of the sound buffer. + // + HWREGBITW(&g_ui32Flags, FLAG_PING) = 0; + } + + // + // See if the second half of the sound buffer needs to be filled. + // + if(HWREGBITW(&g_ui32Flags, FLAG_PONG) == 1) + { + // + // generate new audio into the second half of the sound buffer. + // + GenerateAudio(g_pi16AudioBuffer + (AUDIO_SIZE / 2), + AUDIO_SIZE / 2); + + // + // Clear the flag for the second half of the sound buffer. + // + HWREGBITW(&g_ui32Flags, FLAG_PONG) = 0; + } + } +} diff --git a/Software/Code_Composer/grlib_demo/grlib_demo_ccs.cmd b/Software/Code_Composer/grlib_demo/grlib_demo_ccs.cmd new file mode 100644 index 000000000..cc957ff2a --- /dev/null +++ b/Software/Code_Composer/grlib_demo/grlib_demo_ccs.cmd @@ -0,0 +1,70 @@ +/****************************************************************************** + * + * grlib_demo_ccs.cmd - CCS linker configuration file for grlib_demo. + * + * Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. + * + *****************************************************************************/ + +--retain=g_pfnVectors + +/* 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=rtsv7M3_T_le_eabi.lib */ + +/* The starting address of the application. Normally the interrupt vectors */ +/* must be located at the beginning of the application. */ +#define APP_BASE 0x00000000 +#define RAM_BASE 0x20000000 + +/* System memory map */ + +MEMORY +{ + /* Application stored in and executes from internal flash */ + FLASH (RX) : origin = APP_BASE, length = 0x00100000 + /* Application uses internal RAM for data */ + SRAM (RWX) : origin = 0x20000000, length = 0x00040000 +} + +/* Section allocation in memory */ + +SECTIONS +{ + .intvecs: > APP_BASE + .text : > FLASH + .const : > FLASH + .cinit : > FLASH + .pinit : > FLASH + .init_array : > FLASH + + .vtable : > RAM_BASE + .data : > SRAM + .bss : > SRAM + .sysmem : > SRAM + .stack : > SRAM +} + +__STACK_TOP = __stack + 1024; diff --git a/Software/Code_Composer/grlib_demo/images.c b/Software/Code_Composer/grlib_demo/images.c new file mode 100644 index 000000000..43b36bd7e --- /dev/null +++ b/Software/Code_Composer/grlib_demo/images.c @@ -0,0 +1,1131 @@ +//***************************************************************************** +// +// images.c - Data for the images used by the application. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#include <stdint.h> +#include <stdbool.h> +#include "grlib/grlib.h" + +//***************************************************************************** +// +// The image of the TI symbol. +// +//***************************************************************************** +const uint8_t g_ui8Logo[] = +{ + IMAGE_FMT_4BPP_COMP, + 50, 0, + 50, 0, + + 15, + 0x00, 0x00, 0x00, + 0x03, 0x02, 0x13, + 0x07, 0x05, 0x2a, + 0x0a, 0x08, 0x41, + 0x0d, 0x0a, 0x55, + 0x10, 0x0c, 0x68, + 0x12, 0x0e, 0x74, + 0x15, 0x10, 0x88, + 0x17, 0x12, 0x97, + 0x19, 0x14, 0xa7, + 0x1c, 0x16, 0xb8, + 0x1e, 0x18, 0xc8, + 0x20, 0x19, 0xd6, + 0x22, 0x1b, 0xe1, + 0x24, 0x1c, 0xe9, + 0x24, 0x1c, 0xed, + + 0xf0, 0x07, 0x07, 0x07, 0x02, 0x04, 0xba, 0xaa, 0xaa, 0x18, 0xaa, 0xac, + 0x30, 0x07, 0x07, 0x05, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x40, 0x3f, + 0x3f, 0x3f, 0x3f, 0xc7, 0x3f, 0x3d, 0x48, 0x78, 0x50, 0x3f, 0x3f, 0x3a, + 0x1c, 0xbf, 0xff, 0x70, 0x3f, 0x3f, 0x39, 0x01, 0xdf, 0xe0, 0x12, 0x3f, + 0x3f, 0x00, 0x04, 0xff, 0xff, 0x20, 0xe1, 0x3f, 0x3f, 0x39, 0x03, 0x97, + 0x87, 0x10, 0x3f, 0xf8, 0x3f, 0x39, 0x5f, 0x3f, 0x3b, 0x96, 0x82, 0x06, + 0x00, 0x87, 0x84, 0x04, 0x87, 0x77, 0x77, 0x78, 0x30, 0xc0, 0x3f, 0x3b, + 0xff, 0xd1, 0x0d, 0xff, 0xf5, 0x09, 0xb0, 0xaa, 0x60, 0x3f, 0x3c, 0xa0, + 0x2f, 0xff, 0xf2, 0x60, 0x0c, 0x3f, 0x3f, 0xff, 0xff, 0x80, 0x4f, 0xff, + 0x30, 0xc0, 0x1e, 0x3f, 0x3f, 0xff, 0xff, 0x50, 0x7f, 0x18, 0xff, 0x90, + 0x4f, 0x3f, 0x3f, 0xfd, 0xef, 0x20, 0x06, 0xaf, 0xff, 0x70, 0x7f, 0xdd, + 0x3f, 0x3e, 0xb2, 0x01, 0x12, 0x01, 0xcf, 0xff, 0x50, 0x12, 0x07, 0x3f, + 0x80, 0x3e, 0x80, 0x00, 0x03, 0xff, 0xff, 0x30, 0x00, 0x5a, 0x08, 0x39, + 0x70, 0x3f, 0x3a, 0x60, 0x01, 0xfc, 0x10, 0x10, 0x00, 0x1b, 0x39, 0xb0, + 0x00, 0x00, 0x8c, 0x02, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xab, 0x3a, 0x40, + 0x01, 0x00, 0x07, 0xff, 0xfa, 0x00, 0x00, 0x2f, 0x39, 0x0c, 0xf6, 0x00, + 0x00, 0x7f, 0x6a, 0x4a, 0xff, 0xfd, 0x00, 0x20, 0x00, 0x0a, 0xff, 0xf7, + 0x00, 0x00, 0x4f, 0x84, 0x39, 0xfe, 0x40, 0x00, 0x29, 0x3f, 0xfe, 0xab, + 0x01, 0xa0, 0x1c, 0xff, 0xf4, 0x08, 0xca, 0xcf, 0x72, 0x08, 0xf7, 0x00, + 0x02, 0xdf, 0x37, 0xff, 0xb0, 0x2f, 0x10, 0xff, 0xf2, 0x0c, 0x8c, 0xf7, + 0x00, 0x00, 0x3f, 0x81, 0x3f, 0xff, 0x80, 0x4f, 0xff, 0xc0, 0x2e, 0x3f, + 0x20, 0x02, 0xcf, 0x37, 0x50, 0x8f, 0xff, 0xa0, 0x4f, 0x90, 0x3f, 0x00, + 0x2c, 0x3f, 0x30, 0xaf, 0xff, 0x70, 0x48, 0x7f, 0x3f, 0x00, 0x02, 0x3e, + 0xfd, 0x10, 0xcf, 0x11, 0xff, 0x40, 0x9f, 0x3f, 0x00, 0x00, 0x8f, 0x35, + 0x02, 0xfa, 0x02, 0xff, 0xfe, 0x20, 0xcf, 0x3f, 0x00, 0x20, 0x00, 0x2f, + 0x3d, 0xf8, 0x05, 0xff, 0xfd, 0x00, 0xd0, 0x3f, 0x31, 0x09, 0x3d, 0xf5, + 0x03, 0x54, 0x53, 0x12, 0x00, 0x34, 0x6e, 0x3f, 0x00, 0x04, 0x39, 0xfa, + 0x09, 0x9c, 0xff, 0xff, 0xf3, 0x9a, 0x00, 0x3f, 0x3a, 0x20, 0xa6, 0x31, + 0xa3, 0xaf, 0xff, 0xfe, 0x30, 0x01, 0x10, 0xbf, 0xff, 0xd1, 0x3b, 0x7f, + 0xff, 0xff, 0xfd, 0x40, 0x72, 0x4b, 0x00, 0x00, 0x2c, 0xff, 0xe3, 0x00, + 0x08, 0x00, 0x2d, 0xff, 0xe1, 0x3b, 0x9f, 0xff, 0xfe, 0x40, 0x71, 0x45, + 0x00, 0x01, 0x68, 0x20, 0x00, 0x00, 0x11, 0x06, 0xff, 0xf6, 0xa3, 0xbf, + 0xff, 0xb2, 0x46, 0x80, 0x15, 0xbf, 0xff, 0x94, 0x33, 0x22, 0x22, 0x23, + 0x30, 0xef, 0xf8, 0x47, 0x05, 0x6f, 0xff, 0xff, 0xfe, 0x06, 0xee, 0xee, + 0xee, 0xff, 0x70, 0x3f, 0x05, 0x1c, 0x16, 0xff, 0xff, 0xff, 0xe9, 0xf9, + 0x47, 0x06, 0x07, 0xb2, 0x3c, 0xc1, 0x3f, 0x06, 0x02, 0xdf, 0x33, 0x50, + 0xd3, 0x3f, 0x07, 0x7f, 0x3a, 0xfc, 0x10, 0x3f, 0x07, 0x59, 0x2d, 0x3a, + 0xf9, 0x47, 0x07, 0x00, 0x05, 0x3a, 0x62, 0xf7, 0x3f, 0x07, 0x00, 0x00, + 0x9f, 0x31, 0xf8, 0xc5, 0x3f, 0x07, 0x00, 0x00, 0x0a, 0x39, 0xf9, 0x3f, + 0xc1, 0x07, 0x01, 0x9f, 0xff, 0xff, 0xfc, 0x10, 0x37, 0x80, 0x07, 0x00, + 0x00, 0x06, 0xdf, 0xff, 0xff, 0x50, 0xe1, 0x3f, 0x07, 0x01, 0x15, 0x78, + 0x86, 0x20, 0x3f, 0xff, 0x07, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x00, 0x00, +}; + +//***************************************************************************** +// +// This is the image of a red LED that is turned off. +// +//***************************************************************************** +const uint8_t g_pui8LightOff[] = +{ + IMAGE_FMT_4BPP_COMP, + 20, 0, + 20, 0, + + 15, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x09, + 0x00, 0x00, 0x19, + 0x00, 0x00, 0x2a, + 0x00, 0x00, 0x30, + 0x00, 0x00, 0x34, + 0x00, 0x00, 0x37, + 0x00, 0x00, 0x3a, + 0x00, 0x00, 0x3d, + 0x00, 0x00, 0x3f, + 0x00, 0x00, 0x40, + 0x00, 0x00, 0x42, + 0x00, 0x00, 0x45, + 0x00, 0x00, 0x4a, + 0x00, 0x00, 0x50, + 0x00, 0x00, 0x56, + + 0x84, 0x01, 0x13, 0xaf, 0xe8, 0x31, 0x03, 0x1b, 0xff, 0x08, 0xff, 0xee, + 0xed, 0x71, 0x01, 0x02, 0xff, 0xff, 0x00, 0xfe, 0xed, 0xdd, 0xcc, 0x20, + 0x00, 0x00, 0x2f, 0x00, 0xff, 0xfe, 0xee, 0xdd, 0xcc, 0xcb, 0xa2, 0x00, + 0x40, 0x01, 0x21, 0xdd, 0xdc, 0xcc, 0xbb, 0xa8, 0x10, 0x00, 0x09, 0xff, + 0xfe, 0xdd, 0xdc, 0xcb, 0xbb, 0xba, 0x00, 0x98, 0x30, 0x1e, 0xfe, 0xed, + 0xdc, 0xcb, 0xaa, 0x00, 0xaa, 0xaa, 0x98, 0x61, 0x3e, 0xfe, 0xdd, 0xcc, + 0x00, 0xba, 0x99, 0x9a, 0xaa, 0x98, 0x62, 0x7d, 0xee, 0x00, 0xdc, 0xcb, + 0xa9, 0x99, 0x99, 0x99, 0x88, 0x73, 0x08, 0xcd, 0xed, 0xdc, 0xba, 0xb9, + 0x99, 0x88, 0x64, 0x20, 0xcc, 0xdd, 0x6b, 0x99, 0x87, 0x63, 0x6c, 0xcc, + 0x40, 0xba, 0x1a, 0x98, 0x76, 0x42, 0x2b, 0xba, 0xaa, 0x88, 0x1b, 0x65, + 0x42, 0x1a, 0x2a, 0x99, 0x98, 0x87, 0x00, 0x64, 0x30, 0x04, 0x78, 0x88, + 0x88, 0x89, 0x99, 0x00, 0x88, 0x76, 0x54, 0x20, 0x01, 0x67, 0x77, 0x88, + 0x00, 0x88, 0x88, 0x87, 0x65, 0x43, 0x00, 0x00, 0x25, 0x00, 0x67, 0x77, + 0x77, 0x77, 0x65, 0x44, 0x31, 0x00, 0x00, 0x00, 0x01, 0x45, 0x66, 0x66, + 0x65, 0x54, 0x43, 0x00, 0x10, 0x00, 0x00, 0x00, 0x13, 0x44, 0x45, 0x44, + 0x20, 0x33, 0x20, 0xb9, 0x00, 0x00, 0x12, 0x23, 0x32, 0x80, 0x72, +}; + +//***************************************************************************** +// +// This is the image of a red LED that is turned on. +// +//***************************************************************************** +const uint8_t g_pui8LightOn[] = +{ + IMAGE_FMT_4BPP_COMP, + 20, 0, + 20, 0, + + 15, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x16, + 0x00, 0x00, 0x40, + 0x00, 0x00, 0x76, + 0x00, 0x00, 0x9b, + 0x00, 0x00, 0xac, + 0x00, 0x00, 0xb6, + 0x00, 0x00, 0xbc, + 0x00, 0x00, 0xbe, + 0x00, 0x00, 0xbf, + 0x00, 0x00, 0xc1, + 0x00, 0x00, 0xc5, + 0x00, 0x00, 0xcd, + 0x00, 0x00, 0xdb, + 0x00, 0x00, 0xef, + 0x00, 0x00, 0xfc, + + 0x84, 0x01, 0x13, 0xaf, 0xe7, 0x31, 0x03, 0x1b, 0xff, 0x09, 0xff, 0xee, + 0xee, 0x51, 0x01, 0x02, 0xff, 0xb1, 0x02, 0xdd, 0xcc, 0x20, 0x00, 0x00, + 0x2f, 0xbb, 0xcc, 0x10, 0x92, 0x00, 0x01, 0x72, 0xdc, 0xcc, 0xcb, 0x96, + 0x00, 0x10, 0x07, 0xff, 0xfe, 0xed, 0xdc, 0xcc, 0xbb, 0x08, 0xba, 0x96, + 0x30, 0x1e, 0x22, 0xba, 0xaa, 0xaa, 0x10, 0x86, 0x51, 0x3e, 0x69, 0xba, + 0x99, 0x99, 0x99, 0x01, 0x76, 0x52, 0x5d, 0xee, 0xdd, 0xcb, 0xa9, 0xb2, + 0x20, 0x53, 0xcd, 0x6c, 0x98, 0x76, 0x54, 0xcc, 0xdd, 0x40, 0xcc, 0x6a, + 0x97, 0x66, 0x43, 0x5c, 0xcc, 0xba, 0x40, 0x98, 0x19, 0x87, 0x65, 0x43, + 0x3c, 0xcb, 0xa9, 0x20, 0x98, 0x89, 0x1a, 0x42, 0x1a, 0x88, 0x98, 0x77, + 0x40, 0x88, 0x69, 0x44, 0x31, 0x04, 0x67, 0x77, 0x77, 0x00, 0x78, 0x88, + 0x76, 0x55, 0x44, 0x20, 0x01, 0x55, 0x00, 0x66, 0x66, 0x77, 0x77, 0x65, + 0x54, 0x43, 0x10, 0x00, 0x00, 0x24, 0x55, 0x55, 0x66, 0x65, 0x54, 0x44, + 0x00, 0x31, 0x00, 0x00, 0x02, 0x44, 0x45, 0x55, 0x54, 0x00, 0x44, 0x33, + 0x10, 0x00, 0x00, 0x00, 0x13, 0x44, 0x08, 0x44, 0x44, 0x33, 0x21, 0xb9, + 0x00, 0x00, 0x12, 0x10, 0x33, 0x32, 0x20, 0xba, +}; + +//***************************************************************************** +// +// This is the image of the blue push button background. +// +//***************************************************************************** +const uint8_t g_pui8Blue50x50[] = +{ + IMAGE_FMT_4BPP_COMP, + 50, 0, + 50, 0, + + 15, + 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, + 0x52, 0x00, 0x00, + 0x63, 0x00, 0x00, + 0x6f, 0x00, 0x00, + 0x78, 0x00, 0x00, + 0x7c, 0x00, 0x00, + 0x7d, 0x00, 0x00, + 0x7f, 0x00, 0x00, + 0x81, 0x00, 0x00, + 0x85, 0x00, 0x00, + 0x89, 0x00, 0x00, + 0x8d, 0x00, 0x00, + 0x93, 0x00, 0x00, + 0x9b, 0x00, 0x00, + 0xa9, 0x00, 0x00, + + 0x81, 0x03, 0x13, 0x9e, 0xfe, 0xff, 0xff, 0xff, 0xe9, 0x8a, 0xd1, 0xfe, + 0xd7, 0x31, 0x07, 0x2e, 0x51, 0xee, 0x35, 0xee, 0xee, 0xe9, 0xd4, 0xa2, + 0x35, 0x1e, 0x41, 0x41, 0xfe, 0x3f, 0xee, 0xee, 0xdd, 0xcc, 0x91, 0x33, + 0x40, 0x03, 0x41, 0xee, 0xee, 0xed, 0xdd, 0xdd, 0xdd, 0xc1, 0xe9, 0xd1, + 0xdc, 0xcd, 0xcc, 0xaa, 0x20, 0x32, 0x41, 0x3f, 0x41, 0xed, 0xdc, 0xcc, + 0xcc, 0xcc, 0xe9, 0x81, 0xd1, 0xbb, 0xbb, 0xcc, 0xcb, 0xba, 0x52, 0x39, + 0x40, 0x03, 0x42, 0xcc, 0xba, 0xaa, 0x99, 0x99, 0x99, 0xc0, 0xe9, 0xd1, + 0xaa, 0xaa, 0xab, 0xa9, 0x95, 0x20, 0x04, 0x00, 0x00, 0x1f, 0xff, 0xfe, + 0x41, 0x99, 0x98, 0x1c, 0x88, 0x88, 0x88, 0xe9, 0xd1, 0x29, 0x99, 0x98, + 0x00, 0x41, 0x00, 0x00, 0xef, 0xff, 0xee, 0xdc, 0xba, 0x60, 0x99, 0x4f, + 0x01, 0x89, 0x99, 0x99, 0x98, 0x53, 0x01, 0x00, 0x02, 0xff, 0xfe, 0xed, + 0xcb, 0xa9, 0x47, 0x80, 0x35, 0x98, 0x64, 0x10, 0x0d, 0xef, 0xee, 0xdc, + 0x30, 0xba, 0x98, 0x3f, 0x04, 0x99, 0x88, 0x54, 0x30, 0x06, 0x1e, 0xfe, + 0xed, 0xcb, 0xa9, 0x47, 0x06, 0x86, 0x01, 0x55, 0x41, 0x3e, 0xfe, 0xed, + 0xba, 0x98, 0x3f, 0x81, 0x3f, 0x65, 0x41, 0x5e, 0xee, 0xdc, 0xb9, 0x47, + 0x80, 0x07, 0x88, 0x65, 0x42, 0xbd, 0xee, 0xdb, 0xa9, 0xe1, 0x3f, 0x3f, + 0x39, 0xcc, 0xed, 0xcb, 0x98, 0x3f, 0x81, 0x3f, 0x88, 0x65, 0x43, 0xcc, + 0xdd, 0xca, 0x3f, 0xc3, 0x3f, 0x39, 0x42, 0xcb, 0xdc, 0xba, 0x3f, 0x3f, + 0xb0, 0x3c, 0xb9, 0x47, 0x07, 0x88, 0x88, 0x75, 0x32, 0x18, 0xcb, 0xdc, + 0xa9, 0x3f, 0x07, 0x88, 0x88, 0x65, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0xf8, 0x3f, 0x3f, 0x3f, 0x07, 0x01, 0x64, 0x32, 0xcb, + 0x73, 0xcc, 0x3f, 0x3f, 0x3b, 0x9b, 0xcb, 0x3f, 0x07, 0x00, 0x88, 0x88, + 0x87, 0x54, 0x32, 0x4a, 0xba, 0x99, 0x60, 0x98, 0x37, 0x07, 0x86, 0x54, + 0x32, 0x2a, 0xaa, 0x60, 0xa9, 0x47, 0x07, 0x88, 0x75, 0x43, 0x21, 0x19, + 0x30, 0x8a, 0x99, 0x3f, 0x07, 0x88, 0x65, 0x43, 0x21, 0x0c, 0x04, 0x49, + 0x98, 0x98, 0x37, 0x06, 0x86, 0x54, 0x06, 0x33, 0x20, 0x02, 0x46, 0x68, + 0x47, 0x07, 0x76, 0x01, 0x54, 0x32, 0x10, 0x00, 0x44, 0x66, 0x66, 0x2f, + 0x80, 0x05, 0x87, 0x65, 0x43, 0x32, 0x00, 0x00, 0x13, 0x18, 0x45, 0x55, + 0x66, 0x3f, 0x04, 0x66, 0x54, 0x33, 0x00, 0x21, 0x00, 0x00, 0x01, 0x34, + 0x45, 0x56, 0x66, 0x60, 0x78, 0x2f, 0x01, 0x76, 0x54, 0x43, 0x32, 0x10, + 0x01, 0x00, 0x00, 0x00, 0x12, 0x44, 0x45, 0x55, 0x37, 0x82, 0x01, 0x66, + 0x55, 0x44, 0x33, 0x21, 0x41, 0x00, 0x00, 0x01, 0x23, 0x44, 0x44, 0x55, + 0x56, 0x66, 0x66, 0x60, 0x66, 0xe9, 0xd1, 0x65, 0x54, 0x44, 0x33, 0x22, + 0x40, 0x10, 0x3a, 0x00, 0x12, 0x33, 0x34, 0x44, 0x44, 0x61, 0x44, 0xe9, + 0xd4, 0x43, 0x33, 0x22, 0x21, 0x43, 0x86, 0x31, 0x23, 0x33, 0x33, 0x33, + 0xe9, 0xd4, 0x32, 0x80, 0x47, 0x00, 0x00, 0x01, 0x12, 0x22, 0x22, 0x22, + 0xc8, 0xe9, 0xd3, 0x21, 0x10, 0x43, +}; + +//***************************************************************************** +// +// This is the image of the blue push button background, used when the buttons +// are pressed. +// +//***************************************************************************** +const uint8_t g_pui8Blue50x50Press[] = +{ + IMAGE_FMT_4BPP_COMP, + 50, 0, + 50, 0, + + 15, + 0x00, 0x00, 0x00, + 0x23, 0x00, 0x00, + 0x52, 0x00, 0x00, + 0x63, 0x00, 0x00, + 0x6f, 0x00, 0x00, + 0x78, 0x00, 0x00, + 0x7c, 0x00, 0x00, + 0x7d, 0x00, 0x00, + 0x7f, 0x00, 0x00, + 0x81, 0x00, 0x00, + 0x85, 0x00, 0x00, + 0x89, 0x00, 0x00, + 0x8d, 0x00, 0x00, + 0x93, 0x00, 0x00, + 0x9b, 0x00, 0x00, + 0xa9, 0x00, 0x00, + + 0x83, 0x03, 0x01, 0x12, 0x22, 0x22, 0x22, 0xe9, 0xd3, 0x20, 0x21, 0x10, + 0x07, 0x12, 0x22, 0x23, 0x33, 0x33, 0x64, 0x33, 0xe9, 0xd4, 0x32, 0x21, + 0x47, 0x33, 0x34, 0x19, 0x44, 0x44, 0x44, 0xe9, 0xd4, 0x43, 0x33, 0x34, + 0x00, 0x01, 0x22, 0x33, 0x44, 0x45, 0x56, 0x66, 0x66, 0x60, 0x66, 0xe9, + 0xd1, 0x65, 0x55, 0x44, 0x44, 0x32, 0x40, 0x10, 0x32, 0x12, 0x33, 0x44, + 0x55, 0x66, 0x88, 0x30, 0x88, 0x88, 0xe9, 0xd2, 0x87, 0x66, 0x55, 0x54, + 0x20, 0x44, 0x21, 0x39, 0x01, 0x23, 0x34, 0x45, 0x67, 0xc0, 0x47, 0x33, + 0x65, 0x54, 0x43, 0x10, 0x00, 0x00, 0x0c, 0x12, 0x33, 0x45, 0x66, 0x47, + 0x04, 0x66, 0x55, 0x00, 0x54, 0x31, 0x00, 0x00, 0x23, 0x34, 0x56, 0x78, + 0xc0, 0x3f, 0x04, 0x86, 0x66, 0x66, 0x44, 0x00, 0x01, 0x18, 0x23, 0x45, + 0x67, 0x47, 0x2f, 0x86, 0x64, 0x20, 0x0c, 0x02, 0x33, 0x45, 0x68, 0x3f, + 0x06, 0x89, 0x89, 0x06, 0x94, 0x40, 0x12, 0x34, 0x56, 0x47, 0x07, 0x88, + 0x03, 0x99, 0xa8, 0x91, 0x12, 0x34, 0x57, 0x3f, 0x07, 0x01, 0x88, 0x9a, + 0xaa, 0xa2, 0x23, 0x45, 0x68, 0x3f, 0x80, 0x07, 0x89, 0x99, 0xab, 0xa4, + 0x23, 0x45, 0x78, 0xc0, 0x3f, 0x07, 0x88, 0x9a, 0xbc, 0xb9, 0x23, 0x46, + 0xe7, 0x47, 0x3f, 0x39, 0xcc, 0xbc, 0x3f, 0x3f, 0x3b, 0x0f, 0xcd, 0xbc, + 0x23, 0x56, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0xb0, 0x39, 0x57, 0x3f, 0x07, 0x88, 0x88, 0x9b, 0xcd, + 0x18, 0xbc, 0x24, 0x56, 0x3f, 0x07, 0x88, 0x89, 0xab, 0xe1, 0x3f, 0x3f, + 0x3c, 0xac, 0xdd, 0xcc, 0x34, 0x3f, 0xc3, 0x3f, 0x39, 0xbc, 0xde, 0xcc, + 0x24, 0x3f, 0x07, 0x03, 0x88, 0x88, 0x9a, 0xbd, 0xee, 0xdb, 0x3f, 0x07, + 0x80, 0x01, 0x9b, 0xcd, 0xee, 0xe5, 0x14, 0x56, 0x68, 0xc0, 0x37, 0x06, + 0x89, 0xab, 0xde, 0xef, 0xe3, 0x14, 0x60, 0x55, 0x3f, 0x07, 0x9a, 0xbc, + 0xde, 0xef, 0xe1, 0x0c, 0x03, 0x45, 0x88, 0x99, 0x37, 0x04, 0x89, 0xab, + 0x00, 0xcd, 0xee, 0xfe, 0xd0, 0x01, 0x46, 0x89, 0x99, 0x60, 0x98, 0x37, + 0x03, 0x9a, 0xbc, 0xde, 0xef, 0xff, 0x06, 0x20, 0x00, 0x35, 0x89, 0x99, + 0x37, 0x03, 0x99, 0x00, 0xab, 0xcd, 0xee, 0xff, 0xfe, 0x00, 0x00, 0x14, + 0x04, 0x89, 0x99, 0xaa, 0x99, 0x99, 0x37, 0x89, 0x99, 0x00, 0xab, 0xcc, + 0xde, 0xef, 0xff, 0xf1, 0x00, 0x00, 0x05, 0x02, 0x59, 0x9a, 0xba, 0xaa, + 0x29, 0x99, 0xe9, 0xa0, 0xd1, 0xaa, 0x41, 0xee, 0xff, 0xff, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x25, 0xab, 0xbc, 0xcc, 0xbb, 0xbb, 0x1a, 0xcc, 0xcc, + 0xcc, 0xe9, 0xd1, 0xcd, 0x42, 0xf3, 0x80, 0x41, 0x00, 0x02, 0xaa, 0xcc, + 0xdc, 0xcd, 0xdd, 0x32, 0xdd, 0xdd, 0xe9, 0xd1, 0xde, 0xee, 0x41, 0xff, + 0x40, 0x30, 0x3a, 0x00, 0x19, 0xcc, 0xdd, 0xee, 0xee, 0x6a, 0xee, 0xe9, + 0xd3, 0xef, 0x41, 0xe1, 0x43, 0x00, 0x3a, 0x00, 0x2a, 0x47, 0x01, 0x41, + 0xe2, 0x45, 0x00, 0x0e, 0x00, 0x13, 0x7d, 0xef, 0x81, 0x69, 0x51, 0xef, + 0x20, 0xe9, 0x31, 0x43, +}; + +//***************************************************************************** +// +// Vertical "Temperature" image used in the slider widget example. +// +//***************************************************************************** +const uint8_t g_pui8GettingHotter28x148[] = +{ + IMAGE_FMT_8BPP_COMP, + 28, 0, + 148, 0, + + 63, + 0x00, 0x10, 0x42, + 0x00, 0x29, 0x46, + 0x00, 0x13, 0x72, + 0x00, 0x3c, 0x3c, + 0x00, 0x38, 0x6c, + 0x00, 0x0d, 0xc7, + 0x00, 0x22, 0x9e, + 0x00, 0x06, 0xe5, + 0x00, 0x03, 0xfe, + 0x00, 0x10, 0xf0, + 0x00, 0x45, 0x8a, + 0x00, 0x0b, 0xfe, + 0x00, 0x57, 0x69, + 0x00, 0x1e, 0xe2, + 0x00, 0x2e, 0xc7, + 0x00, 0x13, 0xfd, + 0x00, 0x1c, 0xf6, + 0x00, 0x1d, 0xfc, + 0x00, 0x34, 0xd7, + 0x00, 0x2c, 0xed, + 0x00, 0x44, 0xc3, + 0x00, 0x29, 0xfb, + 0x00, 0x65, 0x8d, + 0x00, 0x3f, 0xe3, + 0x00, 0x58, 0xb4, + 0x00, 0x37, 0xf9, + 0x00, 0x80, 0x7e, + 0x00, 0x46, 0xf8, + 0x00, 0x56, 0xe0, + 0x00, 0x6b, 0xc3, + 0x00, 0x54, 0xf6, + 0x00, 0x7d, 0xb6, + 0x00, 0x68, 0xe1, + 0x00, 0x61, 0xf5, + 0x00, 0x77, 0xd8, + 0x00, 0x6b, 0xf4, + 0x00, 0x9a, 0x9d, + 0x00, 0x74, 0xf3, + 0x00, 0xa7, 0x97, + 0x00, 0x94, 0xbd, + 0x00, 0x7b, 0xf2, + 0x00, 0x88, 0xdf, + 0x00, 0x90, 0xd6, + 0x00, 0x83, 0xf1, + 0x00, 0x8b, 0xf0, + 0x00, 0xab, 0xb9, + 0x00, 0x91, 0xf0, + 0x00, 0x9a, 0xee, + 0x00, 0xa8, 0xdc, + 0x00, 0xa5, 0xed, + 0x00, 0xc4, 0xc6, + 0x00, 0xb2, 0xec, + 0x00, 0xbc, 0xeb, + 0x00, 0xc3, 0xea, + 0x00, 0xd2, 0xda, + 0x00, 0xcc, 0xe9, + 0x00, 0xd4, 0xe9, + 0x00, 0xe1, 0xd8, + 0x00, 0xdb, 0xe8, + 0x00, 0xe0, 0xe7, + 0x00, 0xe6, 0xe7, + 0x00, 0xec, 0xe6, + 0x00, 0xf3, 0xe5, + 0x00, 0xfa, 0xe4, + + 0x1f, 0x08, 0x08, 0x08, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0xfc, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x08, 0x19, 0x03, 0x28, 0x34, 0x34, 0x19, 0x15, + 0x15, 0x07, 0x07, 0x00, 0x08, 0x0f, 0x34, 0x3f, 0x3f, 0x3f, 0x3f, 0x0a, + 0x1c, 0x20, 0x3d, 0x20, 0x1f, 0x07, 0x2b, 0x3f, 0x04, 0x0d, 0x22, 0x3f, + 0x3f, 0x18, 0x1f, 0x05, 0x1e, 0x2b, 0x01, 0x3f, 0x04, 0x2a, 0x3f, 0x3f, + 0x39, 0x05, 0x1f, 0xa8, 0x04, 0x2c, 0x61, 0x16, 0x21, 0x29, 0x3f, 0x3f, + 0x30, 0x3f, 0x02, 0x27, 0x04, 0x34, 0x3f, 0x3f, 0x16, 0x4a, 0x00, 0x21, + 0x05, 0x36, 0xd9, 0x07, 0x1d, 0x0b, 0x29, 0x0b, 0x0b, 0xe9, 0x0b, 0x21, + 0x04, 0x05, 0x22, 0xe1, 0xbb, 0x5d, 0x25, 0x31, 0x3f, 0x3f, 0x2d, 0x22, + 0x30, 0x12, 0x3f, 0x27, 0x07, 0x28, 0x3e, 0x3e, 0x3e, 0x09, 0x36, 0x3e, + 0x3e, 0x32, 0xc9, 0x3e, 0x00, 0x27, 0x98, 0x04, 0x11, 0x3c, 0x52, 0x32, + 0x3e, 0x24, 0x00, 0xd1, 0x2f, 0x05, 0x1e, 0x26, 0x32, 0x00, 0x02, 0x27, + 0x90, 0x06, 0x0e, 0x2d, 0x12, 0x39, 0x16, 0x00, 0x02, 0x44, 0x09, 0x26, + 0x0f, 0x0f, 0x0f, 0xe9, 0x0f, 0x15, 0x00, 0x1b, 0x0f, 0x05, 0x02, 0x04, + 0x04, 0x04, 0x00, 0x18, 0x00, 0x05, 0x09, 0x6d, 0x35, 0x0f, 0x0f, 0x2f, + 0x00, 0x3d, 0x36, 0x28, 0x0f, 0x09, 0x05, 0x05, 0x05, 0xc0, 0x3f, 0x07, + 0x0f, 0x33, 0x3d, 0x3d, 0x32, 0x06, 0xe0, 0x47, 0x07, 0x03, 0x28, 0x3d, + 0x3d, 0x36, 0x02, 0xe8, 0x27, 0x07, 0x04, 0x1d, 0x19, 0x28, 0x1e, 0x1e, + 0x70, 0x1e, 0xe9, 0x07, 0x05, 0x28, 0x3d, 0x3d, 0x3d, 0xd1, 0xe9, 0xd3, + 0x05, 0x1e, 0x11, 0x11, 0x11, 0xe9, 0x06, 0x11, 0x28, 0x3c, 0x3c, 0x3c, + 0xe9, 0xd3, 0x00, 0xf8, 0x65, 0x2d, 0x27, 0x27, 0x07, 0x11, 0x11, 0x23, + 0x0f, 0x30, 0x2d, 0x2d, 0x2d, 0xe9, 0xd2, 0x27, 0x06, 0x0f, 0x05, 0x02, + 0x02, 0x02, 0xe9, 0xd3, 0x27, 0x07, 0xe1, 0x77, 0x2f, 0x05, 0x19, 0x1e, + 0x1e, 0x1e, 0xe9, 0xe1, 0xd3, 0x07, 0x05, 0x28, 0x3b, 0x3b, 0x3b, 0xe9, + 0xa2, 0xd3, 0x05, 0x1e, 0x15, 0x15, 0x15, 0xe9, 0x15, 0x0d, 0x28, 0x3a, + 0x3a, 0x3a, 0xe9, 0xd3, 0x00, 0x65, 0xf0, 0x2d, 0x27, 0x27, 0x07, 0x15, + 0x15, 0x23, 0x30, 0x00, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x36, 0x3a, 0x3a, + 0x30, 0x27, 0x16, 0x27, 0x06, 0x06, 0x02, 0x02, 0x02, 0x83, 0xe9, 0x1f, + 0x3a, 0x3a, 0x0a, 0x06, 0x27, 0x07, 0x83, 0x73, 0x1e, 0x38, 0x38, 0x32, + 0x0e, 0x27, 0x04, 0x08, 0x1b, 0x1e, 0x1e, 0x1e, 0xe9, 0x21, 0x33, 0x38, + 0x1b, 0x38, 0x38, 0x0a, 0x27, 0x04, 0x28, 0x61, 0x49, 0x9d, 0xd3, 0x04, + 0x0e, 0x27, 0x27, 0x0e, 0x00, 0x26, 0x10, 0x19, 0x19, 0x19, 0xe9, 0x19, + 0x28, 0x37, 0x37, 0x63, 0x37, 0xe9, 0xd2, 0x16, 0x00, 0x13, 0x5d, 0x25, + 0x04, 0x25, 0x30, 0x27, 0x27, 0x27, 0xe9, 0x27, 0x16, 0x18, 0x04, 0x00, + 0x06, 0x2f, 0x05, 0x06, 0x02, 0x02, 0x43, 0x02, 0xe9, 0x02, 0x02, 0x06, + 0x0e, 0x2f, 0x05, 0x0e, 0x1b, 0x21, 0x21, 0x1e, 0xb6, 0x27, 0x05, 0x28, + 0x08, 0x35, 0x35, 0x2f, 0x12, 0x1a, 0x33, 0x35, 0x35, 0x64, 0x0e, 0x27, + 0x27, 0x27, 0x02, 0x22, 0x31, 0x35, 0x37, 0x35, 0x04, 0x47, 0x43, 0x35, + 0xe9, 0xd4, 0xa1, 0x23, 0x04, 0x0e, 0x1f, 0x19, 0x1b, 0x30, 0x27, 0x27, + 0x80, 0x3c, 0x1b, 0x1b, 0x1b, 0x25, 0x34, 0x34, 0x34, 0xc3, 0xe9, 0xd4, + 0x34, 0x30, 0x00, 0x12, 0x5a, 0x3a, 0xa0, 0x1a, 0x30, 0x1f, 0x34, 0x33, + 0x1f, 0x01, 0x00, 0xc0, 0x2f, 0x03, 0x02, 0x16, 0x34, 0x34, 0x27, 0x00, + 0x23, 0x00, 0x00, 0xe9, 0x00, 0x02, 0x17, 0x27, 0x04, 0x07, 0x21, 0x1d, + 0x16, 0x0a, 0x02, 0x67, 0x1f, 0x04, 0x01, 0x14, 0x06, 0x14, 0x18, 0x23, + 0x23, 0x23, 0xe9, 0x60, 0x2b, 0x07, 0x06, 0x21, 0x31, 0x33, 0x33, 0x33, + 0xda, 0xe9, 0xd1, 0x06, 0x1f, 0x04, 0x1e, 0x37, 0x33, 0x24, 0x33, 0x00, + 0x5f, 0x1e, 0x1e, 0xe9, 0x1e, 0x28, 0xf0, 0x27, 0x21, 0x65, 0x2d, 0x1e, + 0x2e, 0x33, 0x33, 0x00, 0x30, 0x2a, 0x33, 0x30, 0x1f, 0x30, 0x33, 0x30, + 0x60, 0x0a, 0x27, 0x27, 0x33, 0x0a, 0x04, 0x33, 0x33, 0x03, 0x00, 0x04, + 0x1f, 0x33, 0x16, 0x14, 0x27, 0x25, 0x00, 0x31, 0x31, 0x04, 0x14, 0x2f, + 0x31, 0x0a, 0x1e, 0x0c, 0x23, 0x31, 0x30, 0x0a, 0x27, 0x27, 0x1f, 0x14, + 0x43, 0x2b, 0xe1, 0x25, 0x31, 0x31, 0x04, 0x27, 0x04, 0x00, 0x2b, 0x31, + 0x31, 0x31, 0x18, 0x28, 0x31, 0x31, 0x4d, 0x2a, 0xc1, 0x04, 0x14, 0x1f, + 0x03, 0x25, 0x62, 0x71, 0x18, 0x39, 0x27, 0x01, 0x21, 0x21, 0x21, 0xe9, + 0x14, 0x21, 0x21, 0x29, 0x62, 0x2f, 0x1a, 0x2a, 0x00, 0x68, 0x14, 0x5e, + 0x1e, 0x18, 0x61, 0x23, 0x2a, 0x2f, 0x0c, 0x2f, 0x2a, 0x04, 0x01, 0x2f, + 0x06, 0x1c, 0x0a, 0x81, 0x61, 0x1c, 0x0a, 0x04, 0x00, 0x01, 0x1c, 0x27, + 0x93, 0x04, 0x23, 0x25, 0x7d, 0x14, 0x14, 0x37, 0x06, 0x0c, 0x2b, 0x2f, + 0x2e, 0x28, 0x5f, 0x16, 0x23, 0x23, 0x40, 0x23, 0xe9, 0x23, 0x2c, 0x2f, + 0x2f, 0x22, 0x0a, 0xe0, 0xa5, 0x6d, 0x97, 0x28, 0x2e, 0x2e, 0x29, 0x04, + 0xe8, 0x27, 0x07, 0x04, 0x1d, 0x19, 0x28, 0x25, 0x25, 0x70, 0x25, 0xe9, + 0x07, 0x05, 0x28, 0x2e, 0x2e, 0x2e, 0xd8, 0xe9, 0xd3, 0x18, 0x27, 0x25, + 0x2c, 0x2c, 0x2c, 0xd1, 0xe9, 0xd3, 0x00, 0x26, 0x25, 0x25, 0x25, 0xe9, + 0x78, 0x25, 0x27, 0x22, 0x65, 0x2d, 0x25, 0x28, 0x22, 0x1e, 0x1d, 0x1d, + 0x1d, 0xe9, 0xd2, 0x27, 0x06, 0x18, 0x1c, 0x04, 0x04, 0x04, 0xe9, 0xd3, + 0x26, 0x28, 0x28, 0x67, 0x28, 0xe9, 0xd4, 0x2b, 0x2b, 0x97, 0x4f, 0x3d, + 0x01, 0x2b, 0x2b, 0x2b, 0x0a, 0x22, 0x2b, 0x22, 0x2f, 0xc0, 0x2f, 0x2b, + 0x2b, 0x04, 0x22, 0x2b, 0x2b, 0x1d, 0xe0, 0x1f, 0x07, 0x73, 0x04, 0x22, + 0x28, 0x28, 0x22, 0x45, 0x18, 0x1e, 0x2b, 0x2b, 0x2b, 0xe9, 0x2b, 0x01, + 0x27, 0x25, 0x0a, 0x24, 0x28, 0x04, 0x65, 0x2d, 0x22, 0x25, 0x0a, 0x01, + 0x21, 0x1d, 0x25, 0x21, 0x22, 0x27, 0x85, 0x24, 0x25, 0x25, 0x04, 0x18, + 0xe1, 0x1d, 0xba, 0x65, 0x1d, 0x27, 0x26, 0x18, 0x1d, 0x22, 0x25, 0x27, + 0x04, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c, 0xe9, 0x2c, 0x2b, 0x88, 0x61, 0x20, + 0x25, 0x25, 0x2a, 0x25, 0x01, 0x1d, 0xcc, 0x5d, 0x25, 0x2c, 0x23, 0x52, + 0x32, 0x25, 0x18, 0x61, 0x01, 0x2f, 0x05, 0x2b, 0x23, 0x23, 0x23, 0xe9, + 0x04, 0x23, 0x23, 0x1d, 0x01, 0x0a, 0x26, 0x2e, 0x2e, 0x64, 0x2e, 0xe9, + 0xd1, 0x1d, 0x18, 0x12, 0x20, 0x0a, 0x18, 0x01, 0x04, 0x29, 0x67, 0x1f, + 0x22, 0x0a, 0x04, 0x07, 0x04, 0x04, 0x01, 0x01, 0x16, 0x2f, 0x07, 0x02, + 0x0c, 0x29, 0x1f, 0x1f, 0x22, 0x3f, 0x01, 0x2f, 0x2f, 0x60, 0x2f, 0xe9, + 0xd2, 0x2b, 0x28, 0x25, 0x25, 0x25, 0x30, 0x2b, 0x2c, 0x7f, 0x37, 0x2f, + 0x2c, 0x23, 0x21, 0x23, 0x21, 0x21, 0xe9, 0x21, 0x20, 0x2e, 0x17, 0x05, + 0x6d, 0x2e, 0x35, 0x01, 0x18, 0x1f, 0x05, 0x28, 0x27, 0x18, 0x21, 0x21, + 0x16, 0x27, 0x04, 0x23, 0x21, 0x21, 0x02, 0x1c, 0x0a, 0x04, 0x04, 0x04, + 0x14, 0x01, 0x04, 0x88, 0x26, 0x31, 0x31, 0x31, 0xe9, 0x31, 0x25, 0x1e, + 0x00, 0x1e, 0x0a, 0x01, 0x16, 0x1f, 0x1f, 0x1f, 0x1c, 0x0d, 0x1e, 0x1e, + 0x04, 0x1f, 0x5d, 0x25, 0x2c, 0x21, 0x83, 0x6b, 0x21, 0x1e, 0x1c, 0x01, + 0x2a, 0x27, 0x04, 0x00, 0x20, 0x1e, 0x1c, 0x1d, 0x2e, 0x2e, 0x2c, 0x23, + 0x01, 0x1e, 0x1e, 0x0a, 0x0a, 0x2e, 0x2e, 0x2e, 0x17, 0x87, 0x01, 0x2b, + 0x1e, 0x1e, 0x1e, 0xe9, 0xd4, 0xa1, 0x39, 0x22, 0x2f, 0x27, 0x27, 0x06, + 0x04, 0x1f, 0x27, 0xd1, 0x27, 0x27, 0x27, 0x21, 0x33, 0x33, 0x33, 0xe9, + 0x03, 0x33, 0x2b, 0x1c, 0x14, 0x14, 0x14, 0xe9, 0xd4, 0x0c, 0x14, 0x14, + 0x04, 0x27, 0x3d, 0x02, 0x1f, 0x0c, 0x3e, 0x0c, 0x0c, 0xe9, 0xd4, 0xa1, + 0x27, 0x03, 0x2f, 0x3c, 0x2f, 0x2f, 0xe9, 0xd1, 0x57, 0x0e, 0x2c, 0x1e, + 0x1b, 0x1b, 0x1b, 0x1b, 0xe9, 0xd1, 0x27, 0x1f, 0x04, 0x44, 0x2f, 0x37, + 0x1b, 0x1b, 0x01, 0x26, 0x34, 0x34, 0x4f, 0x34, 0xe9, 0x34, 0x23, 0x27, + 0x21, 0x65, 0x2d, 0x21, 0x34, 0x21, 0x21, 0x17, 0x14, 0x14, 0x14, 0xe9, + 0x68, 0x14, 0x27, 0x05, 0x25, 0x29, 0x01, 0x03, 0x0c, 0x2c, 0x0c, 0x0c, + 0xe9, 0x0c, 0x27, 0x04, 0x2f, 0x19, 0x0e, 0x19, 0x12, 0x03, 0x33, 0x5f, + 0x17, 0x03, 0x22, 0x02, 0x19, 0x19, 0x14, 0x2f, 0x2f, 0x2f, 0xe9, 0x2f, + 0x88, 0x07, 0x35, 0x35, 0x35, 0xe9, 0x35, 0x35, 0x2b, 0x1b, 0x19, 0x19, + 0x19, 0xe9, 0xd2, 0x27, 0x66, 0x25, 0x46, 0x2e, 0x2f, 0x19, 0x19, 0x03, + 0x27, 0x04, 0x21, 0xe8, 0x27, 0x27, 0x07, 0x1e, 0x21, 0x12, 0x0e, 0x0e, + 0x51, 0x0e, 0xe9, 0x0e, 0x27, 0x37, 0x37, 0x37, 0xe9, 0x20, 0x37, 0x23, + 0x29, 0x01, 0x03, 0x0c, 0x0c, 0x0c, 0xb0, 0xe9, 0x0c, 0x65, 0x2d, 0x37, + 0x31, 0x15, 0x15, 0x1c, 0x12, 0x03, 0x35, 0x5f, 0x17, 0x03, 0x22, 0x15, + 0x05, 0x15, 0x14, 0x31, 0x31, 0x31, 0xe9, 0x31, 0x07, 0x86, 0x05, 0x2b, + 0x15, 0x15, 0x15, 0xe9, 0xd3, 0x2d, 0x8b, 0x1e, 0x38, 0x38, 0x38, 0xe9, + 0x38, 0x27, 0x01, 0x7c, 0x03, 0x65, 0x2d, 0x27, 0x27, 0x07, 0x38, 0x38, + 0x07, 0x2c, 0x17, 0x0e, 0x0e, 0x0e, 0xe9, 0xd2, 0x27, 0x87, 0x06, 0x24, + 0x0c, 0x0c, 0x0c, 0xe9, 0xd3, 0x27, 0xe3, 0x07, 0x77, 0x2f, 0x3a, 0x3a, + 0x3a, 0xe9, 0xd2, 0x01, 0x33, 0x2b, 0x1e, 0x1e, 0x33, 0x35, 0x35, 0x7f, + 0x80, 0x37, 0x3a, 0x37, 0x1e, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x0a, 0x22, + 0x15, 0x29, 0x1f, 0x07, 0x2b, 0x11, 0x04, 0x04, 0x20, 0x11, 0x11, 0x1d, + 0x1f, 0x3b, 0x3b, 0x48, 0x3b, 0xe9, 0x3b, 0x2f, 0x2b, 0x11, 0x04, 0x1c, + 0x0c, 0x11, 0x11, 0x0d, 0x2d, 0x65, 0x2d, 0x3b, 0x25, 0x09, 0x11, 0x11, + 0x10, 0x06, 0x21, 0x20, 0x11, 0xd9, 0xc1, 0x27, 0x04, 0x1e, 0x11, 0x11, + 0x06, 0x03, 0x21, 0x28, 0x2d, 0x13, 0x21, 0x32, 0x1d, 0x3c, 0x3c, 0x3c, + 0x81, 0xe9, 0x3c, 0x1e, 0x0f, 0x0f, 0x04, 0x24, 0xe1, 0x58, 0x2d, 0xba, + 0x2d, 0x5d, 0x25, 0x21, 0x0f, 0x0f, 0x26, 0x0e, 0x2d, 0x01, 0x27, 0x0f, + 0x27, 0x07, 0x2b, 0xb3, 0x61, 0x0d, 0xe9, 0x29, 0x0f, 0x03, 0x27, 0x04, + 0x31, 0x3a, 0x10, 0x52, 0x32, 0x0f, 0x06, 0x03, 0x2e, 0x11, 0x3d, 0x3d, + 0x3d, 0xe9, 0x3d, 0x3d, 0x2f, 0x26, 0x18, 0x0d, 0x03, 0x1a, 0x66, 0x26, + 0x3d, 0x27, 0x0e, 0x82, 0x12, 0x09, 0x06, 0x03, 0x0c, 0x39, 0x27, 0x3d, + 0x30, 0x3d, 0x1b, 0x59, 0x01, 0x32, 0x16, 0x04, 0x04, 0x0c, 0x04, 0x03, + 0x03, 0x24, 0x2f, 0x23, 0x0b, 0x0b, 0x21, 0x0b, 0x03, 0x7a, 0x39, 0x32, + 0x32, 0x32, 0x3f, 0xf1, 0x27, 0x24, 0x47, 0x05, 0x3e, 0x3e, 0x3e, 0x23, + 0xf8, 0xc1, 0xa9, 0xd4, 0xa7, 0x24, 0x06, 0x2b, 0x2b, 0x7f, 0x2b, 0xe9, + 0xd3, 0x27, 0x25, 0x09, 0xd4, 0xa1, 0x63, 0x24, 0x27, 0x21, 0x08, 0x08, + 0x08, 0xe9, 0xd4, 0xbf, 0xa1, 0x03, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, + 0x84, 0x27, 0x3e, 0x3f, 0x3f, 0x3f, 0x22, 0x03, 0x03, 0x6f, 0x03, 0xe9, + 0xd4, 0x03, 0x61, 0x49, 0xd3, 0x23, 0xff, 0x87, 0x3f, 0x27, 0x27, 0x27, + 0x27, 0x27, 0x07, 0x87, 0x05, 0x2f, 0x14, 0x06, 0x06, 0x27, 0x07, 0x05, + 0x0f, 0x26, 0x26, 0x26, 0x26, 0x27, 0x07, 0x77, 0x2f, 0xf8, 0x07, 0x07, + 0x07, 0x07, 0x02, +}; + +//***************************************************************************** +// +// Background version of vertical "Temperature" image. +// +//***************************************************************************** +const uint8_t g_pui8GettingHotter28x148Mono[] = +{ + IMAGE_FMT_4BPP_COMP, + 28, 0, + 148, 0, + + 15, + 0x00, 0x00, 0x00, + 0x0e, 0x0d, 0x00, + 0x1c, 0x1a, 0x01, + 0x2a, 0x28, 0x01, + 0x38, 0x35, 0x01, + 0x46, 0x42, 0x01, + 0x54, 0x4f, 0x02, + 0x62, 0x5c, 0x02, + 0x70, 0x6a, 0x02, + 0x7e, 0x77, 0x02, + 0x8c, 0x84, 0x03, + 0x9a, 0x91, 0x03, + 0xa8, 0x9e, 0x03, + 0xb6, 0xac, 0x03, + 0xc4, 0xb9, 0x04, + 0xd2, 0xc6, 0x04, + + 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x37, 0x10, 0xbb, 0x32, + 0x20, 0x07, 0x1b, 0xff, 0xff, 0x46, 0x40, 0xe6, 0x07, 0xbf, 0xff, 0xff, + 0x47, 0xff, 0x50, 0x80, 0x1d, 0x05, 0xff, 0xff, 0xff, 0x49, 0xff, 0xd0, + 0x80, 0x1d, 0x08, 0xff, 0xe6, 0xff, 0x48, 0xff, 0xf2, 0x80, 0x25, 0x0b, + 0xff, 0x60, 0xff, 0x40, 0xdf, 0xf4, 0x84, 0x97, 0x40, 0xff, 0x40, 0xbf, + 0x96, 0x0a, 0xff, 0x08, 0xa0, 0xff, 0x43, 0xff, 0x26, 0x07, 0xff, 0xfd, + 0x08, 0xff, 0xcf, 0xff, 0xf0, 0x25, 0x01, 0xef, 0xff, 0x09, 0xff, 0xff, + 0xff, 0x90, 0x25, 0x00, 0x5f, 0x91, 0x20, 0xfc, 0x10, 0x96, 0x03, 0xaf, + 0xff, 0xfe, 0x71, 0x82, 0x2e, 0x02, 0x40, 0x01, 0x44, 0x30, 0x36, 0x00, + 0x10, 0x09, 0xfd, 0x70, 0xa7, 0x00, 0x00, 0x0b, 0xff, 0x41, 0xc0, 0x97, + 0x00, 0x00, 0x07, 0xff, 0xd1, 0x27, 0x81, 0x01, 0x7f, 0xfd, 0x74, 0x44, + 0x44, 0x40, 0x27, 0x07, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x97, 0x97, 0x27, + 0x80, 0x26, 0x06, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb0, 0xf8, 0x25, 0x5d, + 0x97, 0x4f, 0x01, 0x02, 0x44, 0x44, 0x08, 0x44, 0x44, 0x44, 0x40, 0x05, + 0x07, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x97, 0x97, 0x27, 0x26, + 0x01, 0x06, 0xbb, 0xbb, 0xbb, 0xef, 0xfa, 0x70, 0x25, 0x88, 0x02, 0x09, + 0xff, 0x40, 0x97, 0x00, 0x00, 0x04, 0x20, 0xff, 0xd0, 0x25, 0x02, 0x44, + 0x44, 0x44, 0x5c, 0x20, 0xff, 0xf4, 0x25, 0x07, 0xff, 0xff, 0xff, 0xff, + 0xda, 0x97, 0x94, 0xf1, 0x27, 0x1a, 0x60, 0x25, 0x06, 0x07, 0xbb, 0xbb, + 0xbb, 0xbb, 0x84, 0x2d, 0x65, 0x96, 0x14, 0x02, 0x44, 0x30, 0xd9, 0x40, + 0x1d, 0x07, 0xff, 0x06, 0xb0, 0x00, 0x00, 0xdf, 0xf0, 0x97, 0x91, 0xcf, + 0x4a, 0xf4, 0x35, 0xff, 0xff, 0xe9, 0xff, 0x94, 0x01, 0x52, 0xdf, 0x8c, + 0xf3, 0x23, 0x00, 0x6f, 0x1c, 0xd0, 0xa4, 0x94, 0x0c, 0x23, 0xea, 0x20, + 0x24, 0x00, 0x07, 0x31, 0xff, 0xb0, 0xb5, 0x0a, 0x04, 0x77, 0x60, 0x97, + 0x82, 0x02, 0x24, 0x44, 0x44, 0x44, 0x80, 0x06, 0x3d, 0x04, 0xff, 0xff, + 0xff, 0xff, 0xf0, 0x05, 0x02, 0xef, 0xd8, 0x97, 0x01, 0x07, 0x2a, 0x27, + 0x0a, 0xff, 0xed, 0x08, 0xfe, 0xbe, 0xfe, 0x50, 0x25, 0x0b, 0xff, 0x53, + 0x08, 0xff, 0x01, 0xbf, 0x70, 0x97, 0x40, 0xdf, 0x50, 0x20, 0x5f, 0xe0, + 0x27, 0xa1, 0x9f, 0xa0, 0x5f, 0xf3, 0x80, 0x25, 0x08, 0xff, 0xf7, 0x7f, + 0xfc, 0xef, 0xf4, 0x81, 0x25, 0x05, 0xff, 0xf4, 0x3f, 0xff, 0xff, 0x26, + 0x01, 0x00, 0xcf, 0xf4, 0x0d, 0xff, 0xff, 0xd0, 0x96, 0x03, 0x17, 0xd0, + 0x03, 0xdf, 0xfd, 0x30, 0x26, 0x01, 0x2c, 0x04, 0x40, 0x2e, 0x02, 0xb7, + 0x0a, 0x09, 0xfd, 0x41, 0x70, 0x8f, 0x00, 0x00, 0x0b, 0xff, 0xc0, 0x1f, + 0x06, 0x00, 0x00, 0x07, 0xff, 0xd1, 0x27, 0x01, 0x7f, 0x04, 0xfd, 0x74, + 0x44, 0x44, 0x40, 0x27, 0xff, 0xff, 0x1e, 0xff, 0xff, 0xf0, 0x97, 0x97, + 0x27, 0x26, 0x06, 0x03, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb0, 0x25, 0x5d, + 0x84, 0x97, 0x37, 0xbb, 0x32, 0x20, 0x2f, 0x1b, 0xff, 0x10, 0xff, 0x46, + 0xe6, 0x07, 0xbf, 0xff, 0xff, 0x47, 0x20, 0xff, 0x50, 0x1d, 0x05, 0xff, + 0xff, 0xff, 0x49, 0x20, 0xff, 0xd0, 0x1d, 0x08, 0xff, 0xe6, 0xff, 0x48, + 0x20, 0xff, 0xf2, 0x25, 0x0b, 0xff, 0x60, 0xff, 0x40, 0x21, 0xdf, 0xf4, + 0x97, 0x40, 0xff, 0x40, 0xbf, 0x96, 0x02, 0x0a, 0xff, 0xa0, 0xff, 0x43, + 0xff, 0x26, 0x07, 0x02, 0xff, 0xfd, 0xff, 0xcf, 0xff, 0xf0, 0x25, 0x01, + 0x02, 0xef, 0xff, 0xff, 0xff, 0xff, 0x90, 0x25, 0x00, 0x48, 0x5f, 0x91, + 0xfc, 0x10, 0x96, 0x03, 0xaf, 0xff, 0x20, 0xfe, 0x71, 0x2e, 0x00, 0x00, + 0x01, 0x44, 0x30, 0xe2, 0x9f, 0x57, 0x0d, 0x58, 0xbb, 0xb7, 0x1f, 0x00, + 0x02, 0x3d, 0xff, 0xff, 0xff, 0xfa, 0x10, 0x05, 0x02, 0x4a, 0xef, 0x91, + 0xff, 0x80, 0x1d, 0x09, 0x9a, 0xff, 0x40, 0xf1, 0x25, 0x0b, 0xff, 0xe8, + 0x44, 0x5a, 0xff, 0x40, 0xf4, 0x25, 0x0a, 0xff, 0x60, 0x00, 0x00, 0xcf, + 0x52, 0xf3, 0x25, 0x05, 0x92, 0xdf, 0xd0, 0x25, 0x00, 0x00, 0x9f, 0xe7, + 0x44, 0x5b, 0xff, 0x74, 0x44, 0x41, 0x84, 0x13, 0x07, 0xff, 0xff, 0xff, + 0xe9, 0xff, 0xf4, 0xf0, 0x97, 0x97, 0x27, 0x24, 0x06, 0xbb, 0xbb, 0xbb, + 0x9c, 0xe9, 0xbb, 0xb3, 0x23, 0x6b, 0xb7, 0x00, 0x00, 0x04, 0x34, 0x44, + 0x44, 0x44, 0x40, 0x36, 0x6e, 0xff, 0x0b, 0xff, 0xff, 0xff, 0xf0, 0x05, + 0x04, 0x9a, 0x97, 0x60, 0x0a, 0x97, 0x0a, 0x0b, 0xff, 0xfe, 0xbb, 0xbb, + 0x23, 0xbb, 0xb0, 0x25, 0x09, 0xff, 0xd1, 0x45, 0x0a, 0x18, 0x04, 0xff, + 0xc0, 0x97, 0x01, 0x6f, 0xfa, 0x44, 0x10, 0x44, 0x44, 0x40, 0x06, 0x7e, + 0xff, 0xff, 0xff, 0x2d, 0xff, 0xf0, 0x05, 0x05, 0x9a, 0x97, 0x0a, 0x97, + 0x80, 0x0a, 0x0b, 0xff, 0xfd, 0xbb, 0xbb, 0xbb, 0xb0, 0x8c, 0x25, 0x09, + 0xff, 0xd1, 0x45, 0x0a, 0x04, 0xff, 0x60, 0xc0, 0x97, 0x01, 0x6f, 0xfa, + 0x44, 0x44, 0x44, 0x40, 0x40, 0x05, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x78, 0xf0, 0x97, 0x97, 0x27, 0x26, 0x06, 0xbb, 0xbb, 0x0f, 0xbb, 0xbb, + 0xbb, 0xb0, 0x25, 0x5d, 0x97, 0x4f, 0x84, 0x03, 0x37, 0xbb, 0x32, 0x20, + 0x07, 0x1b, 0xff, 0x10, 0xff, 0x46, 0xe6, 0x07, 0xbf, 0xff, 0xff, 0x47, + 0x20, 0xff, 0x50, 0x1d, 0x05, 0xff, 0xff, 0xff, 0x49, 0x20, 0xff, 0xd0, + 0x1d, 0x08, 0xff, 0xe6, 0xff, 0x48, 0x20, 0xff, 0xf2, 0x25, 0x0b, 0xff, + 0x60, 0xff, 0x40, 0x21, 0xdf, 0xf4, 0x97, 0x40, 0xff, 0x40, 0xbf, 0x96, + 0x02, 0x0a, 0xff, 0xa0, 0xff, 0x43, 0xff, 0x26, 0x07, 0x02, 0xff, 0xfd, + 0xff, 0xcf, 0xff, 0xf0, 0x25, 0x01, 0x02, 0xef, 0xff, 0xff, 0xff, 0xff, + 0x90, 0x25, 0x00, 0x48, 0x5f, 0x91, 0xfc, 0x10, 0x96, 0x03, 0xaf, 0xff, + 0x20, 0xfe, 0x71, 0x2c, 0x0b, 0xff, 0xf0, 0x00, 0x01, 0x3f, 0x44, 0x30, + 0x35, 0x92, 0xad, 0x97, 0x97, 0x27, 0x80, 0x24, 0xf7, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x70, 0x93, 0x25, 0xff, 0xff, 0xe9, 0xff, 0xf0, 0x97, 0x97, + 0xff, 0x27, 0x27, 0x27, 0x22, 0x54, 0x2b, 0x97, 0x97, 0xe3, 0x27, 0x27, + 0x05, 0x06, 0x77, 0x70, 0x27, 0x4f, 0xf0, 0x77, 0x2f, 0x07, 0x07, +}; + +//***************************************************************************** +// +// Green horizontal slider image. +// +//***************************************************************************** +const uint8_t g_pui8GreenSlider195x37[] = +{ + IMAGE_FMT_8BPP_COMP, + 195, 0, + 37, 0, + + 63, + 0x04, 0x04, 0x04, + 0x16, 0x16, 0x16, + 0x01, 0x29, 0x01, + 0x20, 0x21, 0x20, + 0x01, 0x3a, 0x01, + 0x17, 0x35, 0x17, + 0x2d, 0x2e, 0x2d, + 0x01, 0x50, 0x01, + 0x23, 0x43, 0x23, + 0x3a, 0x3a, 0x3a, + 0x01, 0x67, 0x01, + 0x2e, 0x4c, 0x2e, + 0x1a, 0x63, 0x1a, + 0x4b, 0x4b, 0x4b, + 0x02, 0x7e, 0x02, + 0x2f, 0x65, 0x2f, + 0x19, 0x76, 0x19, + 0x46, 0x59, 0x46, + 0x02, 0x8b, 0x02, + 0x02, 0x97, 0x02, + 0x5a, 0x5a, 0x5a, + 0x17, 0x90, 0x17, + 0x50, 0x6c, 0x50, + 0x02, 0xa3, 0x02, + 0x05, 0xa4, 0x05, + 0x0a, 0xa6, 0x0a, + 0x68, 0x68, 0x68, + 0x0f, 0xa8, 0x0f, + 0x13, 0xa9, 0x13, + 0x1f, 0xad, 0x1f, + 0x38, 0x9c, 0x38, + 0x73, 0x73, 0x73, + 0x6b, 0x7c, 0x6b, + 0x2a, 0xb1, 0x2a, + 0x7c, 0x7e, 0x7c, + 0x33, 0xb5, 0x33, + 0x4d, 0xa5, 0x4d, + 0x6d, 0x93, 0x6d, + 0x56, 0xa4, 0x56, + 0x63, 0xa0, 0x63, + 0x42, 0xba, 0x42, + 0x89, 0x89, 0x89, + 0x56, 0xb7, 0x56, + 0x4e, 0xbf, 0x4e, + 0x91, 0x91, 0x91, + 0x8f, 0x95, 0x8f, + 0x59, 0xc3, 0x59, + 0x71, 0xb9, 0x71, + 0x9e, 0x9e, 0x9e, + 0x64, 0xc7, 0x64, + 0x87, 0xb4, 0x87, + 0x6c, 0xca, 0x6c, + 0xa8, 0xa8, 0xa8, + 0x75, 0xcd, 0x75, + 0x7b, 0xcf, 0x7b, + 0x82, 0xd2, 0x82, + 0x8d, 0xcf, 0x8d, + 0x8b, 0xd5, 0x8b, + 0x98, 0xce, 0x98, + 0x92, 0xd7, 0x92, + 0x95, 0xd8, 0x95, + 0x9c, 0xdb, 0x9c, + 0xa3, 0xdc, 0xa3, + 0xa9, 0xe0, 0xa9, + + 0x80, 0x07, 0x06, 0x20, 0x32, 0x3a, 0x3d, 0x3d, 0x3c, 0x0f, 0x3c, 0x3b, + 0x3b, 0x3b, 0xe9, 0xd4, 0xa7, 0x5f, 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xfc, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x39, 0x39, + 0x00, 0x39, 0x37, 0x2f, 0x27, 0x16, 0x0b, 0x03, 0x00, 0x38, 0x00, 0x00, + 0xe9, 0xd4, 0xa7, 0x0b, 0x32, 0x3e, 0x00, 0x3f, 0x3e, 0x3d, 0x3d, 0x3c, + 0x3b, 0x3b, 0x39, 0x3f, 0x39, 0x39, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, + 0x07, 0x07, 0x37, 0x37, 0x37, 0x36, 0x00, 0x35, 0x33, 0x31, 0x24, 0x0f, + 0x05, 0x01, 0x00, 0x38, 0x00, 0x00, 0xe9, 0xd4, 0xa3, 0x25, 0x3e, 0x3f, + 0x00, 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x39, 0x39, 0x37, 0x3f, 0x37, 0x37, + 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, 0x07, 0x07, 0x37, 0x36, 0x36, 0x35, + 0x00, 0x35, 0x33, 0x31, 0x2e, 0x2b, 0x28, 0x1e, 0x0f, 0x06, 0x01, 0x01, + 0x00, 0x00, 0x00, 0xe9, 0xd4, 0x00, 0x00, 0x03, 0x32, 0x3f, 0x3f, 0x3f, + 0x3e, 0x3d, 0x3b, 0x00, 0x39, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x35, + 0xff, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, 0x35, 0x33, 0x33, + 0x33, 0x31, 0x2e, 0x00, 0x2e, 0x2b, 0x28, 0x23, 0x21, 0x10, 0x05, 0x01, + 0x0c, 0x01, 0x00, 0x00, 0x00, 0xe9, 0xd2, 0x03, 0x32, 0x00, 0x3f, 0x3f, + 0x3e, 0x3d, 0x3c, 0x39, 0x37, 0x36, 0x03, 0x35, 0x33, 0x33, 0x31, 0x31, + 0x31, 0xe9, 0xd4, 0xff, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x80, 0x02, 0x2e, + 0x2e, 0x2e, 0x2b, 0x28, 0x23, 0x21, 0x00, 0x1d, 0x1c, 0x10, 0x06, 0x03, + 0x01, 0x00, 0x00, 0x60, 0x00, 0xe9, 0xd1, 0x32, 0x3e, 0x3e, 0x3e, 0x3d, + 0x08, 0x3b, 0x37, 0x36, 0x33, 0x01, 0x2b, 0x2b, 0x2b, 0xff, 0xe9, 0xd4, + 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, 0x05, 0x28, 0x28, 0x28, 0x23, 0x21, + 0x00, 0x1c, 0x19, 0x17, 0x10, 0x06, 0x03, 0x01, 0x00, 0x20, 0x00, 0x00, + 0xe9, 0x00, 0x25, 0x3d, 0x3d, 0x3d, 0x04, 0x3c, 0x39, 0x37, 0x33, 0x31, + 0x12, 0x23, 0x23, 0x7f, 0x23, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, + 0x07, 0x07, 0x23, 0x21, 0x1d, 0x1b, 0x00, 0x17, 0x13, 0x13, 0x0f, 0x06, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x38, 0x3c, 0x3b, + 0x02, 0x3b, 0x37, 0x36, 0x31, 0x2b, 0x28, 0x31, 0x1d, 0x1f, 0x1c, 0x1c, + 0x1c, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xfc, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x1d, 0x1d, + 0x40, 0x1d, 0xe9, 0x1c, 0x18, 0x17, 0x13, 0x12, 0x10, 0x00, 0x0b, 0x06, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x39, 0x39, 0x39, 0x37, + 0x35, 0x31, 0x2b, 0x00, 0x23, 0x21, 0x1c, 0x1b, 0x19, 0x18, 0x18, 0x17, + 0x3f, 0x17, 0x17, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, 0x07, 0x07, 0x17, + 0x17, 0x18, 0x18, 0x00, 0x19, 0x19, 0x1b, 0x1c, 0x1c, 0x1c, 0x19, 0x17, + 0x00, 0x13, 0x12, 0x12, 0x0e, 0x0f, 0x09, 0x06, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x05, 0x36, 0x37, 0x36, 0x36, 0x00, 0x33, 0x31, 0x2b, 0x23, 0x1d, + 0x1c, 0x19, 0x18, 0x0f, 0x18, 0x17, 0x17, 0x17, 0xe9, 0xd4, 0xa7, 0x5f, + 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x05, 0x18, 0x00, 0x18, 0x19, 0x19, 0x19, 0x17, + 0x13, 0x13, 0x12, 0x00, 0x0e, 0x0e, 0x10, 0x11, 0x09, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x16, 0x35, 0x35, 0x35, 0x33, 0x31, 0x2b, 0x00, 0x23, 0x1d, + 0x1c, 0x19, 0x18, 0x17, 0x17, 0x17, 0xff, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xe0, 0x07, 0x07, 0x07, 0x17, 0x17, 0x18, 0x18, 0x18, 0x00, 0x17, 0x13, + 0x12, 0x0e, 0x0e, 0x0a, 0x0a, 0x16, 0x00, 0x0d, 0x06, 0x01, 0x00, 0x00, + 0x26, 0x33, 0x31, 0x00, 0x31, 0x2e, 0x2b, 0x28, 0x21, 0x1c, 0x19, 0x18, + 0xff, 0x03, 0xdb, 0xb7, 0x6f, 0x27, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, 0x07, 0x07, 0x13, + 0x12, 0x0e, 0x0a, 0x00, 0x0a, 0x0a, 0x0f, 0x14, 0x09, 0x03, 0x01, 0x00, + 0x00, 0x2a, 0x2e, 0x2e, 0x2e, 0x2b, 0x28, 0x23, 0x1d, 0x3f, 0x1b, 0x18, + 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x17, 0x13, 0x12, + 0x00, 0x0e, 0x0e, 0x0a, 0x0a, 0x07, 0x0c, 0x1a, 0x0d, 0x00, 0x06, 0x01, + 0x00, 0x2b, 0x2b, 0x2b, 0x2b, 0x28, 0x07, 0x23, 0x21, 0x1c, 0x19, 0x18, + 0x07, 0xbf, 0x77, 0xff, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x17, 0x13, + 0x12, 0x0e, 0x0a, 0x0a, 0x07, 0x07, 0x00, 0x07, 0x1f, 0x14, 0x09, 0x03, + 0x00, 0x28, 0x28, 0x01, 0x28, 0x28, 0x28, 0x23, 0x1d, 0x1c, 0x18, 0x07, + 0xff, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, 0x17, 0x17, 0x13, + 0x12, 0x0e, 0x0a, 0x00, 0x0a, 0x07, 0x07, 0x04, 0x22, 0x14, 0x09, 0x03, + 0x00, 0x01, 0x23, 0x23, 0x23, 0x23, 0x23, 0x21, 0x1d, 0x3f, 0x1b, 0x18, + 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x17, 0x17, 0x13, + 0x00, 0x12, 0x0e, 0x0a, 0x07, 0x07, 0x04, 0x04, 0x29, 0x00, 0x1a, 0x09, + 0x03, 0x01, 0x21, 0x21, 0x21, 0x21, 0x0f, 0x21, 0x1d, 0x1c, 0x19, 0x07, + 0xbf, 0x77, 0x2f, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x01, 0x00, 0x13, 0x0e, + 0x0a, 0x0a, 0x07, 0x04, 0x04, 0x05, 0x00, 0x29, 0x1a, 0x0d, 0x06, 0x01, + 0x1d, 0x1d, 0x1d, 0x07, 0x1d, 0x1d, 0x1c, 0x1c, 0x19, 0x07, 0xbf, 0x77, + 0xff, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x17, 0x17, 0x13, 0x12, 0x0e, + 0x0a, 0x07, 0x04, 0x00, 0x04, 0x02, 0x0b, 0x29, 0x1a, 0x0d, 0x06, 0x01, + 0x00, 0x15, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x19, 0x18, 0xff, 0x07, 0xbf, + 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, 0x07, 0x17, 0x13, 0x13, 0x0e, 0x0a, + 0x00, 0x07, 0x07, 0x04, 0x02, 0x02, 0x11, 0x29, 0x1a, 0x0f, 0x0d, 0x06, + 0x01, 0x10, 0x07, 0xbf, 0x77, 0x2f, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, + 0x00, 0x13, 0x13, 0x12, 0x0e, 0x0a, 0x07, 0x04, 0x02, 0x00, 0x02, 0x02, + 0x20, 0x29, 0x1a, 0x0d, 0x06, 0x01, 0x09, 0x08, 0x13, 0x13, 0x13, 0xe9, + 0x13, 0x13, 0x05, 0xff, 0xcd, 0x97, 0x4f, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, + 0x17, 0x17, 0x13, 0x13, 0x12, 0x0e, 0x00, 0x0a, 0x07, 0x04, 0x02, 0x02, + 0x02, 0x08, 0x2d, 0x00, 0x29, 0x1a, 0x09, 0x03, 0x01, 0x03, 0x10, 0x12, + 0x23, 0x12, 0x12, 0xe9, 0x13, 0x13, 0x13, 0x02, 0xe2, 0xff, 0xc6, 0x87, + 0x3f, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xc0, 0x07, 0x03, 0x13, 0x13, 0x12, 0x12, 0x0e, 0x0a, + 0x00, 0x07, 0x04, 0x02, 0x02, 0x02, 0x02, 0x16, 0x30, 0x00, 0x22, 0x14, + 0x09, 0x03, 0x01, 0x03, 0x0b, 0x0e, 0x20, 0x0e, 0x0e, 0xe9, 0x0e, 0x12, + 0x12, 0x12, 0x13, 0x3f, 0x13, 0x13, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, + 0x07, 0x07, 0x05, 0x12, 0x12, 0x0e, 0x00, 0x0e, 0x0a, 0x0a, 0x07, 0x04, + 0x02, 0x02, 0x02, 0x00, 0x02, 0x08, 0x2d, 0x2c, 0x1f, 0x14, 0x09, 0x03, + 0x0a, 0x00, 0x01, 0x06, 0x0c, 0x61, 0x0a, 0xe9, 0x0e, 0x3f, 0x0e, 0x0e, + 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0e, 0x0a, 0x0a, + 0x00, 0x0a, 0x07, 0x04, 0x04, 0x02, 0x02, 0x02, 0x02, 0x00, 0x02, 0x20, + 0x30, 0x29, 0x1a, 0x0d, 0x06, 0x01, 0x07, 0x00, 0x01, 0x06, 0x0d, 0x0c, + 0x49, 0x31, 0xd4, 0xff, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x05, + 0x07, 0x07, 0x07, 0x04, 0x02, 0x02, 0x40, 0x02, 0xe9, 0x16, 0x34, 0x2c, + 0x22, 0x14, 0x09, 0x00, 0x03, 0x01, 0x00, 0x01, 0x03, 0x09, 0x11, 0x0c, + 0xff, 0x41, 0x29, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x03, + 0x04, 0x04, 0x04, 0x10, 0x02, 0x02, 0x02, 0xe9, 0x02, 0x16, 0x30, 0x30, + 0x00, 0x29, 0x1a, 0x0d, 0x06, 0x01, 0x00, 0x00, 0x00, 0x07, 0x01, 0x06, + 0x09, 0x11, 0x0c, 0x23, 0x09, 0xd4, 0xff, 0xa7, 0x5f, 0x17, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x83, 0x07, 0x04, 0x04, 0x02, 0x02, 0x02, 0xe9, 0xd1, 0x00, 0x16, 0x30, + 0x30, 0x29, 0x1f, 0x14, 0x09, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x06, 0x0d, 0x3f, 0x1a, 0x0f, 0x17, 0xd4, 0xa7, 0x5f, 0x17, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfc, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x05, 0x08, 0x20, 0x00, 0x34, 0x30, 0x2c, 0x1f, 0x14, + 0x09, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x09, + 0x0f, 0x0d, 0x1a, 0x16, 0x08, 0x07, 0xbf, 0x77, 0x2f, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x08, 0x00, 0x16, 0x2d, 0x34, 0x30, 0x29, 0x1f, 0x14, 0x0d, + 0x02, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x03, 0x09, + 0x0d, 0x1a, 0x22, 0x20, 0x11, 0x08, 0x7f, 0x05, 0x02, 0xe2, 0xc6, 0x87, + 0x3f, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xf8, 0x07, 0x07, 0x07, 0x07, 0x01, 0x05, 0x0b, 0x16, 0x00, 0x22, 0x30, + 0x34, 0x30, 0x2c, 0x29, 0x1f, 0x14, 0x01, 0x0d, 0x06, 0x03, 0x01, 0x00, + 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x01, 0x03, 0x09, 0x0d, 0x14, 0x1f, + 0x01, 0x22, 0x2c, 0x30, 0x30, 0x34, 0x34, 0x34, 0xe9, 0xff, 0xd4, 0xa7, + 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, 0x30, 0x30, 0x2c, 0x29, 0x22, 0x1a, + 0x00, 0x14, 0x09, 0x06, 0x03, 0x01, 0x00, 0x00, 0x00, 0xc0, 0xe9, 0xd2, + 0x01, 0x03, 0x06, 0x09, 0x0d, 0x1a, 0x01, 0x1f, 0x22, 0x29, 0x29, 0x2c, + 0x2c, 0x2c, 0xe9, 0xff, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x05, + 0x29, 0x29, 0x22, 0x1f, 0x1a, 0x14, 0x00, 0x0d, 0x09, 0x06, 0x03, 0x01, + 0x00, 0x00, 0x00, 0xc0, 0xe9, 0xd4, 0x01, 0x01, 0x06, 0x09, 0x0d, 0x0d, + 0x03, 0x14, 0x1a, 0x1a, 0x1f, 0x1f, 0x1f, 0xe9, 0xd4, 0xff, 0xa7, 0x5f, + 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x80, 0x05, 0x1a, 0x1a, 0x14, 0x14, 0x0d, 0x09, 0x06, + 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0xe9, 0xd4, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x03, 0x06, 0x06, 0x09, 0x0f, 0x09, 0x0d, 0x0d, 0x0d, 0xe9, + 0xd4, 0xa7, 0x5f, 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xfe, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x09, 0x00, 0x09, 0x09, + 0x06, 0x03, 0x01, 0x01, 0x00, 0x00, 0x70, 0x00, 0xe9, 0xd4, 0xa4, 0x01, + 0x01, 0x01, 0x03, 0x0f, 0x03, 0x06, 0x06, 0x06, 0xe9, 0xd4, 0xa7, 0x5f, + 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x01, 0x03, 0x03, 0x01, 0x01, 0x00, + 0x00, 0x00, 0xe9, 0xc1, 0xd4, 0xa7, 0x00, 0x00, 0x01, 0x01, 0x01, 0xe9, + 0xff, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xe3, 0x07, 0x07, 0x02, 0x00, 0x00, + 0x00, 0xe9, 0xd4, 0xff, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfc, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x06, +}; + +//***************************************************************************** +// +// Red horizontal slider image. +// +//***************************************************************************** +const uint8_t g_pui8RedSlider195x37[] = +{ + IMAGE_FMT_8BPP_COMP, + 195, 0, + 37, 0, + + 63, + 0x04, 0x04, 0x04, + 0x00, 0x00, 0x40, + 0x16, 0x16, 0x16, + 0x00, 0x00, 0x5b, + 0x0c, 0x0c, 0x48, + 0x23, 0x23, 0x23, + 0x00, 0x00, 0x7c, + 0x20, 0x20, 0x35, + 0x15, 0x15, 0x52, + 0x00, 0x00, 0x93, + 0x2e, 0x2e, 0x2e, + 0x00, 0x00, 0xa1, + 0x00, 0x00, 0xb4, + 0x27, 0x27, 0x59, + 0x00, 0x00, 0xc7, + 0x14, 0x14, 0x9d, + 0x3d, 0x3d, 0x3e, + 0x25, 0x25, 0x79, + 0x00, 0x00, 0xd9, + 0x1f, 0x1f, 0xa3, + 0x00, 0x00, 0xec, + 0x13, 0x13, 0xc3, + 0x00, 0x00, 0xf3, + 0x00, 0x00, 0xfa, + 0x30, 0x30, 0x8a, + 0x4c, 0x4c, 0x4c, + 0x00, 0x00, 0xff, + 0x46, 0x46, 0x65, + 0x05, 0x05, 0xff, + 0x0b, 0x0b, 0xff, + 0x11, 0x11, 0xff, + 0x5a, 0x5a, 0x5a, + 0x50, 0x50, 0x7e, + 0x21, 0x21, 0xff, + 0x36, 0x36, 0xd5, + 0x68, 0x68, 0x68, + 0x32, 0x32, 0xff, + 0x73, 0x73, 0x73, + 0x6b, 0x6b, 0x88, + 0x51, 0x51, 0xd4, + 0x67, 0x67, 0xb6, + 0x4c, 0x4c, 0xff, + 0x55, 0x55, 0xef, + 0x85, 0x85, 0x85, + 0x5a, 0x5a, 0xff, + 0x8e, 0x8e, 0x96, + 0x91, 0x91, 0x91, + 0x63, 0x63, 0xff, + 0x70, 0x70, 0xe3, + 0x93, 0x93, 0x9e, + 0x6b, 0x6b, 0xff, + 0x9b, 0x9b, 0x9b, + 0x86, 0x86, 0xcd, + 0x74, 0x74, 0xff, + 0xa0, 0xa0, 0xa2, + 0x7a, 0x7a, 0xfe, + 0x81, 0x81, 0xff, + 0xa8, 0xa8, 0xa8, + 0x8c, 0x8c, 0xf6, + 0x8a, 0x8a, 0xff, + 0x97, 0x97, 0xee, + 0x91, 0x91, 0xff, + 0x9a, 0x9a, 0xff, + 0xa5, 0xa5, 0xfe, + + 0x80, 0x07, 0x07, 0x26, 0x34, 0x3c, 0x3e, 0x3e, 0x3e, 0x1f, 0x3d, 0x3d, + 0x3d, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x3b, 0x3b, 0x3b, + 0x00, 0x38, 0x30, 0x28, 0x20, 0x0d, 0x02, 0x00, 0x00, 0x70, 0x00, 0xe9, + 0xd4, 0xa7, 0x10, 0x34, 0x3f, 0x3f, 0x00, 0x3f, 0x3e, 0x3e, 0x3d, 0x3d, + 0x3d, 0x3b, 0x3b, 0x7f, 0x3b, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, + 0x07, 0x38, 0x38, 0x38, 0x37, 0x35, 0x00, 0x32, 0x2f, 0x27, 0x18, 0x07, + 0x02, 0x00, 0x00, 0x70, 0x00, 0xe9, 0xd4, 0xa3, 0x28, 0x3f, 0x3f, 0x3f, + 0x00, 0x3f, 0x3e, 0x3e, 0x3d, 0x3b, 0x3b, 0x38, 0x38, 0x7f, 0x38, 0xe9, + 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, 0x07, 0x38, 0x37, 0x37, 0x35, 0x35, + 0x00, 0x32, 0x2f, 0x2c, 0x29, 0x29, 0x22, 0x11, 0x02, 0x0c, 0x02, 0x00, + 0x00, 0x00, 0xe9, 0xd4, 0x00, 0x07, 0x00, 0x34, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3e, 0x3d, 0x3b, 0x01, 0x38, 0x38, 0x37, 0x37, 0x35, 0x35, 0x35, 0xe9, + 0xff, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x80, 0x07, 0x35, 0x32, 0x32, 0x32, + 0x2f, 0x2c, 0x2c, 0x00, 0x29, 0x24, 0x24, 0x21, 0x13, 0x07, 0x02, 0x02, + 0x18, 0x00, 0x00, 0x00, 0xe9, 0xd2, 0x07, 0x34, 0x3f, 0x00, 0x3f, 0x3f, + 0x3e, 0x3e, 0x3b, 0x38, 0x37, 0x35, 0x07, 0x32, 0x32, 0x2f, 0x2f, 0x2f, + 0xe9, 0xd4, 0xa7, 0xff, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x01, 0x00, 0x2c, 0x2c, + 0x2c, 0x2c, 0x29, 0x29, 0x24, 0x24, 0x00, 0x21, 0x1e, 0x13, 0x07, 0x02, + 0x02, 0x00, 0x00, 0x60, 0x00, 0xe9, 0xd1, 0x34, 0x3f, 0x3f, 0x3e, 0x3e, + 0x05, 0x3d, 0x38, 0x37, 0x32, 0x2f, 0x0a, 0x29, 0xe9, 0xff, 0xd4, 0xa7, + 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, 0x24, 0x24, 0x21, 0x1e, 0x1d, 0x1a, + 0x01, 0x13, 0x0a, 0x05, 0x02, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x28, + 0x3e, 0x3e, 0x3e, 0x3d, 0x3b, 0x38, 0x2f, 0x32, 0x2f, 0x1b, 0x24, 0xe9, + 0xd4, 0xa7, 0x5f, 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xfe, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x24, 0x00, 0x24, 0x21, + 0x21, 0x1e, 0x1a, 0x16, 0x14, 0x18, 0x00, 0x0a, 0x05, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0d, 0x3a, 0x3d, 0x3d, 0x3d, 0x38, 0x37, 0x2f, + 0x27, 0x29, 0x29, 0x32, 0x1e, 0x1e, 0xe9, 0xd4, 0xa7, 0xff, 0x5f, 0x17, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x05, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e, 0x1c, 0x16, + 0x00, 0x14, 0x12, 0x15, 0x1b, 0x0a, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x28, 0x3b, 0x3b, 0x3b, 0x38, 0x00, 0x35, 0x2f, 0x29, 0x24, 0x21, + 0x1e, 0x1e, 0x1d, 0x0f, 0x1c, 0x1a, 0x1a, 0x1a, 0xe9, 0xd4, 0xa7, 0x5f, + 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x02, 0x1c, 0x00, 0x1c, 0x1d, 0x1d, 0x1e, 0x1e, + 0x1e, 0x1c, 0x17, 0x00, 0x14, 0x12, 0x12, 0x0e, 0x18, 0x10, 0x0a, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x37, 0x38, 0x37, 0x37, 0x00, 0x32, 0x2f, + 0x29, 0x24, 0x21, 0x1e, 0x1d, 0x1c, 0x1f, 0x1a, 0x1a, 0x1a, 0xe9, 0xd4, + 0xa7, 0x5f, 0x17, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xfc, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x1c, 0x1c, 0x00, 0x1c, 0x1d, + 0x1c, 0x1a, 0x16, 0x14, 0x12, 0x0e, 0x00, 0x0c, 0x0f, 0x1b, 0x10, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x20, 0x35, 0x35, 0x35, 0x32, 0x2c, 0x29, 0x24, + 0x27, 0x21, 0x1e, 0x39, 0x1a, 0x1a, 0xe9, 0xd4, 0xa7, 0xff, 0x5f, 0x17, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x00, 0x1a, 0x1a, 0x1c, 0x1c, 0x1a, 0x17, 0x14, 0x12, + 0x00, 0x0e, 0x0c, 0x0c, 0x0b, 0x20, 0x19, 0x0a, 0x02, 0x00, 0x00, 0x00, + 0x27, 0x32, 0x2f, 0x2f, 0x2c, 0x29, 0x07, 0x24, 0x21, 0x1e, 0x1d, 0x1c, + 0x03, 0xdb, 0xb7, 0xff, 0x6f, 0x27, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x80, 0x06, 0x16, + 0x14, 0x12, 0x0e, 0x0c, 0x0b, 0x09, 0x00, 0x18, 0x1f, 0x10, 0x05, 0x02, + 0x00, 0x2a, 0x2c, 0x00, 0x2c, 0x2c, 0x29, 0x29, 0x24, 0x21, 0x1d, 0x1c, + 0xff, 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, 0x07, 0x1a, 0x16, + 0x12, 0x0e, 0x0c, 0x00, 0x0b, 0x09, 0x09, 0x11, 0x23, 0x19, 0x0a, 0x02, + 0x00, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x24, 0x21, 0x3f, 0x1e, 0x1c, + 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x1a, 0x1a, 0x16, + 0x00, 0x12, 0x0e, 0x0c, 0x0b, 0x09, 0x06, 0x06, 0x25, 0x00, 0x1f, 0x0a, + 0x02, 0x00, 0x29, 0x29, 0x29, 0x29, 0x07, 0x24, 0x24, 0x21, 0x1e, 0x1c, + 0x07, 0xbf, 0x77, 0xff, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x1a, 0x17, + 0x14, 0x12, 0x0e, 0x0b, 0x09, 0x06, 0x00, 0x06, 0x03, 0x2b, 0x1f, 0x10, + 0x05, 0x02, 0x24, 0x01, 0x24, 0x24, 0x24, 0x24, 0x21, 0x21, 0x1d, 0x07, + 0xff, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xc0, 0x07, 0x07, 0x1a, 0x1a, 0x17, + 0x14, 0x0e, 0x0c, 0x00, 0x0b, 0x06, 0x06, 0x03, 0x03, 0x2b, 0x23, 0x10, + 0x00, 0x05, 0x02, 0x24, 0x24, 0x21, 0x21, 0x21, 0x21, 0x3f, 0x1e, 0x1d, + 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x1a, 0x17, 0x16, + 0x00, 0x14, 0x0e, 0x0c, 0x09, 0x06, 0x03, 0x03, 0x08, 0x00, 0x2b, 0x23, + 0x19, 0x05, 0x02, 0x21, 0x21, 0x21, 0x07, 0x21, 0x21, 0x1e, 0x1e, 0x1c, + 0x07, 0xbf, 0x77, 0xff, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x1a, 0x17, + 0x14, 0x12, 0x0c, 0x0b, 0x06, 0x03, 0x00, 0x03, 0x01, 0x0d, 0x2e, 0x23, + 0x19, 0x0a, 0x02, 0x0b, 0x15, 0x1d, 0x1d, 0x1d, 0xe9, 0x1c, 0x07, 0xbf, + 0xff, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x80, 0x07, 0x17, 0x16, 0x14, 0x0e, + 0x0b, 0x09, 0x06, 0x00, 0x03, 0x01, 0x01, 0x1b, 0x2e, 0x23, 0x19, 0x0a, + 0x03, 0x02, 0x0f, 0x17, 0x17, 0x17, 0x17, 0x49, 0xda, 0xff, 0x02, 0xd4, + 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, 0x07, 0x01, 0x17, 0x16, 0x14, 0x12, + 0x00, 0x0c, 0x09, 0x06, 0x03, 0x01, 0x01, 0x01, 0x26, 0x00, 0x2b, 0x23, + 0x19, 0x05, 0x02, 0x0d, 0x14, 0x14, 0x41, 0x14, 0xe9, 0x16, 0x16, 0x16, + 0x17, 0x17, 0x01, 0xff, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, + 0x06, 0x17, 0x17, 0x16, 0x14, 0x12, 0x00, 0x0e, 0x0b, 0x06, 0x03, 0x01, + 0x01, 0x01, 0x0d, 0x00, 0x2d, 0x2b, 0x23, 0x10, 0x05, 0x02, 0x05, 0x15, + 0x10, 0x12, 0x12, 0x12, 0xe9, 0x14, 0x14, 0x16, 0x16, 0x07, 0x17, 0x17, + 0x1a, 0x1a, 0x1a, 0xe9, 0xd4, 0xa7, 0xff, 0x5f, 0x17, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, + 0x00, 0x17, 0x17, 0x16, 0x14, 0x12, 0x12, 0x0c, 0x0b, 0x00, 0x06, 0x03, + 0x01, 0x01, 0x01, 0x01, 0x20, 0x33, 0x00, 0x2b, 0x1f, 0x10, 0x05, 0x02, + 0x05, 0x0d, 0x0e, 0x20, 0x0e, 0x0e, 0xe9, 0x0e, 0x12, 0x12, 0x12, 0x14, + 0x3f, 0x14, 0x14, 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x05, + 0x12, 0x12, 0x0e, 0x00, 0x0e, 0x0c, 0x09, 0x06, 0x03, 0x01, 0x01, 0x01, + 0x00, 0x01, 0x0d, 0x2d, 0x2e, 0x25, 0x1f, 0x0a, 0x02, 0x01, 0x00, 0x02, + 0x0a, 0x13, 0x0c, 0x0c, 0x0c, 0xe9, 0x8f, 0xd1, 0x0e, 0x0e, 0x0e, 0xe9, + 0xd4, 0xa7, 0x5f, 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xfe, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x0c, 0x00, 0x0c, 0x0b, + 0x09, 0x06, 0x03, 0x03, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x26, 0x36, + 0x2b, 0x23, 0x19, 0x00, 0x0a, 0x02, 0x00, 0x02, 0x05, 0x10, 0x0f, 0x0b, + 0x00, 0x0b, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0b, 0x0b, 0x7f, 0x0b, 0xe9, + 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf0, 0x07, 0x07, 0x07, 0x05, 0x09, 0x09, 0x06, 0x06, + 0x04, 0x06, 0x03, 0x01, 0x01, 0x01, 0xe9, 0x20, 0x39, 0x00, 0x2e, 0x25, + 0x1f, 0x10, 0x05, 0x02, 0x00, 0x02, 0x0f, 0x05, 0x0a, 0x1b, 0x0f, 0x3a, + 0x21, 0xd4, 0xa7, 0xff, 0x5f, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x81, 0x02, 0x03, + 0x03, 0x03, 0x01, 0x01, 0x01, 0xe9, 0x00, 0x01, 0x1b, 0x36, 0x33, 0x2b, + 0x23, 0x19, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x05, 0x10, 0x1b, + 0x7f, 0x11, 0x23, 0x09, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x03, 0x03, 0x01, 0x30, 0x01, 0x01, 0xe9, 0xd1, 0x20, 0x36, 0x36, 0x2e, + 0x00, 0x25, 0x1f, 0x10, 0x05, 0x02, 0x00, 0x00, 0x00, 0x03, 0x02, 0x02, + 0x0a, 0x19, 0x23, 0x11, 0x17, 0xd4, 0xff, 0xa7, 0x5f, 0x17, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xc0, 0x07, 0x05, 0x0d, 0x26, 0x39, 0x36, 0x2e, 0x25, 0x00, 0x1f, 0x10, + 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x0a, 0x19, + 0x23, 0x20, 0x0d, 0xff, 0x07, 0xbf, 0x77, 0x2f, 0x07, 0x07, 0x07, 0x07, + 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xe0, 0x07, 0x07, + 0x07, 0x0d, 0x20, 0x31, 0x39, 0x33, 0x00, 0x2e, 0x25, 0x1f, 0x19, 0x0a, + 0x02, 0x02, 0x00, 0x20, 0x00, 0x00, 0xe9, 0x02, 0x05, 0x10, 0x19, 0x23, + 0x07, 0x25, 0x25, 0x1b, 0x0d, 0x04, 0x02, 0xe2, 0xc6, 0xff, 0x87, 0x3f, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x80, 0x01, 0x08, 0x0d, 0x20, 0x26, 0x36, 0x39, 0x36, + 0x00, 0x2e, 0x2b, 0x25, 0x1f, 0x19, 0x0a, 0x05, 0x02, 0x10, 0x00, 0x00, + 0x00, 0xe9, 0x00, 0x00, 0x02, 0x05, 0x00, 0x0a, 0x19, 0x1f, 0x25, 0x2b, + 0x2e, 0x33, 0x36, 0x0f, 0x36, 0x39, 0x39, 0x39, 0xe9, 0xd4, 0xa7, 0x5f, + 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x05, 0x36, 0x00, 0x36, 0x33, 0x2e, 0x2b, 0x25, + 0x23, 0x1f, 0x10, 0x03, 0x0a, 0x05, 0x02, 0x00, 0x00, 0x00, 0xe9, 0xd2, + 0x00, 0x02, 0x05, 0x0a, 0x10, 0x19, 0x23, 0x25, 0x25, 0x07, 0x2b, 0x2b, + 0x2e, 0x2e, 0x2e, 0xe9, 0xd4, 0xa7, 0xff, 0x5f, 0x17, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, + 0x00, 0x2b, 0x2b, 0x2b, 0x25, 0x23, 0x1f, 0x19, 0x10, 0x03, 0x0a, 0x02, + 0x02, 0x00, 0x00, 0x00, 0xe9, 0xd4, 0x00, 0x02, 0x02, 0x05, 0x0a, 0x10, + 0x19, 0x1f, 0x23, 0x0f, 0x23, 0x25, 0x25, 0x25, 0xe9, 0xd4, 0xa7, 0x5f, + 0xff, 0x17, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xfe, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x05, 0x23, 0x00, 0x23, 0x1f, 0x1f, 0x19, 0x10, + 0x0a, 0x05, 0x02, 0x0c, 0x02, 0x00, 0x00, 0x00, 0xe9, 0xd4, 0x00, 0x00, + 0x00, 0x02, 0x02, 0x05, 0x05, 0x0a, 0x10, 0x10, 0x19, 0x3f, 0x19, 0x19, + 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x10, 0x10, 0x0a, + 0x01, 0x0a, 0x05, 0x02, 0x02, 0x00, 0x00, 0x00, 0xe9, 0xc0, 0xd4, 0xa4, + 0x02, 0x02, 0x02, 0x05, 0x05, 0x0a, 0x3f, 0x0a, 0x0a, 0xe9, 0xd4, 0xa7, + 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xf8, 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x05, 0x02, 0x07, 0x02, 0x02, + 0x00, 0x00, 0x00, 0xe9, 0xd4, 0xa7, 0x3f, 0x00, 0x00, 0x31, 0x19, 0xd4, + 0xa7, 0x5f, 0x17, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xfe, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, 0x00, 0x3f, 0x00, 0x00, + 0xe9, 0xd4, 0xa7, 0x5f, 0x17, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0xc0, 0x07, 0x06, +}; diff --git a/Software/Code_Composer/grlib_demo/images.h b/Software/Code_Composer/grlib_demo/images.h new file mode 100644 index 000000000..d058988b5 --- /dev/null +++ b/Software/Code_Composer/grlib_demo/images.h @@ -0,0 +1,43 @@ +//***************************************************************************** +// +// images.h - Prototypes for the images used by the application. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#ifndef __IMAGES_H__ +#define __IMAGES_H__ + +//***************************************************************************** +// +// Prototypes for the image arrays. +// +//***************************************************************************** +extern const uint8_t g_ui8Logo[]; +extern const uint8_t g_pui8LightOff[]; +extern const uint8_t g_pui8LightOn[]; +extern const uint8_t g_pui8Blue50x50[]; +extern const uint8_t g_pui8Blue50x50Press[]; +extern const uint8_t g_pui8RedSlider195x37[]; +extern const uint8_t g_pui8GreenSlider195x37[]; +extern const uint8_t g_pui8GettingHotter28x148[]; +extern const uint8_t g_pui8GettingHotter28x148Mono[]; + +#endif // __IMAGES_H__ diff --git a/Software/Code_Composer/grlib_demo/macros.ini_initial b/Software/Code_Composer/grlib_demo/macros.ini_initial new file mode 100644 index 000000000..1aa6ea7ad --- /dev/null +++ b/Software/Code_Composer/grlib_demo/macros.ini_initial @@ -0,0 +1 @@ +SW_ROOT = ../../../../.. diff --git a/Software/Code_Composer/grlib_demo/startup_ccs.c b/Software/Code_Composer/grlib_demo/startup_ccs.c new file mode 100644 index 000000000..da19e517e --- /dev/null +++ b/Software/Code_Composer/grlib_demo/startup_ccs.c @@ -0,0 +1,276 @@ +//***************************************************************************** +// +// startup_ccs.c - Startup code for use with TI's Code Composer Studio. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#include <stdint.h> +#include "inc/hw_nvic.h" +#include "inc/hw_types.h" + +//***************************************************************************** +// +// Forward declaration of the default fault handlers. +// +//***************************************************************************** +void ResetISR(void); +static void NmiSR(void); +static void FaultISR(void); +static void IntDefaultHandler(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 uint32_t __STACK_TOP; + +//***************************************************************************** +// +// External declarations for the interrupt handlers used by the application. +// +//***************************************************************************** +extern void TouchScreenIntHandler(void); +extern void SoundIntHandler(void); + +//***************************************************************************** +// +// 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))((uint32_t)&__STACK_TOP), + // The initial stack pointer + ResetISR, // The reset handler + NmiSR, // The NMI handler + FaultISR, // The hard fault handler + IntDefaultHandler, // The MPU fault handler + IntDefaultHandler, // The bus fault handler + IntDefaultHandler, // The usage fault handler + 0, // Reserved + 0, // Reserved + 0, // Reserved + 0, // Reserved + IntDefaultHandler, // SVCall handler + IntDefaultHandler, // Debug monitor handler + 0, // Reserved + IntDefaultHandler, // The PendSV handler + IntDefaultHandler, // The SysTick handler + IntDefaultHandler, // GPIO Port A + IntDefaultHandler, // GPIO Port B + IntDefaultHandler, // GPIO Port C + IntDefaultHandler, // GPIO Port D + IntDefaultHandler, // GPIO Port E + IntDefaultHandler, // UART0 Rx and Tx + IntDefaultHandler, // UART1 Rx and Tx + IntDefaultHandler, // SSI0 Rx and Tx + IntDefaultHandler, // I2C0 Master and Slave + IntDefaultHandler, // PWM Fault + IntDefaultHandler, // PWM Generator 0 + IntDefaultHandler, // PWM Generator 1 + IntDefaultHandler, // PWM Generator 2 + IntDefaultHandler, // Quadrature Encoder 0 + IntDefaultHandler, // ADC Sequence 0 + IntDefaultHandler, // ADC Sequence 1 + IntDefaultHandler, // ADC Sequence 2 + TouchScreenIntHandler, // ADC Sequence 3 + IntDefaultHandler, // Watchdog timer + IntDefaultHandler, // Timer 0 subtimer A + IntDefaultHandler, // Timer 0 subtimer B + IntDefaultHandler, // Timer 1 subtimer A + IntDefaultHandler, // Timer 1 subtimer B + IntDefaultHandler, // Timer 2 subtimer A + IntDefaultHandler, // Timer 2 subtimer B + IntDefaultHandler, // Analog Comparator 0 + IntDefaultHandler, // Analog Comparator 1 + IntDefaultHandler, // Analog Comparator 2 + IntDefaultHandler, // System Control (PLL, OSC, BO) + IntDefaultHandler, // FLASH Control + IntDefaultHandler, // GPIO Port F + IntDefaultHandler, // GPIO Port G + IntDefaultHandler, // GPIO Port H + IntDefaultHandler, // UART2 Rx and Tx + IntDefaultHandler, // SSI1 Rx and Tx + IntDefaultHandler, // Timer 3 subtimer A + IntDefaultHandler, // Timer 3 subtimer B + IntDefaultHandler, // I2C1 Master and Slave + IntDefaultHandler, // CAN0 + IntDefaultHandler, // CAN1 + IntDefaultHandler, // Ethernet + IntDefaultHandler, // Hibernate + IntDefaultHandler, // USB0 + IntDefaultHandler, // PWM Generator 3 + IntDefaultHandler, // uDMA Software Transfer + IntDefaultHandler, // uDMA Error + IntDefaultHandler, // ADC1 Sequence 0 + IntDefaultHandler, // ADC1 Sequence 1 + IntDefaultHandler, // ADC1 Sequence 2 + IntDefaultHandler, // ADC1 Sequence 3 + IntDefaultHandler, // External Bus Interface 0 + IntDefaultHandler, // GPIO Port J + IntDefaultHandler, // GPIO Port K + IntDefaultHandler, // GPIO Port L + IntDefaultHandler, // SSI2 Rx and Tx + IntDefaultHandler, // SSI3 Rx and Tx + IntDefaultHandler, // UART3 Rx and Tx + IntDefaultHandler, // UART4 Rx and Tx + IntDefaultHandler, // UART5 Rx and Tx + IntDefaultHandler, // UART6 Rx and Tx + IntDefaultHandler, // UART7 Rx and Tx + IntDefaultHandler, // I2C2 Master and Slave + IntDefaultHandler, // I2C3 Master and Slave + IntDefaultHandler, // Timer 4 subtimer A + IntDefaultHandler, // Timer 4 subtimer B + SoundIntHandler, // Timer 5 subtimer A + IntDefaultHandler, // Timer 5 subtimer B + IntDefaultHandler, // FPU + 0, // Reserved + 0, // Reserved + IntDefaultHandler, // I2C4 Master and Slave + IntDefaultHandler, // I2C5 Master and Slave + IntDefaultHandler, // GPIO Port M + IntDefaultHandler, // GPIO Port N + 0, // Reserved + IntDefaultHandler, // Tamper + IntDefaultHandler, // GPIO Port P (Summary or P0) + IntDefaultHandler, // GPIO Port P1 + IntDefaultHandler, // GPIO Port P2 + IntDefaultHandler, // GPIO Port P3 + IntDefaultHandler, // GPIO Port P4 + IntDefaultHandler, // GPIO Port P5 + IntDefaultHandler, // GPIO Port P6 + IntDefaultHandler, // GPIO Port P7 + IntDefaultHandler, // GPIO Port Q (Summary or Q0) + IntDefaultHandler, // GPIO Port Q1 + IntDefaultHandler, // GPIO Port Q2 + IntDefaultHandler, // GPIO Port Q3 + IntDefaultHandler, // GPIO Port Q4 + IntDefaultHandler, // GPIO Port Q5 + IntDefaultHandler, // GPIO Port Q6 + IntDefaultHandler, // GPIO Port Q7 + IntDefaultHandler, // GPIO Port R + IntDefaultHandler, // GPIO Port S + IntDefaultHandler, // SHA/MD5 0 + IntDefaultHandler, // AES 0 + IntDefaultHandler, // DES3DES 0 + IntDefaultHandler, // LCD Controller 0 + IntDefaultHandler, // Timer 6 subtimer A + IntDefaultHandler, // Timer 6 subtimer B + IntDefaultHandler, // Timer 7 subtimer A + IntDefaultHandler, // Timer 7 subtimer B + IntDefaultHandler, // I2C6 Master and Slave + IntDefaultHandler, // I2C7 Master and Slave + IntDefaultHandler, // HIM Scan Matrix Keyboard 0 + IntDefaultHandler, // One Wire 0 + IntDefaultHandler, // HIM PS/2 0 + IntDefaultHandler, // HIM LED Sequencer 0 + IntDefaultHandler, // HIM Consumer IR 0 + IntDefaultHandler, // I2C8 Master and Slave + IntDefaultHandler, // I2C9 Master and Slave + IntDefaultHandler // GPIO Port T +}; + +//***************************************************************************** +// +// 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. This will enable the + // floating-point unit as well, so that does not need to be done here. + // + __asm(" .global _c_int00\n" + " b.w _c_int00"); +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives a NMI. This +// simply enters an infinite loop, preserving the system state for examination +// by a debugger. +// +//***************************************************************************** +static void +NmiSR(void) +{ + // + // Enter an infinite loop. + // + while(1) + { + } +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives a fault +// interrupt. This simply enters an infinite loop, preserving the system state +// for examination by a debugger. +// +//***************************************************************************** +static void +FaultISR(void) +{ + // + // Enter an infinite loop. + // + while(1) + { + } +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives an unexpected +// interrupt. This simply enters an infinite loop, preserving the system state +// for examination by a debugger. +// +//***************************************************************************** +static void +IntDefaultHandler(void) +{ + // + // Go into an infinite loop. + // + while(1) + { + } +} diff --git a/Software/Code_Composer/grlib_demo/target_config.ccxml b/Software/Code_Composer/grlib_demo/target_config.ccxml new file mode 100644 index 000000000..0105ddcd3 --- /dev/null +++ b/Software/Code_Composer/grlib_demo/target_config.ccxml @@ -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="Stellaris In-Circuit Debug Interface_0"> + <instance XML_version="1.2" desc="Stellaris In-Circuit Debug Interface_0" href="connections/Stellaris_ICDI_Connection.xml" id="Stellaris In-Circuit Debug Interface_0" xml="Stellaris_ICDI_Connection.xml" xmlpath="connections"/> + <connection XML_version="1.2" id="Stellaris In-Circuit Debug Interface_0"> + <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 TM4C129XNCZAD_0" href="devices/tm4c129xnczad.xml" id="Stellaris TM4C129XNCZAD_0" xml="tm4c129xnczad.xml" xmlpath="devices"/> + </platform> + </connection> + </configuration> +</configurations> diff --git a/Software/Code_Composer/twine_graphicslib/.ccsproject b/Software/Code_Composer/twine_graphicslib/.ccsproject new file mode 100644 index 000000000..d132942b2 --- /dev/null +++ b/Software/Code_Composer/twine_graphicslib/.ccsproject @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <ccsVersion value="7.2.0"/> + <deviceVariant value="Cortex M.TM4C129XNCZAD"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="16.3.0.STS"/> + <isElfFormat value="true"/> + <createSlaveProjects value=""/> + <templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate,"/> + <filesToOpen value=""/> +</projectOptions> diff --git a/Software/Code_Composer/twine_graphicslib/.cproject b/Software/Code_Composer/twine_graphicslib/.cproject new file mode 100644 index 000000000..670f72289 --- /dev/null +++ b/Software/Code_Composer/twine_graphicslib/.cproject @@ -0,0 +1,141 @@ +<?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.570777470"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug"> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain.2032570844" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.2089916128"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.471837303" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.14452932" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug.2077799957" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug.1862617755" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug.965069148" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.1420295243" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.1973394165" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.1571358636" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.1058631933" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.1533299340" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1304341340" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.1401917836" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.1812174325" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.1748110206" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.515905302" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.2081262530" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/grlib}""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.312422354" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.77324950" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.679207486" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.61011931" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.804002552" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.2089916128" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE.1663408519" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release"> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.ReleaseToolchain.270241411" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease.226377319"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.658988475" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1941138829" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformRelease.573647717" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderRelease.1944619168" name="GNU Make.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerRelease.494478037" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.48552291" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.1313168309" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.438530402" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.1147145429" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.1045197456" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1608793976" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.547667799" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.422231554" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.266800110" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.861179576" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.1730997241" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.2059150249" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.171152981" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.546362320" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.558515027" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease.226377319" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE.2104237110" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="twine_graphicslib.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.504498469" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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> +</cproject> diff --git a/Software/Code_Composer/twine_graphicslib/.project b/Software/Code_Composer/twine_graphicslib/.project new file mode 100644 index 000000000..8736c1f5b --- /dev/null +++ b/Software/Code_Composer/twine_graphicslib/.project @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>twine_graphicslib</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>drivers/frame.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/frame.c</locationURI> + </link> + <link> + <name>drivers/kentec320x240x16_ssd2119.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>SW_ROOT</name> + <value>$%7BTI_PRODUCTS_DIR%7D/TivaWare_C_Series-2.1.4.178</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/twine_graphicslib/graphics_adapter.c b/Software/Code_Composer/twine_graphicslib/graphics_adapter.c new file mode 100644 index 000000000..47500d0a3 --- /dev/null +++ b/Software/Code_Composer/twine_graphicslib/graphics_adapter.c @@ -0,0 +1,45 @@ +/* + * graphics_adapter.c + * + * Created on: Sep 24, 2017 + * Author: Roy + */ + +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include "graphics_adapter.h" +#include "grlib/grlib.h" +#include "drivers/frame.h" +#include "drivers/kentec320x240x16_ssd2119.h" + + +void init_graphics(uint32_t ui32SysClock) +{ + // Initialize the display driver. + Kentec320x240x16_SSD2119Init(ui32SysClock); + + // Initialize the graphics context. + GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119); +} + +void draw_image(uint8_t* data) +{ + GrImageDraw(&g_sContext, data, 0, 0); +} + +void draw_string(char* data, size_t length) +{ + tRectangle backRect; + backRect.i16XMin = 100; + backRect.i16XMax = 300; + backRect.i16YMin = 100; + backRect.i16YMax = 80; + + GrContextForegroundSet(&g_sContext, ClrBlack); + GrRectFill(&g_sContext, &backRect); + + GrContextFontSet(&g_sContext, TEXT_FONT); + GrContextForegroundSet(&g_sContext, ClrWhite); + GrStringDraw(&g_sContext, data, length, 150, 80, true); +} diff --git a/Software/Code_Composer/twine_graphicslib/graphics_adapter.h b/Software/Code_Composer/twine_graphicslib/graphics_adapter.h new file mode 100644 index 000000000..c4e651a89 --- /dev/null +++ b/Software/Code_Composer/twine_graphicslib/graphics_adapter.h @@ -0,0 +1,28 @@ +/* + * graphics_adapter.h + * + * Created on: Sep 24, 2017 + * Author: Roy + */ + +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include "grlib/grlib.h" +#include "drivers/frame.h" +#include "drivers/kentec320x240x16_ssd2119.h" + +//***************************************************************************** +// +// Graphics context used to show text on the color STN display. +// +//***************************************************************************** +static tContext g_sContext; +#define TEXT_FONT g_psFontCmss22b +#define TEXT_HEIGHT (GrFontHeightGet(TEXT_FONT)) +#define BUFFER_METER_HEIGHT TEXT_HEIGHT +#define BUFFER_METER_WIDTH 150 + +void init_graphics(uint32_t ui32SysClock); +void draw_image(uint8_t* data); +void draw_string(char* data, size_t length); diff --git a/Software/Code_Composer/twine_usblib/.ccsproject b/Software/Code_Composer/twine_usblib/.ccsproject new file mode 100644 index 000000000..83cc5ba74 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/.ccsproject @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <ccsVersion value="7.2.0"/> + <deviceVariant value="Cortex M.TM4C129XNCZAD"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="16.9.4.LTS"/> + <isElfFormat value="true"/> + <createSlaveProjects value=""/> + <templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate,"/> + <filesToOpen value=""/> + <isTargetManual value="false"/> +</projectOptions> diff --git a/Software/Code_Composer/twine_usblib/.cproject b/Software/Code_Composer/twine_usblib/.cproject new file mode 100644 index 000000000..5c4201208 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/.cproject @@ -0,0 +1,147 @@ +<?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.1712794256"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1712794256" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1712794256" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug"> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1712794256." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain.1857799670" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.933538578"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.862048202" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + <listOptionValue builtIn="false" value="PRODUCTS="/> + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1818576343" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug.1280873394" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug.1884472642" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug.59496260" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.1260871296" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.1373156313" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.670678401" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.49785414" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.171601804" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1580654289" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.1354247189" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.1422314574" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${SW_ROOT}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}""/> + <listOptionValue builtIn="false" value=""C:\ti\xdctools_3_32_00_06_core\packages""/> + <listOptionValue builtIn="false" value=""C:\ti\tirtos_tivac_2_16_00_08\products\bios_6_45_01_29\packages""/> + <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.701920381" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.18973611" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.651875503" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.2072182850" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.62354248" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.72641058" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.533685650" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.1840927405" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.933538578" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE.1915375055" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + <sourceEntries> + <entry excluding="tm4c129xnczad.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.Release.935848617"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.935848617" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.935848617" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release"> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.935848617." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.ReleaseToolchain.1043243615" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.librarianRelease.1688188836"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1577349600" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.729704881" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.9.4.LTS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.targetPlatformRelease.13362800" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.builderRelease.595631804" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.compilerRelease.749049297" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.SILICON_VERSION.2061789795" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.CODE_STATE.207874384" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.ABI.1005861488" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.FLOAT_SUPPORT.1412660008" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.GCC.1794322910" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DEFINE.1410522242" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DIAG_WARNING.993080532" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DISPLAY_ERROR_NUMBER.974177188" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DIAG_WRAP.1454860188" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.INCLUDE_PATH.1916299080" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.LITTLE_ENDIAN.1995683267" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__C_SRCS.1325065408" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__CPP_SRCS.1367371847" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__ASM_SRCS.3623981" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__ASM2_SRCS.638130892" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.librarianRelease.1688188836" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.library.librarianRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.9.archiverID.OUTPUT_FILE.668849754" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.9.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.lib"" valueType="string"/> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="twine_usblib.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.457322155" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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> +</cproject> diff --git a/Software/Code_Composer/twine_usblib/.project b/Software/Code_Composer/twine_usblib/.project new file mode 100644 index 000000000..3d83dab3e --- /dev/null +++ b/Software/Code_Composer/twine_usblib/.project @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>twine_usblib</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>utils/ustdlib.c</name> + <type>1</type> + <locationURI>SW_ROOT/utils/ustdlib.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>SW_ROOT</name> + <value>$%7BTI_PRODUCTS_DIR%7D/TivaWare_C_Series-2.1.4.178</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/twine_usblib/usb_serial_adapter.c b/Software/Code_Composer/twine_usblib/usb_serial_adapter.c new file mode 100644 index 000000000..9cf3ef3b4 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_adapter.c @@ -0,0 +1,479 @@ +//Twine USB Serial Communication Library + +//! Assuming you installed TivaWare in the default directory, a +//! driver information (INF) file for use with Windows XP, Windows Vista and +//! Windows7 can be found in C:/ti/TivaWare-for-C-Series/windows_drivers. +//! For Windows 2000, the required INF file is in +//! C:/ti/TivaWare-for-C-Series/windows_drivers/win2K. + +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include "inc/hw_ints.h" +#include "inc/hw_memmap.h" +#include "inc/hw_types.h" +#include "inc/hw_uart.h" +#include "driverlib/debug.h" +#include "driverlib/gpio.h" +#include "driverlib/interrupt.h" +#include "driverlib/sysctl.h" +#include "driverlib/systick.h" +#include "driverlib/timer.h" +#include "driverlib/uart.h" +#include "driverlib/usb.h" +#include "driverlib/rom.h" +#include "driverlib/rom_map.h" +#include "usblib/usblib.h" +#include "usblib/usbcdc.h" +#include "usblib/usb-ids.h" +#include "usblib/device/usbdevice.h" +#include "usblib/device/usbdcdc.h" +#include <ti/sysbios/knl/Task.h> +#include "utils/ustdlib.h" +#include "usb_serial_structs.h" +#include "usb_serial_buffer.h" +#include "usb_serial_adapter.h" + +static SerialBuffer inBuffer; + +//***************************************************************************** +// +// This function is called whenever serial data is received from the UART. +// It is passed the accumulated error flags from each character received in +// this interrupt and determines from them whether or not an interrupt +// notification to the host is required. +// +// If a notification is required and the control interrupt endpoint is idle, +// we send the notification immediately. If the endpoint is not idle, we +// accumulate the errors in a global variable which will be checked on +// completion of the previous notification and used to send a second one +// if necessary. +// +//***************************************************************************** +void CheckForSerialStateChange(const tUSBDCDCDevice *psDevice, uint32_t ui32Errors) +{ + uint16_t ui16SerialState; + + // + // Clear our USB serial state. Since we are faking the handshakes, always + // set the TXCARRIER (DSR) and RXCARRIER (DCD) bits. + // + ui16SerialState = USB_CDC_SERIAL_STATE_TXCARRIER | + USB_CDC_SERIAL_STATE_RXCARRIER; + + // + // Are any error bits set? + // + if(ui32Errors) + { + // + // At least one error is being notified so translate from our hardware + // error bits into the correct state markers for the USB notification. + // + if(ui32Errors & UART_DR_OE) + { + ui16SerialState |= USB_CDC_SERIAL_STATE_OVERRUN; + } + + if(ui32Errors & UART_DR_PE) + { + ui16SerialState |= USB_CDC_SERIAL_STATE_PARITY; + } + + if(ui32Errors & UART_DR_FE) + { + ui16SerialState |= USB_CDC_SERIAL_STATE_FRAMING; + } + + if(ui32Errors & UART_DR_BE) + { + ui16SerialState |= USB_CDC_SERIAL_STATE_BREAK; + } + + // + // Call the CDC driver to notify the state change. + // + USBDCDCSerialStateChange((void *)psDevice, ui16SerialState); + } +} + +//***************************************************************************** +// +// Set the state of the RS232 RTS and DTR signals. +// +//***************************************************************************** +void SetControlLineState(uint16_t ui16State) +{ + // + // TODO: If configured with GPIOs controlling the handshake lines, + // set them appropriately depending upon the flags passed in the wValue + // field of the request structure passed. + // +} + +//***************************************************************************** +// +// Get the communication parameters in use on the UART. +// +//***************************************************************************** +void GetLineCoding(tLineCoding *psLineCoding) +{ + psLineCoding->ui32Rate = 9600; + psLineCoding->ui8Databits = 8; + psLineCoding->ui8Parity = USB_CDC_PARITY_NONE; + psLineCoding->ui8Stop = USB_CDC_STOP_BITS_1; +} + +//***************************************************************************** +// +// Handles CDC driver notifications related to control and setup of the device. +// +// \param pvCBData is the client-supplied callback pointer for this channel. +// \param ulEvent identifies the event we are being notified about. +// \param ulMsgValue is an event-specific value. +// \param pvMsgData is an event-specific pointer. +// +// This function is called by the CDC driver to perform control-related +// operations on behalf of the USB host. These functions include setting +// and querying the serial communication parameters, setting handshake line +// states and sending break conditions. +// +// \return The return value is event-specific. +// +//***************************************************************************** +uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData) +{ + // + // Which event are we being asked to process? + // + switch(ui32Event) + { + // + // We are connected to a host and communication is now possible. + // + case USB_EVENT_CONNECTED: + { + // + // Now connected and ready for normal operation. + // + HWREGBITW(&g_ui32Flags, FLAG_USB_CONFIGURED) = 1; + + // + // Flush our buffers. + // + USBBufferFlush(&g_sTxBuffer); + USBBufferFlush(&g_sRxBuffer); + + //TODO: Notify connection! + + // + // Set the command status update flag. + // + HWREGBITW(&g_ui32Flags, FLAG_STATUS_UPDATE) = 1; + + break; + } + + // + // The host has disconnected. + // + case USB_EVENT_DISCONNECTED: + { + // + // No longer connected. + // + HWREGBITW(&g_ui32Flags, FLAG_USB_CONFIGURED) = 0; + + //TODO: Notify disconnection! + + // + // Set the command status update flag. + // + HWREGBITW(&g_ui32Flags, FLAG_STATUS_UPDATE) = 1; + + break; + } + + // + // Return the current serial communication parameters. + // + case USBD_CDC_EVENT_GET_LINE_CODING: + { + GetLineCoding(pvMsgData); + break; + } + + // + // Set the current serial communication parameters. + // + case USBD_CDC_EVENT_SET_LINE_CODING: + { + GetLineCoding(pvMsgData); + break; + } + + // + // Set the current serial communication parameters. + // + case USBD_CDC_EVENT_SET_CONTROL_LINE_STATE: + { + SetControlLineState((uint16_t)ui32MsgValue); + break; + } + + // + // Send a break condition on the serial line. + // + case USBD_CDC_EVENT_SEND_BREAK: + { + break; + } + + // + // Clear the break condition on the serial line. + // + case USBD_CDC_EVENT_CLEAR_BREAK: + { + break; + } + + // + // Ignore SUSPEND and RESUME for now. + // + case USB_EVENT_SUSPEND: + case USB_EVENT_RESUME: + { + break; + } + + // + // We don't expect to receive any other events. Ignore any that show + // up in a release build or hang in a debug build. + // + default: + { +#ifdef DEBUG + while(1); +#else + break; +#endif + } + + } + + return(0); +} + +//***************************************************************************** +// +// Handles CDC driver notifications related to the transmit channel (data to +// the USB host). +// +// \param pvCBData is the client-supplied callback pointer for this channel. +// \param ui32Event identifies the event we are being notified about. +// \param ui32MsgValue is an event-specific value. +// \param pvMsgData is an event-specific pointer. +// +// This function is called by the CDC driver to notify us of any events +// related to operation of the transmit data channel (the IN channel carrying +// data to the USB host). +// +// \return The return value is event-specific. +// +//***************************************************************************** +uint32_t TxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData) +{ + // + // Which event have we been sent? + // + switch(ui32Event) + { + case USB_EVENT_TX_COMPLETE: + { + // + // Since we are using the USBBuffer, we don't need to do anything + // here. + // + break; + } + + // + // We don't expect to receive any other events. Ignore any that show + // up in a release build or hang in a debug build. + // + default: + { +#ifdef DEBUG + while(1); +#else + break; +#endif + } + } + return(0); +} + +//***************************************************************************** +// +// Handles CDC driver notifications related to the receive channel (data from +// the USB host). +// +// \param pvCBData is the client-supplied callback data value for this channel. +// \param ui32Event identifies the event we are being notified about. +// \param ui32MsgValue is an event-specific value. +// \param pvMsgData is an event-specific pointer. +// +// This function is called by the CDC driver to notify us of any events +// related to operation of the receive data channel (the OUT channel carrying +// data from the USB host). +// +// \return The return value is event-specific. +// +//***************************************************************************** +uint32_t RxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue,void *pvMsgData) +{ + // + // Which event are we being sent? + // + switch(ui32Event) + { + // + // A new packet has been received. + // + case USB_EVENT_RX_AVAILABLE: + { + // + // Feed some characters into the UART TX FIFO and enable the + // interrupt so we are told when there is more space. + // + handleRx(); + break; + } + + // + // We are being asked how much unprocessed data we have still to + // process. We return 0 if the UART is currently idle or 1 if it is + // in the process of transmitting something. The actual number of + // bytes in the UART FIFO is not important here, merely whether or + // not everything previously sent to us has been transmitted. + // + case USB_EVENT_DATA_REMAINING: + { + // + // Get the number of bytes in the buffer and add 1 if some data + // still has to clear the transmitter. + return(0); + } + + // + // We are being asked to provide a buffer into which the next packet + // can be read. We do not support this mode of receiving data so let + // the driver know by returning 0. The CDC driver should not be sending + // this message but this is included just for illustration and + // completeness. + // + case USB_EVENT_REQUEST_BUFFER: + { + return(0); + } + + // + // We don't expect to receive any other events. Ignore any that show + // up in a release build or hang in a debug build. + // + default: +#ifdef DEBUG + while(1); +#else + break; +#endif + } + + return(0); +} + +void handleRx(void) +{ + uint32_t ui32Read; + uint8_t ui8Char; + + do + { + ui32Read = USBBufferRead((tUSBBuffer *)&g_sRxBuffer, &ui8Char, 1); + + // Did we get a character? + if(ui32Read) + { + insertArray(&inBuffer, ui8Char); + g_RxCount++; + } + + } while(ui32Read); +} + +//Execute this function on UART0 Interrupt; +void InitUSB(void) +{ + CheckForSerialStateChange(&g_sCDCDevice, 0); +} + +//Initialize USB. +void StartUSB(uint32_t ui32SysClock) +{ + uint32_t ui32PLLRate, ui32RxCount; + + ui32RxCount = 0; + g_RxCount = 0; + + initArray(&inBuffer, 1); + + // Save the PLL rate used by this application. + SysCtlVCOGet(SYSCTL_XTAL_25MHZ, &ui32PLLRate); + + // Not configured initially. + g_ui32Flags = 0; + + // Initialize the transmit and receive buffers. + USBBufferInit(&g_sTxBuffer); + USBBufferInit(&g_sRxBuffer); + + // Set the USB stack mode to Device mode with VBUS monitoring. + USBStackModeSet(0, eUSBModeDevice, 0); + + // Tell the USB library the CPU clock and the PLL frequency. This is a + // new requirement for TM4C129 devices. + USBDCDFeatureSet(0, USBLIB_FEATURE_CPUCLK, &ui32SysClock); + USBDCDFeatureSet(0, USBLIB_FEATURE_USBPLL, &ui32PLLRate); + + // Pass our device information to the USB library and place the device + // on the bus. + USBDCDCInit(0, (tUSBDCDCDevice *)&g_sCDCDevice); + + while (1) + { + if(ui32RxCount != g_RxCount) + { + ui32RxCount = g_RxCount; + + if (callback != NULL) + { + callback(inBuffer.buffer,inBuffer.used); + } + + freeArray(&inBuffer); + initArray(&inBuffer, 1); + } + } +} + +//Send a sequence of chars to PC. +uint32_t SendChars(char* buffer,size_t length) +{ + return USBBufferWrite((tUSBBuffer *)&g_sTxBuffer, (uint8_t*)buffer, length); +} + +//Register for serial data receive callback. +void RegisterReceiveCallback(void (*callback_ptr)(char* buffer, size_t length)) +{ + callback = callback_ptr; +} diff --git a/Software/Code_Composer/twine_usblib/usb_serial_adapter.h b/Software/Code_Composer/twine_usblib/usb_serial_adapter.h new file mode 100644 index 000000000..0e630f627 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_adapter.h @@ -0,0 +1,70 @@ +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include "inc/hw_ints.h" +#include "inc/hw_memmap.h" +#include "inc/hw_types.h" +#include "inc/hw_uart.h" +#include "driverlib/debug.h" +#include "driverlib/gpio.h" +#include "driverlib/interrupt.h" +#include "driverlib/sysctl.h" +#include "driverlib/systick.h" +#include "driverlib/timer.h" +#include "driverlib/uart.h" +#include "driverlib/usb.h" +#include "driverlib/rom.h" +#include "driverlib/rom_map.h" +#include "usblib/usblib.h" +#include "usblib/usbcdc.h" +#include "usblib/usb-ids.h" +#include "usblib/device/usbdevice.h" +#include "usblib/device/usbdcdc.h" +//#include <ti/sysbios/knl/Task.h> +#include "utils/ustdlib.h" +#include "usb_serial_structs.h" + +//***************************************************************************** +// +// The system tick rate expressed both as ticks per second and a millisecond +// period. +// +//***************************************************************************** +#define TICKS_PER_SECOND 100 + +//***************************************************************************** +// +// Variables tracking transmit and receive counts. +// +//***************************************************************************** +static volatile uint32_t g_RxCount; + +#ifdef DEBUG +uint32_t g_ui32UARTRxErrors; +#endif + +//***************************************************************************** +// +// Flags used to pass commands from interrupt context to the main loop. +// +//***************************************************************************** +#define FLAG_STATUS_UPDATE 0 +#define FLAG_USB_CONFIGURED 1 +#define FLAG_SENDING_BREAK 2 +static volatile uint32_t g_ui32Flags; + +static void (*callback)(char* buffer, size_t length); + +//***************************************************************************** +// +// Internal function prototypes. +// +//***************************************************************************** +static void CheckForSerialStateChange(const tUSBDCDCDevice *psDevice, uint32_t ui32Errors); +static void SetControlLineState(uint16_t ui16State); +static void GetLineCoding(tLineCoding *psLineCoding); +static void handleRx(void); +void StartUSB(uint32_t ui32SysClock); +void InitUSB(void); +uint32_t SendChars(char* buffer,size_t length); +void RegisterReceiveCallback(void (*callback_ptr)(char* buffer, size_t length)); diff --git a/Software/Code_Composer/twine_usblib/usb_serial_buffer.c b/Software/Code_Composer/twine_usblib/usb_serial_buffer.c new file mode 100644 index 000000000..5025bb772 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_buffer.c @@ -0,0 +1,32 @@ +/* + * usb_serial_buffer.c + * + * Created on: Sep 24, 2017 + * Author: Roy + */ + +#include <stdlib.h> +#include "usb_serial_buffer.h" + +void initArray(SerialBuffer *a, size_t initialSize) { + a->buffer = (char *)malloc(initialSize); + a->used = 0; + a->size = initialSize; +} + +void insertArray(SerialBuffer *a, char element) { + // a->used is the number of used entries, because a->array[a->used++] updates a->used only *after* the array has been accessed. + // Therefore a->used can go up to a->size + if (a->used == a->size) { + a->size += 1; + a->buffer = (char *)realloc(a->buffer, a->size * sizeof(char)); + } + a->buffer[a->used++] = element; +} + +void freeArray(SerialBuffer *a) { + free(a->buffer); + a->buffer = NULL; + a->used = a->size = 0; +} + diff --git a/Software/Code_Composer/twine_usblib/usb_serial_buffer.h b/Software/Code_Composer/twine_usblib/usb_serial_buffer.h new file mode 100644 index 000000000..561f84b29 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_buffer.h @@ -0,0 +1,20 @@ +/* + * usb_serial_buffer.h + * + * Created on: Sep 24, 2017 + * Author: Roy + */ +#include <stdlib.h> + +struct serialBuffer { + char *buffer; + size_t used; + size_t size; +} typedef SerialBuffer; + +void initArray(SerialBuffer *a, size_t initialSize); + +void insertArray(SerialBuffer *a, char element); + +void freeArray(SerialBuffer *a); + diff --git a/Software/Code_Composer/twine_usblib/usb_serial_structs.c b/Software/Code_Composer/twine_usblib/usb_serial_structs.c new file mode 100644 index 000000000..eaf5eebf4 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_structs.c @@ -0,0 +1,211 @@ +//***************************************************************************** +// +// usb_serial_structs.c - Data structures defining this CDC USB device. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#include <stdbool.h> +#include <stdint.h> +#include "inc/hw_types.h" +#include "driverlib/usb.h" +#include "usblib/usblib.h" +#include "usblib/usbcdc.h" +#include "usblib/usb-ids.h" +#include "usblib/device/usbdevice.h" +#include "usblib/device/usbdcdc.h" +#include "usb_serial_structs.h" + +#define USB_BUFFER_SIZE 1024 + +//***************************************************************************** +// +// The languages supported by this device. +// +//***************************************************************************** +const uint8_t g_pui8LangDescriptor[] = +{ + 4, + USB_DTYPE_STRING, + USBShort(USB_LANG_EN_US) +}; + +//***************************************************************************** +// +// The manufacturer string. +// +//***************************************************************************** +const uint8_t g_pui8ManufacturerString[] = +{ + (17 + 1) * 2, + USB_DTYPE_STRING, + 'T', 0, 'e', 0, 'x', 0, 'a', 0, 's', 0, ' ', 0, 'I', 0, 'n', 0, 's', 0, + 't', 0, 'r', 0, 'u', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 's', 0, +}; + +//***************************************************************************** +// +// The product string. +// +//***************************************************************************** +const uint8_t g_pui8ProductString[] = +{ + 2 + (16 * 2), + USB_DTYPE_STRING, + 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, 'a', 0, 'l', 0, ' ', 0, + 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, 'o', 0, 'r', 0, 't', 0 +}; + +//***************************************************************************** +// +// The serial number string. +// +//***************************************************************************** +const uint8_t g_pui8SerialNumberString[] = +{ + 2 + (8 * 2), + USB_DTYPE_STRING, + '1', 0, '2', 0, '3', 0, '4', 0, '5', 0, '6', 0, '7', 0, '8', 0 +}; + +//***************************************************************************** +// +// The control interface description string. +// +//***************************************************************************** +const uint8_t g_pui8ControlInterfaceString[] = +{ + 2 + (21 * 2), + USB_DTYPE_STRING, + 'A', 0, 'C', 0, 'M', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 't', 0, + 'r', 0, 'o', 0, 'l', 0, ' ', 0, 'I', 0, 'n', 0, 't', 0, 'e', 0, + 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0 +}; + +//***************************************************************************** +// +// The configuration description string. +// +//***************************************************************************** +const uint8_t g_pui8ConfigString[] = +{ + 2 + (26 * 2), + USB_DTYPE_STRING, + 'S', 0, 'e', 0, 'l', 0, 'f', 0, ' ', 0, 'P', 0, 'o', 0, 'w', 0, + 'e', 0, 'r', 0, 'e', 0, 'd', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, + 'f', 0, 'i', 0, 'g', 0, 'u', 0, 'r', 0, 'a', 0, 't', 0, 'i', 0, + 'o', 0, 'n', 0 +}; + +//***************************************************************************** +// +// The descriptor string table. +// +//***************************************************************************** +const uint8_t * const g_pui8StringDescriptors[] = +{ + g_pui8LangDescriptor, + g_pui8ManufacturerString, + g_pui8ProductString, + g_pui8SerialNumberString, + g_pui8ControlInterfaceString, + g_pui8ConfigString +}; + +#define NUM_STRING_DESCRIPTORS (sizeof(g_pui8StringDescriptors) / \ + sizeof(uint8_t *)) + +//***************************************************************************** +// +// CDC device callback function prototypes. +// +//***************************************************************************** +uint32_t RxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, + void *pvMsgData); +uint32_t TxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, + void *pvMsgData); +uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event, + uint32_t ui32MsgValue, void *pvMsgData); + +//***************************************************************************** +// +// The CDC device initialization and customization structures. In this case, +// we are using USBBuffers between the CDC device class driver and the +// application code. The function pointers and callback data values are set +// to insert a buffer in each of the data channels, transmit and receive. +// +// With the buffer in place, the CDC channel callback is set to the relevant +// channel function and the callback data is set to point to the channel +// instance data. The buffer, in turn, has its callback set to the application +// function and the callback data set to our CDC instance structure. +// +//***************************************************************************** +tCDCSerInstance g_sCDCInstance; +tUSBDCDCDevice g_sCDCDevice = +{ + USB_VID_TI_1CBE, + USB_PID_SERIAL, + 0, + USB_CONF_ATTR_SELF_PWR, + ControlHandler, + (void *)&g_sCDCDevice, + USBBufferEventCallback, + (void *)&g_sRxBuffer, + USBBufferEventCallback, + (void *)&g_sTxBuffer, + g_pui8StringDescriptors, + NUM_STRING_DESCRIPTORS, +}; + +//***************************************************************************** +// +// Receive buffer (from the USB perspective). +// +//***************************************************************************** +uint8_t g_pui8USBRxBuffer[USB_BUFFER_SIZE]; +tUSBBuffer g_sRxBuffer = +{ + false, // This is a receive buffer. + RxHandler, // pfnCallback + (void *)&g_sCDCDevice, // Callback data is our device pointer. + USBDCDCPacketRead, // pfnTransfer + USBDCDCRxPacketAvailable, // pfnAvailable + (void *)&g_sCDCDevice, // pvHandle + g_pui8USBRxBuffer, // pui8Buffer + USB_BUFFER_SIZE, // ui32BufferSize +}; + +//***************************************************************************** +// +// Transmit buffer (from the USB perspective). +// +//***************************************************************************** +uint8_t g_pui8USBTxBuffer[USB_BUFFER_SIZE]; +tUSBBuffer g_sTxBuffer = +{ + true, // This is a transmit buffer. + TxHandler, // pfnCallback + (void *)&g_sCDCDevice, // Callback data is our device pointer. + USBDCDCPacketWrite, // pfnTransfer + USBDCDCTxPacketAvailable, // pfnAvailable + (void *)&g_sCDCDevice, // pvHandle + g_pui8USBTxBuffer, // pcBuffer + USB_BUFFER_SIZE, // ulBufferSize +}; diff --git a/Software/Code_Composer/twine_usblib/usb_serial_structs.h b/Software/Code_Composer/twine_usblib/usb_serial_structs.h new file mode 100644 index 000000000..a02ac1c75 --- /dev/null +++ b/Software/Code_Composer/twine_usblib/usb_serial_structs.h @@ -0,0 +1,49 @@ +//***************************************************************************** +// +// usb_serial_structs.h - Data structures defining this USB CDC device. +// +// Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. +// +//***************************************************************************** + +#ifndef _USB_SERIAL_STRUCTS_H_ +#define _USB_SERIAL_STRUCTS_H_ + +//***************************************************************************** +// +// The size of the transmit and receive buffers used for the redirected UART. +// This number should be a power of 2 for best performance. 256 is chosen +// pretty much at random though the buffer should be at least twice the size of +// a maximum-sized USB packet. +// +//***************************************************************************** +#define UART_BUFFER_SIZE 256 + +extern uint32_t RxHandler(void *pvCBData, uint32_t ui32Event, + uint32_t ui32MsgValue, void *pvMsgData); +extern uint32_t TxHandler(void *pvlCBData, uint32_t ui32Event, + uint32_t ui32MsgValue, void *pvMsgData); + +extern tUSBBuffer g_sTxBuffer; +extern tUSBBuffer g_sRxBuffer; +extern tUSBDCDCDevice g_sCDCDevice; +extern uint8_t g_pui8USBTxBuffer[]; +extern uint8_t g_pui8USBRxBuffer[]; + +#endif diff --git a/Software/Code_Composer/twine_usblib_demo/.ccsproject b/Software/Code_Composer/twine_usblib_demo/.ccsproject new file mode 100644 index 000000000..66d8c6648 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/.ccsproject @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<?ccsproject version="1.0"?> +<projectOptions> + <ccsVersion value="7.2.0"/> + <deviceVariant value="Cortex M.TM4C129XNCZAD"/> + <deviceFamily value="TMS470"/> + <deviceEndianness value="little"/> + <codegenToolVersion value="16.3.0.STS"/> + <isElfFormat value="true"/> + <linkerCommandFile value="tm4c129xnczad.cmd"/> + <rts value="libc.a"/> + <createSlaveProjects value=""/> + <templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/> + <filesToOpen value="main.c,"/> + <isTargetManual value="false"/> + <connection value="common/targetdb/connections/Stellaris_ICDI_Connection.xml"/> +</projectOptions> diff --git a/Software/Code_Composer/twine_usblib_demo/.cproject b/Software/Code_Composer/twine_usblib_demo/.cproject new file mode 100644 index 000000000..b4e2ad753 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/.cproject @@ -0,0 +1,235 @@ +<?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.522352697"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.522352697" moduleId="org.eclipse.cdt.core.settings" name="Debug"> + <macros> + <stringMacro name="SW_ROOT" type="VALUE_TEXT" value="C:\ti\TivaWare_C_Series-2.1.4.178"/> + </macros> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.522352697" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep=""> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.522352697." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.DebugToolchain.679743571" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerDebug.1077953619"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.901522327" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=tm4c129xnczad.cmd"/> + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> + <listOptionValue builtIn="false" value="XDC_VERSION=3.50.2.20_core"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="PRODUCTS=com.ti.rtsc.TIRTOSCC13XX_CC26XX:2.16.0.08;com.ti.rtsc.TIRTOStivac:2.16.0.08;"/> + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={"com.ti.rtsc.TIRTOSCC13XX_CC26XX":["${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INCLUDE_PATH}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARY_PATH}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARIES}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_SYMBOLS}"],"com.ti.rtsc.TIRTOStivac":["${COM_TI_RTSC_TIRTOSTIVAC_INCLUDE_PATH}","${COM_TI_RTSC_TIRTOSTIVAC_LIBRARY_PATH}","${COM_TI_RTSC_TIRTOSTIVAC_LIBRARIES}","${COM_TI_RTSC_TIRTOSTIVAC_SYMBOLS}"]}"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> + <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=7.0.0"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1350684432" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.targetPlatformDebug.585216114" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.targetPlatformDebug"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.builderDebug.2104001979" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.builderDebug"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.compilerDebug.1956762681" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.compilerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.1710155872" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.907455529" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.1911567495" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.752565159" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.976303781" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1180289666" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_SYMBOLS}"/> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_SYMBOLS}"/> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="TARGET_IS_TM4C129_RA0"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.572182054" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.411074002" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${workspace_loc:/twine_usblib}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/grlib}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/twine_graphicslib}""/> + <listOptionValue builtIn="false" value=""C:/ti/TivaWare_C_Series-2.1.4.178/examples/boards/dk-tm4c129x""/> + <listOptionValue builtIn="false" value=""C:/ti/TivaWare_C_Series-2.1.4.178""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.321246444" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.309364075" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.1594038081" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.1635443754" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.145301055" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.502409561" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.133682737" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.1765920589" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerDebug.1077953619" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerDebug"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.MAP_FILE.696875197" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.MAP_FILE" useByScannerDiscovery="false" value=""${ProjName}.map"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.STACK_SIZE.571525378" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.STACK_SIZE" useByScannerDiscovery="false" value="2048" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.HEAP_SIZE.776477645" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.HEAP_SIZE" useByScannerDiscovery="false" value="87574" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.OUTPUT_FILE.1189225441" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.out"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.LIBRARY.1158315701" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.LIBRARY" useByScannerDiscovery="false" valueType="libs"> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_LIBRARIES}"/> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARIES}"/> + <listOptionValue builtIn="false" value="C:\ti\TivaWare_C_Series-2.1.4.178\usblib\ccs\Debug\usblib.lib"/> + <listOptionValue builtIn="false" value="libc.a"/> + <listOptionValue builtIn="false" value="${workspace_loc:/driverlib/Debug/driverlib.lib}"/> + <listOptionValue builtIn="false" value="${workspace_loc:/twine_usblib/Debug/twine_usblib.lib}"/> + <listOptionValue builtIn="false" value="${workspace_loc:/grlib/Debug/grlib.lib}"/> + <listOptionValue builtIn="false" value="${workspace_loc:/twine_graphicslib/Debug/twine_graphicslib.lib}"/> + <listOptionValue builtIn="false" value="${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.SEARCH_PATH.540674409" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.SEARCH_PATH" valueType="libPaths"> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_LIBRARY_PATH}""/> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARY_PATH}""/> + <listOptionValue builtIn="false" value=""C:\ti\tirtos_tivac_2_16_00_08\products\bios_6_45_01_29\packages\ti\sysbios\knl""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/twine_usblib}""/> + <listOptionValue builtIn="false" value=""${ProjDirPath}""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DISPLAY_ERROR_NUMBER.1465250876" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP.1879199528" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.XML_LINK_INFO.1390086111" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.XML_LINK_INFO" useByScannerDiscovery="false" value=""${ProjName}_linkInfo.xml"" valueType="string"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD_SRCS.1836791669" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD2_SRCS.1535273501" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD2_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__GEN_CMDS.361661320" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__GEN_CMDS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.hex.2038904037" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.hex"/> + <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1701506998" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool"> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.2033030150" name="Compiler tools directory (-c)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value=""${CG_TOOL_ROOT}"" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1196943233" name="Target (-t)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1643499427" name="Build-profile (-r)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="debug" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1189677152" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/> + </option> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2038602353"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2038602353" moduleId="org.eclipse.cdt.core.settings" name="Release"> + <externalSettings/> + <extensions> + <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.rtsc.xdctools.parsers.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2038602353" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release"> + <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2038602353." name="/" resourcePath=""> + <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.ReleaseToolchain.1835307721" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerRelease.656009818"> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1130728155" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> + <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> + <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> + <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> + <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=tm4c129xnczad.cmd"/> + <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> + <listOptionValue builtIn="false" value="XDC_VERSION=3.50.2.20_core"/> + <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> + <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> + <listOptionValue builtIn="false" value="PRODUCTS=com.ti.rtsc.TIRTOSCC13XX_CC26XX:2.16.0.08;com.ti.rtsc.TIRTOStivac:2.16.0.08;"/> + <listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={"com.ti.rtsc.TIRTOSCC13XX_CC26XX":["${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INCLUDE_PATH}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARY_PATH}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARIES}","${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_SYMBOLS}"],"com.ti.rtsc.TIRTOStivac":["${COM_TI_RTSC_TIRTOSTIVAC_INCLUDE_PATH}","${COM_TI_RTSC_TIRTOSTIVAC_LIBRARY_PATH}","${COM_TI_RTSC_TIRTOSTIVAC_LIBRARIES}","${COM_TI_RTSC_TIRTOSTIVAC_SYMBOLS}"]}"/> + <listOptionValue builtIn="false" value="RTSC_MBS_VERSION=7.0.0"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1025016981" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> + <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.targetPlatformRelease.532303804" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.targetPlatformRelease"/> + <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.builderRelease.635894068" name="GNU Make.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.builderRelease"/> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.compilerRelease.1569639959" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.compilerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.1800735728" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.285056924" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.394434958" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.919878509" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.1393044104" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.990997817" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_SYMBOLS}"/> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_SYMBOLS}"/> + <listOptionValue builtIn="false" value="ccs="ccs""/> + <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.1286317778" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.728960146" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_INCLUDE_PATH}""/> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_INCLUDE_PATH}""/> + <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSCC13XX_CC26XX__BIOS}/../../../tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/knl""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.831457275" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.609910051" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.830116865" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="225"/> + </option> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.1769001670" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.1522774998" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.133765086" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.2071266453" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerRelease.656009818" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exe.linkerRelease"> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.MAP_FILE.1242670691" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.MAP_FILE" useByScannerDiscovery="false" value=""${ProjName}.map"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.STACK_SIZE.400174233" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.STACK_SIZE" useByScannerDiscovery="false" value="512" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.HEAP_SIZE.208444456" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.HEAP_SIZE" useByScannerDiscovery="false" value="0" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.OUTPUT_FILE.512369812" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.out"" valueType="string"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.LIBRARY.2116096543" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.LIBRARY" useByScannerDiscovery="false" valueType="libs"> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSTIVAC_LIBRARIES}"/> + <listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARIES}"/> + <listOptionValue builtIn="false" value="libc.a"/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.SEARCH_PATH.1843246465" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.SEARCH_PATH" valueType="libPaths"> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSTIVAC_LIBRARY_PATH}""/> + <listOptionValue builtIn="false" value=""${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_LIBRARY_PATH}""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> + <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> + </option> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DISPLAY_ERROR_NUMBER.1367884189" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP.1387539244" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.DIAG_WRAP.off" valueType="enumerated"/> + <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.XML_LINK_INFO.241265994" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.linkerID.XML_LINK_INFO" useByScannerDiscovery="false" value=""${ProjName}_linkInfo.xml"" valueType="string"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD_SRCS.837781825" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD2_SRCS.770475684" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__CMD2_SRCS"/> + <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__GEN_CMDS.1523096356" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.exeLinker.inputType__GEN_CMDS"/> + </tool> + <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.hex.1525023855" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.hex"/> + <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1753519114" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool"> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1287626405" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value=""${CG_TOOL_ROOT}"" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.963665735" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M4F" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.2105479182" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="debug" valueType="string"/> + <option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1052803618" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" useByScannerDiscovery="false" valueType="stringList"> + <listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/> + </option> + </tool> + </toolChain> + </folderInfo> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <project id="twine_usblib_demo.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.432341726" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> + </storageModule> + <storageModule moduleId="scannerConfiguration"/> + <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="refreshScope"/> +</cproject> diff --git a/Software/Code_Composer/twine_usblib_demo/.project b/Software/Code_Composer/twine_usblib_demo/.project new file mode 100644 index 000000000..4d854e307 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/.project @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>twine_usblib_demo</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>com.ti.ccstudio.core.ccsNature</nature> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> + </natures> + <linkedResources> + <link> + <name>drivers/frame.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/frame.c</locationURI> + </link> + <link> + <name>drivers/kentec320x240x16_ssd2119.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c</locationURI> + </link> + <link> + <name>drivers/pinout.c</name> + <type>1</type> + <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/pinout.c</locationURI> + </link> + </linkedResources> + <variableList> + <variable> + <name>SW_ROOT</name> + <value>file:/C:/ti/TivaWare_C_Series-2.1.4.178</value> + </variable> + </variableList> +</projectDescription> diff --git a/Software/Code_Composer/twine_usblib_demo/.xdchelp b/Software/Code_Composer/twine_usblib_demo/.xdchelp new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/.xdchelp diff --git a/Software/Code_Composer/twine_usblib_demo/main.c b/Software/Code_Composer/twine_usblib_demo/main.c new file mode 100644 index 000000000..d7bcae1dd --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/main.c @@ -0,0 +1,109 @@ +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include "inc/hw_ints.h" +#include "inc/hw_memmap.h" +#include "inc/hw_types.h" +#include "inc/hw_uart.h" +#include "driverlib/debug.h" +#include "driverlib/gpio.h" +#include "driverlib/interrupt.h" +#include "driverlib/sysctl.h" +#include "driverlib/systick.h" +#include "driverlib/timer.h" +#include "driverlib/uart.h" +#include "driverlib/usb.h" +#include "driverlib/rom.h" +#include "driverlib/rom_map.h" +#include "drivers/pinout.h" +#include "usblib/usblib.h" +#include "usblib/usbcdc.h" +#include "usblib/usb-ids.h" +#include "usblib/device/usbdevice.h" +#include "usblib/device/usbdcdc.h" +#include "utils/ustdlib.h" +#include "usb_serial_adapter.h" +#include "graphics_adapter.h" +#include "protobuf/person-pb-c.h" + +//***************************************************************************** +// +// The system tick rate expressed both as ticks per second and a millisecond +// period. +// +//***************************************************************************** +#define TICKS_PER_SECOND 100 + +//***************************************************************************** +// +// Global system tick counter +// +//***************************************************************************** +static volatile uint32_t g_ui32SysTickCount = 0; + +// Flags used to pass commands from interrupt context to the main loop. +static volatile uint32_t g_ui32Flags; + + +//***************************************************************************** +// +// Interrupt handler for the system tick counter. +// +//***************************************************************************** +void SysTickHandler(void) +{ + // Update our system time. + g_ui32SysTickCount++; +} + +//***************************************************************************** +// +// Interrupt handler for the UART which we are redirecting via USB. +// +//***************************************************************************** +void USB0Handler(void) +{ + InitUSB(); +} + +void receive_callback(char* buffer, size_t length) +{ + //SendChars(buffer,length); + draw_string(buffer, length); + //draw_image((uint8_t *)buffer); + +// Person* p = person__unpack (NULL, length, (uint8_t*)buffer); +// void* buf = malloc (length); +// person__pack (p, buf); +// SendChars(buf,length); +// free(p); +// free(buf); +} + +int main(void) +{ + uint32_t ui32SysClock, ui32PLLRate; + + // Set the system clock to run at 120MHz from the PLL. + ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | + SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | + SYSCTL_CFG_VCO_480), 120000000); + + // Configure the device pins. + PinoutSet(); + + // Save the PLL rate used by this application. + SysCtlVCOGet(SYSCTL_XTAL_25MHZ, &ui32PLLRate); + + // Enable the system tick. + ROM_SysTickPeriodSet(ui32SysClock / TICKS_PER_SECOND); + ROM_SysTickIntEnable(); + ROM_SysTickEnable(); + + init_graphics(ui32SysClock); + + RegisterReceiveCallback(&receive_callback); + StartUSB(ui32SysClock); + + while(1){}; +} diff --git a/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.c b/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.c new file mode 100644 index 000000000..7493ef609 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.c @@ -0,0 +1,227 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: person.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "person-pb-c.h" +void address__init + (Address *message) +{ + static const Address init_value = ADDRESS__INIT; + *message = init_value; +} +size_t address__get_packed_size + (const Address *message) +{ + assert(message->base.descriptor == &address__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t address__pack + (const Address *message, + uint8_t *out) +{ + assert(message->base.descriptor == &address__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t address__pack_to_buffer + (const Address *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &address__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Address * + address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Address *) + protobuf_c_message_unpack (&address__descriptor, + allocator, len, data); +} +void address__free_unpacked + (Address *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &address__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void person__init + (Person *message) +{ + static const Person init_value = PERSON__INIT; + *message = init_value; +} +size_t person__get_packed_size + (const Person *message) +{ + assert(message->base.descriptor == &person__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t person__pack + (const Person *message, + uint8_t *out) +{ + assert(message->base.descriptor == &person__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t person__pack_to_buffer + (const Person *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &person__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Person * + person__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Person *) + protobuf_c_message_unpack (&person__descriptor, + allocator, len, data); +} +void person__free_unpacked + (Person *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &person__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor address__field_descriptors[2] = +{ + { + "street", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Address, street), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "number", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Address, has_number), + offsetof(Address, number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned address__field_indices_by_name[] = { + 1, /* field[1] = number */ + 0, /* field[0] = street */ +}; +static const ProtobufCIntRange address__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor address__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Address", + "Address", + "Address", + "", + sizeof(Address), + 2, + address__field_descriptors, + address__field_indices_by_name, + 1, address__number_ranges, + (ProtobufCMessageInit) address__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor person__field_descriptors[4] = +{ + { + "name", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Person, name), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "age", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Person, has_age), + offsetof(Person, age), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "email", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Person, email), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "address", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Person, n_address), + offsetof(Person, address), + &address__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned person__field_indices_by_name[] = { + 3, /* field[3] = address */ + 1, /* field[1] = age */ + 2, /* field[2] = email */ + 0, /* field[0] = name */ +}; +static const ProtobufCIntRange person__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor person__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Person", + "Person", + "Person", + "", + sizeof(Person), + 4, + person__field_descriptors, + person__field_indices_by_name, + 1, person__number_ranges, + (ProtobufCMessageInit) person__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.h b/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.h new file mode 100644 index 000000000..6dd6f393b --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/protobuf/person-pb-c.h @@ -0,0 +1,112 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: person.proto */ + +#ifndef PROTOBUF_C_person_2eproto__INCLUDED +#define PROTOBUF_C_person_2eproto__INCLUDED + +#include "protobuf-c.h" + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _Address Address; +typedef struct _Person Person; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _Address +{ + ProtobufCMessage base; + char *street; + protobuf_c_boolean has_number; + int32_t number; +}; +#define ADDRESS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&address__descriptor) \ + , NULL, 0, 0 } + + +struct _Person +{ + ProtobufCMessage base; + char *name; + protobuf_c_boolean has_age; + int32_t age; + char *email; + size_t n_address; + Address **address; +}; +#define PERSON__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&person__descriptor) \ + , NULL, 0, 0, NULL, 0,NULL } + + +/* Address methods */ +void address__init + (Address *message); +size_t address__get_packed_size + (const Address *message); +size_t address__pack + (const Address *message, + uint8_t *out); +size_t address__pack_to_buffer + (const Address *message, + ProtobufCBuffer *buffer); +Address * + address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void address__free_unpacked + (Address *message, + ProtobufCAllocator *allocator); +/* Person methods */ +void person__init + (Person *message); +size_t person__get_packed_size + (const Person *message); +size_t person__pack + (const Person *message, + uint8_t *out); +size_t person__pack_to_buffer + (const Person *message, + ProtobufCBuffer *buffer); +Person * + person__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void person__free_unpacked + (Person *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Address_Closure) + (const Address *message, + void *closure_data); +typedef void (*Person_Closure) + (const Person *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor address__descriptor; +extern const ProtobufCMessageDescriptor person__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_person_2eproto__INCLUDED */ diff --git a/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.c b/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.c new file mode 100644 index 000000000..5debac820 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.c @@ -0,0 +1,3642 @@ +/* + * Copyright (c) 2008-2015, Dave Benson and the protobuf-c authors. + * All rights reserved. + * + * 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. + * + * 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. + */ + +/*! \file + * Support library for `protoc-c` generated code. + * + * This file implements the public API used by the code generated + * by `protoc-c`. + * + * \authors Dave Benson and the protobuf-c authors + * + * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. + */ + +/** + * \todo 64-BIT OPTIMIZATION: certain implementations use 32-bit math + * even on 64-bit platforms (uint64_size, uint64_pack, parse_uint64). + * + * \todo Use size_t consistently. + */ + +#include <stdlib.h> /* for malloc, free */ +#include <string.h> /* for strcmp, strlen, memcpy, memmove, memset */ + +#include "protobuf-c.h" + +#define TRUE 1 +#define FALSE 0 + +#define PROTOBUF_C__ASSERT_NOT_REACHED() assert(0) + +/* Workaround for Microsoft compilers. */ +#ifdef _MSC_VER +# define inline __inline +#endif + +/** + * \defgroup internal Internal functions and macros + * + * These are not exported by the library but are useful to developers working + * on `libprotobuf-c` itself. + */ + +/** + * \defgroup macros Utility macros for manipulating structures + * + * Macros and constants used to manipulate the base "classes" generated by + * `protobuf-c`. They also define limits and check correctness. + * + * \ingroup internal + * @{ + */ + +/** The maximum length of a 64-bit integer in varint encoding. */ +#define MAX_UINT64_ENCODED_SIZE 10 + +#ifndef PROTOBUF_C_UNPACK_ERROR +# define PROTOBUF_C_UNPACK_ERROR(...) +#endif + +const char protobuf_c_empty_string[] = ""; + +/** + * Internal `ProtobufCMessage` manipulation macro. + * + * Base macro for manipulating a `ProtobufCMessage`. Used by STRUCT_MEMBER() and + * STRUCT_MEMBER_PTR(). + */ +#define STRUCT_MEMBER_P(struct_p, struct_offset) \ + ((void *) ((uint8_t *) (struct_p) + (struct_offset))) + +/** + * Return field in a `ProtobufCMessage` based on offset. + * + * Take a pointer to a `ProtobufCMessage` and find the field at the offset. + * Cast it to the passed type. + */ +#define STRUCT_MEMBER(member_type, struct_p, struct_offset) \ + (*(member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset))) + +/** + * Return field in a `ProtobufCMessage` based on offset. + * + * Take a pointer to a `ProtobufCMessage` and find the field at the offset. Cast + * it to a pointer to the passed type. + */ +#define STRUCT_MEMBER_PTR(member_type, struct_p, struct_offset) \ + ((member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset))) + +/* Assertions for magic numbers. */ + +#define ASSERT_IS_ENUM_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC) + +#define ASSERT_IS_MESSAGE_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC) + +#define ASSERT_IS_MESSAGE(message) \ + ASSERT_IS_MESSAGE_DESCRIPTOR((message)->descriptor) + +#define ASSERT_IS_SERVICE_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC) + +/**@}*/ + +/* --- version --- */ + +const char * +protobuf_c_version(void) +{ + return PROTOBUF_C_VERSION; +} + +uint32_t +protobuf_c_version_number(void) +{ + return PROTOBUF_C_VERSION_NUMBER; +} + +/* --- allocator --- */ + +static void * +system_alloc(void *allocator_data, size_t size) +{ + return malloc(size); +} + +static void +system_free(void *allocator_data, void *data) +{ + free(data); +} + +static inline void * +do_alloc(ProtobufCAllocator *allocator, size_t size) +{ + return allocator->alloc(allocator->allocator_data, size); +} + +static inline void +do_free(ProtobufCAllocator *allocator, void *data) +{ + if (data != NULL) + allocator->free(allocator->allocator_data, data); +} + +/* + * This allocator uses the system's malloc() and free(). It is the default + * allocator used if NULL is passed as the ProtobufCAllocator to an exported + * function. + */ +static ProtobufCAllocator protobuf_c__allocator = { + .alloc = &system_alloc, + .free = &system_free, + .allocator_data = NULL, +}; + +/* === buffer-simple === */ + +void +protobuf_c_buffer_simple_append(ProtobufCBuffer *buffer, + size_t len, const uint8_t *data) +{ + ProtobufCBufferSimple *simp = (ProtobufCBufferSimple *) buffer; + size_t new_len = simp->len + len; + + if (new_len > simp->alloced) { + ProtobufCAllocator *allocator = simp->allocator; + size_t new_alloced = simp->alloced * 2; + uint8_t *new_data; + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + while (new_alloced < new_len) + new_alloced += new_alloced; + new_data = do_alloc(allocator, new_alloced); + if (!new_data) + return; + memcpy(new_data, simp->data, simp->len); + if (simp->must_free_data) + do_free(allocator, simp->data); + else + simp->must_free_data = TRUE; + simp->data = new_data; + simp->alloced = new_alloced; + } + memcpy(simp->data + simp->len, data, len); + simp->len = new_len; +} + +/** + * \defgroup packedsz protobuf_c_message_get_packed_size() implementation + * + * Routines mainly used by protobuf_c_message_get_packed_size(). + * + * \ingroup internal + * @{ + */ + +/** + * Return the number of bytes required to store the tag for the field. Includes + * 3 bits for the wire-type, and a single bit that denotes the end-of-tag. + * + * \param number + * Field tag to encode. + * \return + * Number of bytes required. + */ +static inline size_t +get_tag_size(uint32_t number) +{ + if (number < (1UL << 4)) { + return 1; + } else if (number < (1UL << 11)) { + return 2; + } else if (number < (1UL << 18)) { + return 3; + } else if (number < (1UL << 25)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the number of bytes required to store a variable-length unsigned + * 32-bit integer in base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +uint32_size(uint32_t v) +{ + if (v < (1UL << 7)) { + return 1; + } else if (v < (1UL << 14)) { + return 2; + } else if (v < (1UL << 21)) { + return 3; + } else if (v < (1UL << 28)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the number of bytes required to store a variable-length signed 32-bit + * integer in base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +int32_size(int32_t v) +{ + if (v < 0) { + return 10; + } else if (v < (1L << 7)) { + return 1; + } else if (v < (1L << 14)) { + return 2; + } else if (v < (1L << 21)) { + return 3; + } else if (v < (1L << 28)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the ZigZag-encoded 32-bit unsigned integer form of a 32-bit signed + * integer. + * + * \param v + * Value to encode. + * \return + * ZigZag encoded integer. + */ +static inline uint32_t +zigzag32(int32_t v) +{ + if (v < 0) + return (-(uint32_t)v) * 2 - 1; + else + return (uint32_t)(v) * 2; +} + +/** + * Return the number of bytes required to store a signed 32-bit integer, + * converted to an unsigned 32-bit integer with ZigZag encoding, using base-128 + * varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +sint32_size(int32_t v) +{ + return uint32_size(zigzag32(v)); +} + +/** + * Return the number of bytes required to store a 64-bit unsigned integer in + * base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +uint64_size(uint64_t v) +{ + uint32_t upper_v = (uint32_t) (v >> 32); + + if (upper_v == 0) { + return uint32_size((uint32_t) v); + } else if (upper_v < (1UL << 3)) { + return 5; + } else if (upper_v < (1UL << 10)) { + return 6; + } else if (upper_v < (1UL << 17)) { + return 7; + } else if (upper_v < (1UL << 24)) { + return 8; + } else if (upper_v < (1UL << 31)) { + return 9; + } else { + return 10; + } +} + +/** + * Return the ZigZag-encoded 64-bit unsigned integer form of a 64-bit signed + * integer. + * + * \param v + * Value to encode. + * \return + * ZigZag encoded integer. + */ +static inline uint64_t +zigzag64(int64_t v) +{ + if (v < 0) + return (-(uint64_t)v) * 2 - 1; + else + return (uint64_t)(v) * 2; +} + +/** + * Return the number of bytes required to store a signed 64-bit integer, + * converted to an unsigned 64-bit integer with ZigZag encoding, using base-128 + * varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +sint64_size(int64_t v) +{ + return uint64_size(zigzag64(v)); +} + +/** + * Calculate the serialized size of a single required message field, including + * the space needed by the preceding tag. + * + * \param field + * Field descriptor for member. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +required_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const void *member) +{ + size_t rv = get_tag_size(field->id); + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + return rv + sint32_size(*(const int32_t *) member); + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + return rv + int32_size(*(const int32_t *) member); + case PROTOBUF_C_TYPE_UINT32: + return rv + uint32_size(*(const uint32_t *) member); + case PROTOBUF_C_TYPE_SINT64: + return rv + sint64_size(*(const int64_t *) member); + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + return rv + uint64_size(*(const uint64_t *) member); + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + return rv + 4; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + return rv + 8; + case PROTOBUF_C_TYPE_BOOL: + return rv + 1; + case PROTOBUF_C_TYPE_FLOAT: + return rv + 4; + case PROTOBUF_C_TYPE_DOUBLE: + return rv + 8; + case PROTOBUF_C_TYPE_STRING: { + const char *str = *(char * const *) member; + size_t len = str ? strlen(str) : 0; + return rv + uint32_size(len) + len; + } + case PROTOBUF_C_TYPE_BYTES: { + size_t len = ((const ProtobufCBinaryData *) member)->len; + return rv + uint32_size(len) + len; + } + case PROTOBUF_C_TYPE_MESSAGE: { + const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member; + size_t subrv = msg ? protobuf_c_message_get_packed_size(msg) : 0; + return rv + uint32_size(subrv) + subrv; + } + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Calculate the serialized size of a single oneof message field, including + * the space needed by the preceding tag. Returns 0 if the oneof field isn't + * selected or is not set. + * + * \param field + * Field descriptor for member. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +oneof_field_get_packed_size(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_get_packed_size(field, member); +} + +/** + * Calculate the serialized size of a single optional message field, including + * the space needed by the preceding tag. Returns 0 if the optional field isn't + * set. + * + * \param field + * Field descriptor for member. + * \param has + * True if the field exists, false if not. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +optional_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_get_packed_size(field, member); +} + +static protobuf_c_boolean +field_is_zeroish(const ProtobufCFieldDescriptor *field, + const void *member) +{ + protobuf_c_boolean ret = FALSE; + + switch (field->type) { + case PROTOBUF_C_TYPE_BOOL: + ret = (0 == *(const protobuf_c_boolean *) member); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + ret = (0 == *(const uint32_t *) member); + break; + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + ret = (0 == *(const uint64_t *) member); + break; + case PROTOBUF_C_TYPE_FLOAT: + ret = (0 == *(const float *) member); + break; + case PROTOBUF_C_TYPE_DOUBLE: + ret = (0 == *(const double *) member); + break; + case PROTOBUF_C_TYPE_STRING: + ret = (NULL == *(const char * const *) member) || + ('\0' == **(const char * const *) member); + break; + case PROTOBUF_C_TYPE_BYTES: + case PROTOBUF_C_TYPE_MESSAGE: + ret = (NULL == *(const void * const *) member); + break; + default: + ret = TRUE; + break; + } + + return ret; +} + +/** + * Calculate the serialized size of a single unlabeled message field, including + * the space needed by the preceding tag. Returns 0 if the field isn't set or + * if it is set to a "zeroish" value (null pointer or 0 for numerical values). + * Unlabeled fields are supported only in proto3. + * + * \param field + * Field descriptor for member. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +unlabeled_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const void *member) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_get_packed_size(field, member); +} + +/** + * Calculate the serialized size of repeated message fields, which may consist + * of any number of values (including 0). Includes the space needed by the + * preceding tags (as needed). + * + * \param field + * Field descriptor for member. + * \param count + * Number of repeated field members. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +repeated_field_get_packed_size(const ProtobufCFieldDescriptor *field, + size_t count, const void *member) +{ + size_t header_size; + size_t rv = 0; + unsigned i; + void *array = *(void * const *) member; + + if (count == 0) + return 0; + header_size = get_tag_size(field->id); + if (0 == (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) + header_size *= count; + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + for (i = 0; i < count; i++) + rv += sint32_size(((int32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + for (i = 0; i < count; i++) + rv += int32_size(((int32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_UINT32: + for (i = 0; i < count; i++) + rv += uint32_size(((uint32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_SINT64: + for (i = 0; i < count; i++) + rv += sint64_size(((int64_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + for (i = 0; i < count; i++) + rv += uint64_size(((uint64_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + rv += 4 * count; + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + rv += 8 * count; + break; + case PROTOBUF_C_TYPE_BOOL: + rv += count; + break; + case PROTOBUF_C_TYPE_STRING: + for (i = 0; i < count; i++) { + size_t len = strlen(((char **) array)[i]); + rv += uint32_size(len) + len; + } + break; + case PROTOBUF_C_TYPE_BYTES: + for (i = 0; i < count; i++) { + size_t len = ((ProtobufCBinaryData *) array)[i].len; + rv += uint32_size(len) + len; + } + break; + case PROTOBUF_C_TYPE_MESSAGE: + for (i = 0; i < count; i++) { + size_t len = protobuf_c_message_get_packed_size( + ((ProtobufCMessage **) array)[i]); + rv += uint32_size(len) + len; + } + break; + } + + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) + header_size += uint32_size(rv); + return header_size + rv; +} + +/** + * Calculate the serialized size of an unknown field, i.e. one that is passed + * through mostly uninterpreted. This is required for forward compatibility if + * new fields are added to the message descriptor. + * + * \param field + * Unknown field type. + * \return + * Number of bytes required. + */ +static inline size_t +unknown_field_get_packed_size(const ProtobufCMessageUnknownField *field) +{ + return get_tag_size(field->tag) + field->len; +} + +/**@}*/ + +/* + * Calculate the serialized size of the message. + */ +size_t protobuf_c_message_get_packed_size(const ProtobufCMessage *message) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = + ((const char *) message) + field->offset; + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_get_packed_size(field, member); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_get_packed_size( + field, + *(const uint32_t *) qmember, + member + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_get_packed_size( + field, + *(protobuf_c_boolean *) qmember, + member + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_get_packed_size( + field, + member + ); + } else { + rv += repeated_field_get_packed_size( + field, + *(const size_t *) qmember, + member + ); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_get_packed_size(&message->unknown_fields[i]); + return rv; +} + +/** + * \defgroup pack protobuf_c_message_pack() implementation + * + * Routines mainly used by protobuf_c_message_pack(). + * + * \ingroup internal + * @{ + */ + +/** + * Pack an unsigned 32-bit integer in base-128 varint encoding and return the + * number of bytes written, which must be 5 or less. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +uint32_pack(uint32_t value, uint8_t *out) +{ + unsigned rv = 0; + + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + } + } + } + } + /* assert: value<128 */ + out[rv++] = value; + return rv; +} + +/** + * Pack a signed 32-bit integer and return the number of bytes written. + * Negative numbers are encoded as two's complement 64-bit integers. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +int32_pack(int32_t value, uint8_t *out) +{ + if (value < 0) { + out[0] = value | 0x80; + out[1] = (value >> 7) | 0x80; + out[2] = (value >> 14) | 0x80; + out[3] = (value >> 21) | 0x80; + out[4] = (value >> 28) | 0x80; + out[5] = out[6] = out[7] = out[8] = 0xff; + out[9] = 0x01; + return 10; + } else { + return uint32_pack(value, out); + } +} + +/** + * Pack a signed 32-bit integer using ZigZag encoding and return the number of + * bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +sint32_pack(int32_t value, uint8_t *out) +{ + return uint32_pack(zigzag32(value), out); +} + +/** + * Pack a 64-bit unsigned integer using base-128 varint encoding and return the + * number of bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +uint64_pack(uint64_t value, uint8_t *out) +{ + uint32_t hi = (uint32_t) (value >> 32); + uint32_t lo = (uint32_t) value; + unsigned rv; + + if (hi == 0) + return uint32_pack((uint32_t) lo, out); + out[0] = (lo) | 0x80; + out[1] = (lo >> 7) | 0x80; + out[2] = (lo >> 14) | 0x80; + out[3] = (lo >> 21) | 0x80; + if (hi < 8) { + out[4] = (hi << 4) | (lo >> 28); + return 5; + } else { + out[4] = ((hi & 7) << 4) | (lo >> 28) | 0x80; + hi >>= 3; + } + rv = 5; + while (hi >= 128) { + out[rv++] = hi | 0x80; + hi >>= 7; + } + out[rv++] = hi; + return rv; +} + +/** + * Pack a 64-bit signed integer in ZigZag encoding and return the number of + * bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +sint64_pack(int64_t value, uint8_t *out) +{ + return uint64_pack(zigzag64(value), out); +} + +/** + * Pack a 32-bit quantity in little-endian byte order. Used for protobuf wire + * types fixed32, sfixed32, float. Similar to "htole32". + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +fixed32_pack(uint32_t value, void *out) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, &value, 4); +#else + uint8_t *buf = out; + + buf[0] = value; + buf[1] = value >> 8; + buf[2] = value >> 16; + buf[3] = value >> 24; +#endif + return 4; +} + +/** + * Pack a 64-bit quantity in little-endian byte order. Used for protobuf wire + * types fixed64, sfixed64, double. Similar to "htole64". + * + * \todo The big-endian impl is really only good for 32-bit machines, a 64-bit + * version would be appreciated, plus a way to decide to use 64-bit math where + * convenient. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +fixed64_pack(uint64_t value, void *out) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, &value, 8); +#else + fixed32_pack(value, out); + fixed32_pack(value >> 32, ((char *) out) + 4); +#endif + return 8; +} + +/** + * Pack a boolean value as an integer and return the number of bytes written. + * + * \todo Perhaps on some platforms *out = !!value would be a better impl, b/c + * that is idiomatic C++ in some STL implementations. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +boolean_pack(protobuf_c_boolean value, uint8_t *out) +{ + *out = value ? TRUE : FALSE; + return 1; +} + +/** + * Pack a NUL-terminated C string and return the number of bytes written. The + * output includes a length delimiter. + * + * The NULL pointer is treated as an empty string. This isn't really necessary, + * but it allows people to leave required strings blank. (See Issue #13 in the + * bug tracker for a little more explanation). + * + * \param str + * String to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +string_pack(const char *str, uint8_t *out) +{ + if (str == NULL) { + out[0] = 0; + return 1; + } else { + size_t len = strlen(str); + size_t rv = uint32_pack(len, out); + memcpy(out + rv, str, len); + return rv + len; + } +} + +/** + * Pack a ProtobufCBinaryData and return the number of bytes written. The output + * includes a length delimiter. + * + * \param bd + * ProtobufCBinaryData to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +binary_data_pack(const ProtobufCBinaryData *bd, uint8_t *out) +{ + size_t len = bd->len; + size_t rv = uint32_pack(len, out); + memcpy(out + rv, bd->data, len); + return rv + len; +} + +/** + * Pack a ProtobufCMessage and return the number of bytes written. The output + * includes a length delimiter. + * + * \param message + * ProtobufCMessage object to pack. + * \param[out] out + * Packed message. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +prefixed_message_pack(const ProtobufCMessage *message, uint8_t *out) +{ + if (message == NULL) { + out[0] = 0; + return 1; + } else { + size_t rv = protobuf_c_message_pack(message, out + 1); + uint32_t rv_packed_size = uint32_size(rv); + if (rv_packed_size != 1) + memmove(out + rv_packed_size, out + 1, rv); + return uint32_pack(rv, out) + rv; + } +} + +/** + * Pack a field tag. + * + * Wire-type will be added in required_field_pack(). + * + * \todo Just call uint64_pack on 64-bit platforms. + * + * \param id + * Tag value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +tag_pack(uint32_t id, uint8_t *out) +{ + if (id < (1UL << (32 - 3))) + return uint32_pack(id << 3, out); + else + return uint64_pack(((uint64_t) id) << 3, out); +} + +/** + * Pack a required field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +required_field_pack(const ProtobufCFieldDescriptor *field, + const void *member, uint8_t *out) +{ + size_t rv = tag_pack(field->id, out); + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + sint32_pack(*(const int32_t *) member, out + rv); + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + int32_pack(*(const int32_t *) member, out + rv); + case PROTOBUF_C_TYPE_UINT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + uint32_pack(*(const uint32_t *) member, out + rv); + case PROTOBUF_C_TYPE_SINT64: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + sint64_pack(*(const int64_t *) member, out + rv); + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + uint64_pack(*(const uint64_t *) member, out + rv); + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + out[0] |= PROTOBUF_C_WIRE_TYPE_32BIT; + return rv + fixed32_pack(*(const uint32_t *) member, out + rv); + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + out[0] |= PROTOBUF_C_WIRE_TYPE_64BIT; + return rv + fixed64_pack(*(const uint64_t *) member, out + rv); + case PROTOBUF_C_TYPE_BOOL: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + boolean_pack(*(const protobuf_c_boolean *) member, out + rv); + case PROTOBUF_C_TYPE_STRING: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + string_pack(*(char *const *) member, out + rv); + case PROTOBUF_C_TYPE_BYTES: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + binary_data_pack((const ProtobufCBinaryData *) member, out + rv); + case PROTOBUF_C_TYPE_MESSAGE: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + prefixed_message_pack(*(ProtobufCMessage * const *) member, out + rv); + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Pack a oneof field and return the number of bytes written. Only packs the + * field that is selected by the case enum. + * + * \param field + * Field descriptor. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +oneof_field_pack(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member, uint8_t *out) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_pack(field, member, out); +} + +/** + * Pack an optional field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param has + * Whether the field is set. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +optional_field_pack(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member, uint8_t *out) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_pack(field, member, out); +} + +/** + * Pack an unlabeled field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +unlabeled_field_pack(const ProtobufCFieldDescriptor *field, + const void *member, uint8_t *out) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_pack(field, member, out); +} + +/** + * Given a field type, return the in-memory size. + * + * \todo Implement as a table lookup. + * + * \param type + * Field type. + * \return + * Size of the field. + */ +static inline size_t +sizeof_elt_in_repeated_array(ProtobufCType type) +{ + switch (type) { + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + case PROTOBUF_C_TYPE_ENUM: + return 4; + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + return 8; + case PROTOBUF_C_TYPE_BOOL: + return sizeof(protobuf_c_boolean); + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_MESSAGE: + return sizeof(void *); + case PROTOBUF_C_TYPE_BYTES: + return sizeof(ProtobufCBinaryData); + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Pack an array of 32-bit quantities. + * + * \param[out] out + * Destination. + * \param[in] in + * Source. + * \param[in] n + * Number of elements in the source array. + */ +static void +copy_to_little_endian_32(void *out, const void *in, const unsigned n) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, in, n * 4); +#else + unsigned i; + const uint32_t *ini = in; + for (i = 0; i < n; i++) + fixed32_pack(ini[i], (uint32_t *) out + i); +#endif +} + +/** + * Pack an array of 64-bit quantities. + * + * \param[out] out + * Destination. + * \param[in] in + * Source. + * \param[in] n + * Number of elements in the source array. + */ +static void +copy_to_little_endian_64(void *out, const void *in, const unsigned n) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, in, n * 8); +#else + unsigned i; + const uint64_t *ini = in; + for (i = 0; i < n; i++) + fixed64_pack(ini[i], (uint64_t *) out + i); +#endif +} + +/** + * Get the minimum number of bytes required to pack a field value of a + * particular type. + * + * \param type + * Field type. + * \return + * Number of bytes. + */ +static unsigned +get_type_min_size(ProtobufCType type) +{ + if (type == PROTOBUF_C_TYPE_SFIXED32 || + type == PROTOBUF_C_TYPE_FIXED32 || + type == PROTOBUF_C_TYPE_FLOAT) + { + return 4; + } + if (type == PROTOBUF_C_TYPE_SFIXED64 || + type == PROTOBUF_C_TYPE_FIXED64 || + type == PROTOBUF_C_TYPE_DOUBLE) + { + return 8; + } + return 1; +} + +/** + * Packs the elements of a repeated field and returns the serialised field and + * its length. + * + * \param field + * Field descriptor. + * \param count + * Number of elements in the repeated field array. + * \param member + * Pointer to the elements for this repeated field. + * \param[out] out + * Serialised representation of the repeated field. + * \return + * Number of bytes serialised to `out`. + */ +static size_t +repeated_field_pack(const ProtobufCFieldDescriptor *field, + size_t count, const void *member, uint8_t *out) +{ + void *array = *(void * const *) member; + unsigned i; + + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) { + unsigned header_len; + unsigned len_start; + unsigned min_length; + unsigned payload_len; + unsigned length_size_min; + unsigned actual_length_size; + uint8_t *payload_at; + + if (count == 0) + return 0; + header_len = tag_pack(field->id, out); + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + len_start = header_len; + min_length = get_type_min_size(field->type) * count; + length_size_min = uint32_size(min_length); + header_len += length_size_min; + payload_at = out + header_len; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + copy_to_little_endian_32(payload_at, array, count); + payload_at += count * 4; + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + copy_to_little_endian_64(payload_at, array, count); + payload_at += count * 8; + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + payload_at += int32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_SINT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + payload_at += sint32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_SINT64: { + const int64_t *arr = (const int64_t *) array; + for (i = 0; i < count; i++) + payload_at += sint64_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_UINT32: { + const uint32_t *arr = (const uint32_t *) array; + for (i = 0; i < count; i++) + payload_at += uint32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: { + const uint64_t *arr = (const uint64_t *) array; + for (i = 0; i < count; i++) + payload_at += uint64_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_BOOL: { + const protobuf_c_boolean *arr = (const protobuf_c_boolean *) array; + for (i = 0; i < count; i++) + payload_at += boolean_pack(arr[i], payload_at); + break; + } + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + + payload_len = payload_at - (out + header_len); + actual_length_size = uint32_size(payload_len); + if (length_size_min != actual_length_size) { + assert(actual_length_size == length_size_min + 1); + memmove(out + header_len + 1, out + header_len, + payload_len); + header_len++; + } + uint32_pack(payload_len, out + len_start); + return header_len + payload_len; + } else { + /* not "packed" cased */ + /* CONSIDER: optimize this case a bit (by putting the loop inside the switch) */ + size_t rv = 0; + unsigned siz = sizeof_elt_in_repeated_array(field->type); + + for (i = 0; i < count; i++) { + rv += required_field_pack(field, array, out + rv); + array = (char *)array + siz; + } + return rv; + } +} + +static size_t +unknown_field_pack(const ProtobufCMessageUnknownField *field, uint8_t *out) +{ + size_t rv = tag_pack(field->tag, out); + out[0] |= field->wire_type; + memcpy(out + rv, field->data, field->len); + return rv + field->len; +} + +/**@}*/ + +size_t +protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = ((const char *) message) + field->offset; + + /* + * It doesn't hurt to compute qmember (a pointer to the + * quantifier field of the structure), but the pointer is only + * valid if the field is: + * - a repeated field, or + * - a field that is part of a oneof + * - an optional field that isn't a pointer type + * (Meaning: not a message or a string). + */ + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_pack(field, member, out + rv); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_pack( + field, + *(const uint32_t *) qmember, + member, + out + rv + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_pack( + field, + *(const protobuf_c_boolean *) qmember, + member, + out + rv + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_pack(field, member, out + rv); + } else { + rv += repeated_field_pack(field, *(const size_t *) qmember, + member, out + rv); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_pack(&message->unknown_fields[i], out + rv); + return rv; +} + +/** + * \defgroup packbuf protobuf_c_message_pack_to_buffer() implementation + * + * Routines mainly used by protobuf_c_message_pack_to_buffer(). + * + * \ingroup internal + * @{ + */ + +/** + * Pack a required field to a virtual buffer. + * + * \param field + * Field descriptor. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes packed. + */ +static size_t +required_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const void *member, ProtobufCBuffer *buffer) +{ + size_t rv; + uint8_t scratch[MAX_UINT64_ENCODED_SIZE * 2]; + + rv = tag_pack(field->id, scratch); + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += sint32_pack(*(const int32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += int32_pack(*(const int32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_UINT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += uint32_pack(*(const uint32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SINT64: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += sint64_pack(*(const int64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += uint64_pack(*(const uint64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_32BIT; + rv += fixed32_pack(*(const uint32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_64BIT; + rv += fixed64_pack(*(const uint64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_BOOL: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += boolean_pack(*(const protobuf_c_boolean *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_STRING: { + const char *str = *(char *const *) member; + size_t sublen = str ? strlen(str) : 0; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, (const uint8_t *) str); + rv += sublen; + break; + } + case PROTOBUF_C_TYPE_BYTES: { + const ProtobufCBinaryData *bd = ((const ProtobufCBinaryData *) member); + size_t sublen = bd->len; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, bd->data); + rv += sublen; + break; + } + case PROTOBUF_C_TYPE_MESSAGE: { + uint8_t simple_buffer_scratch[256]; + size_t sublen; + const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member; + ProtobufCBufferSimple simple_buffer = + PROTOBUF_C_BUFFER_SIMPLE_INIT(simple_buffer_scratch); + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + if (msg == NULL) + sublen = 0; + else + sublen = protobuf_c_message_pack_to_buffer(msg, &simple_buffer.base); + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, simple_buffer.data); + rv += sublen; + PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple_buffer); + break; + } + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; +} + +/** + * Pack a oneof field to a buffer. Only packs the field that is selected by the case enum. + * + * \param field + * Field descriptor. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +oneof_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member, ProtobufCBuffer *buffer) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void *const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Pack an optional field to a buffer. + * + * \param field + * Field descriptor. + * \param has + * Whether the field is set. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +optional_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member, ProtobufCBuffer *buffer) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void *const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Pack an unlabeled field to a buffer. + * + * \param field + * Field descriptor. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +unlabeled_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const void *member, ProtobufCBuffer *buffer) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Get the packed size of an array of same field type. + * + * \param field + * Field descriptor. + * \param count + * Number of elements of this type. + * \param array + * The elements to get the size of. + * \return + * Number of bytes required. + */ +static size_t +get_packed_payload_length(const ProtobufCFieldDescriptor *field, + unsigned count, const void *array) +{ + unsigned rv = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + return count * 4; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + return count * 8; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + rv += int32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_SINT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + rv += sint32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_UINT32: { + const uint32_t *arr = (const uint32_t *) array; + for (i = 0; i < count; i++) + rv += uint32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_SINT64: { + const int64_t *arr = (const int64_t *) array; + for (i = 0; i < count; i++) + rv += sint64_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: { + const uint64_t *arr = (const uint64_t *) array; + for (i = 0; i < count; i++) + rv += uint64_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_BOOL: + return count; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; +} + +/** + * Pack an array of same field type to a virtual buffer. + * + * \param field + * Field descriptor. + * \param count + * Number of elements of this type. + * \param array + * The elements to get the size of. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes packed. + */ +static size_t +pack_buffer_packed_payload(const ProtobufCFieldDescriptor *field, + unsigned count, const void *array, + ProtobufCBuffer *buffer) +{ + uint8_t scratch[16]; + size_t rv = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: +#if !defined(WORDS_BIGENDIAN) + rv = count * 4; + goto no_packing_needed; +#else + for (i = 0; i < count; i++) { + unsigned len = fixed32_pack(((uint32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; +#endif + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: +#if !defined(WORDS_BIGENDIAN) + rv = count * 8; + goto no_packing_needed; +#else + for (i = 0; i < count; i++) { + unsigned len = fixed64_pack(((uint64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; +#endif + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + for (i = 0; i < count; i++) { + unsigned len = int32_pack(((int32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_SINT32: + for (i = 0; i < count; i++) { + unsigned len = sint32_pack(((int32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_UINT32: + for (i = 0; i < count; i++) { + unsigned len = uint32_pack(((uint32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_SINT64: + for (i = 0; i < count; i++) { + unsigned len = sint64_pack(((int64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + for (i = 0; i < count; i++) { + unsigned len = uint64_pack(((uint64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_BOOL: + for (i = 0; i < count; i++) { + unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + return count; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; + +#if !defined(WORDS_BIGENDIAN) +no_packing_needed: + buffer->append(buffer, rv, array); + return rv; +#endif +} + +static size_t +repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + unsigned count, const void *member, + ProtobufCBuffer *buffer) +{ + char *array = *(char * const *) member; + + if (count == 0) + return 0; + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) { + uint8_t scratch[MAX_UINT64_ENCODED_SIZE * 2]; + size_t rv = tag_pack(field->id, scratch); + size_t payload_len = get_packed_payload_length(field, count, array); + size_t tmp; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(payload_len, scratch + rv); + buffer->append(buffer, rv, scratch); + tmp = pack_buffer_packed_payload(field, count, array, buffer); + assert(tmp == payload_len); + return rv + payload_len; + } else { + size_t siz; + unsigned i; + /* CONSIDER: optimize this case a bit (by putting the loop inside the switch) */ + unsigned rv = 0; + + siz = sizeof_elt_in_repeated_array(field->type); + for (i = 0; i < count; i++) { + rv += required_field_pack_to_buffer(field, array, buffer); + array += siz; + } + return rv; + } +} + +static size_t +unknown_field_pack_to_buffer(const ProtobufCMessageUnknownField *field, + ProtobufCBuffer *buffer) +{ + uint8_t header[MAX_UINT64_ENCODED_SIZE]; + size_t rv = tag_pack(field->tag, header); + + header[0] |= field->wire_type; + buffer->append(buffer, rv, header); + buffer->append(buffer, field->len, field->data); + return rv + field->len; +} + +/**@}*/ + +size_t +protobuf_c_message_pack_to_buffer(const ProtobufCMessage *message, + ProtobufCBuffer *buffer) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = + ((const char *) message) + field->offset; + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_pack_to_buffer(field, member, buffer); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_pack_to_buffer( + field, + *(const uint32_t *) qmember, + member, + buffer + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_pack_to_buffer( + field, + *(const protobuf_c_boolean *) qmember, + member, + buffer + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_pack_to_buffer( + field, + member, + buffer + ); + } else { + rv += repeated_field_pack_to_buffer( + field, + *(const size_t *) qmember, + member, + buffer + ); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_pack_to_buffer(&message->unknown_fields[i], buffer); + + return rv; +} + +/** + * \defgroup unpack unpacking implementation + * + * Routines mainly used by the unpacking functions. + * + * \ingroup internal + * @{ + */ + +static inline int +int_range_lookup(unsigned n_ranges, const ProtobufCIntRange *ranges, int value) +{ + unsigned n; + unsigned start; + + if (n_ranges == 0) + return -1; + start = 0; + n = n_ranges; + while (n > 1) { + unsigned mid = start + n / 2; + + if (value < ranges[mid].start_value) { + n = mid - start; + } else if (value >= ranges[mid].start_value + + (int) (ranges[mid + 1].orig_index - + ranges[mid].orig_index)) + { + unsigned new_start = mid + 1; + n = start + n - new_start; + start = new_start; + } else + return (value - ranges[mid].start_value) + + ranges[mid].orig_index; + } + if (n > 0) { + unsigned start_orig_index = ranges[start].orig_index; + unsigned range_size = + ranges[start + 1].orig_index - start_orig_index; + + if (ranges[start].start_value <= value && + value < (int) (ranges[start].start_value + range_size)) + { + return (value - ranges[start].start_value) + + start_orig_index; + } + } + return -1; +} + +static size_t +parse_tag_and_wiretype(size_t len, + const uint8_t *data, + uint32_t *tag_out, + ProtobufCWireType *wiretype_out) +{ + unsigned max_rv = len > 5 ? 5 : len; + uint32_t tag = (data[0] & 0x7f) >> 3; + unsigned shift = 4; + unsigned rv; + + *wiretype_out = data[0] & 7; + if ((data[0] & 0x80) == 0) { + *tag_out = tag; + return 1; + } + for (rv = 1; rv < max_rv; rv++) { + if (data[rv] & 0x80) { + tag |= (data[rv] & 0x7f) << shift; + shift += 7; + } else { + tag |= data[rv] << shift; + *tag_out = tag; + return rv + 1; + } + } + return 0; /* error: bad header */ +} + +/* sizeof(ScannedMember) must be <= (1UL<<BOUND_SIZEOF_SCANNED_MEMBER_LOG2) */ +#define BOUND_SIZEOF_SCANNED_MEMBER_LOG2 5 +typedef struct _ScannedMember ScannedMember; +/** Field as it's being read. */ +struct _ScannedMember { + uint32_t tag; /**< Field tag. */ + uint8_t wire_type; /**< Field type. */ + uint8_t length_prefix_len; /**< Prefix length. */ + const ProtobufCFieldDescriptor *field; /**< Field descriptor. */ + size_t len; /**< Field length. */ + const uint8_t *data; /**< Pointer to field data. */ +}; + +static inline uint32_t +scan_length_prefixed_data(size_t len, const uint8_t *data, + size_t *prefix_len_out) +{ + unsigned hdr_max = len < 5 ? len : 5; + unsigned hdr_len; + uint32_t val = 0; + unsigned i; + unsigned shift = 0; + + for (i = 0; i < hdr_max; i++) { + val |= (data[i] & 0x7f) << shift; + shift += 7; + if ((data[i] & 0x80) == 0) + break; + } + if (i == hdr_max) { + PROTOBUF_C_UNPACK_ERROR("error parsing length for length-prefixed data"); + return 0; + } + hdr_len = i + 1; + *prefix_len_out = hdr_len; + if (hdr_len + val > len) { + PROTOBUF_C_UNPACK_ERROR("data too short after length-prefix of %u", val); + return 0; + } + return hdr_len + val; +} + +static size_t +max_b128_numbers(size_t len, const uint8_t *data) +{ + size_t rv = 0; + while (len--) + if ((*data++ & 0x80) == 0) + ++rv; + return rv; +} + +/**@}*/ + +/** + * Merge earlier message into a latter message. + * + * For numeric types and strings, if the same value appears multiple + * times, the parser accepts the last value it sees. For embedded + * message fields, the parser merges multiple instances of the same + * field. That is, all singular scalar fields in the latter instance + * replace those in the former, singular embedded messages are merged, + * and repeated fields are concatenated. + * + * The earlier message should be freed after calling this function, as + * some of its fields may have been reused and changed to their default + * values during the merge. + */ +static protobuf_c_boolean +merge_messages(ProtobufCMessage *earlier_msg, + ProtobufCMessage *latter_msg, + ProtobufCAllocator *allocator) +{ + unsigned i; + const ProtobufCFieldDescriptor *fields = + latter_msg->descriptor->fields; + for (i = 0; i < latter_msg->descriptor->n_fields; i++) { + if (fields[i].label == PROTOBUF_C_LABEL_REPEATED) { + size_t *n_earlier = + STRUCT_MEMBER_PTR(size_t, earlier_msg, + fields[i].quantifier_offset); + uint8_t **p_earlier = + STRUCT_MEMBER_PTR(uint8_t *, earlier_msg, + fields[i].offset); + size_t *n_latter = + STRUCT_MEMBER_PTR(size_t, latter_msg, + fields[i].quantifier_offset); + uint8_t **p_latter = + STRUCT_MEMBER_PTR(uint8_t *, latter_msg, + fields[i].offset); + + if (*n_earlier > 0) { + if (*n_latter > 0) { + /* Concatenate the repeated field */ + size_t el_size = + sizeof_elt_in_repeated_array(fields[i].type); + uint8_t *new_field; + + new_field = do_alloc(allocator, + (*n_earlier + *n_latter) * el_size); + if (!new_field) + return FALSE; + + memcpy(new_field, *p_earlier, + *n_earlier * el_size); + memcpy(new_field + + *n_earlier * el_size, + *p_latter, + *n_latter * el_size); + + do_free(allocator, *p_latter); + do_free(allocator, *p_earlier); + *p_latter = new_field; + *n_latter = *n_earlier + *n_latter; + } else { + /* Zero copy the repeated field from the earlier message */ + *n_latter = *n_earlier; + *p_latter = *p_earlier; + } + /* Make sure the field does not get double freed */ + *n_earlier = 0; + *p_earlier = 0; + } + } else if (fields[i].label == PROTOBUF_C_LABEL_OPTIONAL || + fields[i].label == PROTOBUF_C_LABEL_NONE) { + const ProtobufCFieldDescriptor *field; + uint32_t *earlier_case_p = STRUCT_MEMBER_PTR(uint32_t, + earlier_msg, + fields[i]. + quantifier_offset); + uint32_t *latter_case_p = STRUCT_MEMBER_PTR(uint32_t, + latter_msg, + fields[i]. + quantifier_offset); + protobuf_c_boolean need_to_merge = FALSE; + void *earlier_elem; + void *latter_elem; + const void *def_val; + + if (fields[i].flags & PROTOBUF_C_FIELD_FLAG_ONEOF) { + if (*latter_case_p == 0) { + /* lookup correct oneof field */ + int field_index = + int_range_lookup( + latter_msg->descriptor + ->n_field_ranges, + latter_msg->descriptor + ->field_ranges, + *earlier_case_p); + field = latter_msg->descriptor->fields + + field_index; + } else { + /* Oneof is present in the latter message, move on */ + continue; + } + } else { + field = &fields[i]; + } + + earlier_elem = STRUCT_MEMBER_P(earlier_msg, field->offset); + latter_elem = STRUCT_MEMBER_P(latter_msg, field->offset); + def_val = field->default_value; + + switch (field->type) { + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage *em = *(ProtobufCMessage **) earlier_elem; + ProtobufCMessage *lm = *(ProtobufCMessage **) latter_elem; + if (em != NULL) { + if (lm != NULL) { + if (!merge_messages(em, lm, allocator)) + return FALSE; + /* Already merged */ + need_to_merge = FALSE; + } else { + /* Zero copy the message */ + need_to_merge = TRUE; + } + } + break; + } + case PROTOBUF_C_TYPE_BYTES: { + uint8_t *e_data = + ((ProtobufCBinaryData *) earlier_elem)->data; + uint8_t *l_data = + ((ProtobufCBinaryData *) latter_elem)->data; + const ProtobufCBinaryData *d_bd = + (ProtobufCBinaryData *) def_val; + + need_to_merge = + (e_data != NULL && + (d_bd == NULL || + e_data != d_bd->data)) && + (l_data == NULL || + (d_bd != NULL && + l_data == d_bd->data)); + break; + } + case PROTOBUF_C_TYPE_STRING: { + char *e_str = *(char **) earlier_elem; + char *l_str = *(char **) latter_elem; + const char *d_str = def_val; + + need_to_merge = e_str != d_str && l_str == d_str; + break; + } + default: { + /* Could be has field or case enum, the logic is + * equivalent, since 0 (FALSE) means not set for + * oneof */ + need_to_merge = (*earlier_case_p != 0) && + (*latter_case_p == 0); + break; + } + } + + if (need_to_merge) { + size_t el_size = + sizeof_elt_in_repeated_array(field->type); + memcpy(latter_elem, earlier_elem, el_size); + /* + * Reset the element from the old message to 0 + * to make sure earlier message deallocation + * doesn't corrupt zero-copied data in the new + * message, earlier message will be freed after + * this function is called anyway + */ + memset(earlier_elem, 0, el_size); + + if (field->quantifier_offset != 0) { + /* Set the has field or the case enum, + * if applicable */ + *latter_case_p = *earlier_case_p; + *earlier_case_p = 0; + } + } + } + } + return TRUE; +} + +/** + * Count packed elements. + * + * Given a raw slab of packed-repeated values, determine the number of + * elements. This function detects certain kinds of errors but not + * others; the remaining error checking is done by + * parse_packed_repeated_member(). + */ +static protobuf_c_boolean +count_packed_elements(ProtobufCType type, + size_t len, const uint8_t *data, size_t *count_out) +{ + switch (type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + if (len % 4 != 0) { + PROTOBUF_C_UNPACK_ERROR("length must be a multiple of 4 for fixed-length 32-bit types"); + return FALSE; + } + *count_out = len / 4; + return TRUE; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + if (len % 8 != 0) { + PROTOBUF_C_UNPACK_ERROR("length must be a multiple of 8 for fixed-length 64-bit types"); + return FALSE; + } + *count_out = len / 8; + return TRUE; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_UINT64: + *count_out = max_b128_numbers(len, data); + return TRUE; + case PROTOBUF_C_TYPE_BOOL: + *count_out = len; + return TRUE; + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_BYTES: + case PROTOBUF_C_TYPE_MESSAGE: + default: + PROTOBUF_C_UNPACK_ERROR("bad protobuf-c type %u for packed-repeated", type); + return FALSE; + } +} + +static inline uint32_t +parse_uint32(unsigned len, const uint8_t *data) +{ + uint32_t rv = data[0] & 0x7f; + if (len > 1) { + rv |= ((uint32_t) (data[1] & 0x7f) << 7); + if (len > 2) { + rv |= ((uint32_t) (data[2] & 0x7f) << 14); + if (len > 3) { + rv |= ((uint32_t) (data[3] & 0x7f) << 21); + if (len > 4) + rv |= ((uint32_t) (data[4]) << 28); + } + } + } + return rv; +} + +static inline uint32_t +parse_int32(unsigned len, const uint8_t *data) +{ + return parse_uint32(len, data); +} + +static inline int32_t +unzigzag32(uint32_t v) +{ + if (v & 1) + return -(v >> 1) - 1; + else + return v >> 1; +} + +static inline uint32_t +parse_fixed_uint32(const uint8_t *data) +{ +#if !defined(WORDS_BIGENDIAN) + uint32_t t; + memcpy(&t, data, 4); + return t; +#else + return data[0] | + ((uint32_t) (data[1]) << 8) | + ((uint32_t) (data[2]) << 16) | + ((uint32_t) (data[3]) << 24); +#endif +} + +static uint64_t +parse_uint64(unsigned len, const uint8_t *data) +{ + unsigned shift, i; + uint64_t rv; + + if (len < 5) + return parse_uint32(len, data); + rv = ((uint64_t) (data[0] & 0x7f)) | + ((uint64_t) (data[1] & 0x7f) << 7) | + ((uint64_t) (data[2] & 0x7f) << 14) | + ((uint64_t) (data[3] & 0x7f) << 21); + shift = 28; + for (i = 4; i < len; i++) { + rv |= (((uint64_t) (data[i] & 0x7f)) << shift); + shift += 7; + } + return rv; +} + +static inline int64_t +unzigzag64(uint64_t v) +{ + if (v & 1) + return -(v >> 1) - 1; + else + return v >> 1; +} + +static inline uint64_t +parse_fixed_uint64(const uint8_t *data) +{ +#if !defined(WORDS_BIGENDIAN) + uint64_t t; + memcpy(&t, data, 8); + return t; +#else + return (uint64_t) parse_fixed_uint32(data) | + (((uint64_t) parse_fixed_uint32(data + 4)) << 32); +#endif +} + +static protobuf_c_boolean +parse_boolean(unsigned len, const uint8_t *data) +{ + unsigned i; + for (i = 0; i < len; i++) + if (data[i] & 0x7f) + return TRUE; + return FALSE; +} + +static protobuf_c_boolean +parse_required_member(ScannedMember *scanned_member, + void *member, + ProtobufCAllocator *allocator, + protobuf_c_boolean maybe_clear) +{ + unsigned len = scanned_member->len; + const uint8_t *data = scanned_member->data; + ProtobufCWireType wire_type = scanned_member->wire_type; + + switch (scanned_member->field->type) { + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int32_t *) member = parse_int32(len, data); + return TRUE; + case PROTOBUF_C_TYPE_UINT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(uint32_t *) member = parse_uint32(len, data); + return TRUE; + case PROTOBUF_C_TYPE_SINT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int32_t *) member = unzigzag32(parse_uint32(len, data)); + return TRUE; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + if (wire_type != PROTOBUF_C_WIRE_TYPE_32BIT) + return FALSE; + *(uint32_t *) member = parse_fixed_uint32(data); + return TRUE; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(uint64_t *) member = parse_uint64(len, data); + return TRUE; + case PROTOBUF_C_TYPE_SINT64: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int64_t *) member = unzigzag64(parse_uint64(len, data)); + return TRUE; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + if (wire_type != PROTOBUF_C_WIRE_TYPE_64BIT) + return FALSE; + *(uint64_t *) member = parse_fixed_uint64(data); + return TRUE; + case PROTOBUF_C_TYPE_BOOL: + *(protobuf_c_boolean *) member = parse_boolean(len, data); + return TRUE; + case PROTOBUF_C_TYPE_STRING: { + char **pstr = member; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + if (maybe_clear && *pstr != NULL) { + const char *def = scanned_member->field->default_value; + if (*pstr != NULL && *pstr != def) + do_free(allocator, *pstr); + } + *pstr = do_alloc(allocator, len - pref_len + 1); + if (*pstr == NULL) + return FALSE; + memcpy(*pstr, data + pref_len, len - pref_len); + (*pstr)[len - pref_len] = 0; + return TRUE; + } + case PROTOBUF_C_TYPE_BYTES: { + ProtobufCBinaryData *bd = member; + const ProtobufCBinaryData *def_bd; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + def_bd = scanned_member->field->default_value; + if (maybe_clear && + bd->data != NULL && + (def_bd == NULL || bd->data != def_bd->data)) + { + do_free(allocator, bd->data); + } + if (len - pref_len > 0) { + bd->data = do_alloc(allocator, len - pref_len); + if (bd->data == NULL) + return FALSE; + memcpy(bd->data, data + pref_len, len - pref_len); + } else { + bd->data = NULL; + } + bd->len = len - pref_len; + return TRUE; + } + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage **pmessage = member; + ProtobufCMessage *subm; + const ProtobufCMessage *def_mess; + protobuf_c_boolean merge_successful = TRUE; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + def_mess = scanned_member->field->default_value; + subm = protobuf_c_message_unpack(scanned_member->field->descriptor, + allocator, + len - pref_len, + data + pref_len); + + if (maybe_clear && + *pmessage != NULL && + *pmessage != def_mess) + { + if (subm != NULL) + merge_successful = merge_messages(*pmessage, subm, allocator); + /* Delete the previous message */ + protobuf_c_message_free_unpacked(*pmessage, allocator); + } + *pmessage = subm; + if (subm == NULL || !merge_successful) + return FALSE; + return TRUE; + } + } + return FALSE; +} + +static protobuf_c_boolean +parse_oneof_member (ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + uint32_t *oneof_case = STRUCT_MEMBER_PTR(uint32_t, message, + scanned_member->field->quantifier_offset); + + /* If we have already parsed a member of this oneof, free it. */ + if (*oneof_case != 0) { + /* lookup field */ + int field_index = + int_range_lookup(message->descriptor->n_field_ranges, + message->descriptor->field_ranges, + *oneof_case); + const ProtobufCFieldDescriptor *old_field = + message->descriptor->fields + field_index; + size_t el_size = sizeof_elt_in_repeated_array(old_field->type); + + switch (old_field->type) { + case PROTOBUF_C_TYPE_STRING: { + char **pstr = member; + const char *def = old_field->default_value; + if (*pstr != NULL && *pstr != def) + do_free(allocator, *pstr); + break; + } + case PROTOBUF_C_TYPE_BYTES: { + ProtobufCBinaryData *bd = member; + const ProtobufCBinaryData *def_bd = old_field->default_value; + if (bd->data != NULL && + (def_bd == NULL || bd->data != def_bd->data)) + { + do_free(allocator, bd->data); + } + break; + } + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage **pmessage = member; + const ProtobufCMessage *def_mess = old_field->default_value; + if (*pmessage != NULL && *pmessage != def_mess) + protobuf_c_message_free_unpacked(*pmessage, allocator); + break; + } + default: + break; + } + + memset (member, 0, el_size); + } + if (!parse_required_member (scanned_member, member, allocator, TRUE)) + return FALSE; + + *oneof_case = scanned_member->tag; + return TRUE; +} + + +static protobuf_c_boolean +parse_optional_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + if (!parse_required_member(scanned_member, member, allocator, TRUE)) + return FALSE; + if (scanned_member->field->quantifier_offset != 0) + STRUCT_MEMBER(protobuf_c_boolean, + message, + scanned_member->field->quantifier_offset) = TRUE; + return TRUE; +} + +static protobuf_c_boolean +parse_repeated_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + size_t *p_n = STRUCT_MEMBER_PTR(size_t, message, field->quantifier_offset); + size_t siz = sizeof_elt_in_repeated_array(field->type); + char *array = *(char **) member; + + if (!parse_required_member(scanned_member, array + siz * (*p_n), + allocator, FALSE)) + { + return FALSE; + } + *p_n += 1; + return TRUE; +} + +static unsigned +scan_varint(unsigned len, const uint8_t *data) +{ + unsigned i; + if (len > 10) + len = 10; + for (i = 0; i < len; i++) + if ((data[i] & 0x80) == 0) + break; + if (i == len) + return 0; + return i + 1; +} + +static protobuf_c_boolean +parse_packed_repeated_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + size_t *p_n = STRUCT_MEMBER_PTR(size_t, message, field->quantifier_offset); + size_t siz = sizeof_elt_in_repeated_array(field->type); + void *array = *(char **) member + siz * (*p_n); + const uint8_t *at = scanned_member->data + scanned_member->length_prefix_len; + size_t rem = scanned_member->len - scanned_member->length_prefix_len; + size_t count = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + count = (scanned_member->len - scanned_member->length_prefix_len) / 4; +#if !defined(WORDS_BIGENDIAN) + goto no_unpacking_needed; +#else + for (i = 0; i < count; i++) { + ((uint32_t *) array)[i] = parse_fixed_uint32(at); + at += 4; + } + break; +#endif + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + count = (scanned_member->len - scanned_member->length_prefix_len) / 8; +#if !defined(WORDS_BIGENDIAN) + goto no_unpacking_needed; +#else + for (i = 0; i < count; i++) { + ((uint64_t *) array)[i] = parse_fixed_uint64(at); + at += 8; + } + break; +#endif + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated int32 value"); + return FALSE; + } + ((int32_t *) array)[count++] = parse_int32(s, at); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_SINT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated sint32 value"); + return FALSE; + } + ((int32_t *) array)[count++] = unzigzag32(parse_uint32(s, at)); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_UINT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated enum or uint32 value"); + return FALSE; + } + ((uint32_t *) array)[count++] = parse_uint32(s, at); + at += s; + rem -= s; + } + break; + + case PROTOBUF_C_TYPE_SINT64: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated sint64 value"); + return FALSE; + } + ((int64_t *) array)[count++] = unzigzag64(parse_uint64(s, at)); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated int64/uint64 value"); + return FALSE; + } + ((int64_t *) array)[count++] = parse_uint64(s, at); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_BOOL: + count = rem; + for (i = 0; i < count; i++) { + if (at[i] > 1) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated boolean value"); + return FALSE; + } + ((protobuf_c_boolean *) array)[i] = at[i]; + } + break; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + *p_n += count; + return TRUE; + +#if !defined(WORDS_BIGENDIAN) +no_unpacking_needed: + memcpy(array, at, count * siz); + *p_n += count; + return TRUE; +#endif +} + +static protobuf_c_boolean +is_packable_type(ProtobufCType type) +{ + return + type != PROTOBUF_C_TYPE_STRING && + type != PROTOBUF_C_TYPE_BYTES && + type != PROTOBUF_C_TYPE_MESSAGE; +} + +static protobuf_c_boolean +parse_member(ScannedMember *scanned_member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + void *member; + + if (field == NULL) { + ProtobufCMessageUnknownField *ufield = + message->unknown_fields + + (message->n_unknown_fields++); + ufield->tag = scanned_member->tag; + ufield->wire_type = scanned_member->wire_type; + ufield->len = scanned_member->len; + ufield->data = do_alloc(allocator, scanned_member->len); + if (ufield->data == NULL) + return FALSE; + memcpy(ufield->data, scanned_member->data, ufield->len); + return TRUE; + } + member = (char *) message + field->offset; + switch (field->label) { + case PROTOBUF_C_LABEL_REQUIRED: + return parse_required_member(scanned_member, member, + allocator, TRUE); + case PROTOBUF_C_LABEL_OPTIONAL: + case PROTOBUF_C_LABEL_NONE: + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF)) { + return parse_oneof_member(scanned_member, member, + message, allocator); + } else { + return parse_optional_member(scanned_member, member, + message, allocator); + } + case PROTOBUF_C_LABEL_REPEATED: + if (scanned_member->wire_type == + PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED) || + is_packable_type(field->type))) + { + return parse_packed_repeated_member(scanned_member, + member, message); + } else { + return parse_repeated_member(scanned_member, + member, message, + allocator); + } + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Initialise messages generated by old code. + * + * This function is used if desc->message_init == NULL (which occurs + * for old code, and which would be useful to support allocating + * descriptors dynamically). + */ +static void +message_init_generic(const ProtobufCMessageDescriptor *desc, + ProtobufCMessage *message) +{ + unsigned i; + + memset(message, 0, desc->sizeof_message); + message->descriptor = desc; + for (i = 0; i < desc->n_fields; i++) { + if (desc->fields[i].default_value != NULL && + desc->fields[i].label != PROTOBUF_C_LABEL_REPEATED) + { + void *field = + STRUCT_MEMBER_P(message, desc->fields[i].offset); + const void *dv = desc->fields[i].default_value; + + switch (desc->fields[i].type) { + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + case PROTOBUF_C_TYPE_ENUM: + memcpy(field, dv, 4); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + memcpy(field, dv, 8); + break; + case PROTOBUF_C_TYPE_BOOL: + memcpy(field, dv, sizeof(protobuf_c_boolean)); + break; + case PROTOBUF_C_TYPE_BYTES: + memcpy(field, dv, sizeof(ProtobufCBinaryData)); + break; + + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_MESSAGE: + /* + * The next line essentially implements a cast + * from const, which is totally unavoidable. + */ + *(const void **) field = dv; + break; + } + } + } +} + +/**@}*/ + +/* + * ScannedMember slabs (an unpacking implementation detail). Before doing real + * unpacking, we first scan through the elements to see how many there are (for + * repeated fields), and which field to use (for non-repeated fields given + * twice). + * + * In order to avoid allocations for small messages, we keep a stack-allocated + * slab of ScannedMembers of size FIRST_SCANNED_MEMBER_SLAB_SIZE (16). After we + * fill that up, we allocate each slab twice as large as the previous one. + */ +#define FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2 4 + +/* + * The number of slabs, including the stack-allocated ones; choose the number so + * that we would overflow if we needed a slab larger than provided. + */ +#define MAX_SCANNED_MEMBER_SLAB \ + (sizeof(unsigned int)*8 - 1 \ + - BOUND_SIZEOF_SCANNED_MEMBER_LOG2 \ + - FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2) + +#define REQUIRED_FIELD_BITMAP_SET(index) \ + (required_fields_bitmap[(index)/8] |= (1UL<<((index)%8))) + +#define REQUIRED_FIELD_BITMAP_IS_SET(index) \ + (required_fields_bitmap[(index)/8] & (1UL<<((index)%8))) + +ProtobufCMessage * +protobuf_c_message_unpack(const ProtobufCMessageDescriptor *desc, + ProtobufCAllocator *allocator, + size_t len, const uint8_t *data) +{ + ProtobufCMessage *rv; + size_t rem = len; + const uint8_t *at = data; + const ProtobufCFieldDescriptor *last_field = desc->fields + 0; + ScannedMember first_member_slab[1UL << + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2]; + + /* + * scanned_member_slabs[i] is an array of arrays of ScannedMember. + * The first slab (scanned_member_slabs[0] is just a pointer to + * first_member_slab), above. All subsequent slabs will be allocated + * using the allocator. + */ + ScannedMember *scanned_member_slabs[MAX_SCANNED_MEMBER_SLAB + 1]; + unsigned which_slab = 0; /* the slab we are currently populating */ + unsigned in_slab_index = 0; /* number of members in the slab */ + size_t n_unknown = 0; + unsigned f; + unsigned j; + unsigned i_slab; + unsigned last_field_index = 0; + unsigned required_fields_bitmap_len; + unsigned char required_fields_bitmap_stack[16]; + unsigned char *required_fields_bitmap = required_fields_bitmap_stack; + protobuf_c_boolean required_fields_bitmap_alloced = FALSE; + + ASSERT_IS_MESSAGE_DESCRIPTOR(desc); + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + + rv = do_alloc(allocator, desc->sizeof_message); + if (!rv) + return (NULL); + scanned_member_slabs[0] = first_member_slab; + + required_fields_bitmap_len = (desc->n_fields + 7) / 8; + if (required_fields_bitmap_len > sizeof(required_fields_bitmap_stack)) { + required_fields_bitmap = do_alloc(allocator, required_fields_bitmap_len); + if (!required_fields_bitmap) { + do_free(allocator, rv); + return (NULL); + } + required_fields_bitmap_alloced = TRUE; + } + memset(required_fields_bitmap, 0, required_fields_bitmap_len); + + /* + * Generated code always defines "message_init". However, we provide a + * fallback for (1) users of old protobuf-c generated-code that do not + * provide the function, and (2) descriptors constructed from some other + * source (most likely, direct construction from the .proto file). + */ + if (desc->message_init != NULL) + protobuf_c_message_init(desc, rv); + else + message_init_generic(desc, rv); + + while (rem > 0) { + uint32_t tag; + ProtobufCWireType wire_type; + size_t used = parse_tag_and_wiretype(rem, at, &tag, &wire_type); + const ProtobufCFieldDescriptor *field; + ScannedMember tmp; + + if (used == 0) { + PROTOBUF_C_UNPACK_ERROR("error parsing tag/wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + /* + * \todo Consider optimizing for field[1].id == tag, if field[1] + * exists! + */ + if (last_field == NULL || last_field->id != tag) { + /* lookup field */ + int field_index = + int_range_lookup(desc->n_field_ranges, + desc->field_ranges, + tag); + if (field_index < 0) { + field = NULL; + n_unknown++; + } else { + field = desc->fields + field_index; + last_field = field; + last_field_index = field_index; + } + } else { + field = last_field; + } + + if (field != NULL && field->label == PROTOBUF_C_LABEL_REQUIRED) + REQUIRED_FIELD_BITMAP_SET(last_field_index); + + at += used; + rem -= used; + tmp.tag = tag; + tmp.wire_type = wire_type; + tmp.field = field; + tmp.data = at; + tmp.length_prefix_len = 0; + + switch (wire_type) { + case PROTOBUF_C_WIRE_TYPE_VARINT: { + unsigned max_len = rem < 10 ? rem : 10; + unsigned i; + + for (i = 0; i < max_len; i++) + if ((at[i] & 0x80) == 0) + break; + if (i == max_len) { + PROTOBUF_C_UNPACK_ERROR("unterminated varint at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = i + 1; + break; + } + case PROTOBUF_C_WIRE_TYPE_64BIT: + if (rem < 8) { + PROTOBUF_C_UNPACK_ERROR("too short after 64bit wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = 8; + break; + case PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED: { + size_t pref_len; + + tmp.len = scan_length_prefixed_data(rem, at, &pref_len); + if (tmp.len == 0) { + /* NOTE: scan_length_prefixed_data calls UNPACK_ERROR */ + goto error_cleanup_during_scan; + } + tmp.length_prefix_len = pref_len; + break; + } + case PROTOBUF_C_WIRE_TYPE_32BIT: + if (rem < 4) { + PROTOBUF_C_UNPACK_ERROR("too short after 32bit wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = 4; + break; + default: + PROTOBUF_C_UNPACK_ERROR("unsupported tag %u at offset %u", + wire_type, (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + + if (in_slab_index == (1UL << + (which_slab + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2))) + { + size_t size; + + in_slab_index = 0; + if (which_slab == MAX_SCANNED_MEMBER_SLAB) { + PROTOBUF_C_UNPACK_ERROR("too many fields"); + goto error_cleanup_during_scan; + } + which_slab++; + size = sizeof(ScannedMember) + << (which_slab + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2); + scanned_member_slabs[which_slab] = do_alloc(allocator, size); + if (scanned_member_slabs[which_slab] == NULL) + goto error_cleanup_during_scan; + } + scanned_member_slabs[which_slab][in_slab_index++] = tmp; + + if (field != NULL && field->label == PROTOBUF_C_LABEL_REPEATED) { + size_t *n = STRUCT_MEMBER_PTR(size_t, rv, + field->quantifier_offset); + if (wire_type == PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED) || + is_packable_type(field->type))) + { + size_t count; + if (!count_packed_elements(field->type, + tmp.len - + tmp.length_prefix_len, + tmp.data + + tmp.length_prefix_len, + &count)) + { + PROTOBUF_C_UNPACK_ERROR("counting packed elements"); + goto error_cleanup_during_scan; + } + *n += count; + } else { + *n += 1; + } + } + + at += tmp.len; + rem -= tmp.len; + } + + /* allocate space for repeated fields, also check that all required fields have been set */ + for (f = 0; f < desc->n_fields; f++) { + const ProtobufCFieldDescriptor *field = desc->fields + f; + if (field->label == PROTOBUF_C_LABEL_REPEATED) { + size_t siz = + sizeof_elt_in_repeated_array(field->type); + size_t *n_ptr = + STRUCT_MEMBER_PTR(size_t, rv, + field->quantifier_offset); + if (*n_ptr != 0) { + unsigned n = *n_ptr; + void *a; + *n_ptr = 0; + assert(rv->descriptor != NULL); +#define CLEAR_REMAINING_N_PTRS() \ + for(f++;f < desc->n_fields; f++) \ + { \ + field = desc->fields + f; \ + if (field->label == PROTOBUF_C_LABEL_REPEATED) \ + STRUCT_MEMBER (size_t, rv, field->quantifier_offset) = 0; \ + } + a = do_alloc(allocator, siz * n); + if (!a) { + CLEAR_REMAINING_N_PTRS(); + goto error_cleanup; + } + STRUCT_MEMBER(void *, rv, field->offset) = a; + } + } else if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + if (field->default_value == NULL && + !REQUIRED_FIELD_BITMAP_IS_SET(f)) + { + CLEAR_REMAINING_N_PTRS(); + PROTOBUF_C_UNPACK_ERROR("message '%s': missing required field '%s'", + desc->name, field->name); + goto error_cleanup; + } + } + } +#undef CLEAR_REMAINING_N_PTRS + + /* allocate space for unknown fields */ + if (n_unknown) { + rv->unknown_fields = do_alloc(allocator, + n_unknown * sizeof(ProtobufCMessageUnknownField)); + if (rv->unknown_fields == NULL) + goto error_cleanup; + } + + /* do real parsing */ + for (i_slab = 0; i_slab <= which_slab; i_slab++) { + unsigned max = (i_slab == which_slab) ? + in_slab_index : (1UL << (i_slab + 4)); + ScannedMember *slab = scanned_member_slabs[i_slab]; + + for (j = 0; j < max; j++) { + if (!parse_member(slab + j, rv, allocator)) { + PROTOBUF_C_UNPACK_ERROR("error parsing member %s of %s", + slab->field ? slab->field->name : "*unknown-field*", + desc->name); + goto error_cleanup; + } + } + } + + /* cleanup */ + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return rv; + +error_cleanup: + protobuf_c_message_free_unpacked(rv, allocator); + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return NULL; + +error_cleanup_during_scan: + do_free(allocator, rv); + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return NULL; +} + +void +protobuf_c_message_free_unpacked(ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCMessageDescriptor *desc; + unsigned f; + + if (message == NULL) + return; + + desc = message->descriptor; + + ASSERT_IS_MESSAGE(message); + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + message->descriptor = NULL; + for (f = 0; f < desc->n_fields; f++) { + if (0 != (desc->fields[f].flags & PROTOBUF_C_FIELD_FLAG_ONEOF) && + desc->fields[f].id != + STRUCT_MEMBER(uint32_t, message, desc->fields[f].quantifier_offset)) + { + /* This is not the selected oneof, skip it */ + continue; + } + + if (desc->fields[f].label == PROTOBUF_C_LABEL_REPEATED) { + size_t n = STRUCT_MEMBER(size_t, + message, + desc->fields[f].quantifier_offset); + void *arr = STRUCT_MEMBER(void *, + message, + desc->fields[f].offset); + + if (arr != NULL) { + if (desc->fields[f].type == PROTOBUF_C_TYPE_STRING) { + unsigned i; + for (i = 0; i < n; i++) + do_free(allocator, ((char **) arr)[i]); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_BYTES) { + unsigned i; + for (i = 0; i < n; i++) + do_free(allocator, ((ProtobufCBinaryData *) arr)[i].data); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_MESSAGE) { + unsigned i; + for (i = 0; i < n; i++) + protobuf_c_message_free_unpacked( + ((ProtobufCMessage **) arr)[i], + allocator + ); + } + do_free(allocator, arr); + } + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_STRING) { + char *str = STRUCT_MEMBER(char *, message, + desc->fields[f].offset); + + if (str && str != desc->fields[f].default_value) + do_free(allocator, str); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_BYTES) { + void *data = STRUCT_MEMBER(ProtobufCBinaryData, message, + desc->fields[f].offset).data; + const ProtobufCBinaryData *default_bd; + + default_bd = desc->fields[f].default_value; + if (data != NULL && + (default_bd == NULL || + default_bd->data != data)) + { + do_free(allocator, data); + } + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage *sm; + + sm = STRUCT_MEMBER(ProtobufCMessage *, message, + desc->fields[f].offset); + if (sm && sm != desc->fields[f].default_value) + protobuf_c_message_free_unpacked(sm, allocator); + } + } + + for (f = 0; f < message->n_unknown_fields; f++) + do_free(allocator, message->unknown_fields[f].data); + if (message->unknown_fields != NULL) + do_free(allocator, message->unknown_fields); + + do_free(allocator, message); +} + +void +protobuf_c_message_init(const ProtobufCMessageDescriptor * descriptor, + void *message) +{ + descriptor->message_init((ProtobufCMessage *) (message)); +} + +protobuf_c_boolean +protobuf_c_message_check(const ProtobufCMessage *message) +{ + unsigned i; + + if (!message || + !message->descriptor || + message->descriptor->magic != PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC) + { + return FALSE; + } + + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *f = message->descriptor->fields + i; + ProtobufCType type = f->type; + ProtobufCLabel label = f->label; + void *field = STRUCT_MEMBER_P (message, f->offset); + + if (label == PROTOBUF_C_LABEL_REPEATED) { + size_t *quantity = STRUCT_MEMBER_P (message, f->quantifier_offset); + + if (*quantity > 0 && *(void **) field == NULL) { + return FALSE; + } + + if (type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage **submessage = *(ProtobufCMessage ***) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (!protobuf_c_message_check(submessage[j])) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_STRING) { + char **string = *(char ***) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (!string[j]) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_BYTES) { + ProtobufCBinaryData *bd = *(ProtobufCBinaryData **) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (bd[j].len > 0 && bd[j].data == NULL) + return FALSE; + } + } + + } else { /* PROTOBUF_C_LABEL_REQUIRED or PROTOBUF_C_LABEL_OPTIONAL */ + + if (type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage *submessage = *(ProtobufCMessage **) field; + if (label == PROTOBUF_C_LABEL_REQUIRED || submessage != NULL) { + if (!protobuf_c_message_check(submessage)) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_STRING) { + char *string = *(char **) field; + if (label == PROTOBUF_C_LABEL_REQUIRED && string == NULL) + return FALSE; + } else if (type == PROTOBUF_C_TYPE_BYTES) { + protobuf_c_boolean *has = STRUCT_MEMBER_P (message, f->quantifier_offset); + ProtobufCBinaryData *bd = field; + if (label == PROTOBUF_C_LABEL_REQUIRED || *has == TRUE) { + if (bd->len > 0 && bd->data == NULL) + return FALSE; + } + } + } + } + + return TRUE; +} + +/* === services === */ + +typedef void (*GenericHandler) (void *service, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); +void +protobuf_c_service_invoke_internal(ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data) +{ + GenericHandler *handlers; + GenericHandler handler; + + /* + * Verify that method_index is within range. If this fails, you are + * likely invoking a newly added method on an old service. (Although + * other memory corruption bugs can cause this assertion too.) + */ + assert(method_index < service->descriptor->n_methods); + + /* + * Get the array of virtual methods (which are enumerated by the + * generated code). + */ + handlers = (GenericHandler *) (service + 1); + + /* + * Get our method and invoke it. + * \todo Seems like handler == NULL is a situation that needs handling. + */ + handler = handlers[method_index]; + (*handler)(service, input, closure, closure_data); +} + +void +protobuf_c_service_generated_init(ProtobufCService *service, + const ProtobufCServiceDescriptor *descriptor, + ProtobufCServiceDestroy destroy) +{ + ASSERT_IS_SERVICE_DESCRIPTOR(descriptor); + service->descriptor = descriptor; + service->destroy = destroy; + service->invoke = protobuf_c_service_invoke_internal; + memset(service + 1, 0, descriptor->n_methods * sizeof(GenericHandler)); +} + +void protobuf_c_service_destroy(ProtobufCService *service) +{ + service->destroy(service); +} + +/* --- querying the descriptors --- */ + +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value_by_name(const ProtobufCEnumDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + + if (desc == NULL || desc->values_by_name == NULL) + return NULL; + + count = desc->n_value_names; + + while (count > 1) { + unsigned mid = start + count / 2; + int rv = strcmp(desc->values_by_name[mid].name, name); + if (rv == 0) + return desc->values + desc->values_by_name[mid].index; + else if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else + count = mid - start; + } + if (count == 0) + return NULL; + if (strcmp(desc->values_by_name[start].name, name) == 0) + return desc->values + desc->values_by_name[start].index; + return NULL; +} + +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value(const ProtobufCEnumDescriptor *desc, + int value) +{ + int rv = int_range_lookup(desc->n_value_ranges, desc->value_ranges, value); + if (rv < 0) + return NULL; + return desc->values + rv; +} + +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field_by_name(const ProtobufCMessageDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + const ProtobufCFieldDescriptor *field; + + if (desc == NULL || desc->fields_sorted_by_name == NULL) + return NULL; + + count = desc->n_fields; + + while (count > 1) { + unsigned mid = start + count / 2; + int rv; + field = desc->fields + desc->fields_sorted_by_name[mid]; + rv = strcmp(field->name, name); + if (rv == 0) + return field; + else if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else + count = mid - start; + } + if (count == 0) + return NULL; + field = desc->fields + desc->fields_sorted_by_name[start]; + if (strcmp(field->name, name) == 0) + return field; + return NULL; +} + +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field(const ProtobufCMessageDescriptor *desc, + unsigned value) +{ + int rv = int_range_lookup(desc->n_field_ranges,desc->field_ranges, value); + if (rv < 0) + return NULL; + return desc->fields + rv; +} + +const ProtobufCMethodDescriptor * +protobuf_c_service_descriptor_get_method_by_name(const ProtobufCServiceDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + + if (desc == NULL || desc->method_indices_by_name == NULL) + return NULL; + + count = desc->n_methods; + + while (count > 1) { + unsigned mid = start + count / 2; + unsigned mid_index = desc->method_indices_by_name[mid]; + const char *mid_name = desc->methods[mid_index].name; + int rv = strcmp(mid_name, name); + + if (rv == 0) + return desc->methods + desc->method_indices_by_name[mid]; + if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else { + count = mid - start; + } + } + if (count == 0) + return NULL; + if (strcmp(desc->methods[desc->method_indices_by_name[start]].name, name) == 0) + return desc->methods + desc->method_indices_by_name[start]; + return NULL; +} diff --git a/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.h b/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.h new file mode 100644 index 000000000..c8fa4fc2a --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/protobuf/protobuf-c.h @@ -0,0 +1,1106 @@ +/* + * Copyright (c) 2008-2017, Dave Benson and the protobuf-c authors. + * All rights reserved. + * + * 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. + * + * 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. + */ + +/*! \file + * \mainpage Introduction + * + * This is [protobuf-c], a C implementation of [Protocol Buffers]. + * + * This file defines the public API for the `libprotobuf-c` support library. + * This API includes interfaces that can be used directly by client code as well + * as the interfaces used by the code generated by the `protoc-c` compiler. + * + * The `libprotobuf-c` support library performs the actual serialization and + * deserialization of Protocol Buffers messages. It interacts with structures, + * definitions, and metadata generated by the `protoc-c` compiler from .proto + * files. + * + * \authors Dave Benson and the `protobuf-c` authors. + * + * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. + * + * [protobuf-c]: https://github.com/protobuf-c/protobuf-c + * [Protocol Buffers]: https://developers.google.com/protocol-buffers/ + * [BSD-2-Clause]: http://opensource.org/licenses/BSD-2-Clause + * + * \page gencode Generated Code + * + * For each enum, we generate a C enum. For each message, we generate a C + * structure which can be cast to a `ProtobufCMessage`. + * + * For each enum and message, we generate a descriptor object that allows us to + * implement a kind of reflection on the structures. + * + * First, some naming conventions: + * + * - The name of the type for enums and messages and services is camel case + * (meaning WordsAreCrammedTogether) except that double underscores are used + * to delimit scopes. For example, the following `.proto` file: + * +~~~{.proto} + package foo.bar; + message BazBah { + optional int32 val = 1; + } +~~~ + * + * would generate a C type `Foo__Bar__BazBah`. + * + * - Identifiers for functions and globals are all lowercase, with camel case + * words separated by single underscores. For example, one of the function + * prototypes generated by `protoc-c` for the above example: + * +~~~{.c} +Foo__Bar__BazBah * + foo__bar__baz_bah__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +~~~ + * + * - Identifiers for enum values contain an uppercase prefix which embeds the + * package name and the enum type name. + * + * - A double underscore is used to separate further components of identifier + * names. + * + * For example, in the name of the unpack function above, the package name + * `foo.bar` has become `foo__bar`, the message name BazBah has become + * `baz_bah`, and the method name is `unpack`. These are all joined with double + * underscores to form the C identifier `foo__bar__baz_bah__unpack`. + * + * We also generate descriptor objects for messages and enums. These are + * declared in the `.pb-c.h` files: + * +~~~{.c} +extern const ProtobufCMessageDescriptor foo__bar__baz_bah__descriptor; +~~~ + * + * The message structures all begin with `ProtobufCMessageDescriptor *` which is + * sufficient to allow them to be cast to `ProtobufCMessage`. + * + * For each message defined in a `.proto` file, we generate a number of + * functions and macros. Each function name contains a prefix based on the + * package name and message name in order to make it a unique C identifier. + * + * - `INIT`. Statically initializes a message object, initializing its + * descriptor and setting its fields to default values. Uninitialized + * messages cannot be processed by the protobuf-c library. + * +~~~{.c} +#define FOO__BAR__BAZ_BAH__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&foo__bar__baz_bah__descriptor), 0 } +~~~ + * - `init()`. Initializes a message object, initializing its descriptor and + * setting its fields to default values. Uninitialized messages cannot be + * processed by the protobuf-c library. + * +~~~{.c} +void foo__bar__baz_bah__init + (Foo__Bar__BazBah *message); +~~~ + * - `unpack()`. Unpacks data for a particular message format. Note that the + * `allocator` parameter is usually `NULL` to indicate that the system's + * `malloc()` and `free()` functions should be used for dynamically allocating + * memory. + * +~~~{.c} +Foo__Bar__BazBah * + foo__bar__baz_bah__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +~~~ + * + * - `free_unpacked()`. Frees a message object obtained with the `unpack()` + * method. Freeing `NULL` is allowed (the same as with `free()`). + * +~~~{.c} +void foo__bar__baz_bah__free_unpacked + (Foo__Bar__BazBah *message, + ProtobufCAllocator *allocator); +~~~ + * + * - `get_packed_size()`. Calculates the length in bytes of the serialized + * representation of the message object. + * +~~~{.c} +size_t foo__bar__baz_bah__get_packed_size + (const Foo__Bar__BazBah *message); +~~~ + * + * - `pack()`. Pack a message object into a preallocated buffer. Assumes that + * the buffer is large enough. (Use `get_packed_size()` first.) + * +~~~{.c} +size_t foo__bar__baz_bah__pack + (const Foo__Bar__BazBah *message, + uint8_t *out); +~~~ + * + * - `pack_to_buffer()`. Packs a message into a "virtual buffer". This is an + * object which defines an "append bytes" callback to consume data as it is + * serialized. + * +~~~{.c} +size_t foo__bar__baz_bah__pack_to_buffer + (const Foo__Bar__BazBah *message, + ProtobufCBuffer *buffer); +~~~ + * + * \page pack Packing and unpacking messages + * + * To pack a message, first compute the packed size of the message with + * protobuf_c_message_get_packed_size(), then allocate a buffer of at least + * that size, then call protobuf_c_message_pack(). + * + * Alternatively, a message can be serialized without calculating the final size + * first. Use the protobuf_c_message_pack_to_buffer() function and provide a + * ProtobufCBuffer object which implements an "append" method that consumes + * data. + * + * To unpack a message, call the protobuf_c_message_unpack() function. The + * result can be cast to an object of the type that matches the descriptor for + * the message. + * + * The result of unpacking a message should be freed with + * protobuf_c_message_free_unpacked(). + */ + +#ifndef PROTOBUF_C_H +#define PROTOBUF_C_H + +#include <assert.h> +#include <limits.h> +#include <stddef.h> +#include <stdint.h> + +#ifdef __cplusplus +# define PROTOBUF_C__BEGIN_DECLS extern "C" { +# define PROTOBUF_C__END_DECLS } +#else +# define PROTOBUF_C__BEGIN_DECLS +# define PROTOBUF_C__END_DECLS +#endif + +PROTOBUF_C__BEGIN_DECLS + +#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) +# ifdef PROTOBUF_C_EXPORT +# define PROTOBUF_C__API __declspec(dllexport) +# else +# define PROTOBUF_C__API __declspec(dllimport) +# endif +#else +# define PROTOBUF_C__API +#endif + +#if !defined(PROTOBUF_C__NO_DEPRECATED) && \ + ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__)) +#else +# define PROTOBUF_C__DEPRECATED +#endif + +#ifndef PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE + #define PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(enum_name) \ + , _##enum_name##_IS_INT_SIZE = INT_MAX +#endif + +#define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3 +#define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9 +#define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af + +/* Empty string used for initializers */ +extern const char protobuf_c_empty_string[]; + +/** + * \defgroup api Public API + * + * This is the public API for `libprotobuf-c`. These interfaces are stable and + * subject to Semantic Versioning guarantees. + * + * @{ + */ + +/** + * Values for the `flags` word in `ProtobufCFieldDescriptor`. + */ +typedef enum { + /** Set if the field is repeated and marked with the `packed` option. */ + PROTOBUF_C_FIELD_FLAG_PACKED = (1 << 0), + + /** Set if the field is marked with the `deprecated` option. */ + PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1), + + /** Set if the field is a member of a oneof (union). */ + PROTOBUF_C_FIELD_FLAG_ONEOF = (1 << 2), +} ProtobufCFieldFlag; + +/** + * Message field rules. + * + * \see [Defining A Message Type] in the Protocol Buffers documentation. + * + * [Defining A Message Type]: + * https://developers.google.com/protocol-buffers/docs/proto#simple + */ +typedef enum { + /** A well-formed message must have exactly one of this field. */ + PROTOBUF_C_LABEL_REQUIRED, + + /** + * A well-formed message can have zero or one of this field (but not + * more than one). + */ + PROTOBUF_C_LABEL_OPTIONAL, + + /** + * This field can be repeated any number of times (including zero) in a + * well-formed message. The order of the repeated values will be + * preserved. + */ + PROTOBUF_C_LABEL_REPEATED, + + /** + * This field has no label. This is valid only in proto3 and is + * equivalent to OPTIONAL but no "has" quantifier will be consulted. + */ + PROTOBUF_C_LABEL_NONE, +} ProtobufCLabel; + +/** + * Field value types. + * + * \see [Scalar Value Types] in the Protocol Buffers documentation. + * + * [Scalar Value Types]: + * https://developers.google.com/protocol-buffers/docs/proto#scalar + */ +typedef enum { + PROTOBUF_C_TYPE_INT32, /**< int32 */ + PROTOBUF_C_TYPE_SINT32, /**< signed int32 */ + PROTOBUF_C_TYPE_SFIXED32, /**< signed int32 (4 bytes) */ + PROTOBUF_C_TYPE_INT64, /**< int64 */ + PROTOBUF_C_TYPE_SINT64, /**< signed int64 */ + PROTOBUF_C_TYPE_SFIXED64, /**< signed int64 (8 bytes) */ + PROTOBUF_C_TYPE_UINT32, /**< unsigned int32 */ + PROTOBUF_C_TYPE_FIXED32, /**< unsigned int32 (4 bytes) */ + PROTOBUF_C_TYPE_UINT64, /**< unsigned int64 */ + PROTOBUF_C_TYPE_FIXED64, /**< unsigned int64 (8 bytes) */ + PROTOBUF_C_TYPE_FLOAT, /**< float */ + PROTOBUF_C_TYPE_DOUBLE, /**< double */ + PROTOBUF_C_TYPE_BOOL, /**< boolean */ + PROTOBUF_C_TYPE_ENUM, /**< enumerated type */ + PROTOBUF_C_TYPE_STRING, /**< UTF-8 or ASCII string */ + PROTOBUF_C_TYPE_BYTES, /**< arbitrary byte sequence */ + PROTOBUF_C_TYPE_MESSAGE, /**< nested message */ +} ProtobufCType; + +/** + * Field wire types. + * + * \see [Message Structure] in the Protocol Buffers documentation. + * + * [Message Structure]: + * https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +typedef enum { + PROTOBUF_C_WIRE_TYPE_VARINT = 0, + PROTOBUF_C_WIRE_TYPE_64BIT = 1, + PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED = 2, + /* "Start group" and "end group" wire types are unsupported. */ + PROTOBUF_C_WIRE_TYPE_32BIT = 5, +} ProtobufCWireType; + +struct ProtobufCAllocator; +struct ProtobufCBinaryData; +struct ProtobufCBuffer; +struct ProtobufCBufferSimple; +struct ProtobufCEnumDescriptor; +struct ProtobufCEnumValue; +struct ProtobufCEnumValueIndex; +struct ProtobufCFieldDescriptor; +struct ProtobufCIntRange; +struct ProtobufCMessage; +struct ProtobufCMessageDescriptor; +struct ProtobufCMessageUnknownField; +struct ProtobufCMethodDescriptor; +struct ProtobufCService; +struct ProtobufCServiceDescriptor; + +typedef struct ProtobufCAllocator ProtobufCAllocator; +typedef struct ProtobufCBinaryData ProtobufCBinaryData; +typedef struct ProtobufCBuffer ProtobufCBuffer; +typedef struct ProtobufCBufferSimple ProtobufCBufferSimple; +typedef struct ProtobufCEnumDescriptor ProtobufCEnumDescriptor; +typedef struct ProtobufCEnumValue ProtobufCEnumValue; +typedef struct ProtobufCEnumValueIndex ProtobufCEnumValueIndex; +typedef struct ProtobufCFieldDescriptor ProtobufCFieldDescriptor; +typedef struct ProtobufCIntRange ProtobufCIntRange; +typedef struct ProtobufCMessage ProtobufCMessage; +typedef struct ProtobufCMessageDescriptor ProtobufCMessageDescriptor; +typedef struct ProtobufCMessageUnknownField ProtobufCMessageUnknownField; +typedef struct ProtobufCMethodDescriptor ProtobufCMethodDescriptor; +typedef struct ProtobufCService ProtobufCService; +typedef struct ProtobufCServiceDescriptor ProtobufCServiceDescriptor; + +/** Boolean type. */ +typedef int protobuf_c_boolean; + +typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data); +typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); +typedef void (*ProtobufCServiceDestroy)(ProtobufCService *); + +/** + * Structure for defining a custom memory allocator. + */ +struct ProtobufCAllocator { + /** Function to allocate memory. */ + void *(*alloc)(void *allocator_data, size_t size); + + /** Function to free memory. */ + void (*free)(void *allocator_data, void *pointer); + + /** Opaque pointer passed to `alloc` and `free` functions. */ + void *allocator_data; +}; + +/** + * Structure for the protobuf `bytes` scalar type. + * + * The data contained in a `ProtobufCBinaryData` is an arbitrary sequence of + * bytes. It may contain embedded `NUL` characters and is not required to be + * `NUL`-terminated. + */ +struct ProtobufCBinaryData { + size_t len; /**< Number of bytes in the `data` field. */ + uint8_t *data; /**< Data bytes. */ +}; + +/** + * Structure for defining a virtual append-only buffer. Used by + * protobuf_c_message_pack_to_buffer() to abstract the consumption of serialized + * bytes. + * + * `ProtobufCBuffer` "subclasses" may be defined on the stack. For example, to + * write to a `FILE` object: + * +~~~{.c} +typedef struct { + ProtobufCBuffer base; + FILE *fp; +} BufferAppendToFile; + +static void +my_buffer_file_append(ProtobufCBuffer *buffer, + size_t len, + const uint8_t *data) +{ + BufferAppendToFile *file_buf = (BufferAppendToFile *) buffer; + fwrite(data, len, 1, file_buf->fp); // XXX: No error handling! +} +~~~ + * + * To use this new type of ProtobufCBuffer, it could be called as follows: + * +~~~{.c} +... +BufferAppendToFile tmp = {0}; +tmp.base.append = my_buffer_file_append; +tmp.fp = fp; +protobuf_c_message_pack_to_buffer(&message, &tmp); +... +~~~ + */ +struct ProtobufCBuffer { + /** Append function. Consumes the `len` bytes stored at `data`. */ + void (*append)(ProtobufCBuffer *buffer, + size_t len, + const uint8_t *data); +}; + +/** + * Simple buffer "subclass" of `ProtobufCBuffer`. + * + * A `ProtobufCBufferSimple` object is declared on the stack and uses a + * scratch buffer provided by the user for the initial allocation. It performs + * exponential resizing, using dynamically allocated memory. A + * `ProtobufCBufferSimple` object can be created and used as follows: + * +~~~{.c} +uint8_t pad[128]; +ProtobufCBufferSimple simple = PROTOBUF_C_BUFFER_SIMPLE_INIT(pad); +ProtobufCBuffer *buffer = (ProtobufCBuffer *) &simple; +~~~ + * + * `buffer` can now be used with `protobuf_c_message_pack_to_buffer()`. Once a + * message has been serialized to a `ProtobufCBufferSimple` object, the + * serialized data bytes can be accessed from the `.data` field. + * + * To free the memory allocated by a `ProtobufCBufferSimple` object, if any, + * call PROTOBUF_C_BUFFER_SIMPLE_CLEAR() on the object, for example: + * +~~~{.c} +PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple); +~~~ + * + * \see PROTOBUF_C_BUFFER_SIMPLE_INIT + * \see PROTOBUF_C_BUFFER_SIMPLE_CLEAR + */ +struct ProtobufCBufferSimple { + /** "Base class". */ + ProtobufCBuffer base; + /** Number of bytes allocated in `data`. */ + size_t alloced; + /** Number of bytes currently stored in `data`. */ + size_t len; + /** Data bytes. */ + uint8_t *data; + /** Whether `data` must be freed. */ + protobuf_c_boolean must_free_data; + /** Allocator to use. May be NULL to indicate the system allocator. */ + ProtobufCAllocator *allocator; +}; + +/** + * Describes an enumeration as a whole, with all of its values. + */ +struct ProtobufCEnumDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** The qualified name (e.g., "namespace.Type"). */ + const char *name; + /** The unqualified name as given in the .proto file (e.g., "Type"). */ + const char *short_name; + /** Identifier used in generated C code. */ + const char *c_name; + /** The dot-separated namespace. */ + const char *package_name; + + /** Number elements in `values`. */ + unsigned n_values; + /** Array of distinct values, sorted by numeric value. */ + const ProtobufCEnumValue *values; + + /** Number of elements in `values_by_name`. */ + unsigned n_value_names; + /** Array of named values, including aliases, sorted by name. */ + const ProtobufCEnumValueIndex *values_by_name; + + /** Number of elements in `value_ranges`. */ + unsigned n_value_ranges; + /** Value ranges, for faster lookups by numeric value. */ + const ProtobufCIntRange *value_ranges; + + /** Reserved for future use. */ + void *reserved1; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; + /** Reserved for future use. */ + void *reserved4; +}; + +/** + * Represents a single value of an enumeration. + */ +struct ProtobufCEnumValue { + /** The string identifying this value in the .proto file. */ + const char *name; + + /** The string identifying this value in generated C code. */ + const char *c_name; + + /** The numeric value assigned in the .proto file. */ + int value; +}; + +/** + * Used by `ProtobufCEnumDescriptor` to look up enum values. + */ +struct ProtobufCEnumValueIndex { + /** Name of the enum value. */ + const char *name; + /** Index into values[] array. */ + unsigned index; +}; + +/** + * Describes a single field in a message. + */ +struct ProtobufCFieldDescriptor { + /** Name of the field as given in the .proto file. */ + const char *name; + + /** Tag value of the field as given in the .proto file. */ + uint32_t id; + + /** Whether the field is `REQUIRED`, `OPTIONAL`, or `REPEATED`. */ + ProtobufCLabel label; + + /** The type of the field. */ + ProtobufCType type; + + /** + * The offset in bytes of the message's C structure's quantifier field + * (the `has_MEMBER` field for optional members or the `n_MEMBER` field + * for repeated members or the case enum for oneofs). + */ + unsigned quantifier_offset; + + /** + * The offset in bytes into the message's C structure for the member + * itself. + */ + unsigned offset; + + /** + * A type-specific descriptor. + * + * If `type` is `PROTOBUF_C_TYPE_ENUM`, then `descriptor` points to the + * corresponding `ProtobufCEnumDescriptor`. + * + * If `type` is `PROTOBUF_C_TYPE_MESSAGE`, then `descriptor` points to + * the corresponding `ProtobufCMessageDescriptor`. + * + * Otherwise this field is NULL. + */ + const void *descriptor; /* for MESSAGE and ENUM types */ + + /** The default value for this field, if defined. May be NULL. */ + const void *default_value; + + /** + * A flag word. Zero or more of the bits defined in the + * `ProtobufCFieldFlag` enum may be set. + */ + uint32_t flags; + + /** Reserved for future use. */ + unsigned reserved_flags; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; +}; + +/** + * Helper structure for optimizing int => index lookups in the case + * where the keys are mostly consecutive values, as they presumably are for + * enums and fields. + * + * The data structures requires that the values in the original array are + * sorted. + */ +struct ProtobufCIntRange { + int start_value; + unsigned orig_index; + /* + * NOTE: the number of values in the range can be inferred by looking + * at the next element's orig_index. A dummy element is added to make + * this simple. + */ +}; + +/** + * An instance of a message. + * + * `ProtobufCMessage` is a light-weight "base class" for all messages. + * + * In particular, `ProtobufCMessage` doesn't have any allocation policy + * associated with it. That's because it's common to create `ProtobufCMessage` + * objects on the stack. In fact, that's what we recommend for sending messages. + * If the object is allocated from the stack, you can't really have a memory + * leak. + * + * This means that calls to functions like protobuf_c_message_unpack() which + * return a `ProtobufCMessage` must be paired with a call to a free function, + * like protobuf_c_message_free_unpacked(). + */ +struct ProtobufCMessage { + /** The descriptor for this message type. */ + const ProtobufCMessageDescriptor *descriptor; + /** The number of elements in `unknown_fields`. */ + unsigned n_unknown_fields; + /** The fields that weren't recognized by the parser. */ + ProtobufCMessageUnknownField *unknown_fields; +}; + +/** + * Describes a message. + */ +struct ProtobufCMessageDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** The qualified name (e.g., "namespace.Type"). */ + const char *name; + /** The unqualified name as given in the .proto file (e.g., "Type"). */ + const char *short_name; + /** Identifier used in generated C code. */ + const char *c_name; + /** The dot-separated namespace. */ + const char *package_name; + + /** + * Size in bytes of the C structure representing an instance of this + * type of message. + */ + size_t sizeof_message; + + /** Number of elements in `fields`. */ + unsigned n_fields; + /** Field descriptors, sorted by tag number. */ + const ProtobufCFieldDescriptor *fields; + /** Used for looking up fields by name. */ + const unsigned *fields_sorted_by_name; + + /** Number of elements in `field_ranges`. */ + unsigned n_field_ranges; + /** Used for looking up fields by id. */ + const ProtobufCIntRange *field_ranges; + + /** Message initialisation function. */ + ProtobufCMessageInit message_init; + + /** Reserved for future use. */ + void *reserved1; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; +}; + +/** + * An unknown message field. + */ +struct ProtobufCMessageUnknownField { + /** The tag number. */ + uint32_t tag; + /** The wire type of the field. */ + ProtobufCWireType wire_type; + /** Number of bytes in `data`. */ + size_t len; + /** Field data. */ + uint8_t *data; +}; + +/** + * Method descriptor. + */ +struct ProtobufCMethodDescriptor { + /** Method name. */ + const char *name; + /** Input message descriptor. */ + const ProtobufCMessageDescriptor *input; + /** Output message descriptor. */ + const ProtobufCMessageDescriptor *output; +}; + +/** + * Service. + */ +struct ProtobufCService { + /** Service descriptor. */ + const ProtobufCServiceDescriptor *descriptor; + /** Function to invoke the service. */ + void (*invoke)(ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); + /** Function to destroy the service. */ + void (*destroy)(ProtobufCService *service); +}; + +/** + * Service descriptor. + */ +struct ProtobufCServiceDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** Service name. */ + const char *name; + /** Short version of service name. */ + const char *short_name; + /** C identifier for the service name. */ + const char *c_name; + /** Package name. */ + const char *package; + /** Number of elements in `methods`. */ + unsigned n_methods; + /** Method descriptors, in the order defined in the .proto file. */ + const ProtobufCMethodDescriptor *methods; + /** Sort index of methods. */ + const unsigned *method_indices_by_name; +}; + +/** + * Get the version of the protobuf-c library. Note that this is the version of + * the library linked against, not the version of the headers compiled against. + * + * \return A string containing the version number of protobuf-c. + */ +PROTOBUF_C__API +const char * +protobuf_c_version(void); + +/** + * Get the version of the protobuf-c library. Note that this is the version of + * the library linked against, not the version of the headers compiled against. + * + * \return A 32 bit unsigned integer containing the version number of + * protobuf-c, represented in base-10 as (MAJOR*1E6) + (MINOR*1E3) + PATCH. + */ +PROTOBUF_C__API +uint32_t +protobuf_c_version_number(void); + +/** + * The version of the protobuf-c headers, represented as a string using the same + * format as protobuf_c_version(). + */ +#define PROTOBUF_C_VERSION "1.3.0" + +/** + * The version of the protobuf-c headers, represented as an integer using the + * same format as protobuf_c_version_number(). + */ +#define PROTOBUF_C_VERSION_NUMBER 1003000 + +/** + * The minimum protoc-c version which works with the current version of the + * protobuf-c headers. + */ +#define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 + +/** + * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by name. + * + * \param desc + * The `ProtobufCEnumDescriptor` object. + * \param name + * The `name` field from the corresponding `ProtobufCEnumValue` object to + * match. + * \return + * A `ProtobufCEnumValue` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value_by_name( + const ProtobufCEnumDescriptor *desc, + const char *name); + +/** + * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by numeric + * value. + * + * \param desc + * The `ProtobufCEnumDescriptor` object. + * \param value + * The `value` field from the corresponding `ProtobufCEnumValue` object to + * match. + * + * \return + * A `ProtobufCEnumValue` object. + * \retval NULL + * If not found. + */ +PROTOBUF_C__API +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value( + const ProtobufCEnumDescriptor *desc, + int value); + +/** + * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by + * the name of the field. + * + * \param desc + * The `ProtobufCMessageDescriptor` object. + * \param name + * The name of the field. + * \return + * A `ProtobufCFieldDescriptor` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field_by_name( + const ProtobufCMessageDescriptor *desc, + const char *name); + +/** + * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by + * the tag value of the field. + * + * \param desc + * The `ProtobufCMessageDescriptor` object. + * \param value + * The tag value of the field. + * \return + * A `ProtobufCFieldDescriptor` object. + * \retval NULL + * If not found. + */ +PROTOBUF_C__API +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field( + const ProtobufCMessageDescriptor *desc, + unsigned value); + +/** + * Determine the number of bytes required to store the serialised message. + * + * \param message + * The message object to serialise. + * \return + * Number of bytes. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_get_packed_size(const ProtobufCMessage *message); + +/** + * Serialise a message from its in-memory representation. + * + * This function stores the serialised bytes of the message in a pre-allocated + * buffer. + * + * \param message + * The message object to serialise. + * \param[out] out + * Buffer to store the bytes of the serialised message. This buffer must + * have enough space to store the packed message. Use + * protobuf_c_message_get_packed_size() to determine the number of bytes + * required. + * \return + * Number of bytes stored in `out`. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out); + +/** + * Serialise a message from its in-memory representation to a virtual buffer. + * + * This function calls the `append` method of a `ProtobufCBuffer` object to + * consume the bytes generated by the serialiser. + * + * \param message + * The message object to serialise. + * \param buffer + * The virtual buffer object. + * \return + * Number of bytes passed to the virtual buffer. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_pack_to_buffer( + const ProtobufCMessage *message, + ProtobufCBuffer *buffer); + +/** + * Unpack a serialised message into an in-memory representation. + * + * \param descriptor + * The message descriptor. + * \param allocator + * `ProtobufCAllocator` to use for memory allocation. May be NULL to + * specify the default allocator. + * \param len + * Length in bytes of the serialised message. + * \param data + * Pointer to the serialised message. + * \return + * An unpacked message object. + * \retval NULL + * If an error occurred during unpacking. + */ +PROTOBUF_C__API +ProtobufCMessage * +protobuf_c_message_unpack( + const ProtobufCMessageDescriptor *descriptor, + ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); + +/** + * Free an unpacked message object. + * + * This function should be used to deallocate the memory used by a call to + * protobuf_c_message_unpack(). + * + * \param message + * The message object to free. May be NULL. + * \param allocator + * `ProtobufCAllocator` to use for memory deallocation. May be NULL to + * specify the default allocator. + */ +PROTOBUF_C__API +void +protobuf_c_message_free_unpacked( + ProtobufCMessage *message, + ProtobufCAllocator *allocator); + +/** + * Check the validity of a message object. + * + * Makes sure all required fields (`PROTOBUF_C_LABEL_REQUIRED`) are present. + * Recursively checks nested messages. + * + * \retval TRUE + * Message is valid. + * \retval FALSE + * Message is invalid. + */ +PROTOBUF_C__API +protobuf_c_boolean +protobuf_c_message_check(const ProtobufCMessage *); + +/** Message initialiser. */ +#define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL } + +/** + * Initialise a message object from a message descriptor. + * + * \param descriptor + * Message descriptor. + * \param message + * Allocated block of memory of size `descriptor->sizeof_message`. + */ +PROTOBUF_C__API +void +protobuf_c_message_init( + const ProtobufCMessageDescriptor *descriptor, + void *message); + +/** + * Free a service. + * + * \param service + * The service object to free. + */ +PROTOBUF_C__API +void +protobuf_c_service_destroy(ProtobufCService *service); + +/** + * Look up a `ProtobufCMethodDescriptor` by name. + * + * \param desc + * Service descriptor. + * \param name + * Name of the method. + * + * \return + * A `ProtobufCMethodDescriptor` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCMethodDescriptor * +protobuf_c_service_descriptor_get_method_by_name( + const ProtobufCServiceDescriptor *desc, + const char *name); + +/** + * Initialise a `ProtobufCBufferSimple` object. + */ +#define PROTOBUF_C_BUFFER_SIMPLE_INIT(array_of_bytes) \ +{ \ + { protobuf_c_buffer_simple_append }, \ + sizeof(array_of_bytes), \ + 0, \ + (array_of_bytes), \ + 0, \ + NULL \ +} + +/** + * Clear a `ProtobufCBufferSimple` object, freeing any allocated memory. + */ +#define PROTOBUF_C_BUFFER_SIMPLE_CLEAR(simp_buf) \ +do { \ + if ((simp_buf)->must_free_data) { \ + if ((simp_buf)->allocator != NULL) \ + (simp_buf)->allocator->free( \ + (simp_buf)->allocator, \ + (simp_buf)->data); \ + else \ + free((simp_buf)->data); \ + } \ +} while (0) + +/** + * The `append` method for `ProtobufCBufferSimple`. + * + * \param buffer + * The buffer object to append to. Must actually be a + * `ProtobufCBufferSimple` object. + * \param len + * Number of bytes in `data`. + * \param data + * Data to append. + */ +PROTOBUF_C__API +void +protobuf_c_buffer_simple_append( + ProtobufCBuffer *buffer, + size_t len, + const unsigned char *data); + +PROTOBUF_C__API +void +protobuf_c_service_generated_init( + ProtobufCService *service, + const ProtobufCServiceDescriptor *descriptor, + ProtobufCServiceDestroy destroy); + +PROTOBUF_C__API +void +protobuf_c_service_invoke_internal( + ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); + +/**@}*/ + +PROTOBUF_C__END_DECLS + +#endif /* PROTOBUF_C_H */ diff --git a/Software/Code_Composer/twine_usblib_demo/targetConfigs/Tiva TM4C129XNCZAD.ccxml b/Software/Code_Composer/twine_usblib_demo/targetConfigs/Tiva TM4C129XNCZAD.ccxml new file mode 100644 index 000000000..534ac1ba0 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/targetConfigs/Tiva TM4C129XNCZAD.ccxml @@ -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="Tiva TM4C129XNCZAD" href="devices/tm4c129xnczad.xml" id="Tiva TM4C129XNCZAD" xml="tm4c129xnczad.xml" xmlpath="devices"/> + </platform> + </connection> + </configuration> +</configurations> diff --git a/Software/Code_Composer/twine_usblib_demo/targetConfigs/readme.txt b/Software/Code_Composer/twine_usblib_demo/targetConfigs/readme.txt new file mode 100644 index 000000000..d783fef4d --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/targetConfigs/readme.txt @@ -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.
\ No newline at end of file diff --git a/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad.cmd b/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad.cmd new file mode 100644 index 000000000..2fb7f20eb --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad.cmd @@ -0,0 +1,67 @@ +/****************************************************************************** + * Copyright (c) 2013-2017 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 2.1.4.178 of the DK-TM4C129X Firmware Package. + * + *****************************************************************************/ + +--retain=g_pfnVectors + +/* 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=rtsv7M3_T_le_eabi.lib */ + +/* The starting address of the application. Normally the interrupt vectors */ +/* must be located at the beginning of the application. */ +#define APP_BASE 0x00000000 +#define RAM_BASE 0x20000000 + +/* System memory map */ + +MEMORY +{ + /* Application stored in and executes from internal flash */ + FLASH (RX) : origin = APP_BASE, length = 0x00100000 + /* Application uses internal RAM for data */ + SRAM (RWX) : origin = 0x20000000, length = 0x00040000 +} + +/* Section allocation in memory */ + +SECTIONS +{ + .intvecs: > APP_BASE + .text : > FLASH + .const : > FLASH + .cinit : > FLASH + .pinit : > FLASH + .init_array : > FLASH + + .vtable : > RAM_BASE + .data : > SRAM + .bss : > SRAM + .sysmem : > SRAM + .stack : > SRAM +} + +__STACK_TOP = __stack + 1024; diff --git a/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad_startup_ccs.c b/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad_startup_ccs.c new file mode 100644 index 000000000..562bb6ff8 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/tm4c129xnczad_startup_ccs.c @@ -0,0 +1,280 @@ +//***************************************************************************** +// +// Startup code for use with TI's Code Composer Studio. +// +// Copyright (c) 2011-2014 Texas Instruments Incorporated. All rights reserved. +// Software License Agreement +// +// 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. +// +//***************************************************************************** + +#include <stdint.h> +#include "inc/hw_nvic.h" +#include "inc/hw_types.h" + +//***************************************************************************** +// +// Forward declaration of the default fault handlers. +// +//***************************************************************************** +void ResetISR(void); +static void NmiSR(void); +static void FaultISR(void); +static void IntDefaultHandler(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 uint32_t __STACK_TOP; + +//***************************************************************************** +// +// External declarations for the interrupt handlers used by the application. +// +//***************************************************************************** +// To be added by user +extern void SysTickHandler(void); +extern void USB0Handler(void); +extern void USB0DeviceIntHandler(void); + +//***************************************************************************** +// +// 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))((uint32_t)&__STACK_TOP), + // The initial stack pointer + ResetISR, // The reset handler + NmiSR, // The NMI handler + FaultISR, // The hard fault handler + IntDefaultHandler, // The MPU fault handler + IntDefaultHandler, // The bus fault handler + IntDefaultHandler, // The usage fault handler + 0, // Reserved + 0, // Reserved + 0, // Reserved + 0, // Reserved + IntDefaultHandler, // SVCall handler + IntDefaultHandler, // Debug monitor handler + 0, // Reserved + IntDefaultHandler, // The PendSV handler + SysTickHandler, // The SysTick handler + IntDefaultHandler, // GPIO Port A + IntDefaultHandler, // GPIO Port B + IntDefaultHandler, // GPIO Port C + IntDefaultHandler, // GPIO Port D + IntDefaultHandler, // GPIO Port E + USB0Handler, // UART0 Rx and Tx + IntDefaultHandler, // UART1 Rx and Tx + IntDefaultHandler, // SSI0 Rx and Tx + IntDefaultHandler, // I2C0 Master and Slave + IntDefaultHandler, // PWM Fault + IntDefaultHandler, // PWM Generator 0 + IntDefaultHandler, // PWM Generator 1 + IntDefaultHandler, // PWM Generator 2 + IntDefaultHandler, // Quadrature Encoder 0 + IntDefaultHandler, // ADC Sequence 0 + IntDefaultHandler, // ADC Sequence 1 + IntDefaultHandler, // ADC Sequence 2 + IntDefaultHandler, // ADC Sequence 3 + IntDefaultHandler, // Watchdog timer + IntDefaultHandler, // Timer 0 subtimer A + IntDefaultHandler, // Timer 0 subtimer B + IntDefaultHandler, // Timer 1 subtimer A + IntDefaultHandler, // Timer 1 subtimer B + IntDefaultHandler, // Timer 2 subtimer A + IntDefaultHandler, // Timer 2 subtimer B + IntDefaultHandler, // Analog Comparator 0 + IntDefaultHandler, // Analog Comparator 1 + IntDefaultHandler, // Analog Comparator 2 + IntDefaultHandler, // System Control (PLL, OSC, BO) + IntDefaultHandler, // FLASH Control + IntDefaultHandler, // GPIO Port F + IntDefaultHandler, // GPIO Port G + IntDefaultHandler, // GPIO Port H + IntDefaultHandler, // UART2 Rx and Tx + IntDefaultHandler, // SSI1 Rx and Tx + IntDefaultHandler, // Timer 3 subtimer A + IntDefaultHandler, // Timer 3 subtimer B + IntDefaultHandler, // I2C1 Master and Slave + IntDefaultHandler, // CAN0 + IntDefaultHandler, // CAN1 + IntDefaultHandler, // Ethernet + IntDefaultHandler, // Hibernate + USB0DeviceIntHandler, // USB0 + IntDefaultHandler, // PWM Generator 3 + IntDefaultHandler, // uDMA Software Transfer + IntDefaultHandler, // uDMA Error + IntDefaultHandler, // ADC1 Sequence 0 + IntDefaultHandler, // ADC1 Sequence 1 + IntDefaultHandler, // ADC1 Sequence 2 + IntDefaultHandler, // ADC1 Sequence 3 + IntDefaultHandler, // External Bus Interface 0 + IntDefaultHandler, // GPIO Port J + IntDefaultHandler, // GPIO Port K + IntDefaultHandler, // GPIO Port L + IntDefaultHandler, // SSI2 Rx and Tx + IntDefaultHandler, // SSI3 Rx and Tx + IntDefaultHandler, // UART3 Rx and Tx + IntDefaultHandler, // UART4 Rx and Tx + IntDefaultHandler, // UART5 Rx and Tx + IntDefaultHandler, // UART6 Rx and Tx + IntDefaultHandler, // UART7 Rx and Tx + IntDefaultHandler, // I2C2 Master and Slave + IntDefaultHandler, // I2C3 Master and Slave + IntDefaultHandler, // Timer 4 subtimer A + IntDefaultHandler, // Timer 4 subtimer B + IntDefaultHandler, // Timer 5 subtimer A + IntDefaultHandler, // Timer 5 subtimer B + IntDefaultHandler, // FPU + 0, // Reserved + 0, // Reserved + IntDefaultHandler, // I2C4 Master and Slave + IntDefaultHandler, // I2C5 Master and Slave + IntDefaultHandler, // GPIO Port M + IntDefaultHandler, // GPIO Port N + 0, // Reserved + IntDefaultHandler, // Tamper + IntDefaultHandler, // GPIO Port P (Summary or P0) + IntDefaultHandler, // GPIO Port P1 + IntDefaultHandler, // GPIO Port P2 + IntDefaultHandler, // GPIO Port P3 + IntDefaultHandler, // GPIO Port P4 + IntDefaultHandler, // GPIO Port P5 + IntDefaultHandler, // GPIO Port P6 + IntDefaultHandler, // GPIO Port P7 + IntDefaultHandler, // GPIO Port Q (Summary or Q0) + IntDefaultHandler, // GPIO Port Q1 + IntDefaultHandler, // GPIO Port Q2 + IntDefaultHandler, // GPIO Port Q3 + IntDefaultHandler, // GPIO Port Q4 + IntDefaultHandler, // GPIO Port Q5 + IntDefaultHandler, // GPIO Port Q6 + IntDefaultHandler, // GPIO Port Q7 + IntDefaultHandler, // GPIO Port R + IntDefaultHandler, // GPIO Port S + IntDefaultHandler, // SHA/MD5 0 + IntDefaultHandler, // AES 0 + IntDefaultHandler, // DES3DES 0 + IntDefaultHandler, // LCD Controller 0 + IntDefaultHandler, // Timer 6 subtimer A + IntDefaultHandler, // Timer 6 subtimer B + IntDefaultHandler, // Timer 7 subtimer A + IntDefaultHandler, // Timer 7 subtimer B + IntDefaultHandler, // I2C6 Master and Slave + IntDefaultHandler, // I2C7 Master and Slave + IntDefaultHandler, // HIM Scan Matrix Keyboard 0 + IntDefaultHandler, // One Wire 0 + IntDefaultHandler, // HIM PS/2 0 + IntDefaultHandler, // HIM LED Sequencer 0 + IntDefaultHandler, // HIM Consumer IR 0 + IntDefaultHandler, // I2C8 Master and Slave + IntDefaultHandler, // I2C9 Master and Slave + IntDefaultHandler, // GPIO Port T + IntDefaultHandler, // Fan 1 + 0, // Reserved +}; + +//***************************************************************************** +// +// 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. This will enable the + // floating-point unit as well, so that does not need to be done here. + // + __asm(" .global _c_int00\n" + " b.w _c_int00"); +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives a NMI. This +// simply enters an infinite loop, preserving the system state for examination +// by a debugger. +// +//***************************************************************************** +static void +NmiSR(void) +{ + // + // Enter an infinite loop. + // + while(1) + { + } +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives a fault +// interrupt. This simply enters an infinite loop, preserving the system state +// for examination by a debugger. +// +//***************************************************************************** +static void +FaultISR(void) +{ + // + // Enter an infinite loop. + // + while(1) + { + } +} + +//***************************************************************************** +// +// This is the code that gets called when the processor receives an unexpected +// interrupt. This simply enters an infinite loop, preserving the system state +// for examination by a debugger. +// +//***************************************************************************** +static void +IntDefaultHandler(void) +{ + // + // Go into an infinite loop. + // + while(1) + { + } +} |
