esp-vent-main: add temporary I2C class and PressureWrapper to the main. Create a static project further on
This commit is contained in:
parent
98ae07bc18
commit
bb1d94c0f8
@ -1,256 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
|
||||||
<cconfiguration id="com.crt.advproject.config.lib.debug.696913249">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.debug.696913249" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
|
||||||
<externalSettings>
|
|
||||||
<externalSetting>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PressureWrapper"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PressureWrapper/Debug"/>
|
|
||||||
<entry flags="RESOLVED" kind="libraryFile" name="PressureWrapper" srcPrefixMapping="" srcRootPath=""/>
|
|
||||||
</externalSetting>
|
|
||||||
</externalSettings>
|
|
||||||
<extensions>
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
</extensions>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.debug.696913249" name="Debug" parent="com.crt.advproject.config.lib.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
|
||||||
<folderInfo id="com.crt.advproject.config.lib.debug.696913249." name="/" resourcePath="">
|
|
||||||
<toolChain id="com.crt.advproject.toolchain.lib.debug.668768939" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.debug">
|
|
||||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.debug.1102466070" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.debug"/>
|
|
||||||
<builder buildPath="${workspace_loc:/PressureWrapper}/Debug" id="com.crt.advproject.builder.lib.debug.1556756309" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.debug"/>
|
|
||||||
<tool id="com.crt.advproject.cpp.lib.debug.1002879076" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.debug">
|
|
||||||
<option id="com.crt.advproject.cpp.thumb.1046075348" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.cpp.specs.1481733714" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.cpp.arch.725063287" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm3" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1417571632" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
|
||||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
|
||||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
|
||||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
|
||||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
|
||||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
|
||||||
</option>
|
|
||||||
<option id="gnu.cpp.compiler.option.other.other.1657696160" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" valueType="string"/>
|
|
||||||
<option id="gnu.cpp.compiler.option.optimization.flags.662209638" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
|
||||||
<option id="com.crt.advproject.cpp.hdrlib.799231184" name="Library headers" superClass="com.crt.advproject.cpp.hdrlib" useByScannerDiscovery="false" value="Newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.cpp.fpu.2061087852" name="Floating point" superClass="com.crt.advproject.cpp.fpu" useByScannerDiscovery="true"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1335167450" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.cpp.misc.dialect.476579445" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
|
|
||||||
<inputType id="com.crt.advproject.compiler.cpp.input.1936590488" superClass="com.crt.advproject.compiler.cpp.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.gcc.lib.debug.1427539774" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.debug">
|
|
||||||
<option id="com.crt.advproject.gcc.thumb.768914634" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.gcc.arch.211003199" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1455275807" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
|
||||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
|
||||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
|
||||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
|
||||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
|
||||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
|
||||||
</option>
|
|
||||||
<option id="gnu.c.compiler.option.misc.other.1729214216" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
|
||||||
<option id="gnu.c.compiler.option.optimization.flags.1759934493" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1501590007" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.c.misc.dialect.2059096606" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gcc.hdrlib.1461475163" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" useByScannerDiscovery="false" value="Newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gcc.specs.693797105" name="Specs" superClass="com.crt.advproject.gcc.specs" useByScannerDiscovery="false" value="com.crt.advproject.gcc.specs.newlib" valueType="enumerated"/>
|
|
||||||
<inputType id="com.crt.advproject.compiler.input.1680854697" superClass="com.crt.advproject.compiler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.gas.lib.debug.838426100" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.debug">
|
|
||||||
<option id="com.crt.advproject.gas.thumb.981983787" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.gas.arch.1994115803" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
|
||||||
<option id="gnu.both.asm.option.flags.crt.517707143" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -D__NEWLIB__" valueType="string"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.2100676575" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.gas.hdrlib.833138933" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="Newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gas.specs.1437965190" name="Specs" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlib" valueType="enumerated"/>
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.239653712" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
<inputType id="com.crt.advproject.assembler.input.108446805" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.ar.lib.debug.935718366" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.debug"/>
|
|
||||||
</toolChain>
|
|
||||||
</folderInfo>
|
|
||||||
<sourceEntries>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
|
||||||
</sourceEntries>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
</cconfiguration>
|
|
||||||
<cconfiguration id="com.crt.advproject.config.lib.release.2009461900">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.release.2009461900" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
|
||||||
<externalSettings>
|
|
||||||
<externalSetting>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/PressureWrapper"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/PressureWrapper/Release"/>
|
|
||||||
<entry flags="RESOLVED" kind="libraryFile" name="PressureWrapper" srcPrefixMapping="" srcRootPath=""/>
|
|
||||||
</externalSetting>
|
|
||||||
</externalSettings>
|
|
||||||
<extensions>
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
</extensions>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Release build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.release.2009461900" name="Release" parent="com.crt.advproject.config.lib.release" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
|
||||||
<folderInfo id="com.crt.advproject.config.lib.release.2009461900." name="/" resourcePath="">
|
|
||||||
<toolChain id="com.crt.advproject.toolchain.lib.release.140763935" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.release">
|
|
||||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.release.1165161351" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.release"/>
|
|
||||||
<builder buildPath="${workspace_loc:/PressureWrapper}/Release" id="com.crt.advproject.builder.lib.release.1968846375" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.release"/>
|
|
||||||
<tool id="com.crt.advproject.cpp.lib.release.861781772" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.release">
|
|
||||||
<option id="com.crt.advproject.cpp.thumb.705381529" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.cpp.specs.2081414330" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.cpp.arch.206172108" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm3" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.811629729" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
|
||||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
|
||||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
|
||||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
|
||||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
|
||||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
|
||||||
</option>
|
|
||||||
<option id="gnu.cpp.compiler.option.other.other.1771594859" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" valueType="string"/>
|
|
||||||
<option id="gnu.cpp.compiler.option.optimization.flags.754599356" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common -Os" valueType="string"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1575131619" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.cpp.misc.dialect.1016149189" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.cpp.hdrlib.1906975086" name="Library headers" superClass="com.crt.advproject.cpp.hdrlib" useByScannerDiscovery="false" value="Newlib" valueType="enumerated"/>
|
|
||||||
<inputType id="com.crt.advproject.compiler.cpp.input.519669570" superClass="com.crt.advproject.compiler.cpp.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.gcc.lib.release.2027303452" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.release">
|
|
||||||
<option id="com.crt.advproject.gcc.thumb.218693650" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.gcc.arch.1847090902" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1055713845" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
|
||||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
|
||||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
|
||||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
|
||||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
|
||||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
|
||||||
</option>
|
|
||||||
<option id="gnu.c.compiler.option.misc.other.1781600719" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
|
||||||
<option id="gnu.c.compiler.option.optimization.flags.1598910290" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1959045491" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.c.misc.dialect.1354623926" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gcc.hdrlib.1900947179" name="Library headers" superClass="com.crt.advproject.gcc.hdrlib" useByScannerDiscovery="false" value="Newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gcc.specs.255712302" name="Specs" superClass="com.crt.advproject.gcc.specs" useByScannerDiscovery="false" value="com.crt.advproject.gcc.specs.newlib" valueType="enumerated"/>
|
|
||||||
<inputType id="com.crt.advproject.compiler.input.1697689482" superClass="com.crt.advproject.compiler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.gas.lib.release.2126839528" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.release">
|
|
||||||
<option id="com.crt.advproject.gas.thumb.480793901" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.crt.advproject.gas.arch.1488817647" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
|
||||||
<option id="gnu.both.asm.option.flags.crt.722835688" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DNDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -D__NEWLIB__" valueType="string"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1459625786" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/DigitalIoPin/inc}""/>
|
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/I2C/inc}""/>
|
|
||||||
</option>
|
|
||||||
<option id="com.crt.advproject.gas.hdrlib.176505258" name="Library headers" superClass="com.crt.advproject.gas.hdrlib" value="Newlib" valueType="enumerated"/>
|
|
||||||
<option id="com.crt.advproject.gas.specs.728725462" name="Specs" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlib" valueType="enumerated"/>
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1897858019" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
<inputType id="com.crt.advproject.assembler.input.1602283710" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.crt.advproject.ar.lib.release.1764261126" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.release"/>
|
|
||||||
</toolChain>
|
|
||||||
</folderInfo>
|
|
||||||
<sourceEntries>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
|
||||||
</sourceEntries>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
</cconfiguration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<project id="PressureWrapper.com.crt.advproject.projecttype.lib.2135684242" name="Static Library" projectType="com.crt.advproject.projecttype.lib"/>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="scannerConfiguration">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
|
||||||
<storageModule moduleId="com.crt.config">
|
|
||||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<TargetConfig>
|
|
||||||
<Properties property_2="LPC15xx_256K.cfx" property_3="NXP" property_4="LPC1549" property_count="5" version="100300"/>
|
|
||||||
<infoList vendor="NXP">
|
|
||||||
<info chip="LPC1549" connectscript="LPC15RunBootRomConnect.scp" flash_driver="LPC15xx_256K.cfx" match_id="0x0" name="LPC1549" resetscript="LPC15RunBootRomReset.scp" stub="crt_emu_cm3_gen">
|
|
||||||
<chip>
|
|
||||||
<name>LPC1549</name>
|
|
||||||
<family>LPC15xx</family>
|
|
||||||
<vendor>NXP (formerly Philips)</vendor>
|
|
||||||
<reset board="None" core="Real" sys="Real"/>
|
|
||||||
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
|
|
||||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
|
||||||
<memory id="RAM" type="RAM"/>
|
|
||||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
|
||||||
<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/>
|
|
||||||
<memoryInstance derived_from="RAM" id="Ram0_16" location="0x2000000" size="0x4000"/>
|
|
||||||
<memoryInstance derived_from="RAM" id="Ram1_16" location="0x2004000" size="0x4000"/>
|
|
||||||
<memoryInstance derived_from="RAM" id="Ram2_4" location="0x2008000" size="0x1000"/>
|
|
||||||
</chip>
|
|
||||||
<processor>
|
|
||||||
<name gcc_name="cortex-m3">Cortex-M3</name>
|
|
||||||
<family>Cortex-M</family>
|
|
||||||
</processor>
|
|
||||||
</info>
|
|
||||||
</infoList>
|
|
||||||
</TargetConfig></projectStorage>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="com.crt.advproject">
|
|
||||||
<boardId>LPCXpresso1549</boardId>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="refreshScope"/>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
|
||||||
</cproject>
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>PressureWrapper</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
<project>lpc_chip_15xx</project>
|
|
||||||
<project>DigitalIoPin</project>
|
|
||||||
<project>I2C</project>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
|
||||||
<triggers>clean,full,incremental,</triggers>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
|
||||||
<triggers>full,incremental,</triggers>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
|
||||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# Automatically-generated file. Do not edit!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
-include ../makefile.init
|
|
||||||
|
|
||||||
RM := rm -rf
|
|
||||||
|
|
||||||
# All of the sources participating in the build are defined here
|
|
||||||
-include sources.mk
|
|
||||||
-include src/subdir.mk
|
|
||||||
-include objects.mk
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
|
||||||
ifneq ($(strip $(C++_DEPS)),)
|
|
||||||
-include $(C++_DEPS)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(CC_DEPS)),)
|
|
||||||
-include $(CC_DEPS)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(CPP_DEPS)),)
|
|
||||||
-include $(CPP_DEPS)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(CXX_DEPS)),)
|
|
||||||
-include $(CXX_DEPS)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(C_DEPS)),)
|
|
||||||
-include $(C_DEPS)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(C_UPPER_DEPS)),)
|
|
||||||
-include $(C_UPPER_DEPS)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
-include ../makefile.defs
|
|
||||||
|
|
||||||
OPTIONAL_TOOL_DEPS := \
|
|
||||||
$(wildcard ../makefile.defs) \
|
|
||||||
$(wildcard ../makefile.init) \
|
|
||||||
$(wildcard ../makefile.targets) \
|
|
||||||
|
|
||||||
|
|
||||||
BUILD_ARTIFACT_NAME := PressureWrapper
|
|
||||||
BUILD_ARTIFACT_EXTENSION := a
|
|
||||||
BUILD_ARTIFACT_PREFIX := lib
|
|
||||||
BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)
|
|
||||||
|
|
||||||
# Add inputs and outputs from these tool invocations to the build variables
|
|
||||||
|
|
||||||
# All Target
|
|
||||||
all:
|
|
||||||
+@$(MAKE) --no-print-directory main-build && $(MAKE) --no-print-directory post-build
|
|
||||||
|
|
||||||
# Main-build Target
|
|
||||||
main-build: libPressureWrapper.a
|
|
||||||
|
|
||||||
# Tool invocations
|
|
||||||
libPressureWrapper.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS)
|
|
||||||
@echo 'Building target: $@'
|
|
||||||
@echo 'Invoking: MCU Archiver'
|
|
||||||
arm-none-eabi-ar -r "libPressureWrapper.a" $(OBJS) $(USER_OBJS) $(LIBS)
|
|
||||||
@echo 'Finished building target: $@'
|
|
||||||
@echo ' '
|
|
||||||
|
|
||||||
# Other Targets
|
|
||||||
clean:
|
|
||||||
-$(RM) libPressureWrapper.a
|
|
||||||
-@echo ' '
|
|
||||||
|
|
||||||
post-build:
|
|
||||||
-@echo 'Performing post-build steps'
|
|
||||||
-arm-none-eabi-size "libPressureWrapper.a" ; # arm-none-eabi-objdump -h -S "libPressureWrapper.a" >"libPressureWrapper.lss"
|
|
||||||
-@echo ' '
|
|
||||||
|
|
||||||
.PHONY: all clean dependents main-build post-build
|
|
||||||
|
|
||||||
-include ../makefile.targets
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# Automatically-generated file. Do not edit!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
USER_OBJS :=
|
|
||||||
|
|
||||||
LIBS :=
|
|
||||||
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# Automatically-generated file. Do not edit!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
ASM_SRCS :=
|
|
||||||
C++_SRCS :=
|
|
||||||
CC_SRCS :=
|
|
||||||
CPP_SRCS :=
|
|
||||||
CXX_SRCS :=
|
|
||||||
C_SRCS :=
|
|
||||||
C_UPPER_SRCS :=
|
|
||||||
OBJ_SRCS :=
|
|
||||||
O_SRCS :=
|
|
||||||
S_SRCS :=
|
|
||||||
S_UPPER_SRCS :=
|
|
||||||
ARCHIVES :=
|
|
||||||
C++_DEPS :=
|
|
||||||
CC_DEPS :=
|
|
||||||
CPP_DEPS :=
|
|
||||||
CXX_DEPS :=
|
|
||||||
C_DEPS :=
|
|
||||||
C_UPPER_DEPS :=
|
|
||||||
OBJS :=
|
|
||||||
|
|
||||||
# Every subdirectory with source files must be described here
|
|
||||||
SUBDIRS := \
|
|
||||||
src \
|
|
||||||
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
../src/PressureWrapper.cpp:10:1:PressureWrapper::PressureWrapper() 16 static
|
|
||||||
../src/PressureWrapper.cpp:15:1:PressureWrapper::~PressureWrapper() 16 static
|
|
||||||
../src/PressureWrapper.cpp:15:1:virtual PressureWrapper::~PressureWrapper() 16 static
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
# Automatically-generated file. Do not edit!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Add inputs and outputs from these tool invocations to the build variables
|
|
||||||
CPP_SRCS += \
|
|
||||||
../src/PressureWrapper.cpp
|
|
||||||
|
|
||||||
CPP_DEPS += \
|
|
||||||
./src/PressureWrapper.d
|
|
||||||
|
|
||||||
OBJS += \
|
|
||||||
./src/PressureWrapper.o
|
|
||||||
|
|
||||||
|
|
||||||
# Each subdirectory must supply rules for building sources it contributes
|
|
||||||
src/%.o: ../src/%.cpp src/subdir.mk
|
|
||||||
@echo 'Building file: $<'
|
|
||||||
@echo 'Invoking: MCU C++ Compiler'
|
|
||||||
arm-none-eabi-c++ -DDEBUG -D__CODE_RED -D__NEWLIB__ -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -I"/Users/evgenymeshcheryakov/Documents/Metropolia/3rd/Embedded Systems Programming TX00CI61-3011/ESP-Ventilation/PressureWrapper/inc" -I"/Users/evgenymeshcheryakov/Documents/Metropolia/3rd/Embedded Systems Programming TX00CI61-3011/ESP-Ventilation/lpc_board_nxp_lpcxpresso_1549/inc" -I"/Users/evgenymeshcheryakov/Documents/Metropolia/3rd/Embedded Systems Programming TX00CI61-3011/ESP-Ventilation/lpc_chip_15xx/inc" -I"/Users/evgenymeshcheryakov/Documents/Metropolia/3rd/Embedded Systems Programming TX00CI61-3011/ESP-Ventilation/DigitalIoPin/inc" -I"/Users/evgenymeshcheryakov/Documents/Metropolia/3rd/Embedded Systems Programming TX00CI61-3011/ESP-Ventilation/I2C/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fmerge-constants -fmacro-prefix-map="$(<D)/"= -mcpu=cortex-m3 -mthumb -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
|
|
||||||
@echo 'Finished building: $<'
|
|
||||||
@echo ' '
|
|
||||||
|
|
||||||
|
|
||||||
clean: clean-src
|
|
||||||
|
|
||||||
clean-src:
|
|
||||||
-$(RM) ./src/PressureWrapper.d ./src/PressureWrapper.o
|
|
||||||
|
|
||||||
.PHONY: clean-src
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
<!-- liblinks.xml
|
|
||||||
|
|
||||||
NXP LPCXpresso IDE "Smart update wizard" script file
|
|
||||||
When executed on a particular application project, will
|
|
||||||
add appropriate links to the specified library project.
|
|
||||||
|
|
||||||
Note that this script assumes that the application project
|
|
||||||
contains the standard 'Debug' and 'Release' build
|
|
||||||
configurations.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<project name="" update="true">
|
|
||||||
<setting id="all.compiler.inc">
|
|
||||||
<value>${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}</value>
|
|
||||||
</setting>
|
|
||||||
<setting id="assembler.inc">
|
|
||||||
<value>${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}</value>
|
|
||||||
</setting>
|
|
||||||
<setting id="linker.libs">
|
|
||||||
<value>${ProjName}</value>
|
|
||||||
</setting>
|
|
||||||
<setting id="linker.paths" buildType="Debug">
|
|
||||||
<value>${MacroStart}workspace_loc:/${ProjName}/Debug${MacroEnd}</value>
|
|
||||||
</setting>
|
|
||||||
<setting id="linker.paths" buildType="Release">
|
|
||||||
<value>${MacroStart}workspace_loc:/${ProjName}/Release${MacroEnd}</value>
|
|
||||||
</setting>
|
|
||||||
<requires msg="Library project `${ProjName}` not found">
|
|
||||||
<value>${ProjName}</value>
|
|
||||||
</requires>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* PressureWrapper.cpp
|
|
||||||
*
|
|
||||||
* Created on: 5 Oct 2022
|
|
||||||
* Author: evgenymeshcheryakov
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <PressureWrapper.h>
|
|
||||||
|
|
||||||
PressureWrapper::PressureWrapper (I2C *i2c) : i2c(i2c)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PressureWrapper::~PressureWrapper ()
|
|
||||||
{
|
|
||||||
// TODO Auto-generated destructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PressureWrapper::getStatus() {
|
|
||||||
uint8_t control_register = 0x01;
|
|
||||||
uint8_t status = 0;
|
|
||||||
i2c->transaction(ADDRESS, &control_register, 1, &status, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
PRESSURE_DATA* PressureWrapper::getPressure () {
|
|
||||||
uint8_t getMeasurementComm = 0xF1;
|
|
||||||
i2c->transaction(ADDRESS, &getMeasurementComm, 1, data.rBuffer, 3);
|
|
||||||
//i2c->transaction(ADDRESS, &getMeasurementComm, 1, data.crc, 1);
|
|
||||||
return &data;
|
|
||||||
}
|
|
||||||
143
esp-vent-main/src/I2C.cpp
Normal file
143
esp-vent-main/src/I2C.cpp
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
* I2C.cpp
|
||||||
|
*
|
||||||
|
* Created on: 21.2.2016
|
||||||
|
* Author: krl
|
||||||
|
* Based on example provided by NXP Semiconductors. See copyright notice below.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief I2CM bus master example using polling mode
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* Copyright(C) NXP Semiconductors, 2014
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* @par
|
||||||
|
* Software that is described herein is for illustrative purposes only
|
||||||
|
* which provides customers with programming information regarding the
|
||||||
|
* LPC products. This software is supplied "AS IS" without any warranties of
|
||||||
|
* any kind, and NXP Semiconductors and its licensor disclaim any and
|
||||||
|
* all warranties, express or implied, including all implied warranties of
|
||||||
|
* merchantability, fitness for a particular purpose and non-infringement of
|
||||||
|
* intellectual property rights. NXP Semiconductors assumes no responsibility
|
||||||
|
* or liability for the use of the software, conveys no license or rights under any
|
||||||
|
* patent, copyright, mask work right, or any other intellectual property rights in
|
||||||
|
* or to any products. NXP Semiconductors reserves the right to make changes
|
||||||
|
* in the software without notification. NXP Semiconductors also makes no
|
||||||
|
* representation or warranty that such application will be suitable for the
|
||||||
|
* specified use without further testing or modification.
|
||||||
|
*
|
||||||
|
* @par
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation is hereby granted, under NXP Semiconductors' and its
|
||||||
|
* licensor's relevant copyrights in the software, without fee, provided that it
|
||||||
|
* is used in conjunction with NXP Semiconductors microcontrollers. This
|
||||||
|
* copyright, permission, and disclaimer notice must appear in all copies of
|
||||||
|
* this code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../inc/I2C.h"
|
||||||
|
|
||||||
|
|
||||||
|
I2C::I2C(const I2C_config &cfg): device(nullptr) {
|
||||||
|
if(cfg.device_number == 0) {
|
||||||
|
device = LPC_I2C0;
|
||||||
|
// board init must have been called before the pins can be configured
|
||||||
|
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 22, IOCON_DIGMODE_EN | cfg.i2c_mode);
|
||||||
|
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 23, IOCON_DIGMODE_EN | cfg.i2c_mode);
|
||||||
|
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SCL);
|
||||||
|
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SDA);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// currently we support only I2C number 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if(device) {
|
||||||
|
/* Enable I2C clock and reset I2C peripheral - the boot ROM does not
|
||||||
|
do this */
|
||||||
|
Chip_I2C_Init(device);
|
||||||
|
|
||||||
|
/* Setup clock rate for I2C */
|
||||||
|
Chip_I2C_SetClockDiv(device, cfg.clock_divider);
|
||||||
|
|
||||||
|
/* Setup I2CM transfer rate */
|
||||||
|
Chip_I2CM_SetBusSpeed(device, cfg.speed);
|
||||||
|
|
||||||
|
/* Enable Master Mode */
|
||||||
|
Chip_I2CM_Enable(device);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
I2C::~I2C() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
bool I2C::write(uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize)
|
||||||
|
{
|
||||||
|
return transaction(devAddr, txBuffPtr, txSize, nullptr, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool I2C::read(uint8_t devAddr, uint8_t *rxBuffPtr, uint16_t rxSize)
|
||||||
|
{
|
||||||
|
return transaction(devAddr, nullptr, 0, rxBuffPtr, rxSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool I2C::transaction(uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize, uint8_t *rxBuffPtr, uint16_t rxSize) {
|
||||||
|
I2CM_XFER_T i2cmXferRec;
|
||||||
|
|
||||||
|
// make sure that master is idle
|
||||||
|
while(!Chip_I2CM_IsMasterPending(LPC_I2C0));
|
||||||
|
|
||||||
|
/* Setup I2C transfer record */
|
||||||
|
i2cmXferRec.slaveAddr = devAddr;
|
||||||
|
i2cmXferRec.status = 0;
|
||||||
|
i2cmXferRec.txSz = txSize;
|
||||||
|
i2cmXferRec.rxSz = rxSize;
|
||||||
|
i2cmXferRec.txBuff = txBuffPtr;
|
||||||
|
i2cmXferRec.rxBuff = rxBuffPtr;
|
||||||
|
|
||||||
|
I2CM_XferBlocking(LPC_I2C0, &i2cmXferRec);
|
||||||
|
// Chip_I2CM_XferBlocking returns before stop condition is fully completed
|
||||||
|
// therefore we need to wait for master to be idle when doing back-to-back transactions (see beginning of the function)
|
||||||
|
|
||||||
|
/* Test for valid operation */
|
||||||
|
if (i2cmXferRec.status == I2CM_STATUS_OK) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transmit and Receive data in master mode */
|
||||||
|
/* This duplicates (and combines) the functionality of Chip_I2CM_Xfer and Chip_I2CM_XferBlocking with a modification
|
||||||
|
* that allows us to do a zero length write (needed to use honeywell humidity/temp sensor)
|
||||||
|
*/
|
||||||
|
uint32_t I2C::I2CM_XferBlocking(LPC_I2C_T *pI2C, I2CM_XFER_T *xfer)
|
||||||
|
{
|
||||||
|
uint32_t ret = 0;
|
||||||
|
/* start transfer */
|
||||||
|
|
||||||
|
/* set the transfer status as busy */
|
||||||
|
xfer->status = I2CM_STATUS_BUSY;
|
||||||
|
/* Clear controller state. */
|
||||||
|
Chip_I2CM_ClearStatus(pI2C, I2C_STAT_MSTRARBLOSS | I2C_STAT_MSTSTSTPERR);
|
||||||
|
/* Write Address and RW bit to data register */
|
||||||
|
//Chip_I2CM_WriteByte(pI2C, (xfer->slaveAddr << 1) | (xfer->txSz == 0)); // original NXP version
|
||||||
|
// krl : both read and write lenght is 0 --> write (for honeywell temp sensor)
|
||||||
|
Chip_I2CM_WriteByte(pI2C, (xfer->slaveAddr << 1) | (xfer->txSz == 0 && xfer->rxSz != 0));
|
||||||
|
/* Enter to Master Transmitter mode */
|
||||||
|
Chip_I2CM_SendStart(pI2C);
|
||||||
|
|
||||||
|
while (ret == 0) {
|
||||||
|
/* wait for status change interrupt */
|
||||||
|
while (!Chip_I2CM_IsMasterPending(pI2C)) {}
|
||||||
|
/* call state change handler */
|
||||||
|
ret = Chip_I2CM_XferHandler(pI2C, xfer);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
33
esp-vent-main/src/I2C.h
Normal file
33
esp-vent-main/src/I2C.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* I2C.h
|
||||||
|
*
|
||||||
|
* Created on: 21.2.2016
|
||||||
|
* Author: krl
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef I2C_H_
|
||||||
|
#define I2C_H_
|
||||||
|
|
||||||
|
#include "chip.h"
|
||||||
|
|
||||||
|
struct I2C_config {
|
||||||
|
unsigned int device_number;
|
||||||
|
unsigned int speed;
|
||||||
|
unsigned int clock_divider;
|
||||||
|
unsigned int i2c_mode;
|
||||||
|
I2C_config(): device_number(0), speed(100000), clock_divider(40), i2c_mode(IOCON_SFI2C_EN) {};
|
||||||
|
};
|
||||||
|
|
||||||
|
class I2C {
|
||||||
|
public:
|
||||||
|
I2C(const I2C_config &cfg);
|
||||||
|
virtual ~I2C();
|
||||||
|
bool transaction(uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize, uint8_t *rxBuffPtr, uint16_t rxSize);
|
||||||
|
bool write(uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize);
|
||||||
|
bool read(uint8_t devAddr, uint8_t *rxBuffPtr, uint16_t rxSize);
|
||||||
|
private:
|
||||||
|
LPC_I2C_T *device;
|
||||||
|
static uint32_t I2CM_XferBlocking(LPC_I2C_T *pI2C, I2CM_XFER_T *xfer);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* I2C_H_ */
|
||||||
47
esp-vent-main/src/PressureWrapper.cpp
Normal file
47
esp-vent-main/src/PressureWrapper.cpp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* PressureWrapper.cpp
|
||||||
|
*
|
||||||
|
* Created on: 5 Oct 2022
|
||||||
|
* Author: evgenymeshcheryakov
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PressureWrapper.h"
|
||||||
|
|
||||||
|
static uint8_t crc8(uint8_t *data, size_t size) {
|
||||||
|
uint8_t crc = 0x00;
|
||||||
|
uint8_t byteCtr;
|
||||||
|
//calculates 8-Bit checksum with given polynomial
|
||||||
|
for (byteCtr = 0; byteCtr < size; ++byteCtr) {
|
||||||
|
crc ^= (data[byteCtr]);
|
||||||
|
for (uint8_t bit = 8; bit > 0; --bit) {
|
||||||
|
if (crc & 0x80) crc = (crc << 1) ^ 0x131; //P(x)=x^8+x^5+x^4+1 = 0001 0011 0001
|
||||||
|
else crc = (crc << 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
PressureWrapper::PressureWrapper ()
|
||||||
|
{
|
||||||
|
NVIC_DisableIRQ(I2C0_IRQn);
|
||||||
|
I2C_config config;
|
||||||
|
I2C i2c_c(config);
|
||||||
|
i2c = &i2c_c;
|
||||||
|
}
|
||||||
|
|
||||||
|
PressureWrapper::~PressureWrapper ()
|
||||||
|
{
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
int PressureWrapper::getPressure() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PRESSURE_DATA* PressureWrapper::getRawPressure () {
|
||||||
|
uint8_t getMeasurementComm = 0xF1;
|
||||||
|
i2c->transaction(0x40, &getMeasurementComm, 1, data.rBuffer, 3);
|
||||||
|
return &data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -8,7 +8,6 @@
|
|||||||
#ifndef PRESSUREWRAPPER_H_
|
#ifndef PRESSUREWRAPPER_H_
|
||||||
#define PRESSUREWRAPPER_H_
|
#define PRESSUREWRAPPER_H_
|
||||||
|
|
||||||
#include "DigitalIoPin.h"
|
|
||||||
#include "I2C.h"
|
#include "I2C.h"
|
||||||
|
|
||||||
#define ADDRESS 0x40
|
#define ADDRESS 0x40
|
||||||
@ -23,21 +22,21 @@ typedef struct _PRESSURE{
|
|||||||
class PressureWrapper
|
class PressureWrapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PressureWrapper (I2C *i2c);
|
PressureWrapper ();
|
||||||
/**
|
/**
|
||||||
* @brief Get the Status object
|
* @brief Get the Status object
|
||||||
*
|
*
|
||||||
* @return true
|
* @return true
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
bool getStatus ();
|
int getPressure ();
|
||||||
PRESSURE_DATA* getPressure ();
|
|
||||||
|
|
||||||
virtual ~PressureWrapper ();
|
virtual ~PressureWrapper ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
I2C *i2c;
|
I2C *i2c;
|
||||||
PRESSURE_DATA data = {{0, 0}, 0};
|
PRESSURE_DATA data = {{0, 0}, 0};
|
||||||
|
PRESSURE_DATA* getRawPressure ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PRESSUREWRAPPER_H_ */
|
#endif /* PRESSUREWRAPPER_H_ */
|
||||||
Loading…
x
Reference in New Issue
Block a user