Changeset - 67d1f9d02048
[Not reviewed]
default
0 5 4
Ethan Zonca (ethanzonca) - 9 years ago 2017-01-04 09:47:53
e@ethanzonca.com
Working pressure sensor and adc vbatt reading
9 files changed with 270 insertions and 2 deletions:
0 comments (0 inline, 0 general)
.cproject
Show inline comments
 
@@ -8,25 +8,25 @@
 
					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
 
					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
 
					<extension id="org.eclipse.cdt.core.GmakeErrorParser" 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 artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1412804961" name="Debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
 
					<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1412804961." name="/" resourcePath="">
 
						<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.1252985156" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.648941311" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.debug" valueType="enumerated"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.648941311" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.size" valueType="enumerated"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.304740068" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.169298544" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.706305735" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.546754958" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.2010935042" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.max" valueType="enumerated"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1280079169" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.71701093" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m0" valueType="enumerated"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1950071975" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn.1668925070" name="Enable extra warnings (-Wextra)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn" value="false" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding.814158729" name="Assume freestanding environment (-ffreestanding)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants.682355504" name="Disable loop invariant move (-fno-move-loop-invariants)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants" value="true" valueType="boolean"/>
 
							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.1248080264" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="true" valueType="boolean"/>
 
@@ -56,58 +56,61 @@
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.2140424518" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Device/ST/STM32F0xx/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/STM32F0xx_HAL_Driver/Inc}&quot;"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.467506757" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
 
									<listOptionValue builtIn="false" value="DEBUG"/>
 
									<listOptionValue builtIn="false" value="HSI48_VALUE=48000000"/>
 
									<listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other.1270173496" name="Other assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other" value="" valueType="string"/>
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.959337448" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.772558380" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.67448346" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Device/ST/STM32F0xx/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/STM32F0xx_HAL_Driver/Inc}&quot;"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.861932487" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
 
									<listOptionValue builtIn="false" value="DEBUG"/>
 
									<listOptionValue builtIn="false" value="HSI48_VALUE=48000000"/>
 
									<listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.600165372" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1750560740" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1784562806" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.151821998" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/CMSIS/Device/ST/STM32F0xx/Include}&quot;"/>
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Libraries/STM32F0xx_HAL_Driver/Inc}&quot;"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions.1186355074" name="Do not use exceptions (-fno-exceptions)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti.191386245" name="Do not use RTTI (-fno-rtti)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nousecxaatexit.319906847" name="Do not use _cxa_atexit() (-fno-use-cxa-atexit)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nousecxaatexit" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nothreadsafestatics.1744222958" name="Do not use thread-safe statics (-fno-threadsafe-statics)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nothreadsafestatics" useByScannerDiscovery="true" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.542894199" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
 
									<listOptionValue builtIn="false" value="DEBUG"/>
 
									<listOptionValue builtIn="false" value="HSI48_VALUE=48000000"/>
 
									<listOptionValue builtIn="false" value="HSE_VALUE=8000000"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other.1587293044" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.723145048" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.813050281" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1033703136" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths.1542555520" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.paths" valueType="libPaths">
 
									<listOptionValue builtIn="false" value="&quot;../ldscripts&quot;"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile.990136660" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile" valueType="stringList">
 
									<listOptionValue builtIn="false" value="mem.ld"/>
 
									<listOptionValue builtIn="false" value="libs.ld"/>
 
									<listOptionValue builtIn="false" value="sections.ld"/>
 
								</option>
 
@@ -117,24 +120,25 @@
 
									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
 
									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
 
								</inputType>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1583473051" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.674928377" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths.1119064960" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile.586579487" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile" valueType="stringList">
 
									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/STM32F031G6_FLASH.ld}&quot;"/>
 
								</option>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart.49019800" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart" value="false" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano.1900135381" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other.39771167" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other" value="" valueType="string"/>
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.388623763" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
 
									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
 
									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
 
								</inputType>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.236341817" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.148059149" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1761004880" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1753381893" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.2083838754" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.1413638576" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.349462589" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
 
@@ -177,24 +181,25 @@
 
							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1132255329" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1868482300">
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.147557585" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.386481977" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.772558380">
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1699786341" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1773335163" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1784562806">
 
								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1512773384" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.1757809268" name="Cross ARM C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.813050281">
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano.1870722667" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano" value="true" valueType="boolean"/>
 
								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other.800326275" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.other" value="" valueType="string"/>
 
							</tool>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.119353502" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1583473051"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.1555481861" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.236341817"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.570109601" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.148059149"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.453775642" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1761004880"/>
 
							<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.1353173965" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.986460430"/>
 
						</toolChain>
 
					</folderInfo>
 
					<sourceEntries>
 
						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Include"/>
 
						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Libraries"/>
 
						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Source"/>
Include/pressure.h
Show inline comments
 
new file 100644
 
#ifndef PRESSURE_H
 
#define PRESSURE_H
 
 
#include "stm32f0xx_hal.h"
 
 
 
#define PIN_SENSORS_SDA GPIO_PIN_7
 
#define PIN_SENSORS_SCL GPIO_PIN_6
 
#define PORT_SENSORS GPIOB
 
 
#define PRESSURE_ADDRESS 0b10111000
 
#define PRESSURE_PRESS_REGH 0x2A
 
#define PRESSURE_PRESS_REGL 0x29
 
#define PRESSURE_PRESS_REGXL 0x28
 
#define PRESSURE_TEMP_REGH 0x2C
 
#define PRESSURE_TEMP_REGL 0x2B
 
#define PRESSURE_AUTOINC 0b10000000
 
 
#define PRESSURE_CTRL1_1HZ 	  0b00010000
 
#define PRESSURE_CTRL1_7HZ 	  0b00100000
 
#define PRESSURE_CTRL1_12_5HZ 0b00110000
 
#define PRESSURE_CTRL1_25HZ   0b01000000
 
 
#define PRESSURE_CTRL1_PWRUP 0b10000000
 
 
void pressure_init(void);
 
void pressure_read(void);
 
void pressure_updatevalues(void);
 
 
int32_t pressure_gettemp(void);
 
int32_t pressure_getpressure(void);
 
 
I2C_HandleTypeDef* pressure_get_i2c_handle(void);
 
#endif
 
Include/system/adc.h
Show inline comments
 
new file 100644
 
#ifndef SYSTEM_ADC_H_
 
#define SYSTEM_ADC_H_
 
 
void adc_init(void);
 
DMA_HandleTypeDef* adc__hdma_gethandle(void);
 
uint8_t adc_get_vbatt(void);
 
 
 
 
#endif /* SYSTEM_ADC_H_ */
Include/system/stm32f0xx_hal_conf.h
Show inline comments
 
#ifndef __STM32F0xx_HAL_CONF_H
 
#define __STM32F0xx_HAL_CONF_H
 
 
#ifdef __cplusplus
 
 extern "C" {
 
#endif
 
 
/* ########################## Module Selection ############################## */
 
/**
 
  * @brief This is the list of modules to be used in the HAL driver 
 
  */
 
#define HAL_MODULE_ENABLED  
 
//#define HAL_ADC_MODULE_ENABLED
 
#define HAL_ADC_MODULE_ENABLED
 
//#define HAL_CAN_MODULE_ENABLED   
 
//#define HAL_CEC_MODULE_ENABLED   
 
//#define HAL_COMP_MODULE_ENABLED   
 
//#define HAL_CRC_MODULE_ENABLED   
 
//#define HAL_CRYP_MODULE_ENABLED   
 
//#define HAL_TSC_MODULE_ENABLED   
 
//#define HAL_DAC_MODULE_ENABLED   
 
#define HAL_I2C_MODULE_ENABLED
 
//#define HAL_I2S_MODULE_ENABLED   
 
#define HAL_IWDG_MODULE_ENABLED
 
//#define HAL_LCD_MODULE_ENABLED   
 
//#define HAL_LPTIM_MODULE_ENABLED   
Libraries/aprs/aprs.c
Show inline comments
 
@@ -21,24 +21,25 @@
 
 */
 

	
 
#include <string.h>
 
#include <stdlib.h>
 

	
 
#include "config.h"
 
#include "pressure.h"
 
#include "aprs.h"
 
#include "gps.h"
 
//#include "gps.h"
 
//#include "adc.h"
 
#include "ax25.h"
 
#include "system/adc.h"
 

	
 

	
 
int32_t meters_to_feet(int32_t m)
 
{
 
  // 10000 ft = 3048 m
 
  return (float)m / 0.3048;
 
}
 

	
 
void aprs_send(void)
 
{
 
  struct s_address addresses[] = { 
 
    {D_CALLSIGN, D_CALLSIGN_ID},  // Destination callsign
 
@@ -81,18 +82,21 @@ void aprs_send(void)
 
  // Pressure
 
  snprintf(tmpBuffer, 128, "%d,", pressure_getpressure());
 
  ax25_send_string(tmpBuffer);
 
  
 
  // Temperature
 
  snprintf(tmpBuffer, 128, "%d,", pressure_gettemp());
 
  ax25_send_string(tmpBuffer);
 

	
 
  // HDOP
 
  snprintf(tmpBuffer, 128, "%u,", gps_getdata()->pdop);
 
  ax25_send_string(tmpBuffer);
 

	
 
  // Vbatt
 
  snprintf(tmpBuffer, 128, "%u,", adc_get_vbatt());
 
  ax25_send_string(tmpBuffer);
 

	
 
  ax25_send_footer();
 
  ax25_flush_frame();
 
}
 

	
 
// vim:softtabstop=4 shiftwidth=4 expandtab 
Source/main.c
Show inline comments
 
//
 
// mBuoy Depth Select Firmware
 
// Copyright 2015 SeaLandAire Technologies
 
//
 
 
#include "config.h"
 
#include "error.h"
 
#include "system/gpio.h"
 
#include "system/sysclk.h"
 
#include "system/watchdog.h"
 
#include "system/uart.h"
 
#include "system/adc.h"
 
#include "stm32f0xx_hal.h"
 
#include "si446x/si446x.h"
 
#include "aprs/aprs.h"
 
#include "aprs/afsk.h"
 
#include "pressure.h"
 
#include "gps.h"
 
 
 
int main(void)
 
{
 
  hal_init();
 
  sysclock_init();
 
  gpio_init();
 
 
  adc_init();
 
 
  afsk_init();
 
  si446x_init();
 
  gps_poweron();
 
  pressure_init();
 
 
  // Software timers
 
  uint32_t last_transmission = HAL_GetTick();
 
  uint32_t last_led = HAL_GetTick();
 
 
  while (1)
 
  {
Source/pressure.c
Show inline comments
 
new file 100644
 
//
 
// Sensors: Reads pressure and e-compass sensors over I2C and stores readings in queryable internal data structures
 
//
 
 
#include "pressure.h"
 
#include "stm32f0xx_hal.h"
 
 
 
#include "config.h"
 
 
 
// Static variables
 
static I2C_HandleTypeDef hi2c1;
 
 
static int32_t pressure_hPa = 0;
 
static int32_t temp_celsius = 0;
 
 
static uint8_t sensors_pressurebuf[8]; // Buffer for i2c rx pressure data
 
static uint8_t sensors_pressure_freshdata = 0; // If pressure sensor has fresh data
 
 
 
// Initialize pressure sensor and E-compass
 
void pressure_init(void)
 
{
 
	GPIO_InitTypeDef GPIO_InitStruct;
 
 
	// I2C Pins
 
    GPIO_InitStruct.Pin = PIN_SENSORS_SCL|PIN_SENSORS_SDA;
 
    GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
 
    GPIO_InitStruct.Pull = GPIO_PULLUP;
 
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
 
    GPIO_InitStruct.Alternate = GPIO_AF1_I2C1;
 
    HAL_GPIO_Init(PORT_SENSORS, &GPIO_InitStruct);
 
 
    // Initialize I2C peripheral
 
    __I2C1_CLK_ENABLE();
 
    hi2c1.Instance = I2C1;
 
    hi2c1.Init.Timing = 0x00108EFB;
 
    hi2c1.Init.OwnAddress1 = 0x0;
 
    hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
 
    hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
 
    hi2c1.Init.OwnAddress2 = 0;
 
    hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
 
    hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLED;
 
    hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLED;
 
    volatile HAL_StatusTypeDef res = HAL_I2C_Init(&hi2c1);
 
 
    // Configure Analog filter
 
    res =  HAL_I2CEx_AnalogFilter_Config(&hi2c1, I2C_ANALOGFILTER_ENABLED);
 
 
	// Enable I2C interrupt
 
    HAL_NVIC_SetPriority(I2C1_IRQn, 7, 4);
 
    HAL_NVIC_EnableIRQ(I2C1_IRQn);
 
 
    // Blocking initialization of sensors
 
 
	// Power on the pressure sensor and configure //////////////////////////////////////////////////
 
	uint8_t temp[2];
 
	temp[0] = PRESSURE_CTRL1_PWRUP | PRESSURE_CTRL1_7HZ;
 
	HAL_Delay(10);
 
	res = HAL_I2C_Mem_Write(&hi2c1, PRESSURE_ADDRESS, 0x20, 1, temp, 1, 500);
 
}
 
 
 
// Initiate interrupt-based read of engineering sensors
 
void pressure_read(void)
 
{
 
	// Start reading pressure sensor
 
	HAL_Delay(10);
 
	volatile  HAL_StatusTypeDef res = HAL_I2C_Mem_Read(&hi2c1, PRESSURE_ADDRESS, PRESSURE_PRESS_REGXL | PRESSURE_AUTOINC, 1, sensors_pressurebuf, 5, 500);
 
 
	// Consume fresh data flag
 
	sensors_pressure_freshdata = 0;
 
 
	// Convert received bytes to pressure in hPa
 
	pressure_hPa = sensors_pressurebuf[0]<<8 | sensors_pressurebuf[1]<<16 | sensors_pressurebuf[2]<<24;
 
	pressure_hPa >>= 8; // Sign extend
 
	pressure_hPa /= 4096; // convert to hPa
 
 
	// Convert received bytes to temperature in Celsius
 
	int16_t temp_out = (sensors_pressurebuf[3] | sensors_pressurebuf[4]<<8);
 
	if(!temp_out)
 
		temp_celsius = 42;
 
	else
 
		temp_celsius = 42.5 + temp_out / 480.0;
 
 
}
 
 
 
// Get current temperature in Celsius
 
int32_t pressure_gettemp(void)
 
{
 
	return temp_celsius;
 
}
 
 
 
// Get current pressure in hPa
 
int32_t pressure_getpressure(void)
 
{
 
	return pressure_hPa;
 
}
 
 
 
 
inline I2C_HandleTypeDef* pressure_get_i2c_handle(void)
 
{
 
	return &hi2c1;
 
}
 
Source/system/adc.c
Show inline comments
 
new file 100644
 
/*
 
 * FeatherHAB
 
 *
 
 * This file is part of FeatherHAB.
 
 *
 
 * FeatherHab is free software: you can redistribute it and/or modify
 
 * it under the terms of the GNU Affero General Public License as published by
 
 * the Free Software Foundation, either version 3 of the License, or
 
 * (at your option) any later version.
 
 *
 
 * FeatherHab 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 Affero General Public License for more details.
 
 *
 
 * You should have received a copy of the GNU Affero General Public License
 
 * along with FeatherHAB. If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 * Ethan Zonca
 
 *
 
 */
 
 
#include "stm32f0xx_hal.h"
 
#include "system/adc.h"
 
 
ADC_HandleTypeDef hadc;
 
DMA_HandleTypeDef hdma_adc;
 
 
#define ADC_BUF_LEN 1
 
uint16_t adc_buffer[ADC_BUF_LEN];
 
 
 
void adc_init(void)
 
{
 
 
    __ADC1_CLK_ENABLE();
 
 
	GPIO_InitTypeDef GPIO_InitStruct;
 
    GPIO_InitStruct.Pin = GPIO_PIN_6;
 
    GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
 
    GPIO_InitStruct.Pull = GPIO_NOPULL;
 
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 
 
 
	ADC_ChannelConfTypeDef sConfig;
 
	hadc.Instance = ADC1;
 
	hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC;
 
	hadc.Init.Resolution = ADC_RESOLUTION12b;
 
	hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT;
 
	hadc.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD;
 
	hadc.Init.EOCSelection = EOC_SEQ_CONV;
 
	hadc.Init.LowPowerAutoWait = DISABLE;
 
	hadc.Init.LowPowerAutoPowerOff = DISABLE;
 
	hadc.Init.ContinuousConvMode = ENABLE;
 
	hadc.Init.DiscontinuousConvMode = DISABLE;
 
	hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
 
	hadc.Init.DMAContinuousRequests = ENABLE;
 
	hadc.Init.Overrun = OVR_DATA_OVERWRITTEN;
 
	HAL_ADC_Init(&hadc);
 
 
	sConfig.Channel = ADC_CHANNEL_6;
 
	sConfig.Rank = ADC_RANK_CHANNEL_NUMBER;
 
	sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
 
	HAL_ADC_ConfigChannel(&hadc, &sConfig);
 
 
 
	__DMA1_CLK_ENABLE();
 
		HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
 
	HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
 
 
    hdma_adc.Instance = DMA1_Channel1;
 
    hdma_adc.Init.Direction = DMA_PERIPH_TO_MEMORY;
 
    hdma_adc.Init.PeriphInc = DMA_PINC_DISABLE;
 
    hdma_adc.Init.MemInc = DMA_MINC_ENABLE;
 
    hdma_adc.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
 
    hdma_adc.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
 
    hdma_adc.Init.Mode = DMA_CIRCULAR;
 
    hdma_adc.Init.Priority = DMA_PRIORITY_LOW;
 
    HAL_DMA_Init(&hdma_adc);
 
 
    __HAL_LINKDMA(&hadc,DMA_Handle,hdma_adc);
 
 
 
    HAL_ADC_Start_DMA(&hadc, adc_buffer, ADC_BUF_LEN);
 
 
 
}
 
 
uint8_t adc_get_vbatt(void)
 
{
 
	return adc_buffer[0] / 62.5; // tenths of volts ish
 
}
 
 
DMA_HandleTypeDef* adc__hdma_gethandle(void)
 
{
 
	return &hdma_adc;
 
}
Source/system/interrupts.c
Show inline comments
 
//
 
// Interrupts: ISRs for all global interrupts
 
//
 
 
#include <system/gpio.h>
 
#include <system/stm32f0xx_it.h>
 
#include "stm32f0xx_hal.h"
 
#include "stm32f0xx.h"
 
#include "system/gpio.h"
 
#include "aprs/afsk.h"
 
#include "pressure.h"
 
#include "system/adc.h"
 
 
// Systick
 
void SysTick_Handler(void)
 
{
 
  HAL_IncTick();
 
  HAL_SYSTICK_IRQHandler();
 
}
 
 
 
void TIM1_CC_IRQHandler(void)
 
{
 
  HAL_TIM_IRQHandler(afsk_timer_gethandle());
 
@@ -29,12 +30,17 @@ void TIM1_BRK_UP_TRG_COM_IRQHandler(void
 
}
 
 
 
// Handle I2C interrupts
 
void I2C1_IRQHandler(void)
 
{
 
	if (pressure_get_i2c_handle()->Instance->ISR & (I2C_FLAG_BERR | I2C_FLAG_ARLO | I2C_FLAG_OVR)) {
 
		HAL_I2C_ER_IRQHandler(pressure_get_i2c_handle());
 
	} else {
 
		HAL_I2C_EV_IRQHandler(pressure_get_i2c_handle());
 
	}
 
}
 
 
void DMA1_Channel1_IRQHandler(void)
 
{
 
  HAL_DMA_IRQHandler(adc__hdma_gethandle());
 
}
0 comments (0 inline, 0 general)