mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-08-20 23:16:30 +08:00
Commit 3 RX100 low power demos.
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="ASCII"?>
|
||||
<com.renesas.linkersection.model:SectionContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com.renesas.linkersection.model="http:///LinkerSection.ecore" targets="GNU_RX">
|
||||
<definedRegionsList name="RAM">
|
||||
<startAddress xsi:type="com.renesas.linkersection.model:FixedAddress"/>
|
||||
<endAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="20479"/>
|
||||
</definedRegionsList>
|
||||
<definedRegionsList name="ROM">
|
||||
<startAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294836224"/>
|
||||
<endAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294967295"/>
|
||||
</definedRegionsList>
|
||||
<sections name=".fvectors" isKeep="true">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294967248"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".fvectors"/>
|
||||
</sections>
|
||||
<sections name=".option_bytes" isKeep="true">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294967176"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".option_bytes"/>
|
||||
</sections>
|
||||
<sections name=".endian_bytes" isKeep="true">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294967168"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".endian_bytes"/>
|
||||
</sections>
|
||||
<sections name=".text">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="4294836224"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".text"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".text.*"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="P"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="etext"/>
|
||||
</sections>
|
||||
<sections name=".rvectors">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.3"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_rvectors_start"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".rvectors"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_rvectors_end"/>
|
||||
</sections>
|
||||
<sections name=".init">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.4"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".init"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__preinit_array_start"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".preinit_array"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__preinit_array_end"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__init_array_start = (. + 3) & ~ 3"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".init_array"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="SORT(.init_array.*)"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__init_array_end"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__fini_array_start"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".fini_array"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="SORT(.fini_array.*)"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__fini_array_end"/>
|
||||
</sections>
|
||||
<sections name=".fini">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.5"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".fini"/>
|
||||
</sections>
|
||||
<sections name=".got">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.6"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".got"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".got.plt"/>
|
||||
</sections>
|
||||
<sections name=".rodata">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.7"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".rodata"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".rodata.*"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="C_1"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="C_2"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="C"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_erodata"/>
|
||||
</sections>
|
||||
<sections name=".eh_frame_hdr">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.8"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".eh_frame_hdr"/>
|
||||
</sections>
|
||||
<sections name=".eh_frame">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.9"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".eh_frame"/>
|
||||
</sections>
|
||||
<sections name=".jcr">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.10"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".jcr"/>
|
||||
</sections>
|
||||
<sections name=".tors">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.11"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__CTOR_LIST__"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___ctors"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".ctors"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___ctors_end"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__CTOR_END__"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__DTOR_LIST__"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___dtors"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".dtors"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="___dtors_end"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="__DTOR_END__"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_mdata"/>
|
||||
</sections>
|
||||
<sections name=".data">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="512"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_data"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".data.*"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="D"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="D_1"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="D_2"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_edata"/>
|
||||
<reservedMemAddress xsi:type="com.renesas.linkersection.model:ReferencedLabelAddress" label="//@sections.12/@contents.10"/>
|
||||
</sections>
|
||||
<sections name=".gcc_exc">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.13"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".gcc_exc"/>
|
||||
</sections>
|
||||
<sections name=".bss">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:ReferencedSectionAddress" referencedSection="//@sections.14"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_bss"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".bss"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name=".bss.**"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="COMMON"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="B"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="B_1"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:WildCardExpression" specificSection="true" name="B_2"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_ebss"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_end"/>
|
||||
</sections>
|
||||
<sections name=".ustack">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="511"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_ustack"/>
|
||||
</sections>
|
||||
<sections name=".istack">
|
||||
<sectionAddress xsi:type="com.renesas.linkersection.model:FixedAddress" fixedAddress="507"/>
|
||||
<contents xsi:type="com.renesas.linkersection.model:Label" rhs="= .;" lhs="_istack"/>
|
||||
</sections>
|
||||
</com.renesas.linkersection.model:SectionContainer>
|
||||
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="%com.renesas.cdt.rx.hardwaredebug.win32.configuration.Id.1038200195">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="%com.renesas.cdt.rx.hardwaredebug.win32.configuration.Id.1038200195" moduleId="org.eclipse.cdt.core.settings" name="HardwareDebug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="RTOSDemo_GCC" buildArtefactType="com.renesas.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=com.renesas.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf *.lst *.lis *.lpp *.map" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.VCErrorParser" id="%com.renesas.cdt.rx.hardwaredebug.win32.configuration.Id.1038200195" name="HardwareDebug" parent="%com.renesas.cdt.rx.hardwaredebug.win32.configuration.Id">
|
||||
<folderInfo id="%com.renesas.cdt.rx.hardwaredebug.win32.configuration.Id.1038200195." name="/" resourcePath="">
|
||||
<toolChain id="%com.renesas.cdt.rx.hardwaredebug.win32.toolChain.Id.1200713553" name="KPIT GNURX-ELF Toolchain" superClass="%com.renesas.cdt.rx.hardwaredebug.win32.toolChain.Id">
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="com.renesas.cdt.rx.hardwaredebug.win32.targetPlatform.Id.2026223031" osList="win32" superClass="com.renesas.cdt.rx.hardwaredebug.win32.targetPlatform.Id"/>
|
||||
<builder buildPath="${workspace_loc:/RTOSDemo_GCC/HardwareDebug}" id="com.renesas.cdt.rx.hardwaredebug.win32.builder.Id.53784355" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GNU Make Builder" superClass="com.renesas.cdt.rx.hardwaredebug.win32.builder.Id"/>
|
||||
<tool command="rx-elf-libgen" id="com.renesas.cdt.rx.hardwaredebug.win32.tool.libgen.Id.454501696" name="Library Generator" superClass="com.renesas.cdt.rx.hardwaredebug.win32.tool.libgen.Id">
|
||||
<option id="com.renesas.cdt.core.LibraryGenerator.option.stdlib.1751934062" name="stdlib.h : Performs C program statndard processing such as storage area management" superClass="com.renesas.cdt.core.LibraryGenerator.option.stdlib" value="true" valueType="boolean"/>
|
||||
<option id="com.renesas.cdt.core.LibraryGenerator.option.string.223218455" name="string.h : Performs string comparison, copying " superClass="com.renesas.cdt.core.LibraryGenerator.option.string" value="true" valueType="boolean"/>
|
||||
<option id="com.renesas.cdt.core.LibraryGenerator.option.selectLibrary.850493556" name="Select library" superClass="com.renesas.cdt.core.LibraryGenerator.option.selectLibrary" value="Optimized" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.core.LibraryGenerator.option.libraryType.1978494303" name="Library type" superClass="com.renesas.cdt.core.LibraryGenerator.option.libraryType" value="Project-Built" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.rx.hardwaredebug.win32.tool.compiler.Id.1144539497" name="Compiler" superClass="com.renesas.cdt.rx.hardwaredebug.win32.tool.compiler.Id">
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Compiler.option.dataEndian.769042703" name="Data Endian" superClass="com.renesas.cdt.rx.HardwareDebug.Compiler.option.dataEndian" value="Little-endian data" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Compiler.option.cpuType.2018307272" name="CPU type" superClass="com.renesas.cdt.rx.HardwareDebug.Compiler.option.cpuType" value="RX100" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.core.Compiler.option.includeFileDir.316833280" name="Include file directories" superClass="com.renesas.cdt.core.Compiler.option.includeFileDir" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${TCINSTALL}\rx-elf\optlibinc""/>
|
||||
<listOptionValue builtIn="false" value=""${TCINSTALL}\rx-elf\include""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Common_Demo_Tasks/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Renesas_Files/r_bsp/mcu/rx111}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/FreeRTOS_Source/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/FreeRTOS_Source/portable/GCC/RX100}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Renesas_Files/r_bsp}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Renesas_Files/r_bsp/board/rskrx111}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Renesas_Files/r_switches}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Renesas_Files/r_switches/src}""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.core.Compiler.option.CPUSeries.2032738140" name="Cpu Series" superClass="com.renesas.cdt.core.Compiler.option.CPUSeries" value="RX111" valueType="string"/>
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Compiler.option.debugLevel.1225535928" name="Debug level" superClass="com.renesas.cdt.rx.HardwareDebug.Compiler.option.debugLevel" value="com.renesas.cdt.rx.HardwareDebug.Compiler.option.debugLevel.none" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Compiler.option.optimizationLevel.1088290642" name="Optimization level" superClass="com.renesas.cdt.rx.HardwareDebug.Compiler.option.optimizationLevel" value="com.renesas.cdt.rx.HardwareDebug.Compiler.option.optimizationLevel.speedCodeSize" valueType="enumerated"/>
|
||||
<inputType id="%Base.Compiler.C.InputType.Id.962451183" name="C Input" superClass="%Base.Compiler.C.InputType.Id"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.rx.hardwaredebug.win32.tool.assembler.Id.1642705589" name="Assembler" superClass="com.renesas.cdt.rx.hardwaredebug.win32.tool.assembler.Id">
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Assembler.option.dataEndian.67883143" name="Data Endian" superClass="com.renesas.cdt.rx.HardwareDebug.Assembler.option.dataEndian" value="Little-endian data" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.core.Assembler.option.includeFileDirectories.434361507" name="Include file directories" superClass="com.renesas.cdt.core.Assembler.option.includeFileDirectories" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}\src""/>
|
||||
</option>
|
||||
<inputType id="%Base.Assembler.inputType.Id.2097860459" name="Assembler InputType" superClass="%Base.Assembler.inputType.Id"/>
|
||||
</tool>
|
||||
<tool command="rx-elf-ld" commandLinePattern="${COMMAND} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT}${INPUTS} ${FLAGS}" id="com.renesas.cdt.rx.hardwaredebug.win32.tool.linker.Id.1295703269" name="Linker" superClass="com.renesas.cdt.rx.hardwaredebug.win32.tool.linker.Id">
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Linker.option.dataEndian.1400369130" name="Data Endian" superClass="com.renesas.cdt.rx.HardwareDebug.Linker.option.dataEndian" value="Little-endian data" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveSearchDirectories.770090581" name="Archive search directories" superClass="com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveSearchDirectories" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${CONFIGDIR}""/>
|
||||
<listOptionValue builtIn="false" value=""${TCINSTALL}\lib\gcc\rx-elf\\${GCC_VERSION}""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveLibraryFiles.1867799274" name="Archive (library) files" superClass="com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveLibraryFiles" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="${ProjName}"/>
|
||||
<listOptionValue builtIn="false" value="gcc"/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.core.Linker.option.userDefinedOptions.1094627795" name="User defined options" superClass="com.renesas.cdt.core.Linker.option.userDefinedOptions" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-e_PowerON_Reset"/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.rx.hardwaredebug.win32.tool.objcopy.Id.1559563032" name="Objcopy" superClass="com.renesas.cdt.rx.hardwaredebug.win32.tool.objcopy.Id"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<profile id="com.iar.cdt.v850.scanner.IAR_V850_PerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="false" filePath=""/>
|
||||
<parser enabled="false"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="com.iar.cdt.v850.toolchain.scannerInfoProvider1">
|
||||
<runAction arguments="" command="" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="com.iar.cdt.rl78.scanner.IAR_RL78_PerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="false" filePath=""/>
|
||||
<parser enabled="false"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="com.iar.cdt.rl78.toolchain.scannerInfoProviderRL78">
|
||||
<runAction arguments="" command="" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="com.iar.cdt.rx.scanner.IAR_RX_PerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="false" filePath=""/>
|
||||
<parser enabled="false"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="com.iar.cdt.rx.toolchain.scannerInfoProviderRX">
|
||||
<runAction arguments="" command="" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="makefileGenerator">
|
||||
<runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
|
||||
<buildOutputProvider>
|
||||
<openAction enabled="true" filePath=""/>
|
||||
<parser enabled="true"/>
|
||||
</buildOutputProvider>
|
||||
<scannerInfoProvider id="specsFile">
|
||||
<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/>
|
||||
<parser enabled="true"/>
|
||||
</scannerInfoProvider>
|
||||
</profile>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="RTOSDemo_GCC.com.renesas.cdt.rx.projectType.Id.1714941242" name="GNURX" projectType="com.renesas.cdt.rx.projectType.Id"/>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
@@ -0,0 +1,6 @@
|
||||
TOOL_CHAIN=KPIT GNURX-ELF Toolchain
|
||||
VERSION=v12.01
|
||||
TC_INSTALL=C:\devtools\Renesas\e2studio\GNURXV~1.01-\rx-elf\
|
||||
GCC_STRING=4.6-GNURX_v12.01
|
||||
VERISON_IDE=3.06.02.080
|
||||
E2STUDIO_VERSION=1.1.1.7
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>RTOSDemo_GCC</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.renesas.cdt.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||
<value>make</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value>${workspace_loc:/RTOSDemo_GCC/HardwareDebug}</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
<value>clean</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.contents</key>
|
||||
<value>org.eclipse.cdt.make.core.configurationIds</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||
<value>false</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
|
||||
<value>all</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>com.renesas.cdt.core.kpitcnature</nature>
|
||||
<nature>com.renesas.cdt.core.kpitccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,22 @@
|
||||
#Mon Mar 11 11:21:23 GMT 2013
|
||||
Library\ Generator\ Command=rx-elf-libgen
|
||||
com.renesas.cdt.core.Assembler.option.includeFileDirectories="${workspace_loc\:/${ProjName}}\\src";
|
||||
com.renesas.cdt.core.Compiler.option.includeFileDir.316833280="${TCINSTALL}\\rx-elf\\optlibinc";
|
||||
com.renesas.cdt.core.LibraryGenerator.option.ctype=true
|
||||
com.renesas.cdt.core.LibraryGenerator.option.libraryType=Project-Built
|
||||
com.renesas.cdt.core.LibraryGenerator.option.math=false
|
||||
com.renesas.cdt.core.LibraryGenerator.option.selectLibrary=Optimized
|
||||
com.renesas.cdt.core.LibraryGenerator.option.stdio=false
|
||||
com.renesas.cdt.core.LibraryGenerator.option.stdlib=true
|
||||
com.renesas.cdt.core.LibraryGenerator.option.string=true
|
||||
com.renesas.cdt.core.Linker.option.userDefinedOptions=[Ljava.lang.String;@13ec853
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.cpuType=RX100
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.cpuType.2018307272=RX100
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.dataEndian=Little-endian data
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.disableFPUInstructions=false
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.genCodeForRX610=false
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.generateRXas100output=false
|
||||
com.renesas.cdt.rx.HardwareDebug.Compiler.option.make64bitDouble=false
|
||||
com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveLibraryFiles=${ProjName};gcc;
|
||||
com.renesas.cdt.rx.HardwareDebug.Linker.option.archiveSearchDirectories.770090581="${CONFIGDIR}";"${TCINSTALL}\\lib\\gcc\\rx-elf\\\\${GCC_VERSION}";
|
||||
eclipse.preferences.version=1
|
||||
@@ -0,0 +1,52 @@
|
||||
REM This file should be executed from the command line prior to the first
|
||||
REM build. It will be necessary to refresh the Eclipse project once the
|
||||
REM .bat file has been executed (normally just press F5 to refresh).
|
||||
|
||||
REM Copies all the required files from their location within the standard
|
||||
REM FreeRTOS directory structure to under the Eclipse project directory.
|
||||
REM This permits the Eclipse project to be used in 'managed' mode and without
|
||||
REM having to setup any linked resources.
|
||||
|
||||
REM Standard paths
|
||||
SET FREERTOS_SOURCE=..\..\Source
|
||||
SET COMMON_SOURCE=..\Common\minimal
|
||||
SET COMMON_INCLUDE=..\Common\include
|
||||
|
||||
REM Have the files already been copied?
|
||||
IF EXIST RTOSDemo\FreeRTOS_Source Goto END
|
||||
|
||||
REM Create the required directory structure.
|
||||
MD RTOSDemo\FreeRTOS_Source
|
||||
MD RTOSDemo\FreeRTOS_Source\include
|
||||
MD RTOSDemo\FreeRTOS_Source\portable
|
||||
MD RTOSDemo\FreeRTOS_Source\portable\MemMang
|
||||
MD RTOSDemo\FreeRTOS_Source\portable\GCC
|
||||
MD RTOSDemo\FreeRTOS_Source\portable\GCC\RX100
|
||||
MD RTOSDemo\Common_Demo_Tasks
|
||||
MD RTOSDemo\Common_Demo_Tasks\include
|
||||
|
||||
REM Copy the core kernel files into the project directory
|
||||
copy %FREERTOS_SOURCE%\tasks.c RTOSDemo\FreeRTOS_Source
|
||||
copy %FREERTOS_SOURCE%\queue.c RTOSDemo\FreeRTOS_Source
|
||||
copy %FREERTOS_SOURCE%\list.c RTOSDemo\FreeRTOS_Source
|
||||
copy %FREERTOS_SOURCE%\timers.c RTOSDemo\FreeRTOS_Source
|
||||
|
||||
REM Copy the common header files into the project directory
|
||||
copy %FREERTOS_SOURCE%\include\*.* RTOSDemo\FreeRTOS_Source\include
|
||||
|
||||
REM Copy the portable layer files into the project directory
|
||||
copy %FREERTOS_SOURCE%\portable\GCC\RX100\*.* RTOSDemo\FreeRTOS_Source\portable\GCC\RX100
|
||||
|
||||
REM Copy the memory allocation files into the project directory
|
||||
copy %FREERTOS_SOURCE%\portable\MemMang\heap_4.c RTOSDemo\FreeRTOS_Source\portable\MemMang
|
||||
|
||||
REM Copy the files that define the common demo tasks.
|
||||
copy %COMMON_SOURCE%\death.c RTOSDemo\Common_Demo_Tasks
|
||||
copy %COMMON_SOURCE%\blocktim.c RTOSDemo\Common_Demo_Tasks
|
||||
copy %COMMON_SOURCE%\GenQTest.c RTOSDemo\Common_Demo_Tasks
|
||||
copy %COMMON_SOURCE%\recmutex.c RTOSDemo\Common_Demo_Tasks
|
||||
|
||||
REM Copy the common demo file headers.
|
||||
copy %COMMON_INCLUDE%\*.h RTOSDemo\Common_Demo_Tasks\include
|
||||
|
||||
: END
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The following #error directive is to remind users that a batch file must be
|
||||
* executed prior to this project being built. The batch file *cannot* be
|
||||
* executed from within the IDE! Once it has been executed, re-open or refresh
|
||||
* the Eclipse project and remove the #error line below.
|
||||
*/
|
||||
//#error Ensure CreateProjectDirectoryStructure.bat has been executed before building. See comment immediately above.
|
||||
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
#define FREERTOS_CONFIG_H
|
||||
|
||||
/* Hardware specifics. */
|
||||
#include "platform.h"
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Application specific definitions.
|
||||
*
|
||||
* These definitions should be adjusted for your particular hardware and
|
||||
* application requirements.
|
||||
*
|
||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
||||
*
|
||||
* See http://www.freertos.org/a00110.html.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
/* DEMO SPECIFIC SETTING:
|
||||
* Set configCREATE_LOW_POWER_DEMO to one to run the low power demo with tick
|
||||
* suppression, or 0 to run the more comprehensive test and demo application.
|
||||
* If configCREATE_LOW_POWER_DEMO is set to 1 then main() calls main_low_power().
|
||||
* If configCREATE_LOW_POWER_DEMO is set to 0 then main() calls main_full().
|
||||
*/
|
||||
#define configCREATE_LOW_POWER_DEMO 1
|
||||
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_TICKLESS_IDLE configCREATE_LOW_POWER_DEMO
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( ICLK_HZ ) /* Set in mcu_info.h. */
|
||||
#define configPERIPHERAL_CLOCK_HZ ( PCLKB_HZ ) /* Set in muc_info.h. */
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 9 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 12 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 0
|
||||
#define configUSE_MALLOC_FAILED_HOOK 0
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 )
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
/* Software timer definitions - only included when the demo is configured to
|
||||
build the full demo (as opposed to the low power demo). */
|
||||
#if configCREATE_LOW_POWER_DEMO == 1
|
||||
#define configUSE_TIMERS 0
|
||||
#else
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 3 )
|
||||
#define configTIMER_QUEUE_LENGTH 5
|
||||
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE )
|
||||
#endif /* configCREATE_LOW_POWER_DEMO */
|
||||
|
||||
/* The interrupt priority used by the kernel itself for the tick interrupt and
|
||||
the pended interrupt. This would normally be the lowest priority. */
|
||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
||||
|
||||
/* The maximum interrupt priority from which FreeRTOS API calls can be made.
|
||||
Interrupts that use a priority above this will not be effected by anything the
|
||||
kernel is doing but must not make any use of FreeRTOS functionality.
|
||||
interrupts that use a priority at or below configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||
can make use of FreeRTOS API function but *only* functions that end in
|
||||
"FromISR()". */
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
|
||||
extern void vAssertCalled( void );
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled();
|
||||
|
||||
/* The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros
|
||||
allow the application writer to add additional code before and after the MCU is
|
||||
placed into the low power state respectively. The implementations provided in
|
||||
this demo can be extended to save even more power - for example the analog
|
||||
input used by the low power demo could be switched off in the pre-sleep macro
|
||||
and back on again in the post sleep macro. */
|
||||
void vPreSleepProcessing( unsigned long xExpectedIdleTime );
|
||||
void vPostSleepProcessing( unsigned long xExpectedIdleTime );
|
||||
#define configPRE_SLEEP_PROCESSING( xExpectedIdleTime ) vPreSleepProcessing( xExpectedIdleTime );
|
||||
#define configPOST_SLEEP_PROCESSING( xExpectedIdleTime ) vPostSleepProcessing( xExpectedIdleTime );
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Simple IO routines to control the LEDs.
|
||||
*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
/* Demo includes. */
|
||||
#include "partest.h"
|
||||
|
||||
#define partestNUM_LEDS ( 4 )
|
||||
|
||||
long lParTestGetLEDState( unsigned long ulLED );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestInitialise( void )
|
||||
{
|
||||
/* Port pin configuration is done by the low level set up prior to this
|
||||
function being called. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestSetLED( unsigned long ulLED, signed long xValue )
|
||||
{
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
if( xValue != 0 )
|
||||
{
|
||||
/* Turn the LED on. */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0: LED0 = LED_ON;
|
||||
break;
|
||||
case 1: LED1 = LED_ON;
|
||||
break;
|
||||
case 2: LED2 = LED_ON;
|
||||
break;
|
||||
case 3: LED3 = LED_ON;
|
||||
break;
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Turn the LED off. */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0: LED0 = LED_OFF;
|
||||
break;
|
||||
case 1: LED1 = LED_OFF;
|
||||
break;
|
||||
case 2: LED2 = LED_OFF;
|
||||
break;
|
||||
case 3: LED3 = LED_OFF;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestToggleLED( unsigned long ulLED )
|
||||
{
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( lParTestGetLEDState( ulLED ) != 0x00 )
|
||||
{
|
||||
vParTestSetLED( ulLED, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
vParTestSetLED( ulLED, 1 );
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
long lParTestGetLEDState( unsigned long ulLED )
|
||||
{
|
||||
long lReturn = pdTRUE;
|
||||
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0 : if( LED0 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 1 : if( LED1 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 2 : if( LED2 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 3 : if( LED3 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return lReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : lcd.c
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Provides variable and function declarations for lcd.c file
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Standard string manipulation & formatting functions */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
/* Defines standard variable types used in this function */
|
||||
#include <stdint.h>
|
||||
/* Bring in board includes. */
|
||||
#include "platform.h"
|
||||
/* Following header file provides function prototypes for LCD controlling functions & macro defines */
|
||||
#include "lcd.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Private global variables and functions
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_delay(volatile int32_t nsecs);
|
||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value);
|
||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value);
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_initialize
|
||||
* Description : Initializes the LCD display.
|
||||
* Arguments : none
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_initialize(void)
|
||||
{
|
||||
/* Set LCD data pins as outputs. */
|
||||
PORT4.PDR.BYTE |= 0x0F;
|
||||
|
||||
/* Set LCD control pins as outputs. */
|
||||
RS_PIN_DDR = 1;
|
||||
E_PIN_DDR = 1;
|
||||
|
||||
/* Power Up Delay for the LCD Module */
|
||||
lcd_delay(50000000);
|
||||
|
||||
/* Display initialises in 8 bit mode - so send one write (seen as 8 bit) to set to 4 bit mode. */
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
|
||||
/* Function Set */
|
||||
lcd_nibble_write(CTRL_WR, 0x02);
|
||||
lcd_delay(39000);
|
||||
lcd_nibble_write(CTRL_WR, 0x02);
|
||||
lcd_nibble_write(CTRL_WR, (LCD_DISPLAY_ON | LCD_TWO_LINE ));
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Display ON/OFF control */
|
||||
lcd_write(CTRL_WR, LCD_CURSOR_OFF);
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Display Clear */
|
||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
||||
lcd_delay(2000000);
|
||||
|
||||
/* Entry Mode Set */
|
||||
lcd_write(CTRL_WR, 0x06);
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Home the cursor */
|
||||
lcd_write(CTRL_WR, LCD_HOME_L1);
|
||||
lcd_delay(5000000);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_clear
|
||||
* Description : Clears the LCD
|
||||
* Arguments : none
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_clear(void)
|
||||
{
|
||||
/* Display Clear */
|
||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
||||
lcd_delay(2000000);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_display
|
||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD.
|
||||
* You need to use the defines LCD_LINE1 and LCD_LINE2 in order to specify the starting position.
|
||||
* For example, to start at the 2nd position on line 1...
|
||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
||||
* Arguments : position -
|
||||
* Line number of display
|
||||
* string -
|
||||
* Pointer to null terminated string
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_display(uint8_t position, uint8_t const * string)
|
||||
{
|
||||
/* Declare next position variable */
|
||||
static uint8_t next_pos = 0xFF;
|
||||
|
||||
/* Set line position if needed. We don't want to if we don't need to because LCD control operations take longer
|
||||
than LCD data operations. */
|
||||
if (next_pos != position)
|
||||
{
|
||||
if(position < LCD_LINE2)
|
||||
{
|
||||
/* Display on Line 1 */
|
||||
lcd_write(CTRL_WR, ((uint8_t)(LCD_HOME_L1 + position)));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Display on Line 2 */
|
||||
lcd_write(CTRL_WR, ((uint8_t)((LCD_HOME_L2 + position) - LCD_LINE2)));
|
||||
}
|
||||
|
||||
lcd_delay(39000);
|
||||
|
||||
/* set position index to known value */
|
||||
next_pos = position;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
/* Write character to LCD. */
|
||||
lcd_write(DATA_WR,*string++);
|
||||
|
||||
lcd_delay(43000);
|
||||
|
||||
/* Increment position index */
|
||||
next_pos++;
|
||||
}
|
||||
while(*string);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_delay
|
||||
* Description : Implements LCD required delays.
|
||||
* Arguments : nsecs -
|
||||
* Number of nanoseconds to delay. RX111 has max clock of 32MHz which gives a cycle time of 31.3ns.
|
||||
* This means that nothing under 313ns should be input. 313ns would be 10 cycles which is still
|
||||
* being optimistic for getting in and out of this function.
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_delay(volatile int32_t nsecs)
|
||||
{
|
||||
while (0 < nsecs)
|
||||
{
|
||||
/* Subtract off 10 cycles per iteration. This number was obtained when using the Renesas toolchain at
|
||||
optimization level 2. The number to nanoseconds to subtract off below is calculated off of the ICLK speed. */
|
||||
nsecs -= (int32_t)((313.0)*(32000000.0/(float)ICLK_HZ));
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_nibble_write
|
||||
* Description : Writes data to display. Sends command to display.
|
||||
* Arguments : value -
|
||||
* The value to write
|
||||
* data_or_ctrl -
|
||||
* Whether to write data or control.
|
||||
* 1 = DATA
|
||||
* 0 = CONTROL
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value)
|
||||
{
|
||||
/* Set Register Select pin high for Data */
|
||||
if (data_or_ctrl == DATA_WR)
|
||||
{
|
||||
/* Data write. */
|
||||
RS_PIN = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Control write. */
|
||||
RS_PIN = 0;
|
||||
}
|
||||
|
||||
/* tsu1 delay */
|
||||
lcd_delay(60);
|
||||
|
||||
/* EN enable chip (HIGH) */
|
||||
E_PIN = 1;
|
||||
|
||||
/* Output the data */
|
||||
PORT4.PODR.BYTE = (value & 0x0F);
|
||||
|
||||
/* tw delay */
|
||||
lcd_delay(450);
|
||||
|
||||
/* Latch data by dropping E */
|
||||
E_PIN = 0;
|
||||
|
||||
/* th2 delay */
|
||||
lcd_delay(10);
|
||||
|
||||
/* tc delay */
|
||||
lcd_delay(480);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_write
|
||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD. You need to use the defines LCD_LINE1 and
|
||||
* LCD_LINE2 in order to specify the starting position.
|
||||
* For example, to start at the 2nd position on line 1...
|
||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
||||
* Arguments : value -
|
||||
* The value to write
|
||||
* data_or_ctrl -
|
||||
* Whether to write data or control.
|
||||
* 1 = DATA
|
||||
* 0 = CONTROL
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value)
|
||||
{
|
||||
/* Write upper nibble first */
|
||||
lcd_nibble_write(data_or_ctrl, (uint8_t)((value & 0xF0) >> 4));
|
||||
|
||||
/* Write lower nibble second */
|
||||
lcd_nibble_write(data_or_ctrl, (uint8_t)(value & 0x0F));
|
||||
}
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : lcd.h
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Provides variable and function declarations for lcd.c file
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/* Multiple inclusion prevention macro */
|
||||
#ifndef LCD_H
|
||||
#define LCD_H
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Defines standard integer variable types used in this file */
|
||||
#include <stdint.h>
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Macro definitions
|
||||
***********************************************************************************************************************/
|
||||
/* RS register select pin */
|
||||
#define RS_PIN PORTC.PODR.BIT.B5
|
||||
#define RS_PIN_DDR PORTC.PDR.BIT.B5
|
||||
/* Display enable pin */
|
||||
#define E_PIN PORTB.PODR.BIT.B1
|
||||
#define E_PIN_DDR PORTB.PDR.BIT.B1
|
||||
/* Data write/read definition */
|
||||
#define DATA_WR 1
|
||||
/* Control write/read definition */
|
||||
#define CTRL_WR 0
|
||||
/* Maximum characters per line of LCD display. */
|
||||
#define NUMB_CHARS_PER_LINE 8
|
||||
/* Number of lines on the LCD display */
|
||||
#define MAXIMUM_LINES 2
|
||||
/* Character position of LCD line 1 */
|
||||
#define LCD_LINE1 0
|
||||
/* Character position of LCD line 2 */
|
||||
#define LCD_LINE2 16
|
||||
/* Clear LCD display and home cursor */
|
||||
#define LCD_CLEAR 0x01
|
||||
/* Move cursor to line 1 */
|
||||
#define LCD_HOME_L1 0x80
|
||||
/* Move cursor to line 2 */
|
||||
#define LCD_HOME_L2 0xC0
|
||||
/* Cursor auto decrement after R/W */
|
||||
#define CURSOR_MODE_DEC 0x04
|
||||
/* Cursor auto increment after R/W */
|
||||
#define CURSOR_MODE_INC 0x06
|
||||
/* Setup, 4 bits,2 lines, 5X7 */
|
||||
#define FUNCTION_SET 0x28
|
||||
/* Display ON with Cursor */
|
||||
#define LCD_CURSOR_ON 0x0E
|
||||
/* Display ON with Cursor off */
|
||||
#define LCD_CURSOR_OFF 0x0C
|
||||
/* Display on with blinking cursor */
|
||||
#define LCD_CURSOR_BLINK 0x0D
|
||||
/* Move Cursor Left One Position */
|
||||
#define LCD_CURSOR_LEFT 0x10
|
||||
/* Move Cursor Right One Position */
|
||||
#define LCD_CURSOR_RIGHT 0x14
|
||||
/* Enable LCD display */
|
||||
#define LCD_DISPLAY_ON 0x04
|
||||
/* Enable both LCD lines */
|
||||
#define LCD_TWO_LINE 0x08
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Exported global functions (to be accessed by other files)
|
||||
***********************************************************************************************************************/
|
||||
/* LCD initialisation function declaration */
|
||||
void lcd_initialize (void);
|
||||
|
||||
/* Update display function declaration */
|
||||
void lcd_display(uint8_t position, uint8_t const * string);
|
||||
|
||||
/* Clear LCD function delcaration */
|
||||
void lcd_clear (void);
|
||||
|
||||
/* End of multiple inclusion prevention macro */
|
||||
#endif
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp.h
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Has the header files that should be included for this platform.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef PLATFORM_BOARD_RSKRX111
|
||||
#define PLATFORM_BOARD_RSKRX111
|
||||
|
||||
/* Make sure that no other platforms have already been defined. Do not touch this! */
|
||||
#ifdef PLATFORM_DEFINED
|
||||
#error "Error - Multiple platforms defined in platform.h!"
|
||||
#else
|
||||
#define PLATFORM_DEFINED
|
||||
#endif
|
||||
|
||||
/***********************************************************************************************************************
|
||||
INCLUDE APPROPRIATE MCU AND BOARD FILES
|
||||
***********************************************************************************************************************/
|
||||
#include "r_bsp_config.h"
|
||||
#include ".\mcu\rx111\iodefine.h"
|
||||
#include ".\mcu\rx111\mcu_info.h"
|
||||
#include ".\board\rskrx111\rskrx111.h"
|
||||
#include ".\board\rskrx111\lcd.h"
|
||||
|
||||
#endif /* PLATFORM_BOARD_RSKRX111 */
|
||||
|
||||
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp_config_reference.c
|
||||
* Device(s) : RX111
|
||||
* Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included
|
||||
* somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h)
|
||||
* is just a reference file that the user can use to make their own r_bsp_config.h file.
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 07.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
#ifndef R_BSP_CONFIG_REF_HEADER_FILE
|
||||
#define R_BSP_CONFIG_REF_HEADER_FILE
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Configuration Options
|
||||
***********************************************************************************************************************/
|
||||
/* Enter the product part number for your MCU. This information will be used to obtain information about your MCU such
|
||||
as package and memory size.
|
||||
To help parse this information, the part number will be defined using multiple macros.
|
||||
R 5 F 51 11 5 A D FM
|
||||
| | | | | | | | | Macro Name Description
|
||||
| | | | | | | | |__MCU_PART_PACKAGE = Package type, number of pins, and pin pitch
|
||||
| | | | | | | |____not used = Products with wide temperature range (D: -40 to 85C G: -40 to 105C)
|
||||
| | | | | | |______not used = Blank
|
||||
| | | | | |________MCU_PART_MEMORY_SIZE = ROM, RAM, and Data Flash Capacity
|
||||
| | | | |___________MCU_PART_GROUP = Group name
|
||||
| | | |______________MCU_PART_SERIES = Series name
|
||||
| | |________________MCU_PART_MEMORY_TYPE = Type of memory (Flash)
|
||||
| |__________________not used = Renesas MCU
|
||||
|____________________not used = Renesas semiconductor product.
|
||||
*/
|
||||
|
||||
/* Package type. Set the macro definition based on values below:
|
||||
Character(s) = Value for macro = Package Type/Number of Pins/Pin Pitch
|
||||
FM = 0x0 = LFQFP/64/0.50
|
||||
FK = 0x1 = LQFP/64/0.80
|
||||
LF = 0x2 = TFLGA/64/0.50
|
||||
FL = 0x3 = LFQFP/48/0.50
|
||||
NE = 0x4 = VQFN/48/0.50
|
||||
NC = 0x5 = HWQFN/36/0.50
|
||||
LM = 0x6 = WFLGA/36/0.50
|
||||
SB = 0x7 = SSOP/36/0.80
|
||||
*/
|
||||
#define MCU_PART_PACKAGE (0x0)
|
||||
|
||||
/* ROM, RAM, and Data Flash Capacity.
|
||||
Character(s) = Value for macro = ROM Size/Ram Size/Data Flash Size
|
||||
5 = 0x5 = 128KB/16KB/8KB
|
||||
4 = 0x4 = 96KB/16KB/8KB
|
||||
3 = 0x3 = 64KB/10KB/8KB
|
||||
1 = 0x1 = 32KB/10KB/8KB
|
||||
J = 0x0 = 16KB/8KB/8KB
|
||||
*/
|
||||
#define MCU_PART_MEMORY_SIZE (0x5)
|
||||
|
||||
/* Group name.
|
||||
Character(s) = Value for macro = Description
|
||||
10 = 0x0 = RX110 Group
|
||||
11 = 0x1 = RX111 Group
|
||||
*/
|
||||
#define MCU_PART_GROUP (0x1)
|
||||
|
||||
/* Series name.
|
||||
Character(s) = Value for macro = Description
|
||||
51 = 0x0 = RX100 Series
|
||||
*/
|
||||
#define MCU_PART_SERIES (0x0)
|
||||
|
||||
/* Memory type.
|
||||
Character(s) = Value for macro = Description
|
||||
F = 0x0 = Flash memory version
|
||||
*/
|
||||
#define MCU_PART_MEMORY_TYPE (0x0)
|
||||
|
||||
/* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a
|
||||
'#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */
|
||||
#if defined(BSP_DECLARE_STACK)
|
||||
/* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize su=0x400
|
||||
/* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize si=0x100
|
||||
#endif
|
||||
|
||||
/* Heap size in bytes. */
|
||||
#define HEAP_BYTES (0x400)
|
||||
|
||||
/* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information
|
||||
on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual.
|
||||
0 = Stay in Supervisor mode.
|
||||
1 = Switch to User mode.
|
||||
*/
|
||||
#define RUN_IN_USER_MODE (0)
|
||||
|
||||
|
||||
/* This macro lets other modules no if a RTOS is being used.
|
||||
0 = RTOS is not used.
|
||||
1 = RTOS is used.
|
||||
*/
|
||||
#define RTOS_USED (0)
|
||||
|
||||
/* Clock source select (CKSEL).
|
||||
0 = Low Speed On-Chip Oscillator (LOCO)
|
||||
1 = High Speed On-Chip Oscillator (HOCO)
|
||||
2 = Main Clock Oscillator
|
||||
3 = Sub-Clock Oscillator
|
||||
4 = PLL Circuit
|
||||
*/
|
||||
#define CLOCK_SOURCE (4)
|
||||
|
||||
/* Clock configuration options.
|
||||
The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The
|
||||
multiplier settings are used to set the clock registers in resetprg.c. If a 16MHz clock is used and the
|
||||
ICLK is 24MHz, PCLKB is 24MHz, FCLK is 24MHz, PCLKD is 24MHz, and CKO is 1MHz then the
|
||||
settings would be:
|
||||
|
||||
XTAL_HZ = 16000000
|
||||
PLL_DIV = 2
|
||||
PLL_MUL = 6 (16MHz x 3 = 48MHz)
|
||||
ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 24MHz
|
||||
PCKB_DIV = 2 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 24MHz
|
||||
PCKD_DIV = 2 : Peripheral Clock D (PCLKD) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKD_DIV) = 24MHz
|
||||
FCK_DIV = 2 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 24MHz
|
||||
*/
|
||||
/* XTAL - Input clock frequency in Hz */
|
||||
#define XTAL_HZ (16000000)
|
||||
/* PLL Input Frequency Divider Select (PLIDIV).
|
||||
Available divisors = /1 (no division), /2, /4
|
||||
*/
|
||||
#define PLL_DIV (2)
|
||||
/* PLL Frequency Multiplication Factor Select (STC).
|
||||
Available multipliers = x6, x8
|
||||
*/
|
||||
#define PLL_MUL (6)
|
||||
/* System Clock Divider (ICK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define ICK_DIV (2)
|
||||
/* Peripheral Module Clock B Divider (PCKB).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKB_DIV (2)
|
||||
/* Peripheral Module Clock D Divider (PCKD).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKD_DIV (2)
|
||||
/* Flash IF Clock Divider (FCK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define FCK_DIV (2)
|
||||
|
||||
/* Below are callback functions that can be used for detecting MCU exceptions, undefined interrupt sources, and
|
||||
bus errors. If the user wishes to be alerted of these events then they will need to define the macro as a
|
||||
function to be called when the event occurs. For example, if the user wanted the function
|
||||
excep_undefined_instr_isr() to be called when an undefined interrupt source ISR is triggered then they would
|
||||
do the following:
|
||||
#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
If the user does not wish to be alerted of these events then they should comment out the macros.
|
||||
|
||||
NOTE: When a callback function is called it will be called from within a ISR. This means that the function
|
||||
will essentially be an interrupt and will hold off other interrupts that occur in the system while it
|
||||
is executing. For this reason, it is recommended to keep these callback functions short as to not
|
||||
decrease the real-time response of your system.
|
||||
*/
|
||||
/* Callback for Supervisor Instruction Violation Exception. */
|
||||
//#define EXCEP_SUPERVISOR_ISR_CALLBACK supervisor_instr_cb
|
||||
|
||||
/* Callback for Undefined Instruction Exception. */
|
||||
//#define EXCEP_UNDEFINED_INSTR_ISR_CALLBACK undefined_instr_cb
|
||||
|
||||
/* Callback for Non-maskable Interrupt. */
|
||||
//#define NMI_ISR_CALLBACK nmi_cb
|
||||
|
||||
/* Callback for all undefined interrupt vectors. User can set a breakpoint in this function to determine which source
|
||||
is creating unwanted interrupts. */
|
||||
//#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
|
||||
/* Callback for Bus Error Interrupt. */
|
||||
//#define BUS_ERROR_ISR_CALLBACK bus_error_cb
|
||||
|
||||
/* The user has the option of separately choosing little or big endian for the User Application Area */
|
||||
|
||||
/* Endian mode for User Application.
|
||||
0 = Big Endian
|
||||
Else = Little Endian (Default)
|
||||
*/
|
||||
#define USER_APP_ENDIAN (1)
|
||||
|
||||
|
||||
/* Configure WDT and IWDT settings.
|
||||
OFS0 - Option Function Select Register 0
|
||||
OFS0 - Option Function Select Register 0
|
||||
b31:b15 Reserved (set to 1)
|
||||
b14 IWDTSLCSTP - IWDT Sleep Mode Count Stop Control - (0=can't stop count, 1=stop w/some low power modes)
|
||||
b13 Reserved (set to 1)
|
||||
b12 IWDTRSTIRQS - IWDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU)
|
||||
b11:b10 IWDTRPSS - IWDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use)
|
||||
b9:b8 IWDTRPES - IWDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use)
|
||||
b7:b4 IWDTCKS - IWDT Clock Frequency Division Ratio - (0=none, 2=/16, 3 = /32, 4=/64, 0xF=/128, 5=/256)
|
||||
b3:b2 IWDTTOPS - IWDT Timeout Period Select - (0=128 cycles, 1=512, 2=1024, 3=2048)
|
||||
b1 IWDTSTRT - IWDT Start Mode Select - (0=auto-start after reset, 1=halt after reset)
|
||||
b0 Reserved (set to 1) */
|
||||
#define OFS0_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Configure whether voltage detection 1 circuit and HOCO are enabled after reset.
|
||||
OFS1 - Option Function Select Register 1
|
||||
b31:b9 Reserved (set to 1)
|
||||
b8 HOCOEN - Enable/disable HOCO oscillation after a reset (0=enable, 1=disable)
|
||||
b7:b4 STUPLVD1LVL - Startup Voltage Monitoring 1 Reset Detection Level Select
|
||||
0 1 0 0: 3.10 V
|
||||
0 1 0 1: 3.00 V
|
||||
0 1 1 0: 2.90 V
|
||||
0 1 1 1: 2.79 V
|
||||
1 0 0 0: 2.68 V
|
||||
1 0 0 1: 2.58 V
|
||||
1 0 1 0: 2.48 V
|
||||
1 0 1 1: 2.06 V
|
||||
1 1 0 0: 1.96 V
|
||||
1 1 0 1: 1.86 V
|
||||
b3:b2 Reserved (set to 1)
|
||||
b2 STUPLVD1REN - Startup Voltage Monitoring 1 Reset Enable (1=monitoring disabled)
|
||||
b0 FASTSTUP - Power-On Fast Startup Time (1=normal; read only) */
|
||||
#define OFS1_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Initializes C input & output library functions.
|
||||
0 = Disable I/O library initialization in resetprg.c. If you are not using stdio then use this value.
|
||||
1 = Enable I/O library initialization in resetprg.c. This is default and needed if you are using stdio. */
|
||||
#define IO_LIB_ENABLE (1)
|
||||
|
||||
#endif /* R_BSP_CONFIG_REF_HEADER_FILE */
|
||||
|
||||
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : rskrx111.h
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Board specific definitions for the RSKRX111.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef RSKRX111_H
|
||||
#define RSKRX111_H
|
||||
|
||||
/* Local defines */
|
||||
#define LED_ON (0)
|
||||
#define LED_OFF (1)
|
||||
#define SET_BIT_HIGH (1)
|
||||
#define SET_BIT_LOW (0)
|
||||
#define SET_BYTE_HIGH (0xFF)
|
||||
#define SET_BYTE_LOW (0x00)
|
||||
|
||||
/* Switches */
|
||||
#define SW_ACTIVE 0
|
||||
#define SW1 PORT3.PIDR.BIT.B0
|
||||
#define SW2 PORT3.PIDR.BIT.B1
|
||||
#define SW3 PORTE.PIDR.BIT.B4
|
||||
#define SW1_PDR PORT3.PDR.BIT.B0
|
||||
#define SW2_PDR PORT3.PDR.BIT.B1
|
||||
#define SW3_PDR PORTE.PDR.BIT.B4
|
||||
#define SW1_PMR PORT3.PMR.BIT.B0
|
||||
#define SW2_PMR PORT3.PMR.BIT.B1
|
||||
#define SW3_PMR PORTE.PMR.BIT.B4
|
||||
|
||||
/* LEDs */
|
||||
#define LED0 PORTB.PODR.BIT.B7
|
||||
#define LED1 PORTA.PODR.BIT.B0
|
||||
#define LED2 PORT5.PODR.BIT.B4
|
||||
#define LED3 PORT1.PODR.BIT.B7
|
||||
#define LED0_PDR PORTB.PDR.BIT.B7
|
||||
#define LED1_PDR PORTA.PDR.BIT.B0
|
||||
#define LED2_PDR PORT5.PDR.BIT.B4
|
||||
#define LED3_PDR PORT1.PDR.BIT.B7
|
||||
|
||||
|
||||
#endif /* RSKRX111_H */
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : hwsetup.c
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX210
|
||||
* Description : Defines the initialization routines used each time the MCU is restarted.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* I/O Register and board definitions */
|
||||
#include "platform.h"
|
||||
#include "r_switches_config.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Private global variables and functions
|
||||
***********************************************************************************************************************/
|
||||
/* MCU I/O port configuration function delcaration */
|
||||
static void output_ports_configure(void);
|
||||
|
||||
/* Interrupt configuration function delcaration */
|
||||
static void interrupts_configure(void);
|
||||
|
||||
/* MCU peripheral module configuration function declaration */
|
||||
static void peripheral_modules_enable(void);
|
||||
|
||||
/* Configure MCU clocks. */
|
||||
static void clock_source_select (void);
|
||||
void operating_frequency_set(void);
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: hardware_setup
|
||||
* Description : Contains setup functions called at device restart
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void HardwareSetup(void)
|
||||
{
|
||||
operating_frequency_set();
|
||||
output_ports_configure();
|
||||
interrupts_configure();
|
||||
peripheral_modules_enable();
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: output_ports_configure
|
||||
* Description : Configures the port and pin direction settings, and sets the pin outputs to a safe level.
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void output_ports_configure(void)
|
||||
{
|
||||
/* Enable LEDs. */
|
||||
/* Start with LEDs off. */
|
||||
LED0 = LED_OFF;
|
||||
LED1 = LED_OFF;
|
||||
LED2 = LED_OFF;
|
||||
LED3 = LED_OFF;
|
||||
|
||||
/* Set LED pins as outputs. */
|
||||
LED0_PDR = 1;
|
||||
LED1_PDR = 1;
|
||||
LED2_PDR = 1;
|
||||
LED3_PDR = 1;
|
||||
|
||||
/* Enable switches. */
|
||||
/* Set pins as inputs. */
|
||||
SW1_PDR = 0;
|
||||
SW2_PDR = 0;
|
||||
SW3_PDR = 0;
|
||||
|
||||
/* Set port mode registers for switches. */
|
||||
SW1_PMR = 0;
|
||||
SW2_PMR = 0;
|
||||
SW3_PMR = 0;
|
||||
|
||||
/* Unlock MPC registers to enable writing to them. */
|
||||
MPC.PWPR.BIT.B0WI = 0 ; /* Unlock protection register */
|
||||
MPC.PWPR.BIT.PFSWE = 1 ; /* Unlock MPC registers */
|
||||
|
||||
/* TXD1 is output. */
|
||||
PORT1.PDR.BIT.B6 = 1;
|
||||
PORT1.PMR.BIT.B6 = 1;
|
||||
MPC.P16PFS.BYTE = 0x0A;
|
||||
/* RXD1 is input. */
|
||||
PORT1.PDR.BIT.B5 = 0;
|
||||
PORT1.PMR.BIT.B5 = 1;
|
||||
MPC.P15PFS.BYTE = 0x0A;
|
||||
|
||||
/* Configure the pin connected to the ADC Pot as an input */
|
||||
PORT4.PDR.BIT.B4 = 0;
|
||||
|
||||
/* Protect off. */
|
||||
SYSTEM.PRCR.WORD = 0xA50B;
|
||||
|
||||
/* Turn off module stop for the A2D converter. */
|
||||
SYSTEM.MSTPCRA.BIT.MSTPA17 = 0;
|
||||
|
||||
/* Protect on. */
|
||||
SYSTEM.PRCR.WORD = 0xA500;
|
||||
|
||||
/* Initialise the first button to generate an interrupt. */
|
||||
R_SWITCHES_Init();
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: interrupts_configure
|
||||
* Description : Configures interrupts used
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void interrupts_configure(void)
|
||||
{
|
||||
/* Add code here to setup additional interrupts */
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: peripheral_modules_enable
|
||||
* Description : Enables and configures peripheral devices on the MCU
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void peripheral_modules_enable(void)
|
||||
{
|
||||
/* Enable triggers to start an ADC conversion. */
|
||||
S12AD.ADCSR.BIT.TRGE = 1;
|
||||
|
||||
/* Only channel 4 is going to be used. */
|
||||
S12AD.ADANSA.BIT.ANSA4 = 1;
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: operating_frequency_set
|
||||
* Description : Configures the clock settings for each of the device clocks
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void operating_frequency_set(void)
|
||||
{
|
||||
/* Used for constructing value to write to SCKCR and CKOCR registers. */
|
||||
uint32_t temp_clock = 0;
|
||||
|
||||
/*
|
||||
Clock Description Frequency
|
||||
----------------------------------------
|
||||
Input Clock Frequency............ 16 MHz
|
||||
PLL frequency (x3)............... 48 MHz
|
||||
Internal Clock Frequency......... 24 MHz
|
||||
Peripheral Clock Frequency....... 24 MHz
|
||||
Clock Out Frequency.............. 1 MHz */
|
||||
|
||||
volatile unsigned int i;
|
||||
|
||||
/* Protect off. */
|
||||
SYSTEM.PRCR.WORD = 0xA50B;
|
||||
|
||||
/* Select the clock based upon user's choice. */
|
||||
clock_source_select();
|
||||
|
||||
|
||||
/* Figure out setting for FCK bits. */
|
||||
#if FCK_DIV == 1
|
||||
/* Do nothing since FCK bits should be 0. */
|
||||
#elif FCK_DIV == 2
|
||||
temp_clock |= 0x10000000;
|
||||
#elif FCK_DIV == 4
|
||||
temp_clock |= 0x20000000;
|
||||
#elif FCK_DIV == 8
|
||||
temp_clock |= 0x30000000;
|
||||
#elif FCK_DIV == 16
|
||||
temp_clock |= 0x40000000;
|
||||
#elif FCK_DIV == 32
|
||||
temp_clock |= 0x50000000;
|
||||
#elif FCK_DIV == 64
|
||||
temp_clock |= 0x60000000;
|
||||
#else
|
||||
#error "Error! Invalid setting for FCK_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for ICK bits. */
|
||||
#if ICK_DIV == 1
|
||||
/* Do nothing since ICK bits should be 0. */
|
||||
#elif ICK_DIV == 2
|
||||
temp_clock |= 0x01000000;
|
||||
#elif ICK_DIV == 4
|
||||
temp_clock |= 0x02000000;
|
||||
#elif ICK_DIV == 8
|
||||
temp_clock |= 0x03000000;
|
||||
#elif ICK_DIV == 16
|
||||
temp_clock |= 0x04000000;
|
||||
#elif ICK_DIV == 32
|
||||
temp_clock |= 0x05000000;
|
||||
#elif ICK_DIV == 64
|
||||
temp_clock |= 0x06000000;
|
||||
#else
|
||||
#error "Error! Invalid setting for ICK_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for PCKB bits. */
|
||||
#if PCKB_DIV == 1
|
||||
/* Do nothing since PCKB bits should be 0. */
|
||||
#elif PCKB_DIV == 2
|
||||
temp_clock |= 0x00000100;
|
||||
#elif PCKB_DIV == 4
|
||||
temp_clock |= 0x00000200;
|
||||
#elif PCKB_DIV == 8
|
||||
temp_clock |= 0x00000300;
|
||||
#elif PCKB_DIV == 16
|
||||
temp_clock |= 0x00000400;
|
||||
#elif PCKB_DIV == 32
|
||||
temp_clock |= 0x00000500;
|
||||
#elif PCKB_DIV == 64
|
||||
temp_clock |= 0x00000600;
|
||||
#else
|
||||
#error "Error! Invalid setting for PCKB_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for PCKD bits. */
|
||||
#if PCKD_DIV == 1
|
||||
/* Do nothing since PCKD bits should be 0. */
|
||||
#elif PCKD_DIV == 2
|
||||
temp_clock |= 0x00000001;
|
||||
#elif PCKD_DIV == 4
|
||||
temp_clock |= 0x00000002;
|
||||
#elif PCKD_DIV == 8
|
||||
temp_clock |= 0x00000003;
|
||||
#elif PCKD_DIV == 16
|
||||
temp_clock |= 0x00000004;
|
||||
#elif PCKD_DIV == 32
|
||||
temp_clock |= 0x00000005;
|
||||
#elif PCKD_DIV == 64
|
||||
temp_clock |= 0x00000006;
|
||||
#else
|
||||
#error "Error! Invalid setting for PCKD_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Set SCKCR register. */
|
||||
SYSTEM.SCKCR.LONG = temp_clock;
|
||||
|
||||
/* Choose clock source. Default for r_bsp_config.h is PLL. */
|
||||
SYSTEM.SCKCR3.WORD = ((uint16_t)CLOCK_SOURCE) << 8;
|
||||
|
||||
/* Protect on. */
|
||||
SYSTEM.PRCR.WORD = 0xA500;
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: clock_source_select
|
||||
* Description : Enables and disables clocks as chosen by the user. This function also implements the software delays
|
||||
* needed for the clocks to stabilize.
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
static void clock_source_select (void)
|
||||
{
|
||||
/* Declared volatile for software delay purposes. */
|
||||
volatile unsigned int i;
|
||||
|
||||
/* NOTE: AS OF VERSION 0.50 OF THE RX111 HARDWARE MANUAL, ALL OF THE CLOCK
|
||||
* STABILIZATION TIMES ARE TBD. FOR NOW, WHERE EVER A WAIT COUNT REGISTER
|
||||
* IS AVAILABLE, THE DELAY IS SET TO THE MAX NUMBER OF CYCLES. WHERE EVER
|
||||
* DELAY LOOPS ARE PRESENT, THE VALUES FROM THE 63N ARE RE-USED. KEEP IN
|
||||
* MIND THAT THE 63N RUNS ON A FASTER CRYSTAL.
|
||||
*/
|
||||
|
||||
#if (CLOCK_SOURCE == 1)
|
||||
/* HOCO is chosen. Start it operating. */
|
||||
SYSTEM.HOCOCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the HOCO has stabilized.*/
|
||||
for(i = 0; i< 28; i++) // tHOCOWT2 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#else
|
||||
/* HOCO is not chosen. Stop the HOCO. */
|
||||
SYSTEM.HOCOCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 2)
|
||||
/* Main clock oscillator is chosen. Start it operating. */
|
||||
SYSTEM.MOSCWTCR.BYTE = 0x07; // Wait 65,536 cycles
|
||||
/* Set the main clock to operating. */
|
||||
SYSTEM.MOSCCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the main clock has stabilized. */
|
||||
for(i = 0; i< 140; i++) // tMAINOSCWT is TBD
|
||||
{
|
||||
__asm volatile( "NOT" );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 3)
|
||||
/* Sub-clock oscillator is chosen. Start it operating. */
|
||||
/* In section 9.8.4, there is a reference to a SOSCWTCR register, but there is no
|
||||
* description for this register in the manual nor reference for it in iodefine.h. */
|
||||
|
||||
/* Set the sub-clock to operating. */
|
||||
SYSTEM.SOSCCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the sub-clock has stabilized. */
|
||||
for(i = 0; i< 30233; i++) // tSUBOSCWT0 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#else
|
||||
/* Set the sub-clock to stopped. */
|
||||
SYSTEM.SOSCCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 4)
|
||||
/* PLL is chosen. Start it operating. Must start main clock as well since PLL uses it. */
|
||||
SYSTEM.MOSCWTCR.BYTE = 0x07; // Wait 65,536 cycles
|
||||
/* Set the main clock to operating. */
|
||||
SYSTEM.MOSCCR.BYTE = 0x00;
|
||||
|
||||
/* Set PLL Input Divisor. */
|
||||
SYSTEM.PLLCR.BIT.PLIDIV = PLL_DIV >> 1;
|
||||
|
||||
/* Set PLL Multiplier. */
|
||||
SYSTEM.PLLCR.BIT.STC = (PLL_MUL * 2) - 1;
|
||||
|
||||
/* Set the PLL to operating. */
|
||||
SYSTEM.PLLCR2.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the main clock and PLL have stabilized. */
|
||||
for(i = 0; i< 140; i++) // tPLLWT2 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* LOCO is saved for last since it is what is running by default out of reset. This means you do not want to turn
|
||||
it off until another clock has been enabled and is ready to use. */
|
||||
#if (CLOCK_SOURCE == 0)
|
||||
/* LOCO is chosen. This is the default out of reset. */
|
||||
SYSTEM.LOCOCR.BYTE = 0x00;
|
||||
#else
|
||||
/* LOCO is not chosen and another clock has already been setup. Turn off the LOCO. */
|
||||
SYSTEM.LOCOCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
/* Make sure a valid clock was chosen. */
|
||||
#if (CLOCK_SOURCE > 4) || (CLOCK_SOURCE < 0)
|
||||
#error "ERROR - Valid clock source must be chosen in r_bsp_config.h using CLOCK_SOURCE macro."
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp.h
|
||||
* Description : Has the header files that should be included for this platform.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 13.01.2012 1.00 First Release
|
||||
* : 27.06.2012 1.10 Updated with new information to reflect udpated r_bsp structure.
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef PLATFORM_BOARD_USER
|
||||
#define PLATFORM_BOARD_USER
|
||||
|
||||
/* Make sure that no other platforms have already been defined. Do not touch this! */
|
||||
#ifdef PLATFORM_DEFINED
|
||||
#error "Error - Multiple platforms defined in platform.h!"
|
||||
#else
|
||||
#define PLATFORM_DEFINED
|
||||
#endif
|
||||
|
||||
/***********************************************************************************************************************
|
||||
INCLUDE APPROPRIATE MCU AND BOARD FILES
|
||||
***********************************************************************************************************************/
|
||||
/* This is a user defined board. Start off by:
|
||||
1)Copy and rename one of the 'board' folders that most closely matches your system (same MCU Series and Group).
|
||||
2)Substitute in your MCU Group for the *MCU Group* option in the #include below for mcu_info.h.
|
||||
3)Copy the other #includes from the r_bsp.h in the 'board' folder that you copied earlier.
|
||||
4)Configure the BSP for your board by modifying the r_bsp_config_reference.h.
|
||||
5)Copy r_bsp_config_reference.h to your project directory and rename it r_bsp_config.h.
|
||||
You can also add your own include files here as well. */
|
||||
#include "r_bsp_config.h"
|
||||
#include ".\mcu\*MCU Group*\mcu_info.h"
|
||||
|
||||
#endif /* PLATFORM_BOARD_USER */
|
||||
|
||||
|
||||
+283
@@ -0,0 +1,283 @@
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* PROJECT NAME : RTOSDemo_GCC */
|
||||
/* FILE : interrupt_handlers.c */
|
||||
/* DESCRIPTION : Interrupt Handler */
|
||||
/* CPU SERIES : RX100 */
|
||||
/* CPU TYPE : RX111 */
|
||||
/* */
|
||||
/* This file is generated by e2studio. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#include "interrupt_handlers.h"
|
||||
|
||||
// INT_Exception(Supervisor Instruction)
|
||||
void INT_Excep_SuperVisorInst(void){/* brk(); */}
|
||||
|
||||
// Exception(Undefined Instruction)
|
||||
void INT_Excep_UndefinedInst(void){/* brk(); */}
|
||||
|
||||
// Exception(Floating Point)
|
||||
void INT_Excep_FloatingPoint(void){/* brk(); */}
|
||||
|
||||
// NMI
|
||||
void INT_NonMaskableInterrupt(void){/* brk(); */}
|
||||
|
||||
// Dummy
|
||||
void Dummy(void)
|
||||
{
|
||||
for( ;; );
|
||||
}
|
||||
|
||||
// BRK
|
||||
void INT_Excep_BRK(void){/* wait(); */}
|
||||
//;0x0000 Reserved
|
||||
|
||||
void INT_Excep_BUSERR(void){ }
|
||||
|
||||
// ICU SWINT
|
||||
void INT_Excep_ICU_SWINT(void){ }
|
||||
|
||||
// CMT0 CMI0
|
||||
void INT_Excep_CMT0_CMI0(void){ }
|
||||
|
||||
// CMT1 CMI1
|
||||
void INT_Excep_CMT1_CMI1(void){ }
|
||||
|
||||
// CAC FERRF
|
||||
void INT_Excep_CAC_FERRF(void){ }
|
||||
|
||||
// CAC MENDF
|
||||
void INT_Excep_CAC_MENDF(void){ }
|
||||
|
||||
// CAC OVFF
|
||||
void INT_Excep_CAC_OVFF(void){ }
|
||||
|
||||
// USB0 D0FIFO0
|
||||
void INT_Excep_USB0_D0FIFO0(void){ }
|
||||
|
||||
// USB0 D1FIFO0
|
||||
void INT_Excep_USB0_D1FIFO0(void){ }
|
||||
|
||||
// USB0 USBI0
|
||||
void INT_Excep_USB0_USBI0(void){ }
|
||||
|
||||
// RSPI0 SPEI0
|
||||
void INT_Excep_RSPI0_SPEI0(void){ }
|
||||
|
||||
// RSPI0 SPRI0
|
||||
void INT_Excep_RSPI0_SPRI0(void){ }
|
||||
|
||||
// RSPI0 SPTI0
|
||||
void INT_Excep_RSPI0_SPTI0(void){ }
|
||||
|
||||
// RSPI0 SPII0
|
||||
void INT_Excep_RSPI0_SPII0(void){ }
|
||||
|
||||
// DOC DOPCF
|
||||
void INT_Excep_DOC_DOPCF(void){ }
|
||||
|
||||
// RTC CUP
|
||||
void INT_Excep_RTC_CUP(void){ }
|
||||
|
||||
// ICU IRQ0
|
||||
void INT_Excep_ICU_IRQ0(void){ }
|
||||
|
||||
// ICU IRQ1
|
||||
void INT_Excep_ICU_IRQ1(void){ }
|
||||
|
||||
// ICU IRQ2
|
||||
void INT_Excep_ICU_IRQ2(void){ }
|
||||
|
||||
// ICU IRQ3
|
||||
void INT_Excep_ICU_IRQ3(void){ }
|
||||
|
||||
// ICU IRQ4
|
||||
void INT_Excep_ICU_IRQ4(void){ }
|
||||
|
||||
// ICU IRQ5
|
||||
void INT_Excep_ICU_IRQ5(void){ }
|
||||
|
||||
// ICU IRQ6
|
||||
void INT_Excep_ICU_IRQ6(void){ }
|
||||
|
||||
// ICU IRQ7
|
||||
void INT_Excep_ICU_IRQ7(void){ }
|
||||
|
||||
// LVD LVD1
|
||||
void INT_Excep_LVD_LVD1(void){ }
|
||||
|
||||
// LVD LVD2
|
||||
void INT_Excep_LVD_LVD2(void){ }
|
||||
|
||||
// USB0 USBR0
|
||||
void INT_Excep_USB0_USBR0(void){ }
|
||||
|
||||
// RTC ALM
|
||||
void INT_Excep_RTC_ALM(void){ }
|
||||
|
||||
// RTC PRD
|
||||
void INT_Excep_RTC_PRD(void){ }
|
||||
|
||||
// S12AD S12ADI0
|
||||
void INT_Excep_S12AD_S12ADI0(void){ }
|
||||
|
||||
// S12AD GBADI
|
||||
void INT_Excep_S12AD_GBADI(void){ }
|
||||
|
||||
// ELC ELSR18I
|
||||
void INT_Excep_ELC_ELSR18I(void){ }
|
||||
|
||||
// MTU0 TGIA0
|
||||
void INT_Excep_MTU0_TGIA0(void){ }
|
||||
|
||||
// MTU0 TGIB0
|
||||
void INT_Excep_MTU0_TGIB0(void){ }
|
||||
|
||||
// MTU0 TGIC0
|
||||
void INT_Excep_MTU0_TGIC0(void){ }
|
||||
|
||||
// MTU0 TGID0
|
||||
void INT_Excep_MTU0_TGID0(void){ }
|
||||
|
||||
// MTU0 TCIV0
|
||||
void INT_Excep_MTU0_TCIV0(void){ }
|
||||
|
||||
// MTU0 TGIE0
|
||||
void INT_Excep_MTU0_TGIE0(void){ }
|
||||
|
||||
// MTU0 TGIF0
|
||||
void INT_Excep_MTU0_TGIF0(void){ }
|
||||
|
||||
// MTU1 TGIA1
|
||||
void INT_Excep_MTU1_TGIA1(void){ }
|
||||
|
||||
// MTU1 TGIB1
|
||||
void INT_Excep_MTU1_TGIB1(void){ }
|
||||
|
||||
// MTU1 TCIV1
|
||||
void INT_Excep_MTU1_TCIV1(void){ }
|
||||
|
||||
// MTU1 TCIU1
|
||||
void INT_Excep_MTU1_TCIU1(void){ }
|
||||
|
||||
// MTU2 TGIA2
|
||||
void INT_Excep_MTU2_TGIA2(void){ }
|
||||
|
||||
// MTU2 TGIB2
|
||||
void INT_Excep_MTU2_TGIB2(void){ }
|
||||
|
||||
// MTU2 TCIV2
|
||||
void INT_Excep_MTU2_TCIV2(void){ }
|
||||
|
||||
// MTU2 TCIU2
|
||||
void INT_Excep_MTU2_TCIU2(void){ }
|
||||
|
||||
// MTU3 TGIA3
|
||||
void INT_Excep_MTU3_TGIA3(void){ }
|
||||
|
||||
// MTU3 TGIB3
|
||||
void INT_Excep_MTU3_TGIB3(void){ }
|
||||
|
||||
// MTU3 TGIC3
|
||||
void INT_Excep_MTU3_TGIC3(void){ }
|
||||
|
||||
// MTU3 TGID3
|
||||
void INT_Excep_MTU3_TGID3(void){ }
|
||||
|
||||
// MTU3 TCIV3
|
||||
void INT_Excep_MTU3_TCIV3(void){ }
|
||||
|
||||
// MTU4 TGIA4
|
||||
void INT_Excep_MTU4_TGIA4(void){ }
|
||||
|
||||
// MTU4 TGIB4
|
||||
void INT_Excep_MTU4_TGIB4(void){ }
|
||||
|
||||
// MTU4 TGIC4
|
||||
void INT_Excep_MTU4_TGIC4(void){ }
|
||||
|
||||
// MTU4 TGID4
|
||||
void INT_Excep_MTU4_TGID4(void){ }
|
||||
|
||||
// MTU4 TCIV4
|
||||
void INT_Excep_MTU4_TCIV4(void){ }
|
||||
|
||||
// MTU5 TGIU5
|
||||
void INT_Excep_MTU5_TGIU5(void){ }
|
||||
|
||||
// MTU5 TGIV5
|
||||
void INT_Excep_MTU5_TGIV5(void){ }
|
||||
|
||||
// MTU5 TGIW5
|
||||
void INT_Excep_MTU5_TGIW5(void){ }
|
||||
|
||||
// POE OEI1
|
||||
void INT_Excep_POE_OEI1(void){ }
|
||||
|
||||
// POE OEI2
|
||||
void INT_Excep_POE_OEI2(void){ }
|
||||
|
||||
// SCI1 ERI1
|
||||
void INT_Excep_SCI1_ERI1(void){ }
|
||||
|
||||
// SCI1 RXI1
|
||||
void INT_Excep_SCI1_RXI1(void){ }
|
||||
|
||||
// SCI1 TXI1
|
||||
void INT_Excep_SCI1_TXI1(void){ }
|
||||
|
||||
// SCI1 TEI1
|
||||
void INT_Excep_SCI1_TEI1(void){ }
|
||||
|
||||
// SCI5 ERI5
|
||||
void INT_Excep_SCI5_ERI5(void){ }
|
||||
|
||||
// SCI5 RXI5
|
||||
void INT_Excep_SCI5_RXI5(void){ }
|
||||
|
||||
// SCI5 TXI5
|
||||
void INT_Excep_SCI5_TXI5(void){ }
|
||||
|
||||
// SCI5 TEI5
|
||||
void INT_Excep_SCI5_TEI5(void){ }
|
||||
|
||||
// SCI12 ERI12
|
||||
void INT_Excep_SCI12_ERI12(void){ }
|
||||
|
||||
// SCI12 RXI12
|
||||
void INT_Excep_SCI12_RXI12(void){ }
|
||||
|
||||
// SCI12 TXI12
|
||||
void INT_Excep_SCI12_TXI12(void){ }
|
||||
|
||||
// SCI12 TEI12
|
||||
void INT_Excep_SCI12_TEI12(void){ }
|
||||
|
||||
// SCI12 SCIX0
|
||||
void INT_Excep_SCI12_SCIX0(void){ }
|
||||
|
||||
// SCI12 SCIX1
|
||||
void INT_Excep_SCI12_SCIX1(void){ }
|
||||
|
||||
// SCI12 SCIX2
|
||||
void INT_Excep_SCI12_SCIX2(void){ }
|
||||
|
||||
// SCI12 SCIX3
|
||||
void INT_Excep_SCI12_SCIX3(void){ }
|
||||
|
||||
// RIIC0 EEI0
|
||||
void INT_Excep_RIIC0_EEI0(void){ }
|
||||
|
||||
// RIIC0 RXI0
|
||||
void INT_Excep_RIIC0_RXI0(void){ }
|
||||
|
||||
// RIIC0 TXI0
|
||||
void INT_Excep_RIIC0_TXI0(void){ }
|
||||
|
||||
// RIIC0 TEI0
|
||||
void INT_Excep_RIIC0_TEI0(void){ }
|
||||
+371
@@ -0,0 +1,371 @@
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* PROJECT NAME : RTOSDemo_GCC */
|
||||
/* FILE : interrupt_handlers.h */
|
||||
/* DESCRIPTION : Interrupt Handler Declarations */
|
||||
/* CPU SERIES : RX100 */
|
||||
/* CPU TYPE : RX111 */
|
||||
/* */
|
||||
/* This file is generated by e2studio. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef INTERRUPT_HANDLERS_H
|
||||
#define INTERRUPT_HANDLERS_H
|
||||
|
||||
// Exception(Supervisor Instruction)
|
||||
// Exception(Supervisor Instruction)
|
||||
void INT_Excep_SuperVisorInst(void) __attribute__ ((interrupt));
|
||||
|
||||
// Exception(Undefined Instruction)
|
||||
void INT_Excep_UndefinedInst(void) __attribute__ ((interrupt));
|
||||
|
||||
// Exception(Floating Point)
|
||||
void INT_Excep_FloatingPoint(void) __attribute__ ((interrupt));
|
||||
|
||||
// NMI
|
||||
void INT_NonMaskableInterrupt(void) __attribute__ ((interrupt));
|
||||
|
||||
// Dummy
|
||||
void Dummy (void) __attribute__ ((interrupt));
|
||||
|
||||
// BRK
|
||||
void INT_Excep_BRK(void) __attribute__ ((interrupt));
|
||||
//;0x0000 Reserved
|
||||
|
||||
void INT_Excep_BUSERR(void) __attribute__ ((interrupt));
|
||||
//;0x0044 Reserved
|
||||
|
||||
void INT_Excep_ICU_SWINT(void) __attribute__ ((interrupt));
|
||||
|
||||
// CMT0 CMI0
|
||||
|
||||
void INT_Excep_CMT0_CMI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// CMT1 CMI1
|
||||
|
||||
void INT_Excep_CMT1_CMI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// CAC FERRF
|
||||
|
||||
void INT_Excep_CAC_FERRF(void) __attribute__ ((interrupt));
|
||||
|
||||
// CAC MENDF
|
||||
|
||||
|
||||
void INT_Excep_CAC_MENDF(void) __attribute__ ((interrupt));
|
||||
|
||||
// CAC OVFF
|
||||
|
||||
void INT_Excep_CAC_OVFF(void) __attribute__ ((interrupt));
|
||||
|
||||
// USB0 D0FIFO0
|
||||
|
||||
void INT_Excep_USB0_D0FIFO0(void) __attribute__ ((interrupt));
|
||||
|
||||
// USB0 D1FIFO0
|
||||
|
||||
void INT_Excep_USB0_D1FIFO0(void) __attribute__ ((interrupt));
|
||||
|
||||
// USB0 USBI0
|
||||
|
||||
void INT_Excep_USB0_USBI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RSPI0 SPEI0
|
||||
|
||||
void INT_Excep_RSPI0_SPEI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RSPI0 SPRI0
|
||||
|
||||
void INT_Excep_RSPI0_SPRI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RSPI0 SPTI0
|
||||
|
||||
void INT_Excep_RSPI0_SPTI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RSPI0 SPII0
|
||||
|
||||
void INT_Excep_RSPI0_SPII0(void) __attribute__ ((interrupt));
|
||||
|
||||
// DOC DOPCF
|
||||
|
||||
void INT_Excep_DOC_DOPCF(void) __attribute__ ((interrupt));
|
||||
|
||||
// RTC CUP
|
||||
|
||||
void INT_Excep_RTC_CUP(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ0
|
||||
|
||||
void INT_Excep_ICU_IRQ0(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ1
|
||||
|
||||
void INT_Excep_ICU_IRQ1(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ2
|
||||
|
||||
void INT_Excep_ICU_IRQ2(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ3
|
||||
|
||||
void INT_Excep_ICU_IRQ3(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ4
|
||||
|
||||
void INT_Excep_ICU_IRQ4(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ5
|
||||
|
||||
void INT_Excep_ICU_IRQ5(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ6
|
||||
|
||||
void INT_Excep_ICU_IRQ6(void) __attribute__ ((interrupt));
|
||||
|
||||
// ICU IRQ7
|
||||
|
||||
void INT_Excep_ICU_IRQ7(void) __attribute__ ((interrupt));
|
||||
|
||||
// LVD LVD1
|
||||
|
||||
void INT_Excep_LVD_LVD1(void) __attribute__ ((interrupt));
|
||||
|
||||
// LVD LVD2
|
||||
|
||||
void INT_Excep_LVD_LVD2(void) __attribute__ ((interrupt));
|
||||
|
||||
// USB0 USBR0
|
||||
|
||||
void INT_Excep_USB0_USBR0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RTC ALM
|
||||
|
||||
void INT_Excep_RTC_ALM(void) __attribute__ ((interrupt));
|
||||
|
||||
// RTC PRD
|
||||
|
||||
void INT_Excep_RTC_PRD(void) __attribute__ ((interrupt));
|
||||
|
||||
// S12AD S12ADI0
|
||||
|
||||
void INT_Excep_S12AD_S12ADI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// S12AD GBADI
|
||||
|
||||
void INT_Excep_S12AD_GBADI(void) __attribute__ ((interrupt));
|
||||
|
||||
// ELC ELSR18I
|
||||
|
||||
void INT_Excep_ELC_ELSR18I(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGIA0
|
||||
|
||||
void INT_Excep_MTU0_TGIA0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGIB0
|
||||
|
||||
void INT_Excep_MTU0_TGIB0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGIC0
|
||||
|
||||
void INT_Excep_MTU0_TGIC0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGID0
|
||||
|
||||
void INT_Excep_MTU0_TGID0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TCIV0
|
||||
|
||||
void INT_Excep_MTU0_TCIV0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGIE0
|
||||
|
||||
void INT_Excep_MTU0_TGIE0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU0 TGIF0
|
||||
|
||||
void INT_Excep_MTU0_TGIF0(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU1 TGIA1
|
||||
|
||||
void INT_Excep_MTU1_TGIA1(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU1 TGIB1
|
||||
|
||||
void INT_Excep_MTU1_TGIB1(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU1 TCIV1
|
||||
|
||||
void INT_Excep_MTU1_TCIV1(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU1 TCIU1
|
||||
|
||||
void INT_Excep_MTU1_TCIU1(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU2 TGIA2
|
||||
|
||||
void INT_Excep_MTU2_TGIA2(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU2 TGIB2
|
||||
|
||||
void INT_Excep_MTU2_TGIB2(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU2 TCIV2
|
||||
|
||||
void INT_Excep_MTU2_TCIV2(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU2 TCIU2
|
||||
|
||||
void INT_Excep_MTU2_TCIU2(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU3 TGIA3
|
||||
|
||||
void INT_Excep_MTU3_TGIA3(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU3 TGIB3
|
||||
|
||||
void INT_Excep_MTU3_TGIB3(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU3 TGIC3
|
||||
|
||||
void INT_Excep_MTU3_TGIC3(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU3 TGID3
|
||||
|
||||
void INT_Excep_MTU3_TGID3(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU3 TCIV3
|
||||
|
||||
void INT_Excep_MTU3_TCIV3(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU4 TGIA4
|
||||
|
||||
void INT_Excep_MTU4_TGIA4(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU4 TGIB4
|
||||
|
||||
void INT_Excep_MTU4_TGIB4(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU4 TGIC4
|
||||
|
||||
void INT_Excep_MTU4_TGIC4(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU4 TGID4
|
||||
|
||||
void INT_Excep_MTU4_TGID4(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU4 TCIV4
|
||||
|
||||
void INT_Excep_MTU4_TCIV4(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU5 TGIU5
|
||||
|
||||
void INT_Excep_MTU5_TGIU5(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU5 TGIV5
|
||||
|
||||
void INT_Excep_MTU5_TGIV5(void) __attribute__ ((interrupt));
|
||||
|
||||
// MTU5 TGIW5
|
||||
|
||||
void INT_Excep_MTU5_TGIW5(void) __attribute__ ((interrupt));
|
||||
|
||||
// POE OEI1
|
||||
|
||||
void INT_Excep_POE_OEI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// POE OEI2
|
||||
|
||||
void INT_Excep_POE_OEI2(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI1 ERI1
|
||||
|
||||
void INT_Excep_SCI1_ERI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI1 RXI1
|
||||
|
||||
void INT_Excep_SCI1_RXI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI1 TXI1
|
||||
|
||||
void INT_Excep_SCI1_TXI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI1 TEI1
|
||||
|
||||
void INT_Excep_SCI1_TEI1(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI5 ERI5
|
||||
|
||||
void INT_Excep_SCI5_ERI5(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI5 RXI5
|
||||
|
||||
void INT_Excep_SCI5_RXI5(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI5 TXI5
|
||||
|
||||
void INT_Excep_SCI5_TXI5(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI5 TEI5
|
||||
|
||||
void INT_Excep_SCI5_TEI5(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 ERI12
|
||||
|
||||
void INT_Excep_SCI12_ERI12(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 RXI12
|
||||
|
||||
void INT_Excep_SCI12_RXI12(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 TXI12
|
||||
|
||||
void INT_Excep_SCI12_TXI12(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 TEI12
|
||||
|
||||
void INT_Excep_SCI12_TEI12(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 SCIX0
|
||||
|
||||
void INT_Excep_SCI12_SCIX0(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 SCIX1
|
||||
|
||||
void INT_Excep_SCI12_SCIX1(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 SCIX2
|
||||
|
||||
void INT_Excep_SCI12_SCIX2(void) __attribute__ ((interrupt));
|
||||
|
||||
// SCI12 SCIX3
|
||||
|
||||
void INT_Excep_SCI12_SCIX3(void) __attribute__ ((interrupt));
|
||||
|
||||
// RIIC0 EEI0
|
||||
|
||||
void INT_Excep_RIIC0_EEI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RIIC0 RXI0
|
||||
|
||||
void INT_Excep_RIIC0_RXI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RIIC0 TXI0
|
||||
|
||||
void INT_Excep_RIIC0_TXI0(void) __attribute__ ((interrupt));
|
||||
|
||||
// RIIC0 TEI0
|
||||
|
||||
void INT_Excep_RIIC0_TEI0(void) __attribute__ ((interrupt));
|
||||
|
||||
//;<<VECTOR DATA START (POWER ON RESET)>>
|
||||
//;Power On Reset PC
|
||||
extern void PowerON_Reset(void);
|
||||
//;<<VECTOR DATA END (POWER ON RESET)>>
|
||||
#endif
|
||||
+9922
File diff suppressed because it is too large
Load Diff
+112
@@ -0,0 +1,112 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : mcu_info.h
|
||||
* Device(s) : RX111
|
||||
* Description : Information about the MCU on this board (RSKRX111).
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef _MCU_INFO
|
||||
#define _MCU_INFO
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Gets MCU configuration information. */
|
||||
#include "r_bsp_config.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Macro definitions
|
||||
***********************************************************************************************************************/
|
||||
/* MCU Series. */
|
||||
#if MCU_PART_SERIES == 0x0
|
||||
#define MCU_SERIES_RX100 (1)
|
||||
#else
|
||||
#error "ERROR - MCU_PART_SERIES - Unknown MCU Series chosen in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* MCU Group name. */
|
||||
#if MCU_PART_GROUP == 0x1
|
||||
#define MCU_RX111 (1)
|
||||
#define MCU_RX11x (1)
|
||||
#else
|
||||
#error "ERROR - MCU_PART_GROUP - Unknown MCU Group chosen in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Package. */
|
||||
#if MCU_PART_PACKAGE == 0x0
|
||||
#define PACKAGE_LFQFP64 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x1
|
||||
#define PACKAGE_LQFP64 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x2
|
||||
#define PACKAGE_TFLGA64 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x3
|
||||
#define PACKAGE_LFQFP48 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x4
|
||||
#define PACKAGE_VQFN48 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x5
|
||||
#define PACKAGE_HWQFN36 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x6
|
||||
#define PACKAGE_WFLGA36 (1)
|
||||
#elif MCU_PART_PACKAGE == 0x7
|
||||
#define PACKAGE_SSOP36 (1)
|
||||
#else
|
||||
#error "ERROR - MCU_PART_PACKAGE - Unknown package chosen in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Memory size of your MCU. */
|
||||
#if MCU_PART_MEMORY_SIZE == 0x0 // "J" parts
|
||||
#define ROM_SIZE_BYTES (16384)
|
||||
#define RAM_SIZE_BYTES (8192)
|
||||
#define DF_SIZE_BYTES (8192)
|
||||
#elif MCU_PART_MEMORY_SIZE == 0x1
|
||||
#define ROM_SIZE_BYTES (32768)
|
||||
#define RAM_SIZE_BYTES (10240)
|
||||
#define DF_SIZE_BYTES (8192)
|
||||
#elif MCU_PART_MEMORY_SIZE == 0x3
|
||||
#define ROM_SIZE_BYTES (65536)
|
||||
#define RAM_SIZE_BYTES (10240)
|
||||
#define DF_SIZE_BYTES (8192)
|
||||
#elif MCU_PART_MEMORY_SIZE == 0x4
|
||||
#define ROM_SIZE_BYTES (98304)
|
||||
#define RAM_SIZE_BYTES (16384)
|
||||
#define DF_SIZE_BYTES (8192)
|
||||
#elif MCU_PART_MEMORY_SIZE == 0x5
|
||||
#define ROM_SIZE_BYTES (131072)
|
||||
#define RAM_SIZE_BYTES (16384)
|
||||
#define DF_SIZE_BYTES (8192)
|
||||
#else
|
||||
#error "ERROR - MCU_PART_MEMORY_SIZE - Unknown memory size chosen in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* System clock speed in Hz. */
|
||||
#define ICLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV)
|
||||
/* Peripheral Module Clock B speed in Hz. */
|
||||
#define PCLKB_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV)
|
||||
/* Peripheral Module Clock D speed in Hz. */
|
||||
#define PCLKD_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKD_DIV)
|
||||
/* FlashIF clock speed in Hz. */
|
||||
#define FCLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV)
|
||||
|
||||
#endif /* _MCU_INFO */
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* PROJECT NAME : RTOSDemo_GCC */
|
||||
/* FILE : reset_program.asm */
|
||||
/* DESCRIPTION : Reset Program */
|
||||
/* CPU SERIES : RX100 */
|
||||
/* CPU TYPE : RX111 */
|
||||
/* */
|
||||
/* This file is generated by e2studio. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
/*reset_program.asm*/
|
||||
|
||||
.list
|
||||
.section .text
|
||||
.global _PowerON_Reset /*global Start routine */
|
||||
|
||||
.extern _HardwareSetup /*external Sub-routine to initialise Hardware*/
|
||||
.extern _data
|
||||
.extern _mdata
|
||||
.extern _ebss
|
||||
.extern _bss
|
||||
.extern _edata
|
||||
.extern _main
|
||||
.extern _ustack
|
||||
.extern _istack
|
||||
.extern _rvectors
|
||||
.extern _exit
|
||||
|
||||
|
||||
_PowerON_Reset :
|
||||
/* initialise user stack pointer */
|
||||
mvtc #_ustack,USP
|
||||
|
||||
/* initialise interrupt stack pointer */
|
||||
mvtc #_istack,ISP
|
||||
|
||||
/* setup intb */
|
||||
mvtc #_rvectors_start, intb /* INTERRUPT VECTOR ADDRESS definition */
|
||||
|
||||
/* load data section from ROM to RAM */
|
||||
|
||||
mov #_mdata,r2 /* src ROM address of data section in R2 */
|
||||
mov #_data,r1 /* dest start RAM address of data section in R1 */
|
||||
mov #_edata,r3 /* end RAM address of data section in R3 */
|
||||
sub r1,r3 /* size of data section in R3 (R3=R3-R1) */
|
||||
smovf /* block copy R3 bytes from R2 to R1 */
|
||||
|
||||
/* bss initialisation : zero out bss */
|
||||
|
||||
mov #00h,r2 /* load R2 reg with zero */
|
||||
mov #_ebss, r3 /* store the end address of bss in R3 */
|
||||
mov #_bss, r1 /* store the start address of bss in R1 */
|
||||
sub r1,r3 /* size of bss section in R3 (R3=R3-R1) */
|
||||
sstr.b
|
||||
/* call the hardware initialiser */
|
||||
bsr.a _HardwareSetup
|
||||
nop
|
||||
|
||||
#ifdef RUN_IN_USER_MODE
|
||||
/* setup PSW */
|
||||
mvtc #10000h, psw /* Set Ubit & Ibit for PSW */
|
||||
|
||||
/* change PSW PM to user-mode */
|
||||
MVFC PSW,R1
|
||||
OR #00100000h,R1
|
||||
PUSH.L R1
|
||||
MVFC PC,R1
|
||||
ADD #10,R1
|
||||
PUSH.L R1
|
||||
RTE
|
||||
NOP
|
||||
NOP
|
||||
#endif
|
||||
#ifdef CPPAPP
|
||||
bsr.a __rx_init
|
||||
#endif
|
||||
/* start user program */
|
||||
bsr.a _main
|
||||
bsr.a _exit
|
||||
|
||||
#ifdef CPPAPP
|
||||
.global _rx_run_preinit_array
|
||||
.type _rx_run_preinit_array,@function
|
||||
_rx_run_preinit_array:
|
||||
mov #__preinit_array_start,r1
|
||||
mov #__preinit_array_end,r2
|
||||
bra.a _rx_run_inilist
|
||||
|
||||
.global _rx_run_init_array
|
||||
.type _rx_run_init_array,@function
|
||||
_rx_run_init_array:
|
||||
mov #__init_array_start,r1
|
||||
mov #__init_array_end,r2
|
||||
mov #4, r3
|
||||
bra.a _rx_run_inilist
|
||||
|
||||
.global _rx_run_fini_array
|
||||
.type _rx_run_fini_array,@function
|
||||
_rx_run_fini_array:
|
||||
mov #__fini_array_start,r2
|
||||
mov #__fini_array_end,r1
|
||||
mov #-4, r3
|
||||
/* fall through */
|
||||
|
||||
_rx_run_inilist:
|
||||
next_inilist:
|
||||
cmp r1,r2
|
||||
beq.b done_inilist
|
||||
mov.l [r1],r4
|
||||
cmp #-1, r4
|
||||
beq.b skip_inilist
|
||||
cmp #0, r4
|
||||
beq.b skip_inilist
|
||||
pushm r1-r3
|
||||
jsr r4
|
||||
popm r1-r3
|
||||
skip_inilist:
|
||||
add r3,r1
|
||||
bra.b next_inilist
|
||||
done_inilist:
|
||||
rts
|
||||
|
||||
.section .init,"ax"
|
||||
.balign 4
|
||||
|
||||
.global __rx_init
|
||||
__rx_init:
|
||||
|
||||
.section .fini,"ax"
|
||||
.balign 4
|
||||
|
||||
.global __rx_fini
|
||||
__rx_fini:
|
||||
bsr.a _rx_run_fini_array
|
||||
|
||||
.section .sdata
|
||||
.balign 4
|
||||
.global __gp
|
||||
.weak __gp
|
||||
__gp:
|
||||
|
||||
.section .data
|
||||
.global ___dso_handle
|
||||
.weak ___dso_handle
|
||||
___dso_handle:
|
||||
.long 0
|
||||
|
||||
.section .init,"ax"
|
||||
bsr.a _rx_run_preinit_array
|
||||
bsr.a _rx_run_init_array
|
||||
rts
|
||||
|
||||
.global __rx_init_end
|
||||
__rx_init_end:
|
||||
|
||||
.section .fini,"ax"
|
||||
|
||||
rts
|
||||
.global __rx_fini_end
|
||||
__rx_fini_end:
|
||||
|
||||
#endif
|
||||
|
||||
/* call to exit*/
|
||||
_exit:
|
||||
bra _loop_here
|
||||
_loop_here:
|
||||
bra _loop_here
|
||||
|
||||
.text
|
||||
.end
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/***********************************************************************/
|
||||
/* */
|
||||
/* PROJECT NAME : RTOSDemo_GCC */
|
||||
/* FILE : typedefine.h */
|
||||
/* DESCRIPTION : Aliases of Integer Type */
|
||||
/* CPU SERIES : RX100 */
|
||||
/* CPU TYPE : RX111 */
|
||||
/* */
|
||||
/* This file is generated by e2studio. */
|
||||
/* */
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
typedef signed char _SBYTE;
|
||||
typedef unsigned char _UBYTE;
|
||||
typedef signed short _SWORD;
|
||||
typedef unsigned short _UWORD;
|
||||
typedef signed int _SINT;
|
||||
typedef unsigned int _UINT;
|
||||
typedef signed long _SDWORD;
|
||||
typedef unsigned long _UDWORD;
|
||||
typedef signed long long _SQWORD;
|
||||
typedef unsigned long long _UQWORD;
|
||||
+590
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,88 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : platform.h
|
||||
* Description : The user chooses which MCU and board they are developing for in this file. If the board you are using
|
||||
* is not listed below, please add your own or use the default 'User Board'.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 30.11.2011 1.00 First Release
|
||||
* : 13.01.2012 1.10 Moved from having platform defined using macro defintion, to having platform defined
|
||||
* by choosing an include path. This makes this file simpler and cleans up the issue
|
||||
* where HEW shows all header files for all platforms under 'Dependencies'.
|
||||
* : 14.02.2012 1.20 Added RX210 BSP.
|
||||
* : 18.04.2012 1.30 Updated to v0.70 of FIT S/W Spec and v0.20 of FIT r_bsp Spec. This includes adding
|
||||
* locking.c and locking.h in board folders. Also, r_bsp can now be configured through
|
||||
* r_bsp_config.h.
|
||||
* : 26.06.2012 1.40 Added new options such as exception callbacks and the ability to choose your MCU using
|
||||
* its part number in r_bsp_config.h. Moved mcu_info.h to the 'mcu' folder. Made an effort
|
||||
* to remove any extra files that the user would need to touch. Removed the flash_options.c
|
||||
* file and put its contents in vecttbl.c.
|
||||
* : 17.07.2012 1.50 Fixed bug with exception callback function names. Added BCLK_OUTPUT and SDCLK_OUTPUT
|
||||
* macro options in r_bsp_config.h. Added some extra code to handle exceptions in
|
||||
* vecttbl.c. Added vecttbl.h so that user has prototypes for exception callbacks.
|
||||
* : 08.11.2012 1.60 Added RX111 BSP
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef _PLATFORM_H_
|
||||
#define _PLATFORM_H_
|
||||
|
||||
/***********************************************************************************************************************
|
||||
DEFINE YOUR SYSTEM - UNCOMMENT THE INCLUDE PATH FOR THE PLATFORM YOU ARE USING.
|
||||
***********************************************************************************************************************/
|
||||
/* RSKRX610 */
|
||||
//#include "./board/rskrx610/r_bsp.h"
|
||||
|
||||
/* RSKRX62N */
|
||||
//#include "./board/rskrx62n/r_bsp.h"
|
||||
|
||||
/* RSKRX62T */
|
||||
//#include "./board/rskrx62t/r_bsp.h"
|
||||
|
||||
/* RDKRX62N */
|
||||
//#include "./board/rdkrx62n/r_bsp.h"
|
||||
|
||||
/* RSKRX630 */
|
||||
//#include "./board/rskrx630/r_bsp.h"
|
||||
|
||||
/* RSKRX63N */
|
||||
//#include "./board/rskrx63n/r_bsp.h"
|
||||
|
||||
/* RDKRX63N */
|
||||
//#include "./board/rdkrx63n/r_bsp.h"
|
||||
|
||||
/* RSKRX210 */
|
||||
//#include "./board/rskrx210/r_bsp.h"
|
||||
|
||||
/* RSKRX111 */
|
||||
#include "./board/rskrx111/r_bsp.h"
|
||||
|
||||
/* User Board - Define your own board here. */
|
||||
//#include "./board/user/r_bsp.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
MAKE SURE AT LEAST ONE PLATFORM WAS DEFINED - DO NOT EDIT BELOW THIS POINT
|
||||
***********************************************************************************************************************/
|
||||
#ifndef PLATFORM_DEFINED
|
||||
#error "Error - No platform defined in platform.h!"
|
||||
#endif
|
||||
|
||||
#endif /* _PLATFORM_H_ */
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp_config_reference.c
|
||||
* Device(s) : RX111
|
||||
* Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included
|
||||
* somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h)
|
||||
* is just a reference file that the user can use to make their own r_bsp_config.h file.
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 07.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
#ifndef R_BSP_CONFIG_REF_HEADER_FILE
|
||||
#define R_BSP_CONFIG_REF_HEADER_FILE
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Configuration Options
|
||||
***********************************************************************************************************************/
|
||||
/* Enter the product part number for your MCU. This information will be used to obtain information about your MCU such
|
||||
as package and memory size.
|
||||
To help parse this information, the part number will be defined using multiple macros.
|
||||
R 5 F 51 11 5 A D FM
|
||||
| | | | | | | | | Macro Name Description
|
||||
| | | | | | | | |__MCU_PART_PACKAGE = Package type, number of pins, and pin pitch
|
||||
| | | | | | | |____not used = Products with wide temperature range (D: -40 to 85C G: -40 to 105C)
|
||||
| | | | | | |______not used = Blank
|
||||
| | | | | |________MCU_PART_MEMORY_SIZE = ROM, RAM, and Data Flash Capacity
|
||||
| | | | |___________MCU_PART_GROUP = Group name
|
||||
| | | |______________MCU_PART_SERIES = Series name
|
||||
| | |________________MCU_PART_MEMORY_TYPE = Type of memory (Flash)
|
||||
| |__________________not used = Renesas MCU
|
||||
|____________________not used = Renesas semiconductor product.
|
||||
*/
|
||||
|
||||
/* Package type. Set the macro definition based on values below:
|
||||
Character(s) = Value for macro = Package Type/Number of Pins/Pin Pitch
|
||||
FM = 0x0 = LFQFP/64/0.50
|
||||
FK = 0x1 = LQFP/64/0.80
|
||||
LF = 0x2 = TFLGA/64/0.50
|
||||
FL = 0x3 = LFQFP/48/0.50
|
||||
NE = 0x4 = VQFN/48/0.50
|
||||
NC = 0x5 = HWQFN/36/0.50
|
||||
LM = 0x6 = WFLGA/36/0.50
|
||||
SB = 0x7 = SSOP/36/0.80
|
||||
*/
|
||||
#define MCU_PART_PACKAGE (0x0)
|
||||
|
||||
/* ROM, RAM, and Data Flash Capacity.
|
||||
Character(s) = Value for macro = ROM Size/Ram Size/Data Flash Size
|
||||
5 = 0x5 = 128KB/16KB/8KB
|
||||
4 = 0x4 = 96KB/16KB/8KB
|
||||
3 = 0x3 = 64KB/10KB/8KB
|
||||
1 = 0x1 = 32KB/10KB/8KB
|
||||
J = 0x0 = 16KB/8KB/8KB
|
||||
*/
|
||||
#define MCU_PART_MEMORY_SIZE (0x5)
|
||||
|
||||
/* Group name.
|
||||
Character(s) = Value for macro = Description
|
||||
10 = 0x0 = RX110 Group
|
||||
11 = 0x1 = RX111 Group
|
||||
*/
|
||||
#define MCU_PART_GROUP (0x1)
|
||||
|
||||
/* Series name.
|
||||
Character(s) = Value for macro = Description
|
||||
51 = 0x0 = RX100 Series
|
||||
*/
|
||||
#define MCU_PART_SERIES (0x0)
|
||||
|
||||
/* Memory type.
|
||||
Character(s) = Value for macro = Description
|
||||
F = 0x0 = Flash memory version
|
||||
*/
|
||||
#define MCU_PART_MEMORY_TYPE (0x0)
|
||||
|
||||
/* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a
|
||||
'#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */
|
||||
#if defined(BSP_DECLARE_STACK)
|
||||
/* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize su=0x400
|
||||
/* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize si=0x100
|
||||
#endif
|
||||
|
||||
/* Heap size in bytes. */
|
||||
#define HEAP_BYTES (0x001)
|
||||
|
||||
/* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information
|
||||
on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual.
|
||||
0 = Stay in Supervisor mode.
|
||||
1 = Switch to User mode.
|
||||
*/
|
||||
#define RUN_IN_USER_MODE (0)
|
||||
|
||||
|
||||
/* This macro lets other modules no if a RTOS is being used.
|
||||
0 = RTOS is not used.
|
||||
1 = RTOS is used.
|
||||
*/
|
||||
#define RTOS_USED (0)
|
||||
|
||||
/* Clock source select (CKSEL).
|
||||
0 = Low Speed On-Chip Oscillator (LOCO)
|
||||
1 = High Speed On-Chip Oscillator (HOCO)
|
||||
2 = Main Clock Oscillator
|
||||
3 = Sub-Clock Oscillator
|
||||
4 = PLL Circuit
|
||||
*/
|
||||
#define CLOCK_SOURCE (4) // GI org 4
|
||||
|
||||
/* Clock configuration options.
|
||||
The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The
|
||||
multiplier settings are used to set the clock registers in resetprg.c. If a 16MHz clock is used and the
|
||||
ICLK is 24MHz, PCLKB is 24MHz, FCLK is 24MHz, PCLKD is 24MHz, and CKO is 1MHz then the
|
||||
settings would be:
|
||||
|
||||
XTAL_HZ = 16000000
|
||||
PLL_DIV = 2
|
||||
PLL_MUL = 6 (16MHz x 3 = 48MHz)
|
||||
ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 24MHz
|
||||
PCKB_DIV = 2 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 24MHz
|
||||
PCKD_DIV = 2 : Peripheral Clock D (PCLKD) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKD_DIV) = 24MHz
|
||||
FCK_DIV = 2 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 24MHz
|
||||
*/
|
||||
/* XTAL - Input clock frequency in Hz */
|
||||
#define XTAL_HZ (16000000)
|
||||
/* PLL Input Frequency Divider Select (PLIDIV).
|
||||
Available divisors = /1 (no division), /2, /4
|
||||
*/
|
||||
#define PLL_DIV (2) // GI org 2
|
||||
/* PLL Frequency Multiplication Factor Select (STC).
|
||||
Available multipliers = x6, x8
|
||||
*/
|
||||
#define PLL_MUL (6) // GI org 6
|
||||
/* System Clock Divider (ICK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define ICK_DIV (2) // NOTE: ICLK CANNOT BE SLOWER THAN PCLK!
|
||||
/* Peripheral Module Clock B Divider (PCKB).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKB_DIV (2) // GI org 2
|
||||
/* Peripheral Module Clock D Divider (PCKD).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKD_DIV (2)
|
||||
/* Flash IF Clock Divider (FCK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define FCK_DIV (2)
|
||||
|
||||
/* Below are callback functions that can be used for detecting MCU exceptions, undefined interrupt sources, and
|
||||
bus errors. If the user wishes to be alerted of these events then they will need to define the macro as a
|
||||
function to be called when the event occurs. For example, if the user wanted the function
|
||||
excep_undefined_instr_isr() to be called when an undefined interrupt source ISR is triggered then they would
|
||||
do the following:
|
||||
#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
If the user does not wish to be alerted of these events then they should comment out the macros.
|
||||
|
||||
NOTE: When a callback function is called it will be called from within a ISR. This means that the function
|
||||
will essentially be an interrupt and will hold off other interrupts that occur in the system while it
|
||||
is executing. For this reason, it is recommended to keep these callback functions short as to not
|
||||
decrease the real-time response of your system.
|
||||
*/
|
||||
/* Callback for Supervisor Instruction Violation Exception. */
|
||||
//#define EXCEP_SUPERVISOR_ISR_CALLBACK supervisor_instr_cb
|
||||
|
||||
/* Callback for Undefined Instruction Exception. */
|
||||
//#define EXCEP_UNDEFINED_INSTR_ISR_CALLBACK undefined_instr_cb
|
||||
|
||||
/* Callback for Non-maskable Interrupt. */
|
||||
//#define NMI_ISR_CALLBACK nmi_cb
|
||||
|
||||
/* Callback for all undefined interrupt vectors. User can set a breakpoint in this function to determine which source
|
||||
is creating unwanted interrupts. */
|
||||
//#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
|
||||
/* Callback for Bus Error Interrupt. */
|
||||
//#define BUS_ERROR_ISR_CALLBACK bus_error_cb
|
||||
|
||||
/* The user has the option of separately choosing little or big endian for the User Application Area */
|
||||
|
||||
/* Endian mode for User Application.
|
||||
0 = Big Endian
|
||||
Else = Little Endian (Default)
|
||||
*/
|
||||
#define USER_APP_ENDIAN (1)
|
||||
|
||||
|
||||
/* Configure WDT and IWDT settings.
|
||||
OFS0 - Option Function Select Register 0
|
||||
OFS0 - Option Function Select Register 0
|
||||
b31:b15 Reserved (set to 1)
|
||||
b14 IWDTSLCSTP - IWDT Sleep Mode Count Stop Control - (0=can't stop count, 1=stop w/some low power modes)
|
||||
b13 Reserved (set to 1)
|
||||
b12 IWDTRSTIRQS - IWDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU)
|
||||
b11:b10 IWDTRPSS - IWDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use)
|
||||
b9:b8 IWDTRPES - IWDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use)
|
||||
b7:b4 IWDTCKS - IWDT Clock Frequency Division Ratio - (0=none, 2=/16, 3 = /32, 4=/64, 0xF=/128, 5=/256)
|
||||
b3:b2 IWDTTOPS - IWDT Timeout Period Select - (0=128 cycles, 1=512, 2=1024, 3=2048)
|
||||
b1 IWDTSTRT - IWDT Start Mode Select - (0=auto-start after reset, 1=halt after reset)
|
||||
b0 Reserved (set to 1) */
|
||||
#define OFS0_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Configure whether voltage detection 1 circuit and HOCO are enabled after reset.
|
||||
OFS1 - Option Function Select Register 1
|
||||
b31:b9 Reserved (set to 1)
|
||||
b8 HOCOEN - Enable/disable HOCO oscillation after a reset (0=enable, 1=disable)
|
||||
b7:b4 STUPLVD1LVL - Startup Voltage Monitoring 1 Reset Detection Level Select
|
||||
0 1 0 0: 3.10 V
|
||||
0 1 0 1: 3.00 V
|
||||
0 1 1 0: 2.90 V
|
||||
0 1 1 1: 2.79 V
|
||||
1 0 0 0: 2.68 V
|
||||
1 0 0 1: 2.58 V
|
||||
1 0 1 0: 2.48 V
|
||||
1 0 1 1: 2.06 V
|
||||
1 1 0 0: 1.96 V
|
||||
1 1 0 1: 1.86 V
|
||||
b3:b2 Reserved (set to 1)
|
||||
b2 STUPLVD1REN - Startup Voltage Monitoring 1 Reset Enable (1=monitoring disabled)
|
||||
b0 FASTSTUP - Power-On Fast Startup Time (1=normal; read only) */
|
||||
#define OFS1_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Initializes C input & output library functions.
|
||||
0 = Disable I/O library initialization in resetprg.c. If you are not using stdio then use this value.
|
||||
1 = Enable I/O library initialization in resetprg.c. This is default and needed if you are using stdio. */
|
||||
#define IO_LIB_ENABLE (0)
|
||||
|
||||
#endif /* R_BSP_CONFIG_REF_HEADER_FILE */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
r_bsp Package
|
||||
=============
|
||||
|
||||
Document Number
|
||||
---------------
|
||||
N/A
|
||||
|
||||
Version
|
||||
-------
|
||||
v1.60
|
||||
|
||||
Overview
|
||||
--------
|
||||
The r_bsp package provides a foundation for code to be built on top of. It provides startup code, iodefines, and MCU
|
||||
information for different boards. There are 2 folders that make up the r_bsp package. The 'mcu' folder has iodefine
|
||||
files and a file named 'mcu_info.h' for each MCU group. The 'mcu_info.h' file has information about the MCU on the board
|
||||
and is configured based on the information given in r_bsp_config.h. The information in 'mcu_info.h' is used to help
|
||||
configure Renesas middleware that uses the r_bsp package. The 'board' folder has a folder with startup code for each
|
||||
supported board. Which MCU and board is chosen is decided by the settings in 'platform.h'. The user can choose which
|
||||
board they are using by uncommenting the include path that applies to their board. For example, if you are using the
|
||||
RSK+RX62N then you would uncomment the #include "./board/rskrx62n/r_bsp.h" include path. Users are encouraged to add
|
||||
their own boards to the 'board' directory. BSPs are configured by using the r_bsp_config.h file. Each board will have a
|
||||
reference configuration file named r_bsp_config_reference.h. The user should copy this file to their project, rename it
|
||||
to r_bsp_config.h, and use the options inside the file to configure the BSP for their project.
|
||||
|
||||
Features
|
||||
--------
|
||||
* Provides foundation to build code on top of.
|
||||
* Provides MCU startup code.
|
||||
* Provides SFR access through iodefine.h
|
||||
* Stores details of MCU in 'mcu_info.h' to help configure Renesas middleware.
|
||||
* Easily configure BSP through r_bsp_config.h.
|
||||
* Choose MCU easily by inputting part number details in r_bsp_config.h.
|
||||
* Provides callbacks for MCU exceptions and the bus error interrupt.
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
N/A
|
||||
|
||||
Peripherals Used Directly
|
||||
-------------------------
|
||||
N/A
|
||||
|
||||
Required Packages
|
||||
-----------------
|
||||
* r_glyph [required if you want to use LCD for RDK boards]
|
||||
* r_rspi_rx [required if you want to use LCD for RDK boards]
|
||||
|
||||
How to add to your project
|
||||
--------------------------
|
||||
* Copy the r_bsp folder to your project.
|
||||
* Add an include path to the 'r_bsp' directory.
|
||||
* Add all of the source files for your board from the 'r_bsp\board\--YOUR_BOARD--' directory to your project.
|
||||
* Uncomment the include path for your board in 'platform.h' which is located in the 'r_bsp' directory.
|
||||
* Copy the file r_bsp_config_reference.h from the 'r_bsp\board\--YOUR_BOARD--' directory and copy it to your project's
|
||||
source code directory. Rename the file r_bsp_config.h.
|
||||
* Open r_bsp_config.h and use the macros to configure the BSP for your project.
|
||||
|
||||
File Structure
|
||||
--------------
|
||||
r_bsp
|
||||
| platform.h (choose which board is being used)
|
||||
| readme.txt
|
||||
|
|
||||
+---board (contains supported boards)
|
||||
| +---rdkrx62n (contains BSP source and header files)
|
||||
| |
|
||||
| +---rdkrx63n
|
||||
| |
|
||||
| +---rskrx111
|
||||
| |
|
||||
| +---rskrx210
|
||||
| |
|
||||
| +---rskrx610
|
||||
| |
|
||||
| +---rskrx62n
|
||||
| |
|
||||
| +---rskrx62t
|
||||
| |
|
||||
| +---rskrx630
|
||||
| |
|
||||
| +---rskrx63n
|
||||
| |
|
||||
| \---user
|
||||
|
|
||||
\---mcu
|
||||
+---rx111 (contains common files to this MCU group, e.g. iodefine.h)
|
||||
|
|
||||
+---rx210
|
||||
|
|
||||
+---rx610
|
||||
|
|
||||
+---rx62n
|
||||
|
|
||||
+---rx62t
|
||||
|
|
||||
+---rx630
|
||||
|
|
||||
\---rx63n
|
||||
|
||||
BIN
Binary file not shown.
+47
@@ -0,0 +1,47 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_switches_config.c
|
||||
* Description : Configures the switches code
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 17.01.2012 1.00 First Release
|
||||
* : 17.02.2012 1.10 Added RSKRX210 support.
|
||||
* : 08.03.2012 1.20 Added GetVersion() function (though it's really a macro).
|
||||
* : 04.06.2012 1.30 Code can now be interrupt or poll driven.
|
||||
***********************************************************************************************************************/
|
||||
#ifndef SWITCHES_CONFIG_HEADER_FILE
|
||||
#define SWITCHES_CONFIG_HEADER_FILE
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Configuration Options
|
||||
***********************************************************************************************************************/
|
||||
/* This macro sets whether interrupts or polling is used for detecting switch presses. The benefit of using interrupts
|
||||
is that no extra processing is used for polling and the use of a system timer tick is not a requirement. The downside
|
||||
of using interrupts is that callback functions are called from within an interrupt so if your ISR is long then it can
|
||||
degrade the real-time response of your system. The benefit of polling is that functions are called at the application
|
||||
level and debouncing is supported. The downside to polling is that your system must call the R_SWITCHES_Update() on a
|
||||
regular basis which requires extra processing.
|
||||
|
||||
0 = Use interrupts
|
||||
1 = Use polling
|
||||
*/
|
||||
#define SWITCHES_DETECTION_MODE (0)
|
||||
|
||||
#endif /* SWITCHES_CONFIG_HEADER_FILE */
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_switches_if.h
|
||||
* Description : Functions for using switches with callback functions.
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 17.01.2012 1.00 First Release
|
||||
* : 17.02.2012 1.10 Added RSKRX210 support.
|
||||
* : 08.03.2012 1.20 Added GetVersion() function (though it's really a macro).
|
||||
* : 04.06.2012 1.30 Code can now be interrupt or poll driven.
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef SWITCHES_API_HEADER_FILE
|
||||
#define SWITCHES_API_HEADER_FILE
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Fixed width integer support. */
|
||||
#include <stdint.h>
|
||||
/* Used for configuring the code */
|
||||
#include "r_switches_config.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Macro definitions
|
||||
***********************************************************************************************************************/
|
||||
/* Version Number of API. */
|
||||
#define SWITCHES_VERSION_MAJOR (1)
|
||||
#define SWITCHES_VERSION_MINOR (0)
|
||||
/* The process of getting the version number is done through the macro below. The version number is encoded where the
|
||||
top 2 bytes are the major version number and the bottom 2 bytes are the minor version number. For example,
|
||||
Version 4.25 would be returned as 0x00040019. */
|
||||
#define R_SWITCHES_GetVersion() ((((uint32_t)SWITCHES_VERSION_MAJOR) << 16) | (uint32_t)SWITCHES_VERSION_MINOR)
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Public Functions
|
||||
***********************************************************************************************************************/
|
||||
void R_SWITCHES_Init(void);
|
||||
void R_SWITCHES_Update(void);
|
||||
|
||||
/* Callback prototypes. */
|
||||
#if defined(SW1_CALLBACK_FUNCTION)
|
||||
void SW1_CALLBACK_FUNCTION(void);
|
||||
#endif
|
||||
|
||||
#if defined(SW2_CALLBACK_FUNCTION)
|
||||
void SW2_CALLBACK_FUNCTION(void);
|
||||
#endif
|
||||
|
||||
#if defined(SW3_CALLBACK_FUNCTION)
|
||||
void SW3_CALLBACK_FUNCTION(void);
|
||||
#endif
|
||||
|
||||
#endif /* SWITCHES_API_HEADER_FILE */
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
PLEASE REFER TO THE APPLICATION NOTE FOR THIS MIDDLEWARE FOR MORE INFORMATION
|
||||
|
||||
Switches
|
||||
========
|
||||
|
||||
Document Number
|
||||
---------------
|
||||
N/A
|
||||
|
||||
Version
|
||||
-------
|
||||
v1.40
|
||||
|
||||
Overview
|
||||
--------
|
||||
Configures port pins for switches and calls user defined function on switch press. Switch presses can be detected using
|
||||
IRQ interrupts or by polling. The benefit of using interrupts is that no extra processing is used for polling and the
|
||||
use of a system timer tick is not a requirement. The downside of using interrupts is that callback functions are called
|
||||
from within an interrupt so if your ISR is long then it can degrade the real-time response of your system. The benefit
|
||||
of polling is that functions are called at the application level and debouncing is supported. The downside to polling is
|
||||
that your system must call the R_SWITCHES_Update() on a regular basis which requires extra processing.
|
||||
|
||||
Features
|
||||
--------
|
||||
* Call one function to setup switches.
|
||||
* Define function to call when switch is pressed.
|
||||
* Can be configured to be interrupt or poll driven.
|
||||
|
||||
Supported MCUs
|
||||
--------------
|
||||
* RX610 Group
|
||||
* RX621, RX62N Group
|
||||
* RX62T Group
|
||||
* RX630 Group
|
||||
* RX631, RX63N Group
|
||||
* RX210 Group
|
||||
* RX111 Group
|
||||
|
||||
Boards Tested On
|
||||
----------------
|
||||
* RSKRX610
|
||||
* RSK+RX62N
|
||||
* RSKRX62T
|
||||
* RDKRX62N
|
||||
* RSKRX630
|
||||
* RSKRX63N
|
||||
* RDKRX63N
|
||||
* RSKRX111
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
* None
|
||||
|
||||
Peripherals Used Directly
|
||||
-------------------------
|
||||
* None
|
||||
|
||||
Required Packages
|
||||
-----------------
|
||||
* None
|
||||
|
||||
How to add to your project
|
||||
--------------------------
|
||||
* Add src\r_switches.c to your project.
|
||||
* Add an include path to the 'r_switches' directory.
|
||||
* Add an include path to the 'r_switches\src' directory.
|
||||
* Configure middleware through r_switches_config.h.
|
||||
* Add a #include for r_switches_if.h to files that need to use this package.
|
||||
|
||||
Toolchain(s) Used
|
||||
-----------------
|
||||
* Renesas RX v1.02
|
||||
|
||||
File Structure
|
||||
--------------
|
||||
r_switches
|
||||
| readme.txt
|
||||
| r_switches_config.h
|
||||
| r_switches_if.h
|
||||
|
|
||||
\---src
|
||||
r_switches.c
|
||||
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_switches.c
|
||||
* Description : Functions for using switches with callback functions.
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 17.01.2012 1.00 First Release
|
||||
* : 17.02.2012 1.10 Added RSKRX210 support.
|
||||
* : 08.03.2012 1.20 Added GetVersion() function (though it's really a macro).
|
||||
* : 04.06.2012 1.30 Code can now be interrupt or poll driven.
|
||||
* : 07.11.2012 1.40 Added support for RSKRX111
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Board and MCU support. */
|
||||
#include "platform.h"
|
||||
/* Switches prototypes. */
|
||||
#include "r_switches_if.h"
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
typedef int bool;
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Macro definitions
|
||||
***********************************************************************************************************************/
|
||||
/* This helps reduce the amount of unique code for each supported board. */
|
||||
#define X_IRQ( x ) XX_IRQ( x )
|
||||
#define XX_IRQ( x ) _ICU_IRQ##x
|
||||
|
||||
/* These macros define which IRQ pins are used for the switches. Note that these defintions cannot have parentheses
|
||||
around them. */
|
||||
#if defined(PLATFORM_BOARD_RSKRX111)
|
||||
#define SW1_IRQ_NUMBER 0
|
||||
#define SW2_IRQ_NUMBER 1
|
||||
#define SW3_IRQ_NUMBER 4
|
||||
#else
|
||||
#error This file is only for use on the RX100 RSK
|
||||
#endif
|
||||
|
||||
/* Number of switches on this board. */
|
||||
#define SWITCHES_NUM (3)
|
||||
|
||||
/* Register definitions not yet correct in iodefine.h. */
|
||||
#define MPC_P30PFS_REG ( * ( unsigned char * ) 0x0008C158 )
|
||||
#define MPC_P31PFS_REG ( * ( unsigned char * ) 0x0008C159 )
|
||||
#define MPC_PE4PFS_REG ( * ( unsigned char * ) 0x0008C1B4 )
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Typedef definitions
|
||||
***********************************************************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
bool active;
|
||||
int32_t debounce_cnt;
|
||||
} switch_t;
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Private global variables and functions
|
||||
***********************************************************************************************************************/
|
||||
#if SWITCHES_DETECTION_MODE == 1
|
||||
/* Update Hz */
|
||||
static uint32_t g_sw_debounce_cnts;
|
||||
/* Used for debounce. */
|
||||
switch_t g_switches[SWITCHES_NUM];
|
||||
#endif
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function Name: R_SWITCHES_Init
|
||||
* Description : Initializes pins to be input and interrupt on switch presses.
|
||||
* Arguments :
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
|
||||
void R_SWITCHES_Init (void)
|
||||
{
|
||||
/* Unlock protection register */
|
||||
MPC.PWPR.BYTE &= 0x7F;
|
||||
/* Unlock MPC registers */
|
||||
MPC.PWPR.BYTE |= 0x40;
|
||||
|
||||
/* Make switch pins inputs. */
|
||||
PORT3.PDR.BYTE &= 0xFC;
|
||||
PORTE.PDR.BYTE &= 0xEF;
|
||||
|
||||
/* Set port mode registers for switches. */
|
||||
PORT3.PMR.BYTE &= 0xFC;
|
||||
PORTE.PMR.BYTE &= 0xEF;
|
||||
|
||||
MPC_P30PFS_REG = 0x40; /* P30 is used as IRQ pin */
|
||||
MPC_P31PFS_REG = 0x40; /* P31 is used as IRQ pin */
|
||||
MPC_PE4PFS_REG = 0x40; /* PE4 is used as IRQ pin */
|
||||
|
||||
/* Set IRQ type (falling edge) */
|
||||
ICU.IRQCR[ SW1_IRQ_NUMBER ].BYTE = 0x04;
|
||||
ICU.IRQCR[ SW2_IRQ_NUMBER ].BYTE = 0x04;
|
||||
ICU.IRQCR[ SW3_IRQ_NUMBER ].BYTE = 0x04;
|
||||
|
||||
/* Set interrupt priorities, which must be below
|
||||
configMAX_SYSCALL_INTERRUPT_PRIORITY. */
|
||||
_IPR( X_IRQ(SW1_IRQ_NUMBER) ) = configKERNEL_INTERRUPT_PRIORITY;
|
||||
_IPR( X_IRQ(SW2_IRQ_NUMBER) ) = configKERNEL_INTERRUPT_PRIORITY;
|
||||
_IPR( X_IRQ(SW3_IRQ_NUMBER) ) = configKERNEL_INTERRUPT_PRIORITY;
|
||||
|
||||
/* Clear any pending interrupts */
|
||||
_IR( X_IRQ(SW1_IRQ_NUMBER) ) = 0;
|
||||
_IR( X_IRQ(SW2_IRQ_NUMBER) ) = 0;
|
||||
_IR( X_IRQ(SW3_IRQ_NUMBER) ) = 0;
|
||||
|
||||
/* Enable the interrupts */
|
||||
_IEN( X_IRQ(SW1_IRQ_NUMBER) ) = 1;
|
||||
_IEN( X_IRQ(SW2_IRQ_NUMBER) ) = 1;
|
||||
_IEN( X_IRQ(SW3_IRQ_NUMBER) ) = 1;
|
||||
}
|
||||
|
||||
/* If using polling then the user must call the update function. */
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: R_SWITCHES_Update
|
||||
* Description : Polls switches and calls callback functions as needed. If you are using IRQ mode then this function
|
||||
* is not needed and can be removed if desired. It is left in so that code will not fail when switching
|
||||
* between polling or IRQ mode.
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void R_SWITCHES_Update (void)
|
||||
{
|
||||
#if SWITCHES_DETECTION_MODE == 1
|
||||
/* This code is only needed for polling mode. */
|
||||
/* Check switch 1. */
|
||||
if (SW1 == SW_ACTIVE)
|
||||
{
|
||||
if (g_switches[0].active != true)
|
||||
{
|
||||
if (++g_switches[0].debounce_cnt >= g_sw_debounce_cnts)
|
||||
{
|
||||
/* Set this to true so we only call the callback function once per press. */
|
||||
g_switches[0].active = true;
|
||||
|
||||
/* Call callback function. */
|
||||
SW1_CALLBACK_FUNCTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 == g_switches[0].debounce_cnt)
|
||||
{
|
||||
g_switches[0].active = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_switches[0].debounce_cnt--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check switch 2. */
|
||||
if (SW2 == SW_ACTIVE)
|
||||
{
|
||||
if (g_switches[1].active != true)
|
||||
{
|
||||
if (++g_switches[1].debounce_cnt >= g_sw_debounce_cnts)
|
||||
{
|
||||
/* Set this to true so we only call the callback function once per press. */
|
||||
g_switches[1].active = true;
|
||||
|
||||
/* Call callback function. */
|
||||
SW2_CALLBACK_FUNCTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 == g_switches[1].debounce_cnt)
|
||||
{
|
||||
g_switches[1].active = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_switches[1].debounce_cnt--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check switch 3. */
|
||||
if (SW3 == SW_ACTIVE)
|
||||
{
|
||||
if (g_switches[2].active != true)
|
||||
{
|
||||
if (++g_switches[2].debounce_cnt >= g_sw_debounce_cnts)
|
||||
{
|
||||
/* Set this to true so we only call the callback function once per press. */
|
||||
g_switches[2].active = true;
|
||||
|
||||
/* Call callback function. */
|
||||
SW3_CALLBACK_FUNCTION();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 == g_switches[2].debounce_cnt)
|
||||
{
|
||||
g_switches[2].active = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_switches[2].debounce_cnt--;
|
||||
}
|
||||
}
|
||||
#endif /* SWITCHES_DETECTION_MODE */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* This project provides two demo applications. A low power project that
|
||||
* demonstrates the FreeRTOS tickless mode, and a more comprehensive test and
|
||||
* demo application. The configCREATE_LOW_POWER_DEMO setting (defined at the
|
||||
* top of FreeRTOSConfig.h) is used to select between the two. The low power
|
||||
* demo is implemented and described in main_low_power.c. The more
|
||||
* comprehensive test and demo application is implemented and described in
|
||||
* main_full.c.
|
||||
*
|
||||
* This file implements the code that is not demo specific, including the
|
||||
* hardware setup and FreeRTOS hook functions.
|
||||
*/
|
||||
|
||||
/* Kernel includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
/* Platform includes. */
|
||||
#include "lcd.h"
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* main_low_power() is used when configCREATE_LOW_POWER_DEMO is set to 1.
|
||||
* main_full() is used when configCREATE_LOW_POWER_DEMO is set to 0.
|
||||
*/
|
||||
extern void main_low_power( void );
|
||||
extern void main_full( void );
|
||||
|
||||
/* Prototypes for the standard FreeRTOS callback/hook functions implemented
|
||||
within this file. */
|
||||
void vApplicationMallocFailedHook( void );
|
||||
void vApplicationIdleHook( void );
|
||||
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );
|
||||
void vApplicationTickHook( void );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* See the documentation page for this demo on the FreeRTOS.org web site for
|
||||
full information - including hardware setup requirements. */
|
||||
|
||||
void main( void )
|
||||
{
|
||||
lcd_initialize();
|
||||
lcd_display( LCD_LINE1, "FreeRTOS" );
|
||||
|
||||
/* The configCREATE_LOW_POWER_DEMO setting is described in FreeRTOSConfig.h. */
|
||||
#if configCREATE_LOW_POWER_DEMO == 1
|
||||
{
|
||||
lcd_display( LCD_LINE2, "LP Demo" );
|
||||
main_low_power();
|
||||
}
|
||||
#else
|
||||
{
|
||||
lcd_display( LCD_LINE2, "Ful Demo" );
|
||||
main_full();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationMallocFailedHook( void )
|
||||
{
|
||||
/* vApplicationMallocFailedHook() will only be called if
|
||||
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
|
||||
function that will get called if a call to pvPortMalloc() fails.
|
||||
pvPortMalloc() is called internally by the kernel whenever a task, queue,
|
||||
timer or semaphore is created. It is also called by various parts of the
|
||||
demo application. If heap_1.c, heap_2.c or heap_4.c are used, then the size
|
||||
of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE
|
||||
in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
|
||||
to query the size of free heap space that remains (although it does not
|
||||
provide information on how the remaining heap might be fragmented). */
|
||||
taskDISABLE_INTERRUPTS();
|
||||
for( ;; );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationIdleHook( void )
|
||||
{
|
||||
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
||||
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
||||
task. It is essential that code added to this hook function never attempts
|
||||
to block in any way (for example, call xQueueReceive() with a block time
|
||||
specified, or call vTaskDelay()). If the application makes use of the
|
||||
vTaskDelete() API function (as this demo application does) then it is also
|
||||
important that vApplicationIdleHook() is permitted to return to its calling
|
||||
function, because it is the responsibility of the idle task to clean up
|
||||
memory allocated by the kernel to any task that has since been deleted. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
||||
{
|
||||
( void ) pcTaskName;
|
||||
( void ) pxTask;
|
||||
|
||||
/* Run time stack overflow checking is performed if
|
||||
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is
|
||||
called if a stack overflow is detected. */
|
||||
taskDISABLE_INTERRUPTS();
|
||||
for( ;; );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vApplicationTickHook( void )
|
||||
{
|
||||
/* This function will be called by each tick interrupt if
|
||||
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
|
||||
added here, but the tick hook is called from an interrupt context, so
|
||||
code must not attempt to block, and only the interrupt safe FreeRTOS API
|
||||
functions can be used (those that end in FromISR()). */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vAssertCalled( void )
|
||||
{
|
||||
volatile unsigned long ul = 0;
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
/* Set ul to a non-zero value using the debugger to step out of this
|
||||
function. */
|
||||
while( ul == 0 )
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,436 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
/* ****************************************************************************
|
||||
* When configCREATE_LOW_POWER_DEMO is set to 1 in FreeRTOSConfig.h main() will
|
||||
* call main_low_power(), which is defined in this file. main_low_power()
|
||||
* demonstrates FreeRTOS tick suppression being used to allow the MCU to be
|
||||
* placed into both the low power deep sleep mode and the low power software
|
||||
* standby mode. When configCREATE_LOW_POWER_DEMO is set to 0 main will
|
||||
* instead call main_full(), which is a more comprehensive RTOS demonstration.
|
||||
* ****************************************************************************
|
||||
*
|
||||
* This application demonstrates the FreeRTOS tickless idle mode (tick
|
||||
* suppression). See http://www.freertos.org/low-power-tickless-rtos.html
|
||||
* The demo is configured to execute on the Renesas RX100 RSK.
|
||||
*
|
||||
* Functionality:
|
||||
*
|
||||
* + Two tasks are created, an Rx task and a Tx task.
|
||||
*
|
||||
* + The Rx task repeatedly blocks on a queue to wait for data. The Rx task
|
||||
* toggles LED 0 each time is receives a value from the queue.
|
||||
*
|
||||
* + The Tx task repeatedly enters the Blocked state for an amount of time
|
||||
* that is set by the position of the potentiometer. On exiting the blocked
|
||||
* state the Tx task sends a value through the queue to the Rx task (causing
|
||||
* the Rx task to exit the blocked state and toggle LED 0).
|
||||
*
|
||||
* If the value read from the potentiometer is less than or equal to
|
||||
* mainSOFTWARE_STANDBY_DELAY then the Tx task blocks for the equivalent
|
||||
* number of milliseconds. For example, if the sampled analog value is
|
||||
* 2000, then the Tx task blocks for 2000ms. Blocking for a finite period
|
||||
* allows the kernel to stop the tick interrupt and place the RX100 into
|
||||
* deep sleep mode.
|
||||
*
|
||||
* If the value read form the potentiometer is greater than
|
||||
* mainSOFTWARE_STANDBY_DELAY then the Tx task blocks on a semaphore with
|
||||
* an infinite timeout. Blocking with an infinite timeout allows the kernel
|
||||
* to stop the tick interrupt and place the RX100 into software standby
|
||||
* mode. Pressing a button will generate an interrupt that causes the RX100
|
||||
* to exit software standby mode. The interrupt service routine 'gives' the
|
||||
* semaphore to unblock the Tx task.
|
||||
*
|
||||
*
|
||||
* Using the Demo and Observed Behaviour:
|
||||
*
|
||||
* 1) Turn the potentiometer completely counter clockwise.
|
||||
*
|
||||
* 2) Program the RX100 with the application, then disconnect the programming/
|
||||
* debugging hardware to ensure power readings are not effected by any
|
||||
* connected interfaces.
|
||||
*
|
||||
* 3) Start the application running. LED 0 will toggle quickly because the
|
||||
* potentiometer is turned to its lowest value. LED 1 will be illuminated
|
||||
* when the RX100 is not in a power saving mode, but will appear to be off
|
||||
* because most execution time is spent in a sleep mode. Led 2 will be
|
||||
* illuminated when the RX100 is in deep sleep mode, and will appear to be
|
||||
* always on, again because most execution time is spent in deep sleep mode.
|
||||
* The LEDs are turned on and off by the application defined pre and post
|
||||
* sleep macros (see the definitions of configPRE_SLEEP_PROCESSING() and
|
||||
* configPOST_SLEEP_PROCESSING() in FreeRTOSConfig.h).
|
||||
*
|
||||
* 4) Slowly turn the potentiometer in the clockwise direction. This will
|
||||
* increase the value read from the potentiometer, which will increase the
|
||||
* time the Tx task spends in the Blocked state, which will therefore
|
||||
* decrease the frequency at which the Tx task sends data to the queue (and
|
||||
* the rate at which LED 0 is toggled).
|
||||
*
|
||||
* 5) Keep turning the potentiometer in the clockwise direction. Eventually
|
||||
* the value read from the potentiometer will go above
|
||||
* mainSOFTWARE_STANDBY_DELAY, causing the Tx task to block on the semaphore
|
||||
* with an infinite timeout. LED 0 will stop toggling because the Tx task is
|
||||
* no longer sending to the queue. LED 1 and LED 2 will both be off because
|
||||
* the RX100 is neither running or in deep sleep mode (it is in software
|
||||
* standby mode).
|
||||
*
|
||||
* 6) Turn the potentiometer counter clockwise again to ensure its value goes
|
||||
* back below mainSOFTWARE_STANDBY_DELAY.
|
||||
*
|
||||
* 7) Press any of the three buttons to generate an interrupt. The interrupt
|
||||
* will take the RX100 out of software standby mode, and the interrupt
|
||||
* service routine will unblock the Tx task by 'giving' the semaphore. LED 0
|
||||
* will then start to toggle again.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Hardware specific includes. */
|
||||
#include "platform.h"
|
||||
#include "r_switches_if.h"
|
||||
|
||||
/* Kernel includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
/* Common demo includes. */
|
||||
#include "partest.h"
|
||||
|
||||
/* Priorities at which the Rx and Tx tasks are created. */
|
||||
#define configQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define configQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
|
||||
/* The number of items the queue can hold. This is 1 as the Rx task will
|
||||
remove items as they are added so the Tx task should always find the queue
|
||||
empty. */
|
||||
#define mainQUEUE_LENGTH ( 1 )
|
||||
|
||||
/* The LED used to indicate that a value has been received on the queue. */
|
||||
#define mainQUEUE_LED ( 0 )
|
||||
|
||||
/* The LED used to indicate that full power is being used (the MCU is not in
|
||||
deep sleep or software standby mode). */
|
||||
#define mainFULL_POWER_LED ( 1 )
|
||||
|
||||
/* The LED used to indicate that deep sleep mode is being used. */
|
||||
#define mainDEEP_SLEEP_LED ( 2 )
|
||||
|
||||
/* The Tx task sends to the queue with a frequency that is set by the value
|
||||
read from the potentiometer until the value goes above that set by the
|
||||
mainSOFTWARE_STANDBY_DELAY constant - at which time the Tx task instead blocks
|
||||
indefinitely on a semaphore. */
|
||||
#define mainSOFTWARE_STANDBY_DELAY ( 3000UL )
|
||||
|
||||
/* A block time of zero simply means "don't block". */
|
||||
#define mainDONT_BLOCK ( 0 )
|
||||
|
||||
/* The value that is sent from the Tx task to the Rx task on the queue. */
|
||||
#define mainQUEUED_VALUE ( 100UL )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* The Rx and Tx tasks as described at the top of this file.
|
||||
*/
|
||||
static void prvQueueReceiveTask( void *pvParameters );
|
||||
static void prvQueueSendTask( void *pvParameters );
|
||||
|
||||
/*
|
||||
* Reads and returns the value of the ADC connected to the potentiometer built
|
||||
* onto the RSK.
|
||||
*/
|
||||
static unsigned short prvReadPOT( void );
|
||||
|
||||
/*
|
||||
* The handler for the interrupt generated when any of the buttons are pressed.
|
||||
*/
|
||||
void vButtonInterrupt( void ) __attribute__((interrupt));
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The queue to pass data from the Tx task to the Rx task. */
|
||||
static xQueueHandle xQueue = NULL;
|
||||
|
||||
/* The semaphore that is 'given' by interrupts generated from button pushes. */
|
||||
static xSemaphoreHandle xSemaphore = NULL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void main_low_power( void )
|
||||
{
|
||||
/* Create the queue. */
|
||||
xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );
|
||||
configASSERT( xQueue );
|
||||
|
||||
/* Create the semaphore that is 'given' by an interrupt generated from a
|
||||
button push. */
|
||||
vSemaphoreCreateBinary( xSemaphore );
|
||||
configASSERT( xSemaphore );
|
||||
|
||||
/* Make sure the semaphore starts in the expected state - no button pushes
|
||||
have yet occurred. A block time of zero can be used as it is guaranteed
|
||||
that the semaphore will be available because it has just been created. */
|
||||
xSemaphoreTake( xSemaphore, mainDONT_BLOCK );
|
||||
|
||||
/* Start the two tasks as described at the top of this file. */
|
||||
xTaskCreate( prvQueueReceiveTask, "Rx", configMINIMAL_STACK_SIZE, NULL, configQUEUE_RECEIVE_TASK_PRIORITY, NULL );
|
||||
xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );
|
||||
|
||||
/* The CPU is currently running, not sleeping, so turn on the LED that
|
||||
shows the CPU is not in a sleep mode. */
|
||||
vParTestSetLED( mainFULL_POWER_LED, pdTRUE );
|
||||
|
||||
/* Start the scheduler running running. */
|
||||
vTaskStartScheduler();
|
||||
|
||||
/* If all is well the next line of code will not be reached as the
|
||||
scheduler will be running. If the next line is reached then it is likely
|
||||
there was insufficient FreeRTOS heap available for the idle task and/or
|
||||
timer task to be created. See http://www.freertos.org/a00111.html. */
|
||||
for( ;; );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvQueueSendTask( void *pvParameters )
|
||||
{
|
||||
portTickType xDelay;
|
||||
const unsigned long ulValueToSend = mainQUEUED_VALUE;
|
||||
|
||||
/* Remove compiler warning about unused parameter. */
|
||||
( void ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
/* The delay period between successive sends to the queue is set by
|
||||
the potentiometer reading. */
|
||||
xDelay = ( portTickType ) prvReadPOT();
|
||||
|
||||
/* If the block time is greater than 3000 milliseconds then block
|
||||
indefinitely waiting for a button push. */
|
||||
if( xDelay > mainSOFTWARE_STANDBY_DELAY )
|
||||
{
|
||||
/* As this is an indefinite delay the kernel will place the CPU
|
||||
into software standby mode the next time the idle task runs. */
|
||||
xSemaphoreTake( xSemaphore, portMAX_DELAY );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert a time in milliseconds to a time in ticks. */
|
||||
xDelay /= portTICK_RATE_MS;
|
||||
|
||||
/* Place this task in the blocked state until it is time to run
|
||||
again. As this is not an indefinite sleep the kernel will place
|
||||
the CPU into the deep sleep state when the idle task next runs. */
|
||||
vTaskDelay( xDelay );
|
||||
}
|
||||
|
||||
/* Send to the queue - causing the queue receive task to flash its LED.
|
||||
It should not be necessary to block on the queue send because the Rx
|
||||
task will have removed the last queued item. */
|
||||
xQueueSend( xQueue, &ulValueToSend, mainDONT_BLOCK );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvQueueReceiveTask( void *pvParameters )
|
||||
{
|
||||
unsigned long ulReceivedValue;
|
||||
|
||||
/* Remove compiler warning about unused parameter. */
|
||||
( void ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
/* Wait until something arrives in the queue - this will block
|
||||
indefinitely provided INCLUDE_vTaskSuspend is set to 1 in
|
||||
FreeRTOSConfig.h. */
|
||||
xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );
|
||||
|
||||
/* To get here something must have arrived, but is it the expected
|
||||
value? If it is, toggle the LED. */
|
||||
if( ulReceivedValue == mainQUEUED_VALUE )
|
||||
{
|
||||
vParTestToggleLED( mainQUEUE_LED );
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vPreSleepProcessing( unsigned long ulExpectedIdleTime )
|
||||
{
|
||||
/* Called by the kernel before it places the MCU into a sleep mode because
|
||||
configPRE_SLEEP_PROCESSING() is #defined to vPreSleepProcessing().
|
||||
|
||||
NOTE: Additional actions can be taken here to get the power consumption
|
||||
even lower. For example, the ADC input used by this demo could be turned
|
||||
off here, and then back on again in the power sleep processing function.
|
||||
For maximum power saving ensure all unused pins are in their lowest power
|
||||
state. */
|
||||
|
||||
/* Avoid compiler warnings about the unused parameter. */
|
||||
( void ) ulExpectedIdleTime;
|
||||
|
||||
/* Is the MCU about to enter deep sleep mode or software standby mode? */
|
||||
if( SYSTEM.SBYCR.BIT.SSBY == 0 )
|
||||
{
|
||||
/* Turn on the LED that indicates deep sleep mode is being entered. */
|
||||
vParTestSetLED( mainDEEP_SLEEP_LED, pdTRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Software standby mode is being used, so no LEDs are illuminated to
|
||||
ensure minimum power readings are obtained. Ensure the Queue LED is
|
||||
also off. */
|
||||
vParTestSetLED( mainQUEUE_LED, pdFALSE );
|
||||
}
|
||||
|
||||
/* Turn off the LED that indicates full power is being used. */
|
||||
vParTestSetLED( mainFULL_POWER_LED, pdFALSE );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vPostSleepProcessing( unsigned long ulExpectedIdleTime )
|
||||
{
|
||||
/* Called by the kernel when the MCU exits a sleep mode because
|
||||
configPOST_SLEEP_PROCESSING is #defined to vPostSleepProcessing(). */
|
||||
|
||||
/* Avoid compiler warnings about the unused parameter. */
|
||||
( void ) ulExpectedIdleTime;
|
||||
|
||||
/* Turn off the LED that indicates deep sleep mode, and turn on the LED
|
||||
that indicates full power is being used. */
|
||||
vParTestSetLED( mainDEEP_SLEEP_LED, pdFALSE );
|
||||
vParTestSetLED( mainFULL_POWER_LED, pdTRUE );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static unsigned short prvReadPOT( void )
|
||||
{
|
||||
unsigned short usADCValue;
|
||||
const unsigned short usMinADCValue = 128;
|
||||
|
||||
/* Start an ADC scan. */
|
||||
S12AD.ADCSR.BIT.ADST = 1;
|
||||
while( S12AD.ADCSR.BIT.ADST == 1 )
|
||||
{
|
||||
/* Just waiting for the ADC scan to complete. Inefficient
|
||||
polling! */
|
||||
}
|
||||
|
||||
usADCValue = S12AD.ADDR4;
|
||||
|
||||
/* Don't let the ADC value get too small as the LED behaviour will look
|
||||
erratic. */
|
||||
if( usADCValue < usMinADCValue )
|
||||
{
|
||||
usADCValue = usMinADCValue;
|
||||
}
|
||||
|
||||
return usADCValue;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vButtonInterrupt( void )
|
||||
{
|
||||
long lHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
/* The semaphore is only created when the build is configured to create the
|
||||
low power demo. */
|
||||
if( xSemaphore != NULL )
|
||||
{
|
||||
/* This interrupt will bring the CPU out of deep sleep and software
|
||||
standby modes. Give the semaphore that was used to place the Tx task
|
||||
into an indefinite sleep. */
|
||||
if( uxQueueMessagesWaitingFromISR( xSemaphore ) == 0 )
|
||||
{
|
||||
xSemaphoreGiveFromISR( xSemaphore, &lHigherPriorityTaskWoken );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The semaphore was already available, so the task is not blocked
|
||||
on it and there is no point giving it. */
|
||||
}
|
||||
|
||||
/* If giving the semaphore caused a task to leave the Blocked state,
|
||||
and the task that left the Blocked state has a priority equal to or
|
||||
above the priority of the task that this interrupt interrupted, then
|
||||
lHigherPriorityTaskWoken will have been set to pdTRUE inside the call
|
||||
to xSemaphoreGiveFromISR(), and calling portYIELD_FROM_ISR() will cause
|
||||
a context switch to the unblocked task. */
|
||||
portYIELD_FROM_ISR( lHigherPriorityTaskWoken );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
Copyright 2001, 2002 Georges Menie (www.menie.org)
|
||||
stdarg version contributed by Christian Ettinger
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
putchar is the only external dependency for this file,
|
||||
if you have a working putchar, leave it commented out.
|
||||
If not, uncomment the define below and
|
||||
replace outbyte(c) by your own function call.
|
||||
|
||||
*/
|
||||
|
||||
#define putchar(c) c
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
static void printchar(char **str, int c)
|
||||
{
|
||||
//extern int putchar(int c);
|
||||
|
||||
if (str) {
|
||||
**str = (char)c;
|
||||
++(*str);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)putchar(c);
|
||||
}
|
||||
}
|
||||
|
||||
#define PAD_RIGHT 1
|
||||
#define PAD_ZERO 2
|
||||
|
||||
static int prints(char **out, const char *string, int width, int pad)
|
||||
{
|
||||
register int pc = 0, padchar = ' ';
|
||||
|
||||
if (width > 0) {
|
||||
register int len = 0;
|
||||
register const char *ptr;
|
||||
for (ptr = string; *ptr; ++ptr) ++len;
|
||||
if (len >= width) width = 0;
|
||||
else width -= len;
|
||||
if (pad & PAD_ZERO) padchar = '0';
|
||||
}
|
||||
if (!(pad & PAD_RIGHT)) {
|
||||
for ( ; width > 0; --width) {
|
||||
printchar (out, padchar);
|
||||
++pc;
|
||||
}
|
||||
}
|
||||
for ( ; *string ; ++string) {
|
||||
printchar (out, *string);
|
||||
++pc;
|
||||
}
|
||||
for ( ; width > 0; --width) {
|
||||
printchar (out, padchar);
|
||||
++pc;
|
||||
}
|
||||
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* the following should be enough for 32 bit int */
|
||||
#define PRINT_BUF_LEN 12
|
||||
|
||||
static int printi(char **out, int i, int b, int sg, int width, int pad, int letbase)
|
||||
{
|
||||
char print_buf[PRINT_BUF_LEN];
|
||||
register char *s;
|
||||
register int t, neg = 0, pc = 0;
|
||||
register unsigned int u = (unsigned int)i;
|
||||
|
||||
if (i == 0) {
|
||||
print_buf[0] = '0';
|
||||
print_buf[1] = '\0';
|
||||
return prints (out, print_buf, width, pad);
|
||||
}
|
||||
|
||||
if (sg && b == 10 && i < 0) {
|
||||
neg = 1;
|
||||
u = (unsigned int)-i;
|
||||
}
|
||||
|
||||
s = print_buf + PRINT_BUF_LEN-1;
|
||||
*s = '\0';
|
||||
|
||||
while (u) {
|
||||
t = (unsigned int)u % b;
|
||||
if( t >= 10 )
|
||||
t += letbase - '0' - 10;
|
||||
*--s = (char)(t + '0');
|
||||
u /= b;
|
||||
}
|
||||
|
||||
if (neg) {
|
||||
if( width && (pad & PAD_ZERO) ) {
|
||||
printchar (out, '-');
|
||||
++pc;
|
||||
--width;
|
||||
}
|
||||
else {
|
||||
*--s = '-';
|
||||
}
|
||||
}
|
||||
|
||||
return pc + prints (out, s, width, pad);
|
||||
}
|
||||
|
||||
static int print( char **out, const char *format, va_list args )
|
||||
{
|
||||
register int width, pad;
|
||||
register int pc = 0;
|
||||
char scr[2];
|
||||
|
||||
for (; *format != 0; ++format) {
|
||||
if (*format == '%') {
|
||||
++format;
|
||||
width = pad = 0;
|
||||
if (*format == '\0') break;
|
||||
if (*format == '%') goto out;
|
||||
if (*format == '-') {
|
||||
++format;
|
||||
pad = PAD_RIGHT;
|
||||
}
|
||||
while (*format == '0') {
|
||||
++format;
|
||||
pad |= PAD_ZERO;
|
||||
}
|
||||
for ( ; *format >= '0' && *format <= '9'; ++format) {
|
||||
width *= 10;
|
||||
width += *format - '0';
|
||||
}
|
||||
if( *format == 's' ) {
|
||||
register char *s = (char *)va_arg( args, int );
|
||||
pc += prints (out, s?s:"(null)", width, pad);
|
||||
continue;
|
||||
}
|
||||
if( *format == 'd' ) {
|
||||
pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');
|
||||
continue;
|
||||
}
|
||||
if( *format == 'x' ) {
|
||||
pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');
|
||||
continue;
|
||||
}
|
||||
if( *format == 'X' ) {
|
||||
pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');
|
||||
continue;
|
||||
}
|
||||
if( *format == 'u' ) {
|
||||
pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');
|
||||
continue;
|
||||
}
|
||||
if( *format == 'c' ) {
|
||||
/* char are converted to int then pushed on the stack */
|
||||
scr[0] = (char)va_arg( args, int );
|
||||
scr[1] = '\0';
|
||||
pc += prints (out, scr, width, pad);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
out:
|
||||
printchar (out, *format);
|
||||
++pc;
|
||||
}
|
||||
}
|
||||
if (out) **out = '\0';
|
||||
va_end( args );
|
||||
return pc;
|
||||
}
|
||||
|
||||
int printf(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start( args, format );
|
||||
return print( 0, format, args );
|
||||
}
|
||||
|
||||
int sprintf(char *out, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start( args, format );
|
||||
return print( &out, format, args );
|
||||
}
|
||||
|
||||
|
||||
int snprintf( char *buf, unsigned int count, const char *format, ... )
|
||||
{
|
||||
va_list args;
|
||||
|
||||
( void ) count;
|
||||
|
||||
va_start( args, format );
|
||||
return print( &buf, format, args );
|
||||
}
|
||||
|
||||
|
||||
#ifdef TEST_PRINTF
|
||||
int main(void)
|
||||
{
|
||||
char *ptr = "Hello world!";
|
||||
char *np = 0;
|
||||
int i = 5;
|
||||
unsigned int bs = sizeof(int)*8;
|
||||
int mi;
|
||||
char buf[80];
|
||||
|
||||
mi = (1 << (bs-1)) + 1;
|
||||
printf("%s\n", ptr);
|
||||
printf("printf test\n");
|
||||
printf("%s is null pointer\n", np);
|
||||
printf("%d = 5\n", i);
|
||||
printf("%d = - max int\n", mi);
|
||||
printf("char %c = 'a'\n", 'a');
|
||||
printf("hex %x = ff\n", 0xff);
|
||||
printf("hex %02x = 00\n", 0);
|
||||
printf("signed %d = unsigned %u = hex %x\n", -3, -3, -3);
|
||||
printf("%d %s(s)%", 0, "message");
|
||||
printf("\n");
|
||||
printf("%d %s(s) with %%\n", 0, "message");
|
||||
sprintf(buf, "justif: \"%-10s\"\n", "left"); printf("%s", buf);
|
||||
sprintf(buf, "justif: \"%10s\"\n", "right"); printf("%s", buf);
|
||||
sprintf(buf, " 3: %04d zero padded\n", 3); printf("%s", buf);
|
||||
sprintf(buf, " 3: %-4d left justif.\n", 3); printf("%s", buf);
|
||||
sprintf(buf, " 3: %4d right justif.\n", 3); printf("%s", buf);
|
||||
sprintf(buf, "-3: %04d zero padded\n", -3); printf("%s", buf);
|
||||
sprintf(buf, "-3: %-4d left justif.\n", -3); printf("%s", buf);
|
||||
sprintf(buf, "-3: %4d right justif.\n", -3); printf("%s", buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* if you compile this file with
|
||||
* gcc -Wall $(YOUR_C_OPTIONS) -DTEST_PRINTF -c printf.c
|
||||
* you will get a normal warning:
|
||||
* printf.c:214: warning: spurious trailing `%' in format
|
||||
* this line is testing an invalid % at the end of the format string.
|
||||
*
|
||||
* this should display (on 32bit int machine) :
|
||||
*
|
||||
* Hello world!
|
||||
* printf test
|
||||
* (null) is null pointer
|
||||
* 5 = 5
|
||||
* -2147483647 = - max int
|
||||
* char a = 'a'
|
||||
* hex ff = ff
|
||||
* hex 00 = 00
|
||||
* signed -3 = unsigned 4294967293 = hex fffffffd
|
||||
* 0 message(s)
|
||||
* 0 message(s) with %
|
||||
* justif: "left "
|
||||
* justif: " right"
|
||||
* 3: 0003 zero padded
|
||||
* 3: 3 left justif.
|
||||
* 3: 3 right justif.
|
||||
* -3: -003 zero padded
|
||||
* -3: -3 left justif.
|
||||
* -3: -3 right justif.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* To keep linker happy. */
|
||||
int write( int i, char* c, int n)
|
||||
{
|
||||
(void)i;
|
||||
(void)n;
|
||||
(void)c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.renesas.cdt.launch.dsf.gdbremote.launchConfigurationType">
|
||||
<intAttribute key="com.renesas.cdt.core.admPortNumber" value="61236"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.initCommands" value=""/>
|
||||
<stringAttribute key="com.renesas.cdt.core.ipAddress" value="localhost"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.jtagDevice" value="E1"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.loadImage" value="true"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.optionInitCommands" value=""/>
|
||||
<intAttribute key="com.renesas.cdt.core.portNumber" value="61234"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.runCommands" value=""/>
|
||||
<stringAttribute key="com.renesas.cdt.core.serverParam" value="-g E1 -l 0 -t R5F51115 -p 61234 -d 61236 -uClockSrcHoco= 0 -uInputClock= 12.0000 -uAllowClockSourceInternal= 1 -uUseFine= 1 -uFineBaudRate= 2.00 -w 0 -z 0 -uRegisterSetting= 0 -uModePin= 0 -uDebugMode= 0 -uExecuteProgram= 0 -uIdCode= FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -n 0 -uWorkRamAddress= 1000 -uProgReWriteIRom= 0 -uProgReWriteDFlash= 0"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.setResume" value="true"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.setStopAt" value="true"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.startServer" value="true"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.stopAt" value="main"/>
|
||||
<stringAttribute key="com.renesas.cdt.core.targetDevice" value="R5F51115"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.useRemoteTarget" value="true"/>
|
||||
<booleanAttribute key="com.renesas.cdt.core.verboseMode" value="false"/>
|
||||
<stringAttribute key="com.renesas.cdt.launch.dsf.IO_MAP" value="${eclipse_home}..\internal\IoFiles\RX\RX111.sfrx"/>
|
||||
<booleanAttribute key="com.renesas.cdt.launch.dsf.USE_DEFAULT_IO_MAP" value="true"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.allow.clock.source.internal" value="true"/>
|
||||
<intAttribute key="com.renesas.hardwaredebug.e1.clock_source" value="0"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.connection.mode" value="0"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.e1_pwr" value="false"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.execute.program" value="false"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.external_memory" value=""/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.fine.baud.rate" value="2.00"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.flash_overwrite_blocks" value=""/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.hw_break" value="false"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.id_code" value="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.inputclock" value="12.0000"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.jtag.clock.freq" value="16.5"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.jtag.or.fine" value="1"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.le" value="true"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.mode" value="0"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.mode_pin" value="0"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.prog_rewrite_dflash" value="false"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e1.prog_rewrite_irom" value="false"/>
|
||||
<stringAttribute key="com.renesas.hardwaredebug.e1.supply.voltage" value="3.3V"/>
|
||||
<intAttribute key="com.renesas.hardwaredebug.e1.work_ram_start" value="4096"/>
|
||||
<booleanAttribute key="com.renesas.hardwaredebug.e20.le" value="true"/>
|
||||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
|
||||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${eclipse_home}../DebugComp/rx-elf-gdb"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
|
||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="HardwareDebug\RTOSDemo_GCC.x"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RTOSDemo_GCC"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/RTOSDemo_GCC"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "/>
|
||||
</launchConfiguration>
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
#define FREERTOS_CONFIG_H
|
||||
|
||||
/* Hardware specifics. */
|
||||
#include "platform.h"
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Application specific definitions.
|
||||
*
|
||||
* These definitions should be adjusted for your particular hardware and
|
||||
* application requirements.
|
||||
*
|
||||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
|
||||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
|
||||
*
|
||||
* See http://www.freertos.org/a00110.html.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
/* DEMO SPECIFIC SETTING:
|
||||
* Set configCREATE_LOW_POWER_DEMO to one to run the low power demo with tick
|
||||
* suppression, or 0 to run the more comprehensive test and demo application.
|
||||
* If configCREATE_LOW_POWER_DEMO is set to 1 then main() calls main_low_power().
|
||||
* If configCREATE_LOW_POWER_DEMO is set to 0 then main() calls main_full().
|
||||
*/
|
||||
#define configCREATE_LOW_POWER_DEMO 1
|
||||
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_TICKLESS_IDLE configCREATE_LOW_POWER_DEMO
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( ICLK_HZ ) /* Set in mcu_info.h. */
|
||||
#define configPERIPHERAL_CLOCK_HZ ( PCLKB_HZ ) /* Set in muc_info.h. */
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 9 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 12 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 0
|
||||
#define configUSE_MALLOC_FAILED_HOOK 0
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 )
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
/* Software timer definitions - only included when the demo is configured to
|
||||
build the full demo (as opposed to the low power demo). */
|
||||
#if configCREATE_LOW_POWER_DEMO == 1
|
||||
#define configUSE_TIMERS 0
|
||||
#else
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 3 )
|
||||
#define configTIMER_QUEUE_LENGTH 5
|
||||
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE )
|
||||
#endif /* configCREATE_LOW_POWER_DEMO */
|
||||
|
||||
/*
|
||||
The interrupt priority used by the kernel itself for the tick interrupt and
|
||||
the pended interrupt is set by configKERNEL_INTERRUPT_PRIORITY. This would
|
||||
normally be the lowest priority (1 in this case). The maximum interrupt
|
||||
priority from which FreeRTOS API calls can be made is set by
|
||||
configMAX_SYSCALL_INTERRUPT_PRIORITY. Interrupts that use a priority above this
|
||||
will not be effected by anything the kernel is doing. Interrupts at or below
|
||||
this priority can use FreeRTOS API functions - but *only* those that end in
|
||||
"FromISR". Both these constants are defined in 'PriorityDefinitions.h' so they
|
||||
can also be included in assembly source files.
|
||||
*/
|
||||
#include "PriorityDefinitions.h"
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
|
||||
extern void vAssertCalled( void );
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled();
|
||||
|
||||
/* The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros
|
||||
allow the application writer to add additional code before and after the MCU is
|
||||
placed into the low power state respectively. The implementations provided in
|
||||
this demo can be extended to save even more power - for example the analog
|
||||
input used by the low power demo could be switched off in the pre-sleep macro
|
||||
and back on again in the post sleep macro. */
|
||||
void vPreSleepProcessing( unsigned long xExpectedIdleTime );
|
||||
void vPostSleepProcessing( unsigned long xExpectedIdleTime );
|
||||
#define configPRE_SLEEP_PROCESSING( xExpectedIdleTime ) vPreSleepProcessing( xExpectedIdleTime );
|
||||
#define configPOST_SLEEP_PROCESSING( xExpectedIdleTime ) vPostSleepProcessing( xExpectedIdleTime );
|
||||
|
||||
/* configTICK_VECTOR must be set to the interrupt vector used by the peripheral
|
||||
that generates the tick interrupt. */
|
||||
#define configTICK_VECTOR VECT_CMT0_CMI0
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Simple IO routines to control the LEDs.
|
||||
*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
/* Demo includes. */
|
||||
#include "partest.h"
|
||||
|
||||
#define partestNUM_LEDS ( 4 )
|
||||
|
||||
long lParTestGetLEDState( unsigned long ulLED );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestInitialise( void )
|
||||
{
|
||||
/* Port pin configuration is done by the low level set up prior to this
|
||||
function being called. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestSetLED( unsigned long ulLED, signed long xValue )
|
||||
{
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
if( xValue != 0 )
|
||||
{
|
||||
/* Turn the LED on. */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0: LED0 = LED_ON;
|
||||
break;
|
||||
case 1: LED1 = LED_ON;
|
||||
break;
|
||||
case 2: LED2 = LED_ON;
|
||||
break;
|
||||
case 3: LED3 = LED_ON;
|
||||
break;
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Turn the LED off. */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0: LED0 = LED_OFF;
|
||||
break;
|
||||
case 1: LED1 = LED_OFF;
|
||||
break;
|
||||
case 2: LED2 = LED_OFF;
|
||||
break;
|
||||
case 3: LED3 = LED_OFF;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vParTestToggleLED( unsigned long ulLED )
|
||||
{
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( lParTestGetLEDState( ulLED ) != 0x00 )
|
||||
{
|
||||
vParTestSetLED( ulLED, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
vParTestSetLED( ulLED, 1 );
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
long lParTestGetLEDState( unsigned long ulLED )
|
||||
{
|
||||
long lReturn = pdTRUE;
|
||||
|
||||
if( ulLED < partestNUM_LEDS )
|
||||
{
|
||||
switch( ulLED )
|
||||
{
|
||||
case 0 : if( LED0 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 1 : if( LED1 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 2 : if( LED2 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
case 3 : if( LED3 != 0 )
|
||||
{
|
||||
lReturn = pdFALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return lReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
|
||||
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
|
||||
>>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel.
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details. You should have received a copy of the GNU General Public License
|
||||
and the FreeRTOS license exception along with FreeRTOS; if not itcan be
|
||||
viewed here: http://www.freertos.org/a00114.html and also obtained by
|
||||
writing to Real Time Engineers Ltd., contact details for whom are available
|
||||
on the FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
|
||||
#ifndef PRIORITY_DEFINITIONS_H
|
||||
#define PRIORITY_DEFINITIONS_H
|
||||
|
||||
|
||||
/* The interrupt priority used by the kernel itself for the tick interrupt and
|
||||
the pended interrupt. This would normally be the lowest priority. */
|
||||
#define configKERNEL_INTERRUPT_PRIORITY 1
|
||||
|
||||
/* The maximum interrupt priority from which FreeRTOS API calls can be made.
|
||||
Interrupts that use a priority above this will not be effected by anything the
|
||||
kernel is doing but must not make any use of FreeRTOS functionality.
|
||||
interrupts that use a priority at or below configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||
can make use of FreeRTOS API function but *only* functions that end in
|
||||
"FromISR()". */
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 4
|
||||
|
||||
#endif /* PRIORITY_DEFINITIONS_H */
|
||||
@@ -0,0 +1,398 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<project>
|
||||
<fileVersion>2</fileVersion>
|
||||
<fileChecksum>1022944783</fileChecksum>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\Debug\Obj\reg_test.o</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\queue.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\FreeRTOS.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\projdefs.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\RX100\port.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\port.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\heap_4.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\blocktim.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\queue.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\port_asm.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\ParTest.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\GenQTest.o</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\yvals.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\lcd.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\list.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\blocktim.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\death.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\hardware_setup.o</file>
|
||||
<file>$PROJ_DIR$\FreeRTOSConfig.h</file>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\main_full.c</file>
|
||||
<file>$PROJ_DIR$\main_low_power.c</file>
|
||||
<file>$PROJ_DIR$\ParTest.c</file>
|
||||
<file>$PROJ_DIR$\reg_test.s</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main_low_power.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\timers.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\list.o</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\DLib_Defaults.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\DLib_Product.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\ycheck.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\xencoding_limits.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\DLib_Threads.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\platform.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\board\rskrx111\r_bsp.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\stddef.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\ysizet.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\stdint.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\r_bsp_config.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\mcu\rx111\mcu_info.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\board\rskrx111\lcd.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\portable.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\tasks.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\timers.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\lcd.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\queue.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main_full.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main_low_power.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\templproj.out</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\RTOSDemo_IAR.pbd</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\limits.h</file>
|
||||
<file>$PROJ_DIR$\PriorityDefinitions.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\board\rskrx111\rskrx111.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\heap_4.o</file>
|
||||
<file>$TOOLKIT_DIR$\inc\intrinsics.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\iorx111.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\port.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\hardware_setup.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\r_switches.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\death.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\GenQTest.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\recmutex.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main_full.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\ParTest.pbi</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\tasks.o</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dlrxfllsn.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\mpu_wrappers.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\string.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\list.h</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\recmutex.o</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\stdlib.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\machine.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\task.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\timers.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\RX100\port_asm.s</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\IAR\RX100\portmacro.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_4.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\list.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\queue.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\tasks.c</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\timers.c</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\board\user\hardware_setup.c</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_switches\src\r_switches.c</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_bsp\board\rskrx111\lcd.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\blocktim.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\death.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\GenQTest.c</file>
|
||||
<file>$PROJ_DIR$\..\Common\Minimal\recmutex.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\r_switches.o</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_switches\r_switches_if.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\ystdio.h</file>
|
||||
<file>$PROJ_DIR$\..\..\Source\include\StackMacros.h</file>
|
||||
<file>$TOOLKIT_DIR$\inc\c\stdio.h</file>
|
||||
<file>$PROJ_DIR$\Renesas_Files\r_switches\r_switches_config.h</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\RX100\port.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 56</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 5</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 50 30 12 28 66 29 31 32 2 35 36 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 73 69 68</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 63</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 13</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main_full.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 62</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 46</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main_low_power.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 25</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 47</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\ParTest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 10</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 64</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\reg_test.s</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ARX</name>
|
||||
<file> 0</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 48</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\IAR\RX100\port_asm.s</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ARX</name>
|
||||
<file> 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_4.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 53</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 6</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 71 30 12 28 66 29 31 32 36 2 35 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 73 69</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\list.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 27</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 15</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 71 30 12 28 66 29 31 32 36 2 35 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 69</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 45</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 8</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 71 30 12 28 66 29 31 32 36 68 2 35 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 73 69 1</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 65</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 42</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 93 30 12 28 66 29 31 32 36 91 71 68 2 35 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 73 69 74 92</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\..\Source\timers.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 26</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 43</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 2 35 30 12 28 66 29 31 32 36 3 19 33 34 38 55 39 52 40 37 51 41 76 54 72 67 73 69 1 74</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Renesas_Files\r_bsp\board\user\hardware_setup.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 18</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 57</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 33 34 38 55 39 52 40 37 30 12 28 66 29 31 32 90 94</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Renesas_Files\r_switches\src\r_switches.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 89</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 58</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Renesas_Files\r_bsp\board\rskrx111\lcd.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 14</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 44</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\blocktim.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 16</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 7</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\death.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 17</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 59</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\GenQTest.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 11</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 60</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Common\Minimal\recmutex.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCRX</name>
|
||||
<file> 70</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 61</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<project>
|
||||
<fileVersion>2</fileVersion>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<toolchain>
|
||||
<name>RX</name>
|
||||
</toolchain>
|
||||
<debug>1</debug>
|
||||
<settings>
|
||||
<name>C-SPY</name>
|
||||
<archiveVersion>2</archiveVersion>
|
||||
<data>
|
||||
<version>5</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>CMandatory</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CInput</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DebuggerProcessorVariant</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRunToEnable</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CRunToName</name>
|
||||
<state>main</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CMacOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CMacFile</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DynDriver</name>
|
||||
<state>RXEMUE20</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DDFOverride</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DDFFile</name>
|
||||
<state>$TOOLKIT_DIR$\config\debugger\ior5f51115.ddf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DebuggerUseExtraOptions</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>DebuggerExtraOptions</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ODebuggerByteOrder</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ODebuggerDoubleSize</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesSuppressCheck1</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesPath1</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesSuppressCheck2</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesPath2</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesSuppressCheck3</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesPath3</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ODebuggerCore</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>ODebuggerIntSize</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesOffset1</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesOffset2</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesOffset3</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesUse1</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesUse2</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCImagesUse3</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>RXEMUE20</name>
|
||||
<archiveVersion>3</archiveVersion>
|
||||
<data>
|
||||
<version>3</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>EmuMandatory</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCEmuUseUSBSerialNo</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCEmuUSBSerialNo</name>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadSuppressDownload</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadVerifyAll</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadAttach</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDebuggingMode</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCExcecuteAfterFlash</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadOnlyChangedBlocks</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>RXJLINK</name>
|
||||
<archiveVersion>3</archiveVersion>
|
||||
<data>
|
||||
<version>4</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>JlinkMandatory</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkDownloadSuppressDownload</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkDownloadVerifyAll</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDownloadAttach</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCDebuggingMode</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkExcecuteAfterFlash</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkScanChainEnable</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkDevicePosition</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkOtherDeviceTypes</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkPreceedingIRBits</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkUseUSBSerialNo</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>OCJlinkUSBSerialNo</name>
|
||||
<state></state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
<name>SIMRX</name>
|
||||
<archiveVersion>1</archiveVersion>
|
||||
<data>
|
||||
<version>1</version>
|
||||
<wantNonLocal>1</wantNonLocal>
|
||||
<debug>1</debug>
|
||||
<option>
|
||||
<name>SimMandatory</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>SimEnablePSP</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>SimPspOverrideConfig</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>SimPspConfigFile</name>
|
||||
<state>$TOOLKIT_DIR$\CONFIG\iocf.psp.config</state>
|
||||
</option>
|
||||
</data>
|
||||
</settings>
|
||||
<debuggerPlugins>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXRxPlugin.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
|
||||
<loadFlag>1</loadFlag>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
|
||||
<loadFlag>0</loadFlag>
|
||||
</plugin>
|
||||
</debuggerPlugins>
|
||||
</configuration>
|
||||
</project>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\RTOSDemo_IAR.ewp</path>
|
||||
</project>
|
||||
<batchBuild/>
|
||||
</workspace>
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
[Sfr]
|
||||
|
||||
|
||||
[SfrGroupInfo]
|
||||
@@ -0,0 +1,252 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : lcd.c
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Provides variable and function declarations for lcd.c file
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Standard string manipulation & formatting functions */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
/* Defines standard variable types used in this function */
|
||||
#include <stdint.h>
|
||||
/* Bring in board includes. */
|
||||
#include "platform.h"
|
||||
/* Following header file provides function prototypes for LCD controlling functions & macro defines */
|
||||
#include "lcd.h"
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Private global variables and functions
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_delay(volatile int32_t nsecs);
|
||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value);
|
||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value);
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_initialize
|
||||
* Description : Initializes the LCD display.
|
||||
* Arguments : none
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_initialize(void)
|
||||
{
|
||||
/* Set LCD data pins as outputs. */
|
||||
PORT4.PDR.BYTE |= 0x0F;
|
||||
|
||||
/* Set LCD control pins as outputs. */
|
||||
RS_PIN_DDR = 1;
|
||||
E_PIN_DDR = 1;
|
||||
|
||||
/* Power Up Delay for the LCD Module */
|
||||
lcd_delay(50000000);
|
||||
|
||||
/* Display initialises in 8 bit mode - so send one write (seen as 8 bit) to set to 4 bit mode. */
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
lcd_nibble_write(CTRL_WR, 0x03);
|
||||
lcd_delay(5000000);
|
||||
|
||||
/* Function Set */
|
||||
lcd_nibble_write(CTRL_WR, 0x02);
|
||||
lcd_delay(39000);
|
||||
lcd_nibble_write(CTRL_WR, 0x02);
|
||||
lcd_nibble_write(CTRL_WR, (LCD_DISPLAY_ON | LCD_TWO_LINE ));
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Display ON/OFF control */
|
||||
lcd_write(CTRL_WR, LCD_CURSOR_OFF);
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Display Clear */
|
||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
||||
lcd_delay(2000000);
|
||||
|
||||
/* Entry Mode Set */
|
||||
lcd_write(CTRL_WR, 0x06);
|
||||
lcd_delay(39000);
|
||||
|
||||
/* Home the cursor */
|
||||
lcd_write(CTRL_WR, LCD_HOME_L1);
|
||||
lcd_delay(5000000);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_clear
|
||||
* Description : Clears the LCD
|
||||
* Arguments : none
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_clear(void)
|
||||
{
|
||||
/* Display Clear */
|
||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
||||
lcd_delay(2000000);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_display
|
||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD.
|
||||
* You need to use the defines LCD_LINE1 and LCD_LINE2 in order to specify the starting position.
|
||||
* For example, to start at the 2nd position on line 1...
|
||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
||||
* Arguments : position -
|
||||
* Line number of display
|
||||
* string -
|
||||
* Pointer to null terminated string
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
void lcd_display(uint8_t position, uint8_t const * string)
|
||||
{
|
||||
/* Declare next position variable */
|
||||
static uint8_t next_pos = 0xFF;
|
||||
|
||||
/* Set line position if needed. We don't want to if we don't need to because LCD control operations take longer
|
||||
than LCD data operations. */
|
||||
if (next_pos != position)
|
||||
{
|
||||
if(position < LCD_LINE2)
|
||||
{
|
||||
/* Display on Line 1 */
|
||||
lcd_write(CTRL_WR, ((uint8_t)(LCD_HOME_L1 + position)));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Display on Line 2 */
|
||||
lcd_write(CTRL_WR, ((uint8_t)((LCD_HOME_L2 + position) - LCD_LINE2)));
|
||||
}
|
||||
|
||||
lcd_delay(39000);
|
||||
|
||||
/* set position index to known value */
|
||||
next_pos = position;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
/* Write character to LCD. */
|
||||
lcd_write(DATA_WR,*string++);
|
||||
|
||||
lcd_delay(43000);
|
||||
|
||||
/* Increment position index */
|
||||
next_pos++;
|
||||
}
|
||||
while(*string);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_delay
|
||||
* Description : Implements LCD required delays.
|
||||
* Arguments : nsecs -
|
||||
* Number of nanoseconds to delay. RX111 has max clock of 32MHz which gives a cycle time of 31.3ns.
|
||||
* This means that nothing under 313ns should be input. 313ns would be 10 cycles which is still
|
||||
* being optimistic for getting in and out of this function.
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_delay(volatile int32_t nsecs)
|
||||
{
|
||||
while (0 < nsecs)
|
||||
{
|
||||
/* Subtract off 10 cycles per iteration. This number was obtained when using the Renesas toolchain at
|
||||
optimization level 2. The number to nanoseconds to subtract off below is calculated off of the ICLK speed. */
|
||||
nsecs -= (int32_t)((313.0)*(32000000.0/(float)ICLK_HZ));
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_nibble_write
|
||||
* Description : Writes data to display. Sends command to display.
|
||||
* Arguments : value -
|
||||
* The value to write
|
||||
* data_or_ctrl -
|
||||
* Whether to write data or control.
|
||||
* 1 = DATA
|
||||
* 0 = CONTROL
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value)
|
||||
{
|
||||
/* Set Register Select pin high for Data */
|
||||
if (data_or_ctrl == DATA_WR)
|
||||
{
|
||||
/* Data write. */
|
||||
RS_PIN = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Control write. */
|
||||
RS_PIN = 0;
|
||||
}
|
||||
|
||||
/* tsu1 delay */
|
||||
lcd_delay(60);
|
||||
|
||||
/* EN enable chip (HIGH) */
|
||||
E_PIN = 1;
|
||||
|
||||
/* Output the data */
|
||||
PORT4.PODR.BYTE = (value & 0x0F);
|
||||
|
||||
/* tw delay */
|
||||
lcd_delay(450);
|
||||
|
||||
/* Latch data by dropping E */
|
||||
E_PIN = 0;
|
||||
|
||||
/* th2 delay */
|
||||
lcd_delay(10);
|
||||
|
||||
/* tc delay */
|
||||
lcd_delay(480);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name : lcd_write
|
||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD. You need to use the defines LCD_LINE1 and
|
||||
* LCD_LINE2 in order to specify the starting position.
|
||||
* For example, to start at the 2nd position on line 1...
|
||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
||||
* Arguments : value -
|
||||
* The value to write
|
||||
* data_or_ctrl -
|
||||
* Whether to write data or control.
|
||||
* 1 = DATA
|
||||
* 0 = CONTROL
|
||||
* Return Value : none
|
||||
***********************************************************************************************************************/
|
||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value)
|
||||
{
|
||||
/* Write upper nibble first */
|
||||
lcd_nibble_write(data_or_ctrl, (uint8_t)((value & 0xF0) >> 4));
|
||||
|
||||
/* Write lower nibble second */
|
||||
lcd_nibble_write(data_or_ctrl, (uint8_t)(value & 0x0F));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : lcd.h
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Provides variable and function declarations for lcd.c file
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/* Multiple inclusion prevention macro */
|
||||
#ifndef LCD_H
|
||||
#define LCD_H
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* Defines standard integer variable types used in this file */
|
||||
#include <stdint.h>
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Macro definitions
|
||||
***********************************************************************************************************************/
|
||||
/* RS register select pin */
|
||||
#define RS_PIN PORTC.PODR.BIT.B5
|
||||
#define RS_PIN_DDR PORTC.PDR.BIT.B5
|
||||
/* Display enable pin */
|
||||
#define E_PIN PORTB.PODR.BIT.B1
|
||||
#define E_PIN_DDR PORTB.PDR.BIT.B1
|
||||
/* Data write/read definition */
|
||||
#define DATA_WR 1
|
||||
/* Control write/read definition */
|
||||
#define CTRL_WR 0
|
||||
/* Maximum characters per line of LCD display. */
|
||||
#define NUMB_CHARS_PER_LINE 8
|
||||
/* Number of lines on the LCD display */
|
||||
#define MAXIMUM_LINES 2
|
||||
/* Character position of LCD line 1 */
|
||||
#define LCD_LINE1 0
|
||||
/* Character position of LCD line 2 */
|
||||
#define LCD_LINE2 16
|
||||
/* Clear LCD display and home cursor */
|
||||
#define LCD_CLEAR 0x01
|
||||
/* Move cursor to line 1 */
|
||||
#define LCD_HOME_L1 0x80
|
||||
/* Move cursor to line 2 */
|
||||
#define LCD_HOME_L2 0xC0
|
||||
/* Cursor auto decrement after R/W */
|
||||
#define CURSOR_MODE_DEC 0x04
|
||||
/* Cursor auto increment after R/W */
|
||||
#define CURSOR_MODE_INC 0x06
|
||||
/* Setup, 4 bits,2 lines, 5X7 */
|
||||
#define FUNCTION_SET 0x28
|
||||
/* Display ON with Cursor */
|
||||
#define LCD_CURSOR_ON 0x0E
|
||||
/* Display ON with Cursor off */
|
||||
#define LCD_CURSOR_OFF 0x0C
|
||||
/* Display on with blinking cursor */
|
||||
#define LCD_CURSOR_BLINK 0x0D
|
||||
/* Move Cursor Left One Position */
|
||||
#define LCD_CURSOR_LEFT 0x10
|
||||
/* Move Cursor Right One Position */
|
||||
#define LCD_CURSOR_RIGHT 0x14
|
||||
/* Enable LCD display */
|
||||
#define LCD_DISPLAY_ON 0x04
|
||||
/* Enable both LCD lines */
|
||||
#define LCD_TWO_LINE 0x08
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Exported global functions (to be accessed by other files)
|
||||
***********************************************************************************************************************/
|
||||
/* LCD initialisation function declaration */
|
||||
void lcd_initialize (void);
|
||||
|
||||
/* Update display function declaration */
|
||||
void lcd_display(uint8_t position, uint8_t const * string);
|
||||
|
||||
/* Clear LCD function delcaration */
|
||||
void lcd_clear (void);
|
||||
|
||||
/* End of multiple inclusion prevention macro */
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp.h
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Has the header files that should be included for this platform.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef PLATFORM_BOARD_RSKRX111
|
||||
#define PLATFORM_BOARD_RSKRX111
|
||||
|
||||
/* Make sure that no other platforms have already been defined. Do not touch this! */
|
||||
#ifdef PLATFORM_DEFINED
|
||||
#error "Error - Multiple platforms defined in platform.h!"
|
||||
#else
|
||||
#define PLATFORM_DEFINED
|
||||
#endif
|
||||
|
||||
/***********************************************************************************************************************
|
||||
INCLUDE APPROPRIATE MCU AND BOARD FILES
|
||||
***********************************************************************************************************************/
|
||||
#include "r_bsp_config.h"
|
||||
#include "iorx111.h"
|
||||
#include ".\mcu\rx111\mcu_info.h"
|
||||
#include ".\board\rskrx111\rskrx111.h"
|
||||
#include ".\board\rskrx111\lcd.h"
|
||||
|
||||
#endif /* PLATFORM_BOARD_RSKRX111 */
|
||||
|
||||
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : r_bsp_config_reference.c
|
||||
* Device(s) : RX111
|
||||
* Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included
|
||||
* somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h)
|
||||
* is just a reference file that the user can use to make their own r_bsp_config.h file.
|
||||
************************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 07.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
#ifndef R_BSP_CONFIG_REF_HEADER_FILE
|
||||
#define R_BSP_CONFIG_REF_HEADER_FILE
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Configuration Options
|
||||
***********************************************************************************************************************/
|
||||
/* Enter the product part number for your MCU. This information will be used to obtain information about your MCU such
|
||||
as package and memory size.
|
||||
To help parse this information, the part number will be defined using multiple macros.
|
||||
R 5 F 51 11 5 A D FM
|
||||
| | | | | | | | | Macro Name Description
|
||||
| | | | | | | | |__MCU_PART_PACKAGE = Package type, number of pins, and pin pitch
|
||||
| | | | | | | |____not used = Products with wide temperature range (D: -40 to 85C G: -40 to 105C)
|
||||
| | | | | | |______not used = Blank
|
||||
| | | | | |________MCU_PART_MEMORY_SIZE = ROM, RAM, and Data Flash Capacity
|
||||
| | | | |___________MCU_PART_GROUP = Group name
|
||||
| | | |______________MCU_PART_SERIES = Series name
|
||||
| | |________________MCU_PART_MEMORY_TYPE = Type of memory (Flash)
|
||||
| |__________________not used = Renesas MCU
|
||||
|____________________not used = Renesas semiconductor product.
|
||||
*/
|
||||
|
||||
/* Package type. Set the macro definition based on values below:
|
||||
Character(s) = Value for macro = Package Type/Number of Pins/Pin Pitch
|
||||
FM = 0x0 = LFQFP/64/0.50
|
||||
FK = 0x1 = LQFP/64/0.80
|
||||
LF = 0x2 = TFLGA/64/0.50
|
||||
FL = 0x3 = LFQFP/48/0.50
|
||||
NE = 0x4 = VQFN/48/0.50
|
||||
NC = 0x5 = HWQFN/36/0.50
|
||||
LM = 0x6 = WFLGA/36/0.50
|
||||
SB = 0x7 = SSOP/36/0.80
|
||||
*/
|
||||
#define MCU_PART_PACKAGE (0x0)
|
||||
|
||||
/* ROM, RAM, and Data Flash Capacity.
|
||||
Character(s) = Value for macro = ROM Size/Ram Size/Data Flash Size
|
||||
5 = 0x5 = 128KB/16KB/8KB
|
||||
4 = 0x4 = 96KB/16KB/8KB
|
||||
3 = 0x3 = 64KB/10KB/8KB
|
||||
1 = 0x1 = 32KB/10KB/8KB
|
||||
J = 0x0 = 16KB/8KB/8KB
|
||||
*/
|
||||
#define MCU_PART_MEMORY_SIZE (0x5)
|
||||
|
||||
/* Group name.
|
||||
Character(s) = Value for macro = Description
|
||||
10 = 0x0 = RX110 Group
|
||||
11 = 0x1 = RX111 Group
|
||||
*/
|
||||
#define MCU_PART_GROUP (0x1)
|
||||
|
||||
/* Series name.
|
||||
Character(s) = Value for macro = Description
|
||||
51 = 0x0 = RX100 Series
|
||||
*/
|
||||
#define MCU_PART_SERIES (0x0)
|
||||
|
||||
/* Memory type.
|
||||
Character(s) = Value for macro = Description
|
||||
F = 0x0 = Flash memory version
|
||||
*/
|
||||
#define MCU_PART_MEMORY_TYPE (0x0)
|
||||
|
||||
/* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a
|
||||
'#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */
|
||||
#if defined(BSP_DECLARE_STACK)
|
||||
/* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize su=0x400
|
||||
/* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||
#pragma stacksize si=0x100
|
||||
#endif
|
||||
|
||||
/* Heap size in bytes. */
|
||||
#define HEAP_BYTES (0x400)
|
||||
|
||||
/* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information
|
||||
on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual.
|
||||
0 = Stay in Supervisor mode.
|
||||
1 = Switch to User mode.
|
||||
*/
|
||||
#define RUN_IN_USER_MODE (0)
|
||||
|
||||
|
||||
/* This macro lets other modules no if a RTOS is being used.
|
||||
0 = RTOS is not used.
|
||||
1 = RTOS is used.
|
||||
*/
|
||||
#define RTOS_USED (0)
|
||||
|
||||
/* Clock source select (CKSEL).
|
||||
0 = Low Speed On-Chip Oscillator (LOCO)
|
||||
1 = High Speed On-Chip Oscillator (HOCO)
|
||||
2 = Main Clock Oscillator
|
||||
3 = Sub-Clock Oscillator
|
||||
4 = PLL Circuit
|
||||
*/
|
||||
#define CLOCK_SOURCE (4)
|
||||
|
||||
/* Clock configuration options.
|
||||
The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The
|
||||
multiplier settings are used to set the clock registers in resetprg.c. If a 16MHz clock is used and the
|
||||
ICLK is 24MHz, PCLKB is 24MHz, FCLK is 24MHz, PCLKD is 24MHz, and CKO is 1MHz then the
|
||||
settings would be:
|
||||
|
||||
XTAL_HZ = 16000000
|
||||
PLL_DIV = 2
|
||||
PLL_MUL = 6 (16MHz x 3 = 48MHz)
|
||||
ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 24MHz
|
||||
PCKB_DIV = 2 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 24MHz
|
||||
PCKD_DIV = 2 : Peripheral Clock D (PCLKD) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKD_DIV) = 24MHz
|
||||
FCK_DIV = 2 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 24MHz
|
||||
*/
|
||||
/* XTAL - Input clock frequency in Hz */
|
||||
#define XTAL_HZ (16000000)
|
||||
/* PLL Input Frequency Divider Select (PLIDIV).
|
||||
Available divisors = /1 (no division), /2, /4
|
||||
*/
|
||||
#define PLL_DIV (2)
|
||||
/* PLL Frequency Multiplication Factor Select (STC).
|
||||
Available multipliers = x6, x8
|
||||
*/
|
||||
#define PLL_MUL (6)
|
||||
/* System Clock Divider (ICK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define ICK_DIV (2)
|
||||
/* Peripheral Module Clock B Divider (PCKB).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKB_DIV (2)
|
||||
/* Peripheral Module Clock D Divider (PCKD).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define PCKD_DIV (2)
|
||||
/* Flash IF Clock Divider (FCK).
|
||||
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||
*/
|
||||
#define FCK_DIV (2)
|
||||
|
||||
/* Below are callback functions that can be used for detecting MCU exceptions, undefined interrupt sources, and
|
||||
bus errors. If the user wishes to be alerted of these events then they will need to define the macro as a
|
||||
function to be called when the event occurs. For example, if the user wanted the function
|
||||
excep_undefined_instr_isr() to be called when an undefined interrupt source ISR is triggered then they would
|
||||
do the following:
|
||||
#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
If the user does not wish to be alerted of these events then they should comment out the macros.
|
||||
|
||||
NOTE: When a callback function is called it will be called from within a ISR. This means that the function
|
||||
will essentially be an interrupt and will hold off other interrupts that occur in the system while it
|
||||
is executing. For this reason, it is recommended to keep these callback functions short as to not
|
||||
decrease the real-time response of your system.
|
||||
*/
|
||||
/* Callback for Supervisor Instruction Violation Exception. */
|
||||
//#define EXCEP_SUPERVISOR_ISR_CALLBACK supervisor_instr_cb
|
||||
|
||||
/* Callback for Undefined Instruction Exception. */
|
||||
//#define EXCEP_UNDEFINED_INSTR_ISR_CALLBACK undefined_instr_cb
|
||||
|
||||
/* Callback for Non-maskable Interrupt. */
|
||||
//#define NMI_ISR_CALLBACK nmi_cb
|
||||
|
||||
/* Callback for all undefined interrupt vectors. User can set a breakpoint in this function to determine which source
|
||||
is creating unwanted interrupts. */
|
||||
//#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb
|
||||
|
||||
/* Callback for Bus Error Interrupt. */
|
||||
//#define BUS_ERROR_ISR_CALLBACK bus_error_cb
|
||||
|
||||
/* The user has the option of separately choosing little or big endian for the User Application Area */
|
||||
|
||||
/* Endian mode for User Application.
|
||||
0 = Big Endian
|
||||
Else = Little Endian (Default)
|
||||
*/
|
||||
#define USER_APP_ENDIAN (1)
|
||||
|
||||
|
||||
/* Configure WDT and IWDT settings.
|
||||
OFS0 - Option Function Select Register 0
|
||||
OFS0 - Option Function Select Register 0
|
||||
b31:b15 Reserved (set to 1)
|
||||
b14 IWDTSLCSTP - IWDT Sleep Mode Count Stop Control - (0=can't stop count, 1=stop w/some low power modes)
|
||||
b13 Reserved (set to 1)
|
||||
b12 IWDTRSTIRQS - IWDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU)
|
||||
b11:b10 IWDTRPSS - IWDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use)
|
||||
b9:b8 IWDTRPES - IWDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use)
|
||||
b7:b4 IWDTCKS - IWDT Clock Frequency Division Ratio - (0=none, 2=/16, 3 = /32, 4=/64, 0xF=/128, 5=/256)
|
||||
b3:b2 IWDTTOPS - IWDT Timeout Period Select - (0=128 cycles, 1=512, 2=1024, 3=2048)
|
||||
b1 IWDTSTRT - IWDT Start Mode Select - (0=auto-start after reset, 1=halt after reset)
|
||||
b0 Reserved (set to 1) */
|
||||
#define OFS0_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Configure whether voltage detection 1 circuit and HOCO are enabled after reset.
|
||||
OFS1 - Option Function Select Register 1
|
||||
b31:b9 Reserved (set to 1)
|
||||
b8 HOCOEN - Enable/disable HOCO oscillation after a reset (0=enable, 1=disable)
|
||||
b7:b4 STUPLVD1LVL - Startup Voltage Monitoring 1 Reset Detection Level Select
|
||||
0 1 0 0: 3.10 V
|
||||
0 1 0 1: 3.00 V
|
||||
0 1 1 0: 2.90 V
|
||||
0 1 1 1: 2.79 V
|
||||
1 0 0 0: 2.68 V
|
||||
1 0 0 1: 2.58 V
|
||||
1 0 1 0: 2.48 V
|
||||
1 0 1 1: 2.06 V
|
||||
1 1 0 0: 1.96 V
|
||||
1 1 0 1: 1.86 V
|
||||
b3:b2 Reserved (set to 1)
|
||||
b2 STUPLVD1REN - Startup Voltage Monitoring 1 Reset Enable (1=monitoring disabled)
|
||||
b0 FASTSTUP - Power-On Fast Startup Time (1=normal; read only) */
|
||||
#define OFS1_REG_VALUE (0xFFFFFFFF) //Disable by default
|
||||
|
||||
/* Initializes C input & output library functions.
|
||||
0 = Disable I/O library initialization in resetprg.c. If you are not using stdio then use this value.
|
||||
1 = Enable I/O library initialization in resetprg.c. This is default and needed if you are using stdio. */
|
||||
#define IO_LIB_ENABLE (1)
|
||||
|
||||
#endif /* R_BSP_CONFIG_REF_HEADER_FILE */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : rskrx111.h
|
||||
* H/W Platform : RSKRX111
|
||||
* Description : Board specific definitions for the RSKRX111.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef RSKRX111_H
|
||||
#define RSKRX111_H
|
||||
|
||||
/* Local defines */
|
||||
#define LED_ON (0)
|
||||
#define LED_OFF (1)
|
||||
#define SET_BIT_HIGH (1)
|
||||
#define SET_BIT_LOW (0)
|
||||
#define SET_BYTE_HIGH (0xFF)
|
||||
#define SET_BYTE_LOW (0x00)
|
||||
|
||||
/* Switches */
|
||||
#define SW_ACTIVE 0
|
||||
#define SW1 PORT3.PIDR.BIT.B0
|
||||
#define SW2 PORT3.PIDR.BIT.B1
|
||||
#define SW3 PORTE.PIDR.BIT.B4
|
||||
#define SW1_PDR PORT3.PDR.BIT.B0
|
||||
#define SW2_PDR PORT3.PDR.BIT.B1
|
||||
#define SW3_PDR PORTE.PDR.BIT.B4
|
||||
#define SW1_PMR PORT3.PMR.BIT.B0
|
||||
#define SW2_PMR PORT3.PMR.BIT.B1
|
||||
#define SW3_PMR PORTE.PMR.BIT.B4
|
||||
|
||||
/* LEDs */
|
||||
#define LED0 PORTB.PODR.BIT.B7
|
||||
#define LED1 PORTA.PODR.BIT.B0
|
||||
#define LED2 PORT5.PODR.BIT.B4
|
||||
#define LED3 PORT1.PODR.BIT.B7
|
||||
#define LED0_PDR PORTB.PDR.BIT.B7
|
||||
#define LED1_PDR PORTA.PDR.BIT.B0
|
||||
#define LED2_PDR PORT5.PDR.BIT.B4
|
||||
#define LED3_PDR PORT1.PDR.BIT.B7
|
||||
|
||||
|
||||
#endif /* RSKRX111_H */
|
||||
@@ -0,0 +1,366 @@
|
||||
/***********************************************************************************************************************
|
||||
* DISCLAIMER
|
||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||
* applicable laws, including copyright laws.
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||
* following link:
|
||||
* http://www.renesas.com/disclaimer
|
||||
*
|
||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* File Name : hwsetup.c
|
||||
* Device(s) : RX
|
||||
* H/W Platform : RSKRX210
|
||||
* Description : Defines the initialization routines used each time the MCU is restarted.
|
||||
***********************************************************************************************************************/
|
||||
/***********************************************************************************************************************
|
||||
* History : DD.MM.YYYY Version Description
|
||||
* : 08.11.2012 0.01 Beta Release
|
||||
***********************************************************************************************************************/
|
||||
|
||||
/***********************************************************************************************************************
|
||||
Includes <System Includes> , "Project Includes"
|
||||
***********************************************************************************************************************/
|
||||
/* I/O Register and board definitions */
|
||||
#include "platform.h"
|
||||
#include "r_switches_if.h"
|
||||
/***********************************************************************************************************************
|
||||
Private global variables and functions
|
||||
***********************************************************************************************************************/
|
||||
/* MCU I/O port configuration function delcaration */
|
||||
static void output_ports_configure(void);
|
||||
|
||||
/* Interrupt configuration function delcaration */
|
||||
static void interrupts_configure(void);
|
||||
|
||||
/* MCU peripheral module configuration function declaration */
|
||||
static void peripheral_modules_enable(void);
|
||||
|
||||
/* Configure MCU clocks. */
|
||||
static void clock_source_select (void);
|
||||
void operating_frequency_set(void);
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: hardware_setup
|
||||
* Description : Contains setup functions called at device restart
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void vHardwareSetup(void)
|
||||
{
|
||||
operating_frequency_set();
|
||||
output_ports_configure();
|
||||
interrupts_configure();
|
||||
peripheral_modules_enable();
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: output_ports_configure
|
||||
* Description : Configures the port and pin direction settings, and sets the pin outputs to a safe level.
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void output_ports_configure(void)
|
||||
{
|
||||
/* Enable LEDs. */
|
||||
/* Start with LEDs off. */
|
||||
LED0 = LED_OFF;
|
||||
LED1 = LED_OFF;
|
||||
LED2 = LED_OFF;
|
||||
LED3 = LED_OFF;
|
||||
|
||||
/* Set LED pins as outputs. */
|
||||
LED0_PDR = 1;
|
||||
LED1_PDR = 1;
|
||||
LED2_PDR = 1;
|
||||
LED3_PDR = 1;
|
||||
|
||||
/* Enable switches. */
|
||||
/* Set pins as inputs. */
|
||||
SW1_PDR = 0;
|
||||
SW2_PDR = 0;
|
||||
SW3_PDR = 0;
|
||||
|
||||
/* Set port mode registers for switches. */
|
||||
SW1_PMR = 0;
|
||||
SW2_PMR = 0;
|
||||
SW3_PMR = 0;
|
||||
|
||||
/* Unlock MPC registers to enable writing to them. */
|
||||
MPC.PWPR.BIT.B0WI = 0 ; /* Unlock protection register */
|
||||
MPC.PWPR.BIT.PFSWE = 1 ; /* Unlock MPC registers */
|
||||
|
||||
/* TXD1 is output. */
|
||||
PORT1.PDR.BIT.B6 = 1;
|
||||
PORT1.PMR.BIT.B6 = 1;
|
||||
MPC.P16PFS.BYTE = 0x0A;
|
||||
/* RXD1 is input. */
|
||||
PORT1.PDR.BIT.B5 = 0;
|
||||
PORT1.PMR.BIT.B5 = 1;
|
||||
MPC.P15PFS.BYTE = 0x0A;
|
||||
|
||||
/* Configure the pin connected to the ADC Pot as an input */
|
||||
PORT4.PDR.BIT.B4 = 0;
|
||||
|
||||
/* Protect off. */
|
||||
SYSTEM.PRCR.WORD = 0xA50B;
|
||||
|
||||
/* Turn off module stop for the A2D converter. */
|
||||
SYSTEM.MSTPCRA.BIT.MSTPA17 = 0;
|
||||
|
||||
/* Protect on. */
|
||||
SYSTEM.PRCR.WORD = 0xA500;
|
||||
|
||||
/* Initialise the first button to generate an interrupt. */
|
||||
R_SWITCHES_Init();
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: interrupts_configure
|
||||
* Description : Configures interrupts used
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void interrupts_configure(void)
|
||||
{
|
||||
/* Add code here to setup additional interrupts */
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: peripheral_modules_enable
|
||||
* Description : Enables and configures peripheral devices on the MCU
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void peripheral_modules_enable(void)
|
||||
{
|
||||
/* Enable triggers to start an ADC conversion. */
|
||||
S12AD.ADCSR.BIT.TRGE = 1;
|
||||
|
||||
/* Only channel 4 is going to be used. */
|
||||
S12AD.ADANSA.BIT.ANSA4 = 1;
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: operating_frequency_set
|
||||
* Description : Configures the clock settings for each of the device clocks
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
void operating_frequency_set(void)
|
||||
{
|
||||
/* Used for constructing value to write to SCKCR and CKOCR registers. */
|
||||
uint32_t temp_clock = 0;
|
||||
|
||||
/*
|
||||
Clock Description Frequency
|
||||
----------------------------------------
|
||||
Input Clock Frequency............ 16 MHz
|
||||
PLL frequency (x3)............... 48 MHz
|
||||
Internal Clock Frequency......... 24 MHz
|
||||
Peripheral Clock Frequency....... 24 MHz
|
||||
Clock Out Frequency.............. 1 MHz */
|
||||
|
||||
volatile unsigned int i;
|
||||
|
||||
/* Protect off. */
|
||||
SYSTEM.PRCR.WORD = 0xA50B;
|
||||
|
||||
/* Select the clock based upon user's choice. */
|
||||
clock_source_select();
|
||||
|
||||
|
||||
/* Figure out setting for FCK bits. */
|
||||
#if FCK_DIV == 1
|
||||
/* Do nothing since FCK bits should be 0. */
|
||||
#elif FCK_DIV == 2
|
||||
temp_clock |= 0x10000000;
|
||||
#elif FCK_DIV == 4
|
||||
temp_clock |= 0x20000000;
|
||||
#elif FCK_DIV == 8
|
||||
temp_clock |= 0x30000000;
|
||||
#elif FCK_DIV == 16
|
||||
temp_clock |= 0x40000000;
|
||||
#elif FCK_DIV == 32
|
||||
temp_clock |= 0x50000000;
|
||||
#elif FCK_DIV == 64
|
||||
temp_clock |= 0x60000000;
|
||||
#else
|
||||
#error "Error! Invalid setting for FCK_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for ICK bits. */
|
||||
#if ICK_DIV == 1
|
||||
/* Do nothing since ICK bits should be 0. */
|
||||
#elif ICK_DIV == 2
|
||||
temp_clock |= 0x01000000;
|
||||
#elif ICK_DIV == 4
|
||||
temp_clock |= 0x02000000;
|
||||
#elif ICK_DIV == 8
|
||||
temp_clock |= 0x03000000;
|
||||
#elif ICK_DIV == 16
|
||||
temp_clock |= 0x04000000;
|
||||
#elif ICK_DIV == 32
|
||||
temp_clock |= 0x05000000;
|
||||
#elif ICK_DIV == 64
|
||||
temp_clock |= 0x06000000;
|
||||
#else
|
||||
#error "Error! Invalid setting for ICK_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for PCKB bits. */
|
||||
#if PCKB_DIV == 1
|
||||
/* Do nothing since PCKB bits should be 0. */
|
||||
#elif PCKB_DIV == 2
|
||||
temp_clock |= 0x00000100;
|
||||
#elif PCKB_DIV == 4
|
||||
temp_clock |= 0x00000200;
|
||||
#elif PCKB_DIV == 8
|
||||
temp_clock |= 0x00000300;
|
||||
#elif PCKB_DIV == 16
|
||||
temp_clock |= 0x00000400;
|
||||
#elif PCKB_DIV == 32
|
||||
temp_clock |= 0x00000500;
|
||||
#elif PCKB_DIV == 64
|
||||
temp_clock |= 0x00000600;
|
||||
#else
|
||||
#error "Error! Invalid setting for PCKB_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Figure out setting for PCKD bits. */
|
||||
#if PCKD_DIV == 1
|
||||
/* Do nothing since PCKD bits should be 0. */
|
||||
#elif PCKD_DIV == 2
|
||||
temp_clock |= 0x00000001;
|
||||
#elif PCKD_DIV == 4
|
||||
temp_clock |= 0x00000002;
|
||||
#elif PCKD_DIV == 8
|
||||
temp_clock |= 0x00000003;
|
||||
#elif PCKD_DIV == 16
|
||||
temp_clock |= 0x00000004;
|
||||
#elif PCKD_DIV == 32
|
||||
temp_clock |= 0x00000005;
|
||||
#elif PCKD_DIV == 64
|
||||
temp_clock |= 0x00000006;
|
||||
#else
|
||||
#error "Error! Invalid setting for PCKD_DIV in r_bsp_config.h"
|
||||
#endif
|
||||
|
||||
/* Set SCKCR register. */
|
||||
SYSTEM.SCKCR.LONG = temp_clock;
|
||||
|
||||
/* Choose clock source. Default for r_bsp_config.h is PLL. */
|
||||
SYSTEM.SCKCR3.WORD = ((uint16_t)CLOCK_SOURCE) << 8;
|
||||
|
||||
/* Protect on. */
|
||||
SYSTEM.PRCR.WORD = 0xA500;
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Function name: clock_source_select
|
||||
* Description : Enables and disables clocks as chosen by the user. This function also implements the software delays
|
||||
* needed for the clocks to stabilize.
|
||||
* Arguments : none
|
||||
* Return value : none
|
||||
***********************************************************************************************************************/
|
||||
static void clock_source_select (void)
|
||||
{
|
||||
/* Declared volatile for software delay purposes. */
|
||||
volatile unsigned int i;
|
||||
|
||||
/* NOTE: AS OF VERSION 0.50 OF THE RX111 HARDWARE MANUAL, ALL OF THE CLOCK
|
||||
* STABILIZATION TIMES ARE TBD. FOR NOW, WHERE EVER A WAIT COUNT REGISTER
|
||||
* IS AVAILABLE, THE DELAY IS SET TO THE MAX NUMBER OF CYCLES. WHERE EVER
|
||||
* DELAY LOOPS ARE PRESENT, THE VALUES FROM THE 63N ARE RE-USED. KEEP IN
|
||||
* MIND THAT THE 63N RUNS ON A FASTER CRYSTAL.
|
||||
*/
|
||||
|
||||
#if (CLOCK_SOURCE == 1)
|
||||
/* HOCO is chosen. Start it operating. */
|
||||
SYSTEM.HOCOCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the HOCO has stabilized.*/
|
||||
for(i = 0; i< 28; i++) // tHOCOWT2 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#else
|
||||
/* HOCO is not chosen. Stop the HOCO. */
|
||||
SYSTEM.HOCOCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 2)
|
||||
/* Main clock oscillator is chosen. Start it operating. */
|
||||
SYSTEM.MOSCWTCR.BYTE = 0x07; // Wait 65,536 cycles
|
||||
/* Set the main clock to operating. */
|
||||
SYSTEM.MOSCCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the main clock has stabilized. */
|
||||
for(i = 0; i< 140; i++) // tMAINOSCWT is TBD
|
||||
{
|
||||
__asm volatile( "NOT" );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 3)
|
||||
/* Sub-clock oscillator is chosen. Start it operating. */
|
||||
/* In section 9.8.4, there is a reference to a SOSCWTCR register, but there is no
|
||||
* description for this register in the manual nor reference for it in iorx111.h. */
|
||||
|
||||
/* Set the sub-clock to operating. */
|
||||
SYSTEM.SOSCCR.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the sub-clock has stabilized. */
|
||||
for(i = 0; i< 30233; i++) // tSUBOSCWT0 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#else
|
||||
/* Set the sub-clock to stopped. */
|
||||
SYSTEM.SOSCCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
#if (CLOCK_SOURCE == 4)
|
||||
/* PLL is chosen. Start it operating. Must start main clock as well since PLL uses it. */
|
||||
SYSTEM.MOSCWTCR.BYTE = 0x07; // Wait 65,536 cycles
|
||||
/* Set the main clock to operating. */
|
||||
SYSTEM.MOSCCR.BYTE = 0x00;
|
||||
|
||||
/* Set PLL Input Divisor. */
|
||||
SYSTEM.PLLCR.BIT.PLIDIV = PLL_DIV >> 1;
|
||||
|
||||
/* Set PLL Multiplier. */
|
||||
SYSTEM.PLLCR.BIT.STC = (PLL_MUL * 2) - 1;
|
||||
|
||||
/* Set the PLL to operating. */
|
||||
SYSTEM.PLLCR2.BYTE = 0x00;
|
||||
/* The delay period needed is to make sure that the main clock and PLL have stabilized. */
|
||||
for(i = 0; i< 140; i++) // tPLLWT2 is TBD
|
||||
{
|
||||
__asm volatile( "NOP" );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* LOCO is saved for last since it is what is running by default out of reset. This means you do not want to turn
|
||||
it off until another clock has been enabled and is ready to use. */
|
||||
#if (CLOCK_SOURCE == 0)
|
||||
/* LOCO is chosen. This is the default out of reset. */
|
||||
SYSTEM.LOCOCR.BYTE = 0x00;
|
||||
#else
|
||||
/* LOCO is not chosen and another clock has already been setup. Turn off the LOCO. */
|
||||
SYSTEM.LOCOCR.BYTE = 0x01;
|
||||
#endif
|
||||
|
||||
/* Make sure a valid clock was chosen. */
|
||||
#if (CLOCK_SOURCE > 4) || (CLOCK_SOURCE < 0)
|
||||
#error "ERROR - Valid clock source must be chosen in r_bsp_config.h using CLOCK_SOURCE macro."
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user