Compare commits
39 Commits
117ba3202c
...
abfcc5bab5
Author | SHA1 | Date | |
---|---|---|---|
abfcc5bab5 | |||
28efb35679 | |||
293480dbbb | |||
df649b3ba5 | |||
a3925be518 | |||
b1e57d125b | |||
72f04af872 | |||
3d2f391749 | |||
6b38f3945e | |||
cae7fe1ed2 | |||
7799cdc871 | |||
53c2820cc4 | |||
bf83a6c0eb | |||
d192bac6c9 | |||
8cd4d9b60e | |||
4f8fe7ba39 | |||
d145aa3661 | |||
c9b90a679e | |||
ee3249beca | |||
cc32a3092a | |||
e65c4d612c | |||
7940c95b23 | |||
5bbbc9fe44 | |||
4c9c1ff2c8 | |||
0eb025d3d4 | |||
87eb642adc | |||
5c9846fce3 | |||
063ed8bb51 | |||
3ccc0ca0f3 | |||
9370ddbadd | |||
ac75969758 | |||
c74299dc0d | |||
8d41a30bff | |||
8b5bbd3e9a | |||
107a454051 | |||
01d4b75921 | |||
8878d1fd10 | |||
3300c5eebd | |||
0f1d8b71d7 |
38
.cproject
38
.cproject
@ -24,7 +24,7 @@
|
|||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.755606893" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.755606893" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1771260818" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1771260818" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1811760675" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VGTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1811760675" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VGTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.2006503660" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="16" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.2006503660" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="32" valueType="string"/>
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.188797436" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.188797436" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
<builder buildPath="${workspace_loc:/test1}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.901063855" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
<builder buildPath="${workspace_loc:/test1}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.901063855" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1851291017" name="MCU/MPU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1851291017" name="MCU/MPU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
@ -97,28 +97,28 @@
|
|||||||
<configuration artifactExtension="elf" 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.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.603779794" name="Release" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release">
|
<configuration artifactExtension="elf" 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.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.603779794" name="Release" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release">
|
||||||
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.603779794." name="/" resourcePath="">
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.603779794." name="/" resourcePath="">
|
||||||
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.846299435" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.846299435" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1996532596" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F407VGTx" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1996532596" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F407VGTx" valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1932354132" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1932354132" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.783288720" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.783288720" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.619251655" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.619251655" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1646548773" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1646548773" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1901965124" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1901965124" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.859080388" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VGTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.859080388" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VGTx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1202403298" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="16" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1202403298" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="32" valueType="string"/>
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.584865598" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.584865598" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
<builder buildPath="${workspace_loc:/test1}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1873374287" managedBuildOn="true" name="Gnu Make Builder.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
<builder buildPath="${workspace_loc:/test1}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1873374287" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1806292512" name="MCU/MPU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1806292512" name="MCU/MPU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.623288838" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.623288838" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.2013577938" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.2013577938" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1063892447" name="MCU/MPU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1063892447" name="MCU/MPU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.318905510" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.318905510" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.187906977" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.187906977" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.516585832" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.516585832" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
<listOptionValue builtIn="false" value="STM32F407xx"/>
|
<listOptionValue builtIn="false" value="STM32F407xx"/>
|
||||||
</option>
|
</option>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1500062626" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1500062626" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/>
|
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/>
|
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/>
|
||||||
@ -128,11 +128,11 @@
|
|||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.219678164" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.219678164" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1427603543" name="MCU/MPU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1427603543" name="MCU/MPU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.130697829" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.130697829" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1547171342" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1547171342" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1754531090" name="MCU/MPU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1754531090" name="MCU/MPU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.610449053" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld}" valueType="string"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.610449053" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32F407VGTX_FLASH.ld}" valueType="string"/>
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.1602204541" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.1602204541" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
@ -150,7 +150,7 @@
|
|||||||
</toolChain>
|
</toolChain>
|
||||||
</folderInfo>
|
</folderInfo>
|
||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
<entry excluding="Src/mock_lcd.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
</sourceEntries>
|
</sourceEntries>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
#ifndef __EEPROM_24AA02E48
|
#ifndef __EEPROM_24AA02E48
|
||||||
#define __EEPROM_24AA02E48
|
#define __EEPROM_24AA02E48
|
||||||
|
|
||||||
void EEPROM_24AA02E48_run_test(void);
|
int EEPROM_24AA02E48_run_test(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef __CS43L22
|
#ifndef __CS43L22
|
||||||
#define __CS43L22
|
#define __CS43L22
|
||||||
|
|
||||||
void CS43L22_run_test(void);
|
int CS43L22_run_test(void);
|
||||||
void CS43L22_cleanup(void);
|
void CS43L22_cleanup(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
18
Core/Inc/DHT11.h
Normal file
18
Core/Inc/DHT11.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef __DHT11
|
||||||
|
#define __DHT11
|
||||||
|
|
||||||
|
#define SKIP_LOW while (!(GPIOD->IDR & 0x0800)) {}
|
||||||
|
#define SKIP_HIGH while (GPIOD->IDR & 0x0800) {}
|
||||||
|
|
||||||
|
__attribute__((packed))
|
||||||
|
struct DHT11_Data {
|
||||||
|
uint8_t humid_integral;
|
||||||
|
uint8_t humid_decimal;
|
||||||
|
uint8_t temp_integral;
|
||||||
|
uint8_t temp_decimal;
|
||||||
|
uint8_t crc;
|
||||||
|
};
|
||||||
|
|
||||||
|
int DHT11_run_test(void);
|
||||||
|
|
||||||
|
#endif
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
extern ADC_HandleTypeDef hadc1;
|
extern ADC_HandleTypeDef hadc1;
|
||||||
|
|
||||||
void DNI_show_celsius(void);
|
int DNI_show_celsius(void);
|
||||||
void DNI_show_fahrenheit(void);
|
int DNI_show_fahrenheit(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
11
Core/Inc/KSZ8081RND.h
Normal file
11
Core/Inc/KSZ8081RND.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef __KSZ8081RND
|
||||||
|
#define __KSZ8081RND
|
||||||
|
|
||||||
|
|
||||||
|
int KSZ8081RND_run_test(void);
|
||||||
|
|
||||||
|
int ReadRegister(uint32_t reg, uint16_t *value);
|
||||||
|
int WriteRegister(uint32_t reg, uint16_t value);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef __LIS302DL
|
#ifndef __LIS302DL
|
||||||
#define __LIS302DL
|
#define __LIS302DL
|
||||||
|
|
||||||
void LIS302DL_run_test(void);
|
int LIS302DL_run_test(void);
|
||||||
void LIS302DL_run_test_dynamic(void);
|
int LIS302DL_run_test_dynamic(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
8
Core/Inc/LSM9DS1.h
Normal file
8
Core/Inc/LSM9DS1.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __LSM9DS1
|
||||||
|
#define __LSM9DS1
|
||||||
|
|
||||||
|
int LSM9DS1_test_accel(void);
|
||||||
|
void LSM9DS1_cleanup_accel(void);
|
||||||
|
int LSM9DS1_test_magnet(void);
|
||||||
|
|
||||||
|
#endif
|
6
Core/Inc/MP45DT02.h
Normal file
6
Core/Inc/MP45DT02.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef __MP45DT02
|
||||||
|
#define __MP45DT02
|
||||||
|
|
||||||
|
int MP45DT02_run_test(void);
|
||||||
|
|
||||||
|
#endif
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef __PCA9685
|
#ifndef __PCA9685
|
||||||
#define __PCA9685
|
#define __PCA9685
|
||||||
|
|
||||||
void PCA9685_run_test(void);
|
int PCA9685_run_test(void);
|
||||||
void PCA9685_cleanup(void);
|
void PCA9685_cleanup(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef __SST25VF016B
|
#ifndef __SST25VF016B
|
||||||
#define __SST25VF016B
|
#define __SST25VF016B
|
||||||
|
|
||||||
void SST25VF016B_run_test(void);
|
int SST25VF016B_run_test(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#define DISPLAY_RW ((uint16_t) (0x1U << 10))
|
#define DISPLAY_RW ((uint16_t) (0x1U << 10))
|
||||||
#define DISPLAY_ENA ((uint16_t) (0x1U << 11))
|
#define DISPLAY_ENA ((uint16_t) (0x1U << 11))
|
||||||
|
|
||||||
|
#define DISPLAY_FRAMES_AVAILABLE 14
|
||||||
|
|
||||||
#define DISPLAY_POLL_UNTIL_READY do { while (display_read_status() & 0x80) {} } while (0)
|
#define DISPLAY_POLL_UNTIL_READY do { while (display_read_status() & 0x80) {} } while (0)
|
||||||
|
|
||||||
#define DISPLAY_SET_INCREMENT do { display_write_instruction_byte(0x06); } while (0)
|
#define DISPLAY_SET_INCREMENT do { display_write_instruction_byte(0x06); } while (0)
|
||||||
@ -16,11 +18,17 @@
|
|||||||
|
|
||||||
#define DISPLAY_CLEAR do { display_write_instruction_byte(0x01); } while (0)
|
#define DISPLAY_CLEAR do { display_write_instruction_byte(0x01); } while (0)
|
||||||
|
|
||||||
|
struct Display_emu_state {
|
||||||
|
size_t cursor_offset:5;
|
||||||
|
size_t next:1;
|
||||||
|
};
|
||||||
|
|
||||||
void display_init(void);
|
void display_init(void);
|
||||||
uint8_t display_read_status(void);
|
|
||||||
void display_write_instruction_byte(uint8_t code);
|
void display_write_instruction_byte(uint8_t code);
|
||||||
void display_write_data_byte(uint8_t code);
|
void display_write_data_byte(uint8_t code);
|
||||||
void display_write_data_seq(char *codes);
|
void display_write_data_seq(char *codes);
|
||||||
|
void display_to_framebuffer(void);
|
||||||
|
void display_to_direct(void);
|
||||||
|
void display_load(uint32_t frame_no);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,6 +32,8 @@ extern "C" {
|
|||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
/* #define HAL_SD_MODULE_ENABLED */
|
/* #define HAL_SD_MODULE_ENABLED */
|
||||||
/* #define HAL_MMC_MODULE_ENABLED */
|
/* #define HAL_MMC_MODULE_ENABLED */
|
||||||
#define HAL_SPI_MODULE_ENABLED
|
#define HAL_SPI_MODULE_ENABLED
|
||||||
/* #define HAL_TIM_MODULE_ENABLED */
|
#define HAL_TIM_MODULE_ENABLED
|
||||||
/* #define HAL_UART_MODULE_ENABLED */
|
/* #define HAL_UART_MODULE_ENABLED */
|
||||||
/* #define HAL_USART_MODULE_ENABLED */
|
/* #define HAL_USART_MODULE_ENABLED */
|
||||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
extern I2C_HandleTypeDef hi2c1;
|
extern I2C_HandleTypeDef hi2c1;
|
||||||
|
|
||||||
void EEPROM_24AA02E48_run_test(void)
|
int EEPROM_24AA02E48_run_test(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("24AA02E48 EEPROM");
|
display_write_data_seq("24AA02E48 EEPROM");
|
||||||
@ -13,9 +13,9 @@ void EEPROM_24AA02E48_run_test(void)
|
|||||||
size_t err_count = 0;
|
size_t err_count = 0;
|
||||||
|
|
||||||
// write the Address Pointer register
|
// write the Address Pointer register
|
||||||
uint8_t data_buffer[13];
|
uint8_t data_buffer[9];
|
||||||
data_buffer[12] = '\0';
|
data_buffer[8] = '\0';
|
||||||
data_buffer[0] = 0xF4;
|
data_buffer[0] = 0xF8;
|
||||||
|
|
||||||
for (size_t t = 0; t < 5; t++) {
|
for (size_t t = 0; t < 5; t++) {
|
||||||
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0xA0, data_buffer, 1, 2000);
|
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0xA0, data_buffer, 1, 2000);
|
||||||
@ -26,12 +26,14 @@ void EEPROM_24AA02E48_run_test(void)
|
|||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("24AA02E48 EEPROM");
|
display_write_data_seq("24AA02E48 EEPROM");
|
||||||
|
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("W ");
|
display_write_data_seq("W ");
|
||||||
display_write_data_byte('1' + t);
|
display_write_data_byte('1' + t);
|
||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (op_result) {
|
switch (op_result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -42,15 +44,13 @@ void EEPROM_24AA02E48_run_test(void)
|
|||||||
display_write_data_seq("TIMEOUT");
|
display_write_data_seq("TIMEOUT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_Delay(2000);
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t t = 0; t < 5; t++) {
|
for (size_t t = 0; t < 5; t++) {
|
||||||
op_result = HAL_I2C_Master_Receive(&hi2c1, 0xA1, data_buffer, 12, 2000);
|
op_result = HAL_I2C_Master_Receive(&hi2c1, 0xA1, data_buffer, 8, 2000);
|
||||||
|
|
||||||
if (op_result) {
|
if (op_result) {
|
||||||
err_count++;
|
err_count++;
|
||||||
@ -58,12 +58,14 @@ void EEPROM_24AA02E48_run_test(void)
|
|||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("24AA02E48 EEPROM");
|
display_write_data_seq("24AA02E48 EEPROM");
|
||||||
|
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("R ");
|
display_write_data_seq("R ");
|
||||||
display_write_data_byte('1' + t);
|
display_write_data_byte('1' + t);
|
||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (op_result) {
|
switch (op_result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -74,25 +76,16 @@ void EEPROM_24AA02E48_run_test(void)
|
|||||||
display_write_data_seq("TIMEOUT");
|
display_write_data_seq("TIMEOUT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_Delay(2000);
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY_CLEAR;
|
if (!err_count) {
|
||||||
display_write_data_seq("24AA02E48 EEPROM");
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
|
||||||
if (err_count) {
|
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
|
||||||
display_write_data_byte('0' + err_count / 10 % 10);
|
|
||||||
display_write_data_byte('0' + err_count % 10);
|
|
||||||
display_write_data_seq("E ");
|
|
||||||
display_write_data_seq(data_buffer);
|
|
||||||
} else {
|
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
|
||||||
display_write_data_seq("OK ");
|
display_write_data_seq("OK ");
|
||||||
display_write_data_seq(data_buffer);
|
display_write_data_seq((char *) data_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return !!err_count;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
extern I2C_HandleTypeDef hi2c1;
|
extern I2C_HandleTypeDef hi2c1;
|
||||||
|
|
||||||
void CS43L22_run_test(void)
|
int CS43L22_run_test(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("CS43L22 Audio");
|
display_write_data_seq("CS43L22 Audio");
|
||||||
@ -31,6 +31,8 @@ void CS43L22_run_test(void)
|
|||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (op_result) {
|
switch (op_result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -52,12 +54,16 @@ void CS43L22_run_test(void)
|
|||||||
display_write_data_seq("CS43L22 Audio");
|
display_write_data_seq("CS43L22 Audio");
|
||||||
|
|
||||||
if (err_count) {
|
if (err_count) {
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_byte('0' + err_count % 10);
|
display_write_data_byte('0' + err_count % 10);
|
||||||
display_write_data_seq(" Errors");
|
display_write_data_seq(" Errors");
|
||||||
|
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("OK");
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
118
Core/Src/DHT11.c
Normal file
118
Core/Src/DHT11.c
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "generic_macros.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "DHT11.h"
|
||||||
|
|
||||||
|
extern TIM_HandleTypeDef htim2;
|
||||||
|
|
||||||
|
static inline void wait(uint32_t wait_us)
|
||||||
|
{
|
||||||
|
uint32_t target_time = TIM2->CNT;
|
||||||
|
target_time += wait_us << 4;
|
||||||
|
|
||||||
|
while (TIM2->CNT < target_time) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline size_t dht11_measure_high_duration(void)
|
||||||
|
{
|
||||||
|
SKIP_LOW;
|
||||||
|
uint32_t start_time = TIM2->CNT;
|
||||||
|
SKIP_HIGH;
|
||||||
|
uint32_t end_time = TIM2->CNT;
|
||||||
|
|
||||||
|
// elapsed_time > 49us ? 1 : 0
|
||||||
|
return (end_time - start_time) > (49 << 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
static size_t dht11_read_value(struct DHT11_Data *data)
|
||||||
|
{
|
||||||
|
// treat data as a normal array to simplify read loop
|
||||||
|
uint8_t *buffer = (uint8_t *) data;
|
||||||
|
|
||||||
|
register uint32_t read_register = 0;
|
||||||
|
|
||||||
|
HAL_TIM_Base_Start(&htim2);
|
||||||
|
|
||||||
|
// try to trigger the output
|
||||||
|
for (int t = 0; t < 10; t++) {
|
||||||
|
TIM2->CNT = 0;
|
||||||
|
|
||||||
|
GPIOD->MODER |= 0x00400000; // enable output mode on GPIOD 11
|
||||||
|
|
||||||
|
GPIOD->BSRR = GPIO_PIN_11; // enable DHT11
|
||||||
|
wait(50000); // hold HIGH for 50 ms
|
||||||
|
GPIOD->BSRR = GPIO_PIN_11 << 16; // start signal
|
||||||
|
wait(30000); // hold it for 30 ms
|
||||||
|
GPIOD->BSRR = GPIO_PIN_11; // pull up, DHT will now take control over the connection
|
||||||
|
|
||||||
|
wait(100);
|
||||||
|
GPIOD->MODER &= 0xFF3FFFFF; // switch GPIOD 11 to input mode
|
||||||
|
|
||||||
|
// reading pull down from DHT11
|
||||||
|
SKIP_LOW;
|
||||||
|
|
||||||
|
// waiting for response
|
||||||
|
for (size_t i = TIM2->CNT + (200000 << 4); TIM2->CNT <= i; )
|
||||||
|
if (!(GPIOD->IDR & 0x0800))
|
||||||
|
goto reading_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if didn't exit through goto, then DHT11 awaiting has timed out
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
reading_data:
|
||||||
|
// read 5 bytes of data
|
||||||
|
for (size_t i = 0; i < 5; i++) {
|
||||||
|
for (register size_t j = 0; j < 8; j++) {
|
||||||
|
read_register <<= 1;
|
||||||
|
read_register |= dht11_measure_high_duration();
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer[i] = (uint8_t) read_register;
|
||||||
|
}
|
||||||
|
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int DHT11_run_test(void)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("DHT11 Temp+Humid");
|
||||||
|
|
||||||
|
struct DHT11_Data data;
|
||||||
|
size_t result = dht11_read_value(&data);
|
||||||
|
|
||||||
|
size_t checksum_mismatch = ((
|
||||||
|
data.humid_decimal
|
||||||
|
+ data.humid_integral
|
||||||
|
+ data.temp_decimal
|
||||||
|
+ data.temp_integral
|
||||||
|
) & 0xFF) != data.crc;
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq("StartTimeout");
|
||||||
|
} else if (checksum_mismatch) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq("CRC Fault");
|
||||||
|
} else {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 7);
|
||||||
|
display_write_data_byte('0' + (data.humid_integral/10)%10);
|
||||||
|
display_write_data_byte('0' + (data.humid_integral)%10);
|
||||||
|
display_write_data_seq("% ");
|
||||||
|
|
||||||
|
display_write_data_byte('0' + (data.temp_integral/10)%10);
|
||||||
|
display_write_data_byte('0' + (data.temp_integral)%10);
|
||||||
|
display_write_data_byte('.');
|
||||||
|
display_write_data_byte('0' + data.temp_decimal);
|
||||||
|
display_write_data_seq("C");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (result || checksum_mismatch);
|
||||||
|
}
|
@ -3,25 +3,23 @@
|
|||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "DNI.h"
|
#include "DNI.h"
|
||||||
|
|
||||||
static uint32_t DNI_read(void)
|
static int DNI_read(void)
|
||||||
{
|
{
|
||||||
HAL_ADC_Start(&hadc1);
|
HAL_ADC_Start(&hadc1);
|
||||||
if (HAL_ADC_PollForConversion(&hadc1, 100) != HAL_OK)
|
|
||||||
PANIC(0x4000);
|
|
||||||
|
|
||||||
return HAL_ADC_GetValue(&hadc1);
|
HAL_StatusTypeDef s = HAL_ADC_PollForConversion(&hadc1, 100);
|
||||||
|
|
||||||
|
if (HAL_OK != s)
|
||||||
|
return -s;
|
||||||
|
else
|
||||||
|
return HAL_ADC_GetValue(&hadc1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DNI_convert_to_celsius(uint32_t value)
|
static int DNI_convert_to_celsius(int value)
|
||||||
{
|
{
|
||||||
return (2512 - value) << 2;
|
return (2512 - value) << 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DNI_convert_to_fahrenheit(uint32_t value)
|
|
||||||
{
|
|
||||||
return (2953 - value) * 50 / 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DNI_print(int temperature)
|
static void DNI_print(int temperature)
|
||||||
{
|
{
|
||||||
int add_sign = temperature < 0;
|
int add_sign = temperature < 0;
|
||||||
@ -50,49 +48,68 @@ static void DNI_print(int temperature)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (add_sign) {
|
if (add_sign) {
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 9);
|
||||||
display_write_data_byte('-');
|
display_write_data_byte('-');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DNI_print_celsius(int temperature)
|
static void DNI_print_celsius(int temperature)
|
||||||
{
|
{
|
||||||
DISPLAY_SET_CURSOR(1, 7);
|
DISPLAY_SET_CURSOR(1, 15);
|
||||||
DISPLAY_SET_DECREMENT;
|
DISPLAY_SET_DECREMENT;
|
||||||
display_write_data_seq("C ");
|
display_write_data_seq("C ");
|
||||||
|
|
||||||
DNI_print(temperature);
|
DNI_print(temperature);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DNI_print_fahrenheit(int temperature)
|
static void print_ok(void)
|
||||||
{
|
{
|
||||||
DISPLAY_SET_CURSOR(1, 7);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
DISPLAY_SET_DECREMENT;
|
DISPLAY_SET_INCREMENT;
|
||||||
display_write_data_seq("F ");
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
DNI_print(temperature);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DNI_show_celsius(void)
|
static void print_error(int err_code)
|
||||||
|
{
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
DISPLAY_SET_INCREMENT;
|
||||||
|
|
||||||
|
switch (err_code) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
|
case HAL_ERROR:
|
||||||
|
display_write_data_seq("HAL_ERROR");
|
||||||
|
break;
|
||||||
|
case HAL_BUSY:
|
||||||
|
display_write_data_seq("HAL_BUSY");
|
||||||
|
break;
|
||||||
|
case HAL_TIMEOUT:
|
||||||
|
display_write_data_seq("HAL_TIMEOUT");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
display_write_data_seq("WRONG ERROR");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int DNI_show_celsius(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
DISPLAY_SET_INCREMENT;
|
DISPLAY_SET_INCREMENT;
|
||||||
|
|
||||||
display_write_data_seq("DNI Temperature");
|
display_write_data_seq("DNI Temperature");
|
||||||
|
|
||||||
uint32_t value = DNI_read();
|
int value = DNI_read();
|
||||||
int temp = DNI_convert_to_celsius(value);
|
|
||||||
DNI_print_celsius(temp);
|
if (value < 0) {
|
||||||
}
|
print_error(-value);
|
||||||
|
return 1;
|
||||||
void DNI_show_fahrenheit(void)
|
} else {
|
||||||
{
|
int temp = DNI_convert_to_celsius(value);
|
||||||
DISPLAY_CLEAR;
|
DNI_print_celsius(temp);
|
||||||
DISPLAY_SET_INCREMENT;
|
|
||||||
|
print_ok();
|
||||||
display_write_data_seq("DNI Temperature");
|
|
||||||
|
return 0;
|
||||||
uint32_t value = DNI_read();
|
}
|
||||||
int temp = DNI_convert_to_fahrenheit(value);
|
|
||||||
DNI_print_fahrenheit(temp);
|
|
||||||
}
|
}
|
||||||
|
138
Core/Src/KSZ8081RND.c
Normal file
138
Core/Src/KSZ8081RND.c
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "KSZ8081RND.h"
|
||||||
|
|
||||||
|
#define RW_TIMEOUT_US 500000
|
||||||
|
|
||||||
|
extern TIM_HandleTypeDef htim2;
|
||||||
|
|
||||||
|
int KSZ8081RND_run_test(void)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("KSZ8081RND ETH");
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
|
||||||
|
// enable clocks
|
||||||
|
__HAL_RCC_ETH_CLK_ENABLE();
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
|
|
||||||
|
// configure pins
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {};
|
||||||
|
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
|
||||||
|
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
|
||||||
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
|
||||||
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
// hardware reset KSZ8081RND
|
||||||
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_10, GPIO_PIN_RESET);
|
||||||
|
HAL_Delay(10);
|
||||||
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_10, GPIO_PIN_SET);
|
||||||
|
HAL_Delay(10);
|
||||||
|
|
||||||
|
// enable PLL and REF_CLK output from KSZ8081RND
|
||||||
|
uint16_t r;
|
||||||
|
|
||||||
|
if (ReadRegister(0x1F, &r)) {
|
||||||
|
display_write_data_seq("READ ERROR");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
r |= (1 << 7);
|
||||||
|
|
||||||
|
if (WriteRegister(0x1F, r)) {
|
||||||
|
display_write_data_seq("WRITE ERROR");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// switch MAC to RMII interface
|
||||||
|
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
||||||
|
SYSCFG->PMC |= (1 << 23);
|
||||||
|
(void)SYSCFG->PMC;
|
||||||
|
|
||||||
|
// check if software reset happens on MAC
|
||||||
|
TIM2->CNT = 0;
|
||||||
|
|
||||||
|
ETH->DMABMR |= 1; // assert software reset
|
||||||
|
HAL_TIM_Base_Start(&htim2);
|
||||||
|
|
||||||
|
while (ETH->DMABMR & 1) {
|
||||||
|
if (TIM2->CNT > (500000 << 4)) {
|
||||||
|
// MAC software reset timed out -> no REF_CLK output from PHY?
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
display_write_data_seq("SR ERROR");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
display_write_data_seq("OK");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReadRegister(uint32_t reg, uint16_t *value)
|
||||||
|
{
|
||||||
|
uint16_t tmpreg1;
|
||||||
|
|
||||||
|
tmpreg1 = (reg << 6);
|
||||||
|
tmpreg1 |= 1;
|
||||||
|
|
||||||
|
ETH->MACMIIAR = tmpreg1;
|
||||||
|
|
||||||
|
TIM2->CNT = 0;
|
||||||
|
HAL_TIM_Base_Start(&htim2);
|
||||||
|
|
||||||
|
while (ETH->MACMIIAR & 1) {
|
||||||
|
if (TIM2->CNT > (RW_TIMEOUT_US << 4)) {
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
*value = (uint16_t) (ETH->MACMIIDR);
|
||||||
|
return HAL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WriteRegister(uint32_t reg, uint16_t value)
|
||||||
|
{
|
||||||
|
uint32_t tmpreg1;
|
||||||
|
|
||||||
|
tmpreg1 = (reg << 6);
|
||||||
|
tmpreg1 |= 3;
|
||||||
|
|
||||||
|
ETH->MACMIIDR = value;
|
||||||
|
ETH->MACMIIAR = tmpreg1;
|
||||||
|
|
||||||
|
TIM2->CNT = 0;
|
||||||
|
HAL_TIM_Base_Start(&htim2);
|
||||||
|
|
||||||
|
while (ETH->MACMIIAR & 1) {
|
||||||
|
if (TIM2->CNT > (RW_TIMEOUT_US << 4)) {
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HAL_TIM_Base_Stop(&htim2);
|
||||||
|
return 0;
|
||||||
|
}
|
@ -33,7 +33,7 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
|||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("LIS302DL Accel ");
|
display_write_data_seq("LIS302DL Accel ");
|
||||||
display_write_data_seq(postfix);
|
display_write_data_seq(postfix);
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq(prefix);
|
display_write_data_seq(prefix);
|
||||||
display_write_data_byte(' ');
|
display_write_data_byte(' ');
|
||||||
|
|
||||||
@ -43,6 +43,8 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
|||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -53,8 +55,6 @@ static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, siz
|
|||||||
display_write_data_seq("TIMEOUT");
|
display_write_data_seq("TIMEOUT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_Delay(2000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void retrieve_data(size_t *err_count, uint8_t *data_xyz, char *postfix)
|
static void retrieve_data(size_t *err_count, uint8_t *data_xyz, char *postfix)
|
||||||
@ -103,7 +103,7 @@ static void retrieve_data(size_t *err_count, uint8_t *data_xyz, char *postfix)
|
|||||||
FAILSAFE_POST_OP("RZ");
|
FAILSAFE_POST_OP("RZ");
|
||||||
}
|
}
|
||||||
|
|
||||||
void LIS302DL_run_test(void)
|
int LIS302DL_run_test(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("LIS302DL Accel");
|
display_write_data_seq("LIS302DL Accel");
|
||||||
@ -113,52 +113,16 @@ void LIS302DL_run_test(void)
|
|||||||
|
|
||||||
retrieve_data(&err_count, data_xyz, "");
|
retrieve_data(&err_count, data_xyz, "");
|
||||||
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel");
|
|
||||||
|
|
||||||
// output retrieved values
|
|
||||||
print_at(data_xyz[2], 14);
|
|
||||||
print_at(data_xyz[1], 11);
|
|
||||||
print_at(data_xyz[0], 8);
|
|
||||||
|
|
||||||
// print the execution stats
|
// print the execution stats
|
||||||
if (err_count) {
|
if (!err_count) {
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_byte('0' + err_count / 10 % 10);
|
|
||||||
display_write_data_byte('0' + err_count % 10);
|
|
||||||
display_write_data_seq(" errs");
|
|
||||||
} else {
|
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
|
||||||
display_write_data_seq("OK");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LIS302DL_run_test_dynamic(void)
|
|
||||||
{
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel D");
|
|
||||||
|
|
||||||
size_t err_count = 0;
|
|
||||||
uint8_t data_xyz[3];
|
|
||||||
|
|
||||||
retrieve_data(&err_count, data_xyz, "D");
|
|
||||||
|
|
||||||
DISPLAY_CLEAR;
|
|
||||||
display_write_data_seq("LIS302DL Accel D");
|
|
||||||
|
|
||||||
// output retrieved values
|
|
||||||
print_at(data_xyz[2], 14);
|
|
||||||
print_at(data_xyz[1], 11);
|
|
||||||
print_at(data_xyz[0], 8);
|
|
||||||
|
|
||||||
// print the execution stats
|
|
||||||
if (err_count) {
|
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
|
||||||
display_write_data_byte('0' + err_count / 10 % 10);
|
|
||||||
display_write_data_byte('0' + err_count % 10);
|
|
||||||
display_write_data_seq(" errs");
|
|
||||||
} else {
|
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
|
||||||
display_write_data_seq("OK");
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
// output retrieved values
|
||||||
|
print_at(data_xyz[2], 14);
|
||||||
|
print_at(data_xyz[1], 11);
|
||||||
|
print_at(data_xyz[0], 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return !!err_count;
|
||||||
}
|
}
|
||||||
|
127
Core/Src/LSM9DS1.c
Normal file
127
Core/Src/LSM9DS1.c
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "LSM9DS1.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
|
||||||
|
#define FAILSAFE_PRE_OP for (size_t t = 0; t < 5; t++) {
|
||||||
|
#define FAILSAFE_POST_OP_ACCEL(prefix) if (op_result) print_error_accel(op_result, &err_count, t, prefix); else break; }
|
||||||
|
#define FAILSAFE_POST_OP_MAGNET(prefix) if (op_result) print_error_magnet(op_result, &err_count, t, prefix); else break; }
|
||||||
|
|
||||||
|
extern I2C_HandleTypeDef hi2c1;
|
||||||
|
|
||||||
|
static void print_error_message(HAL_StatusTypeDef result, size_t *err_count, size_t t, char *prefix)
|
||||||
|
{
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq(prefix);
|
||||||
|
display_write_data_byte(' ');
|
||||||
|
|
||||||
|
(*err_count)++;
|
||||||
|
|
||||||
|
display_write_data_byte('1' + t);
|
||||||
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
|
switch (result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
|
case HAL_ERROR:
|
||||||
|
display_write_data_seq("ERROR");
|
||||||
|
break;
|
||||||
|
case HAL_BUSY:
|
||||||
|
display_write_data_seq("BUSY");
|
||||||
|
break;
|
||||||
|
case HAL_TIMEOUT:
|
||||||
|
display_write_data_seq("TIMEOUT");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_error_accel(HAL_StatusTypeDef result, size_t *err_count, size_t t, char *prefix)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("LSM9DS1 Accel");
|
||||||
|
|
||||||
|
print_error_message(result, err_count, t, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_error_magnet(HAL_StatusTypeDef result, size_t *err_count, size_t t, char *prefix)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("LSM9DS1 Magnet");
|
||||||
|
|
||||||
|
print_error_message(result, err_count, t, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
int LSM9DS1_test_accel(void)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("LSM9DS1 Accel");
|
||||||
|
|
||||||
|
HAL_StatusTypeDef op_result;
|
||||||
|
uint8_t buffer[6];
|
||||||
|
size_t err_count = 0;
|
||||||
|
|
||||||
|
// enable sampling at 10 Hz
|
||||||
|
buffer[0] = 0x20;
|
||||||
|
buffer[1] = 0x20;
|
||||||
|
FAILSAFE_PRE_OP;
|
||||||
|
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0xD6, buffer, 2, 1000);
|
||||||
|
FAILSAFE_POST_OP_ACCEL("E");
|
||||||
|
|
||||||
|
HAL_Delay(100);
|
||||||
|
|
||||||
|
// set future read address
|
||||||
|
buffer[0] = 0x28;
|
||||||
|
FAILSAFE_PRE_OP;
|
||||||
|
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0xD6, buffer, 1, 1000);
|
||||||
|
FAILSAFE_POST_OP_ACCEL("A");
|
||||||
|
|
||||||
|
// read from registers sequentially
|
||||||
|
FAILSAFE_PRE_OP;
|
||||||
|
op_result = HAL_I2C_Master_Receive(&hi2c1, 0xD7, buffer, 6, 1000);
|
||||||
|
FAILSAFE_POST_OP_ACCEL("R");
|
||||||
|
|
||||||
|
if (!err_count) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LSM9DS1_cleanup_accel(void)
|
||||||
|
{
|
||||||
|
// power down the accelerometer
|
||||||
|
uint8_t buffer[2] = {0x20, 0x00};
|
||||||
|
HAL_I2C_Master_Transmit(&hi2c1, 0xD6, buffer, 2, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
int LSM9DS1_test_magnet(void)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("LSM9DS1 Magnet");
|
||||||
|
|
||||||
|
HAL_StatusTypeDef op_result;
|
||||||
|
uint8_t buffer[6];
|
||||||
|
size_t err_count = 0;
|
||||||
|
|
||||||
|
// set future read address
|
||||||
|
buffer[0] = 0x28;
|
||||||
|
FAILSAFE_PRE_OP;
|
||||||
|
op_result = HAL_I2C_Master_Transmit(&hi2c1, 0x3C, buffer, 1, 1000);
|
||||||
|
FAILSAFE_POST_OP_MAGNET("A");
|
||||||
|
|
||||||
|
// read from registers sequentially
|
||||||
|
FAILSAFE_PRE_OP;
|
||||||
|
op_result = HAL_I2C_Master_Receive(&hi2c1, 0x3D, buffer, 6, 1000);
|
||||||
|
FAILSAFE_POST_OP_MAGNET("R");
|
||||||
|
|
||||||
|
if (!err_count) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
83
Core/Src/MP45DT02.c
Normal file
83
Core/Src/MP45DT02.c
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "MP45DT02.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
|
||||||
|
#define SAMPLE_AMOUNT 256
|
||||||
|
|
||||||
|
struct TestResult {
|
||||||
|
unsigned int lo_present:1;
|
||||||
|
unsigned int hi_present:1;
|
||||||
|
};
|
||||||
|
|
||||||
|
int MP45DT02_run_test(void)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("MP45DT02 Mic");
|
||||||
|
|
||||||
|
uint16_t sample_buffer[SAMPLE_AMOUNT];
|
||||||
|
|
||||||
|
for (size_t t = 0; t < 5; t++) {
|
||||||
|
// gather samples
|
||||||
|
register unsigned int reset_value = (GPIO_PIN_10 << 16);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < SAMPLE_AMOUNT; i++) {
|
||||||
|
sample_buffer[i] = 0;
|
||||||
|
for (size_t j = 0; j < 16; j++) {
|
||||||
|
for (int k = 0; k < 16; k++) {
|
||||||
|
GPIOB->BSRR = reset_value;
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
asm("nop");
|
||||||
|
GPIOB->BSRR = GPIO_PIN_10;
|
||||||
|
}
|
||||||
|
sample_buffer[i] <<= 1;
|
||||||
|
sample_buffer[i] |= (GPIOC->IDR & (1 << 3)) >> 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TestResult res = {};
|
||||||
|
|
||||||
|
// look for zeros
|
||||||
|
for (size_t i = 0; i < SAMPLE_AMOUNT / 2; i++)
|
||||||
|
if (~((uint32_t *) sample_buffer)[i]) {
|
||||||
|
res.lo_present = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for ones
|
||||||
|
for (size_t i = 0; i < SAMPLE_AMOUNT / 2; i++)
|
||||||
|
if (((uint32_t *) sample_buffer)[i]) {
|
||||||
|
res.hi_present = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("MP45DT02 Mic");
|
||||||
|
|
||||||
|
if (t) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 14);
|
||||||
|
display_write_data_byte('T');
|
||||||
|
display_write_data_byte('0' + t + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
if (res.lo_present & res.hi_present) {
|
||||||
|
display_write_data_seq("OK");
|
||||||
|
return 0;
|
||||||
|
} else if (res.lo_present) {
|
||||||
|
display_write_data_seq("ALWAYS LO");
|
||||||
|
} else if (res.hi_present) {
|
||||||
|
display_write_data_seq("ALWAYS HI");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
extern I2C_HandleTypeDef hi2c1;
|
extern I2C_HandleTypeDef hi2c1;
|
||||||
|
|
||||||
void PCA9685_run_test(void)
|
int PCA9685_run_test(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("PCA9685 PWM");
|
display_write_data_seq("PCA9685 PWM");
|
||||||
@ -30,7 +30,7 @@ void PCA9685_run_test(void)
|
|||||||
|
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("PCA9685 PWM");
|
display_write_data_seq("PCA9685 PWM");
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
|
||||||
display_write_data_seq("B");
|
display_write_data_seq("B");
|
||||||
display_write_data_byte('0' + i);
|
display_write_data_byte('0' + i);
|
||||||
@ -40,6 +40,8 @@ void PCA9685_run_test(void)
|
|||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (op_result) {
|
switch (op_result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -62,13 +64,17 @@ void PCA9685_run_test(void)
|
|||||||
display_write_data_seq("PCA9685 PWM");
|
display_write_data_seq("PCA9685 PWM");
|
||||||
|
|
||||||
if (err_count) {
|
if (err_count) {
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_byte('0' + err_count / 10 % 10);
|
display_write_data_byte('0' + err_count / 10 % 10);
|
||||||
display_write_data_byte('0' + err_count % 10);
|
display_write_data_byte('0' + err_count % 10);
|
||||||
display_write_data_seq(" errors");
|
display_write_data_seq(" errors");
|
||||||
|
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("OK OUT ENABLED");
|
display_write_data_seq("OK");
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
|
|
||||||
extern SPI_HandleTypeDef hspi1;
|
extern SPI_HandleTypeDef hspi1;
|
||||||
|
|
||||||
void SST25VF016B_run_test(void)
|
int SST25VF016B_run_test(void)
|
||||||
{
|
{
|
||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("SST25VF016B Flas");
|
display_write_data_seq("SST25VF016B Flas");
|
||||||
|
|
||||||
HAL_StatusTypeDef op_result;
|
HAL_StatusTypeDef op_result;
|
||||||
size_t err_count = 0;
|
size_t err_count = 0;
|
||||||
|
size_t chip_id_fault = 0;
|
||||||
|
|
||||||
uint8_t tx_buffer[8] = {0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
uint8_t tx_buffer[8] = {0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
uint8_t rx_buffer[9];
|
uint8_t rx_buffer[9];
|
||||||
@ -29,11 +30,13 @@ void SST25VF016B_run_test(void)
|
|||||||
DISPLAY_CLEAR;
|
DISPLAY_CLEAR;
|
||||||
display_write_data_seq("SST25VF016B Flas");
|
display_write_data_seq("SST25VF016B Flas");
|
||||||
|
|
||||||
DISPLAY_SET_CURSOR(1, 0);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_byte('1' + t);
|
display_write_data_byte('1' + t);
|
||||||
display_write_data_seq("/5 ");
|
display_write_data_seq("/5 ");
|
||||||
|
|
||||||
switch (op_result) {
|
switch (op_result) {
|
||||||
|
case HAL_OK:
|
||||||
|
break;
|
||||||
case HAL_ERROR:
|
case HAL_ERROR:
|
||||||
display_write_data_seq("ERROR");
|
display_write_data_seq("ERROR");
|
||||||
break;
|
break;
|
||||||
@ -44,8 +47,6 @@ void SST25VF016B_run_test(void)
|
|||||||
display_write_data_seq("TIMEOUT");
|
display_write_data_seq("TIMEOUT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_Delay(2000);
|
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -57,13 +58,49 @@ void SST25VF016B_run_test(void)
|
|||||||
display_write_data_seq("SST25VF016B Flas");
|
display_write_data_seq("SST25VF016B Flas");
|
||||||
|
|
||||||
if (err_count) {
|
if (err_count) {
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_byte('0' + err_count % 10);
|
display_write_data_byte('0' + err_count % 10);
|
||||||
display_write_data_seq(" Errors");
|
display_write_data_seq(" Errors");
|
||||||
|
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
DISPLAY_SET_CURSOR(1, 1);
|
for (size_t i = 0; i < 4; i += 2) {
|
||||||
|
// odd reads MUST result in 0xBF
|
||||||
|
if (rx_buffer[4+i] != 0xBF) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_byte('B');
|
||||||
|
display_write_data_byte('1'+i);
|
||||||
|
display_write_data_seq(" WRONG");
|
||||||
|
|
||||||
|
chip_id_fault = 1;
|
||||||
|
|
||||||
|
goto write_retrieved_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 1; i < 4; i += 2) {
|
||||||
|
// even reads MUST result in 0x41
|
||||||
|
if (rx_buffer[4+i] != 0x41) {
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
|
display_write_data_byte('B');
|
||||||
|
display_write_data_byte('1'+i);
|
||||||
|
display_write_data_seq(" WRONG");
|
||||||
|
|
||||||
|
chip_id_fault = 1;
|
||||||
|
|
||||||
|
goto write_retrieved_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 4);
|
||||||
display_write_data_seq("OK");
|
display_write_data_seq("OK");
|
||||||
DISPLAY_SET_CURSOR(1, 8);
|
|
||||||
display_write_data_seq((char) rx_buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_retrieved_data:
|
||||||
|
DISPLAY_SET_CURSOR(1, 12);
|
||||||
|
display_write_data_seq((char *) &(rx_buffer[4]));
|
||||||
|
|
||||||
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_7, GPIO_PIN_SET);
|
||||||
|
|
||||||
|
return (err_count || chip_id_fault);
|
||||||
}
|
}
|
||||||
|
114
Core/Src/lcd.c
114
Core/Src/lcd.c
@ -2,22 +2,45 @@
|
|||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "generic_macros.h"
|
#include "generic_macros.h"
|
||||||
|
|
||||||
|
static char display_framebuffer[16*2*DISPLAY_FRAMES_AVAILABLE];
|
||||||
|
size_t display_current_frame;
|
||||||
|
static size_t display_framebuffer_mode;
|
||||||
|
|
||||||
|
static struct Display_emu_state des;
|
||||||
|
|
||||||
void display_init(void)
|
void display_init(void)
|
||||||
{
|
{
|
||||||
|
// prepare virtual framebuffer
|
||||||
|
display_current_frame = 0;
|
||||||
|
display_framebuffer_mode = 0;
|
||||||
|
des.cursor_offset = 0;
|
||||||
|
des.next = 0;
|
||||||
|
memset(display_framebuffer, 0x20, 16*2*DISPLAY_FRAMES_AVAILABLE);
|
||||||
|
|
||||||
// switch to 4-bit 2-line mode
|
// switch to 4-bit 2-line mode
|
||||||
display_write_instruction_byte(0x28);
|
display_write_instruction_byte(0x28);
|
||||||
|
|
||||||
// clear display
|
// clear display
|
||||||
display_write_instruction_byte(0x01);
|
display_write_instruction_byte(0x01);
|
||||||
|
|
||||||
// enable display
|
// enable display
|
||||||
display_write_instruction_byte(0x0C);
|
display_write_instruction_byte(0x0C);
|
||||||
|
|
||||||
// move cursor to first line
|
// move cursor to first line
|
||||||
display_write_instruction_byte(0x80);
|
display_write_instruction_byte(0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t display_read_status(void)
|
void display_to_framebuffer(void)
|
||||||
|
{
|
||||||
|
display_framebuffer_mode = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void display_to_direct(void)
|
||||||
|
{
|
||||||
|
display_framebuffer_mode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint8_t display_read_status(void)
|
||||||
{
|
{
|
||||||
// make sure GPIOE is in correct mode
|
// make sure GPIOE is in correct mode
|
||||||
GPIOE->MODER = 0x00504000;
|
GPIOE->MODER = 0x00504000;
|
||||||
@ -43,7 +66,7 @@ uint8_t display_read_status(void)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_write_instruction_byte(uint8_t code)
|
static void display_write_instruction_byte_direct(uint8_t code)
|
||||||
{
|
{
|
||||||
DISPLAY_POLL_UNTIL_READY;
|
DISPLAY_POLL_UNTIL_READY;
|
||||||
|
|
||||||
@ -62,7 +85,37 @@ void display_write_instruction_byte(uint8_t code)
|
|||||||
GPIOE->BSRR = (DISPLAY_ENA << 16);
|
GPIOE->BSRR = (DISPLAY_ENA << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_write_data_byte(uint8_t code)
|
static void display_write_instruction_byte_framebuffer(uint8_t code)
|
||||||
|
{
|
||||||
|
// emulate physical display behavior on receiving instructions
|
||||||
|
if (code & 0x80) {
|
||||||
|
// decode new cursor offset
|
||||||
|
size_t offset = ((code & 0x40) >> 2) | (code & 0xF);
|
||||||
|
des.cursor_offset = offset;
|
||||||
|
} else if (code == 0x01) {
|
||||||
|
// reset screen
|
||||||
|
memset(&(display_framebuffer[16*2*display_current_frame]), 0x20, 16*2);
|
||||||
|
des.cursor_offset = 0;
|
||||||
|
des.next = 0;
|
||||||
|
} else if (code == 0x06) {
|
||||||
|
// set increment mode
|
||||||
|
des.next = 0;
|
||||||
|
} else if (code == 0x04) {
|
||||||
|
// set decrement mode
|
||||||
|
des.next = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void display_write_instruction_byte(uint8_t code)
|
||||||
|
{
|
||||||
|
if (display_framebuffer_mode) {
|
||||||
|
display_write_instruction_byte_framebuffer(code);
|
||||||
|
} else {
|
||||||
|
display_write_instruction_byte_direct(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void display_write_data_byte_direct(uint8_t code)
|
||||||
{
|
{
|
||||||
DISPLAY_POLL_UNTIL_READY;
|
DISPLAY_POLL_UNTIL_READY;
|
||||||
|
|
||||||
@ -81,12 +134,51 @@ void display_write_data_byte(uint8_t code)
|
|||||||
GPIOE->BSRR = DISPLAY_ENA << 16;
|
GPIOE->BSRR = DISPLAY_ENA << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void display_write_data_byte_framebuffer(uint8_t code)
|
||||||
|
{
|
||||||
|
if (display_current_frame >= DISPLAY_FRAMES_AVAILABLE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (((int) des.cursor_offset >= 32) || ((int) des.cursor_offset < 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
display_framebuffer[16*2*display_current_frame + des.cursor_offset] = (char) code;
|
||||||
|
des.cursor_offset += des.next ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void display_write_data_byte(uint8_t code)
|
||||||
|
{
|
||||||
|
if (display_framebuffer_mode) {
|
||||||
|
display_write_data_byte_framebuffer(code);
|
||||||
|
} else {
|
||||||
|
display_write_data_byte_direct(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void display_write_data_seq(char *codes)
|
void display_write_data_seq(char *codes)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < 16; i++) {
|
for (size_t i = 0; i < 16; i++) {
|
||||||
if (codes[i] != 0)
|
if (codes[i])
|
||||||
display_write_data_byte(codes[i]);
|
display_write_data_byte(codes[i]);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void display_load(uint32_t frame_no)
|
||||||
|
{
|
||||||
|
if (display_framebuffer_mode)
|
||||||
|
return;
|
||||||
|
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < 16; i++) {
|
||||||
|
display_write_data_byte_direct(display_framebuffer[16*2*display_current_frame + i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 0);
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < 16; i++) {
|
||||||
|
display_write_data_byte_direct(display_framebuffer[16*2*display_current_frame + i + 16]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
387
Core/Src/main.c
387
Core/Src/main.c
@ -30,6 +30,10 @@
|
|||||||
#include "CS43L22.h"
|
#include "CS43L22.h"
|
||||||
#include "SST25VF016B.h"
|
#include "SST25VF016B.h"
|
||||||
#include "LIS302DL.h"
|
#include "LIS302DL.h"
|
||||||
|
#include "MP45DT02.h"
|
||||||
|
#include "LSM9DS1.h"
|
||||||
|
#include "DHT11.h"
|
||||||
|
#include "KSZ8081RND.h"
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
@ -44,6 +48,17 @@
|
|||||||
#define WAIT_UNTIL_CB_PRESSED while (!HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) && HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8))
|
#define WAIT_UNTIL_CB_PRESSED while (!HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) && HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8))
|
||||||
#define WAIT_UNTIL_CB_RELEASED while (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) || !HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8))
|
#define WAIT_UNTIL_CB_RELEASED while (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) || !HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8))
|
||||||
|
|
||||||
|
#define UB (GPIOA->IDR & GPIO_PIN_0)
|
||||||
|
#define SWT1 !(GPIOC->IDR & GPIO_PIN_11)
|
||||||
|
#define SWT2 !(GPIOA->IDR & GPIO_PIN_15)
|
||||||
|
#define SWT3 !(GPIOC->IDR & GPIO_PIN_9)
|
||||||
|
#define SWT4 !(GPIOC->IDR & GPIO_PIN_6)
|
||||||
|
#define SWT5 !(GPIOC->IDR & GPIO_PIN_8)
|
||||||
|
|
||||||
|
#define WAIT_UNTIL_ALL_BUTTONS_RELEASED do {} while ( UB || SWT1 || SWT2 || SWT3 || SWT4 || SWT5 )
|
||||||
|
|
||||||
|
#define LEN(x) ( sizeof(x) / sizeof((x)[0]) )
|
||||||
|
|
||||||
/* USER CODE END PD */
|
/* USER CODE END PD */
|
||||||
|
|
||||||
/* Private macro -------------------------------------------------------------*/
|
/* Private macro -------------------------------------------------------------*/
|
||||||
@ -58,35 +73,41 @@ I2C_HandleTypeDef hi2c1;
|
|||||||
|
|
||||||
SPI_HandleTypeDef hspi1;
|
SPI_HandleTypeDef hspi1;
|
||||||
|
|
||||||
|
TIM_HandleTypeDef htim2;
|
||||||
|
|
||||||
/* USER CODE BEGIN PV */
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
void ((*executors[])(void)) = {
|
extern size_t display_current_frame;
|
||||||
|
|
||||||
|
static const int ((*executors[])(void)) = {
|
||||||
DNI_show_celsius,
|
DNI_show_celsius,
|
||||||
DNI_show_fahrenheit,
|
|
||||||
PCA9685_run_test,
|
PCA9685_run_test,
|
||||||
EEPROM_24AA02E48_run_test,
|
EEPROM_24AA02E48_run_test,
|
||||||
CS43L22_run_test,
|
CS43L22_run_test,
|
||||||
SST25VF016B_run_test,
|
SST25VF016B_run_test,
|
||||||
LIS302DL_run_test,
|
LIS302DL_run_test,
|
||||||
LIS302DL_run_test_dynamic
|
MP45DT02_run_test,
|
||||||
|
LSM9DS1_test_accel,
|
||||||
|
LSM9DS1_test_magnet,
|
||||||
|
DHT11_run_test,
|
||||||
|
KSZ8081RND_run_test
|
||||||
};
|
};
|
||||||
|
|
||||||
void ((*cleanup_functions[])(void)) = {
|
static const void ((*cleanup_functions[])(void)) = {
|
||||||
NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
PCA9685_cleanup,
|
PCA9685_cleanup,
|
||||||
NULL,
|
NULL,
|
||||||
CS43L22_cleanup,
|
CS43L22_cleanup,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
|
LSM9DS1_cleanup_accel,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
int delay_between_runs[] = {250, 250, -1, -1, -1, -1, -1, 200};
|
unsigned int eth_errorred = 0;
|
||||||
|
|
||||||
size_t current_executor_id = 0;
|
|
||||||
|
|
||||||
size_t buttons_interrupt_enabled;
|
|
||||||
|
|
||||||
/* USER CODE END PV */
|
/* USER CODE END PV */
|
||||||
|
|
||||||
@ -96,6 +117,7 @@ static void MX_GPIO_Init(void);
|
|||||||
static void MX_ADC1_Init(void);
|
static void MX_ADC1_Init(void);
|
||||||
static void MX_I2C1_Init(void);
|
static void MX_I2C1_Init(void);
|
||||||
static void MX_SPI1_Init(void);
|
static void MX_SPI1_Init(void);
|
||||||
|
static void MX_TIM2_Init(void);
|
||||||
/* USER CODE BEGIN PFP */
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
/* USER CODE END PFP */
|
/* USER CODE END PFP */
|
||||||
@ -103,132 +125,6 @@ static void MX_SPI1_Init(void);
|
|||||||
/* Private user code ---------------------------------------------------------*/
|
/* Private user code ---------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN 0 */
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
void switch_to_next_test(void)
|
|
||||||
{
|
|
||||||
current_executor_id += 1;
|
|
||||||
current_executor_id %= 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
void buttons_switch_to_interrupt(void)
|
|
||||||
{
|
|
||||||
// save current executor ID
|
|
||||||
size_t tmp = current_executor_id;
|
|
||||||
|
|
||||||
// configure user button
|
|
||||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_0;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
|
|
||||||
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
|
|
||||||
|
|
||||||
// configure SW5 (alternative advancing method)
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_8;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
|
|
||||||
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
|
||||||
|
|
||||||
// restore current executor ID
|
|
||||||
current_executor_id = tmp;
|
|
||||||
|
|
||||||
// set interrupt mode flag
|
|
||||||
buttons_interrupt_enabled = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void buttons_switch_to_input(void)
|
|
||||||
{
|
|
||||||
// configure user button
|
|
||||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_0;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
HAL_NVIC_DisableIRQ(EXTI0_IRQn);
|
|
||||||
|
|
||||||
// configure SW5 (alternative input method)
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_8;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
HAL_NVIC_DisableIRQ(EXTI9_5_IRQn);
|
|
||||||
|
|
||||||
// clear interrupt mode flag
|
|
||||||
buttons_interrupt_enabled = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void button_init_and_test(void)
|
|
||||||
{
|
|
||||||
// letting the buttons be tested
|
|
||||||
display_write_data_seq("Fill any bar:");
|
|
||||||
DISPLAY_SET_CURSOR(1, 5);
|
|
||||||
display_write_data_seq("[-] [-----]");
|
|
||||||
|
|
||||||
size_t pressed_elements;
|
|
||||||
|
|
||||||
uint32_t sw_button_locations[5][2] = {
|
|
||||||
{GPIOC, GPIO_PIN_11},
|
|
||||||
{GPIOA, GPIO_PIN_15},
|
|
||||||
{GPIOC, GPIO_PIN_9},
|
|
||||||
{GPIOC, GPIO_PIN_6},
|
|
||||||
{GPIOC, GPIO_PIN_8}
|
|
||||||
};
|
|
||||||
|
|
||||||
do {
|
|
||||||
HAL_Delay(100);
|
|
||||||
pressed_elements = 0;
|
|
||||||
|
|
||||||
DISPLAY_SET_CURSOR(1, 6);
|
|
||||||
|
|
||||||
if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0)) {
|
|
||||||
pressed_elements |= 0x20;
|
|
||||||
display_write_data_byte('*');
|
|
||||||
} else {
|
|
||||||
display_write_data_byte('-');
|
|
||||||
}
|
|
||||||
|
|
||||||
DISPLAY_SET_CURSOR(1, 10);
|
|
||||||
|
|
||||||
for (size_t i = 0; i < 5; i++) {
|
|
||||||
pressed_elements >>= 1;
|
|
||||||
|
|
||||||
size_t input = !HAL_GPIO_ReadPin(sw_button_locations[i][0], sw_button_locations[i][1]);
|
|
||||||
|
|
||||||
if (input) {
|
|
||||||
pressed_elements |= 0x20;
|
|
||||||
display_write_data_byte('*');
|
|
||||||
} else {
|
|
||||||
display_write_data_byte('-');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (!(((pressed_elements & 0x1) == 0x1) || ((pressed_elements & 0x3E) == 0x3E)));
|
|
||||||
|
|
||||||
|
|
||||||
// visual reaction to bar fill
|
|
||||||
DISPLAY_SET_CURSOR(0, 0);
|
|
||||||
display_write_data_seq("Release buttons");
|
|
||||||
|
|
||||||
GPIOD->ODR = 0x1000;
|
|
||||||
HAL_Delay(500);
|
|
||||||
GPIOD->ODR = 0x2000;
|
|
||||||
HAL_Delay(500);
|
|
||||||
GPIOD->ODR = 0x4000;
|
|
||||||
HAL_Delay(500);
|
|
||||||
GPIOD->ODR = 0x8000;
|
|
||||||
HAL_Delay(500);
|
|
||||||
|
|
||||||
// waiting for control buttons to be released
|
|
||||||
WAIT_UNTIL_CB_RELEASED;
|
|
||||||
GPIOD->ODR = 0x0000;
|
|
||||||
HAL_Delay(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -263,44 +159,115 @@ int main(void)
|
|||||||
MX_ADC1_Init();
|
MX_ADC1_Init();
|
||||||
MX_I2C1_Init();
|
MX_I2C1_Init();
|
||||||
MX_SPI1_Init();
|
MX_SPI1_Init();
|
||||||
|
MX_TIM2_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
buttons_interrupt_enabled = 0;
|
|
||||||
|
|
||||||
GPIOD->ODR = 0x1000;
|
GPIOD->BSRR = 0x1000;
|
||||||
display_init();
|
display_init();
|
||||||
|
|
||||||
GPIOD->ODR = 0xF000;
|
GPIOD->BSRR = 0xF000;
|
||||||
button_init_and_test();
|
|
||||||
|
// perform all tests
|
||||||
|
size_t successful_tests = 0;
|
||||||
|
size_t failed_tests = 0;
|
||||||
|
|
||||||
|
const int test_amount = LEN(executors);
|
||||||
|
|
||||||
|
for (display_current_frame = 1; display_current_frame < LEN(executors)+1; display_current_frame++)
|
||||||
|
{
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
display_write_data_seq("Testing...");
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 2);
|
||||||
|
display_write_data_seq("P:");
|
||||||
|
display_write_data_byte('0' + (successful_tests / 10) % 10);
|
||||||
|
display_write_data_byte('0' + (successful_tests) % 10);
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 10);
|
||||||
|
display_write_data_seq("F:");
|
||||||
|
display_write_data_byte('0' + (failed_tests / 10) % 10);
|
||||||
|
display_write_data_byte('0' + (failed_tests) % 10);
|
||||||
|
|
||||||
|
display_to_framebuffer();
|
||||||
|
|
||||||
|
// test
|
||||||
|
if (executors[display_current_frame-1]())
|
||||||
|
failed_tests++;
|
||||||
|
else
|
||||||
|
successful_tests++;
|
||||||
|
|
||||||
|
// cleanup (if required)
|
||||||
|
if (cleanup_functions[display_current_frame-1])
|
||||||
|
cleanup_functions[display_current_frame-1]();
|
||||||
|
|
||||||
|
// write test number tag onto this framebuffer
|
||||||
|
DISPLAY_SET_CURSOR(1, 0);
|
||||||
|
DISPLAY_SET_INCREMENT;
|
||||||
|
display_write_data_byte('T');
|
||||||
|
display_write_data_byte('0' + (display_current_frame / 10) % 10);
|
||||||
|
display_write_data_byte('0' + display_current_frame % 10);
|
||||||
|
|
||||||
|
display_to_direct();
|
||||||
|
}
|
||||||
|
|
||||||
|
// render final result to first framebuffer
|
||||||
|
display_to_framebuffer();
|
||||||
|
display_current_frame = 0;
|
||||||
|
|
||||||
|
DISPLAY_CLEAR;
|
||||||
|
if (successful_tests == LEN(executors))
|
||||||
|
display_write_data_seq("All tests done!");
|
||||||
|
else
|
||||||
|
display_write_data_seq("Failures found!");
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 1);
|
||||||
|
display_write_data_seq("PASSED /");
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 8);
|
||||||
|
display_write_data_byte('0' + (successful_tests / 10) % 10);
|
||||||
|
display_write_data_byte('0' + successful_tests % 10);
|
||||||
|
|
||||||
|
DISPLAY_SET_CURSOR(1, 11);
|
||||||
|
display_write_data_byte('0' + (test_amount / 10) % 10);
|
||||||
|
display_write_data_byte('0' + test_amount % 10);
|
||||||
|
|
||||||
|
display_to_direct();
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
/* USER CODE BEGIN WHILE */
|
/* USER CODE BEGIN WHILE */
|
||||||
while (1)
|
while (1) {
|
||||||
{
|
WAIT_UNTIL_ALL_BUTTONS_RELEASED;
|
||||||
if (delay_between_runs[current_executor_id] == -1 && buttons_interrupt_enabled)
|
|
||||||
buttons_switch_to_input();
|
|
||||||
else if (delay_between_runs[current_executor_id] != -1 && !buttons_interrupt_enabled)
|
|
||||||
buttons_switch_to_interrupt();
|
|
||||||
|
|
||||||
executors[current_executor_id]();
|
display_load(display_current_frame);
|
||||||
|
|
||||||
if (delay_between_runs[current_executor_id] == -1) {
|
while (1) {
|
||||||
WAIT_UNTIL_CB_PRESSED;
|
HAL_Delay(15);
|
||||||
HAL_Delay(150);
|
|
||||||
GPIOD->BSRR = 0x1000;
|
|
||||||
|
|
||||||
WAIT_UNTIL_CB_RELEASED;
|
// go to next report
|
||||||
HAL_Delay(150);
|
if (UB || SWT1 || SWT5) {
|
||||||
GPIOD->BSRR = 0x1000 << 16;
|
display_current_frame += 1;
|
||||||
|
display_current_frame %= LEN(executors)+1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (cleanup_functions[current_executor_id])
|
// go to previous report
|
||||||
cleanup_functions[current_executor_id]();
|
else if (SWT3 || SWT4) {
|
||||||
|
display_current_frame -= 1;
|
||||||
|
|
||||||
switch_to_next_test();
|
if ((int) display_current_frame == -1)
|
||||||
} else {
|
display_current_frame = LEN(executors);
|
||||||
HAL_Delay(delay_between_runs[current_executor_id]);
|
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return to summary frame
|
||||||
|
else if (SWT2) {
|
||||||
|
display_current_frame = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* USER CODE END WHILE */
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
/* USER CODE BEGIN 3 */
|
||||||
@ -328,7 +295,12 @@ void SystemClock_Config(void)
|
|||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||||
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||||
|
RCC_OscInitStruct.PLL.PLLM = 16;
|
||||||
|
RCC_OscInitStruct.PLL.PLLN = 128;
|
||||||
|
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
|
||||||
|
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
@ -338,12 +310,12 @@ void SystemClock_Config(void)
|
|||||||
*/
|
*/
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV4;
|
||||||
|
|
||||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
|
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
@ -473,6 +445,51 @@ static void MX_SPI1_Init(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM2 Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_TIM2_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM2_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_Init 0 */
|
||||||
|
|
||||||
|
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||||
|
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM2_Init 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_Init 1 */
|
||||||
|
htim2.Instance = TIM2;
|
||||||
|
htim2.Init.Prescaler = 0;
|
||||||
|
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
|
htim2.Init.Period = 0xffffffff;
|
||||||
|
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||||
|
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||||
|
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||||
|
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||||
|
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||||
|
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
/* USER CODE BEGIN TIM2_Init 2 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_Init 2 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief GPIO Initialization Function
|
* @brief GPIO Initialization Function
|
||||||
* @param None
|
* @param None
|
||||||
@ -485,22 +502,30 @@ static void MX_GPIO_Init(void)
|
|||||||
/* USER CODE END MX_GPIO_Init_1 */
|
/* USER CODE END MX_GPIO_Init_1 */
|
||||||
|
|
||||||
/* GPIO Ports Clock Enable */
|
/* GPIO Ports Clock Enable */
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
|
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
|
||||||
|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
|
|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10|GPIO_PIN_7, GPIO_PIN_RESET);
|
||||||
|GPIO_PIN_4|GPIO_PIN_7, GPIO_PIN_RESET);
|
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14
|
||||||
|
|GPIO_PIN_15|GPIO_PIN_4|GPIO_PIN_7, GPIO_PIN_RESET);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : PC3 PC6 PC8 PC9
|
||||||
|
PC11 */
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9
|
||||||
|
|GPIO_PIN_11;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : PA0 PA15 */
|
/*Configure GPIO pins : PA0 PA15 */
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_15;
|
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_15;
|
||||||
@ -517,6 +542,20 @@ static void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pin : PB10 */
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_10;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pin : PD11 */
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_11;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||||
|
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : PD12 PD13 PD14 PD15
|
/*Configure GPIO pins : PD12 PD13 PD14 PD15
|
||||||
PD4 PD7 */
|
PD4 PD7 */
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|
||||||
@ -526,12 +565,6 @@ static void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : PC6 PC8 PC9 PC11 */
|
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
/*Configure GPIO pin : PB7 */
|
/*Configure GPIO pin : PB7 */
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_7;
|
GPIO_InitStruct.Pin = GPIO_PIN_7;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
@ -555,6 +588,10 @@ void Error_Handler(void)
|
|||||||
{
|
{
|
||||||
/* USER CODE BEGIN Error_Handler_Debug */
|
/* USER CODE BEGIN Error_Handler_Debug */
|
||||||
/* User can add his own implementation to report the HAL error return state */
|
/* User can add his own implementation to report the HAL error return state */
|
||||||
|
eth_errorred = 1;
|
||||||
|
return;
|
||||||
|
//goto back_to_life;
|
||||||
|
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -286,6 +286,51 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM_Base MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param htim_base: TIM_Base handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
{
|
||||||
|
if(htim_base->Instance==TIM2)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||||
|
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_MspInit 1 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM_Base MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param htim_base: TIM_Base handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
{
|
||||||
|
if(htim_base->Instance==TIM2)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||||
|
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM2_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
@ -204,7 +204,7 @@ void EXTI0_IRQHandler(void)
|
|||||||
{
|
{
|
||||||
GPIOD->ODR = 0x1000;
|
GPIOD->ODR = 0x1000;
|
||||||
|
|
||||||
switch_to_next_test();
|
//switch_to_next_test();
|
||||||
|
|
||||||
for (int i = 300000; i > 0; i--) asm("nop");
|
for (int i = 300000; i > 0; i--) asm("nop");
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ void EXTI9_5_IRQHandler(void)
|
|||||||
{
|
{
|
||||||
GPIOD->ODR = 0x1000;
|
GPIOD->ODR = 0x1000;
|
||||||
|
|
||||||
switch_to_next_test();
|
//switch_to_next_test();
|
||||||
|
|
||||||
for (int i = 300000; i > 0; i--) asm("nop");
|
for (int i = 300000; i > 0; i--) asm("nop");
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ C_SRCS += \
|
|||||||
../Core/Src/CS43L22.c \
|
../Core/Src/CS43L22.c \
|
||||||
../Core/Src/DNI.c \
|
../Core/Src/DNI.c \
|
||||||
../Core/Src/LIS302DL.c \
|
../Core/Src/LIS302DL.c \
|
||||||
|
../Core/Src/LSM9DS1.c \
|
||||||
|
../Core/Src/MP45DT02.c \
|
||||||
../Core/Src/PCA9685.c \
|
../Core/Src/PCA9685.c \
|
||||||
../Core/Src/SST25VF016B.c \
|
../Core/Src/SST25VF016B.c \
|
||||||
../Core/Src/lcd.c \
|
../Core/Src/lcd.c \
|
||||||
@ -24,6 +26,8 @@ OBJS += \
|
|||||||
./Core/Src/CS43L22.o \
|
./Core/Src/CS43L22.o \
|
||||||
./Core/Src/DNI.o \
|
./Core/Src/DNI.o \
|
||||||
./Core/Src/LIS302DL.o \
|
./Core/Src/LIS302DL.o \
|
||||||
|
./Core/Src/LSM9DS1.o \
|
||||||
|
./Core/Src/MP45DT02.o \
|
||||||
./Core/Src/PCA9685.o \
|
./Core/Src/PCA9685.o \
|
||||||
./Core/Src/SST25VF016B.o \
|
./Core/Src/SST25VF016B.o \
|
||||||
./Core/Src/lcd.o \
|
./Core/Src/lcd.o \
|
||||||
@ -39,6 +43,8 @@ C_DEPS += \
|
|||||||
./Core/Src/CS43L22.d \
|
./Core/Src/CS43L22.d \
|
||||||
./Core/Src/DNI.d \
|
./Core/Src/DNI.d \
|
||||||
./Core/Src/LIS302DL.d \
|
./Core/Src/LIS302DL.d \
|
||||||
|
./Core/Src/LSM9DS1.d \
|
||||||
|
./Core/Src/MP45DT02.d \
|
||||||
./Core/Src/PCA9685.d \
|
./Core/Src/PCA9685.d \
|
||||||
./Core/Src/SST25VF016B.d \
|
./Core/Src/SST25VF016B.d \
|
||||||
./Core/Src/lcd.d \
|
./Core/Src/lcd.d \
|
||||||
@ -57,7 +63,7 @@ Core/Src/%.o Core/Src/%.su Core/Src/%.cyclo: ../Core/Src/%.c Core/Src/subdir.mk
|
|||||||
clean: clean-Core-2f-Src
|
clean: clean-Core-2f-Src
|
||||||
|
|
||||||
clean-Core-2f-Src:
|
clean-Core-2f-Src:
|
||||||
-$(RM) ./Core/Src/24AA02E48.cyclo ./Core/Src/24AA02E48.d ./Core/Src/24AA02E48.o ./Core/Src/24AA02E48.su ./Core/Src/CS43L22.cyclo ./Core/Src/CS43L22.d ./Core/Src/CS43L22.o ./Core/Src/CS43L22.su ./Core/Src/DNI.cyclo ./Core/Src/DNI.d ./Core/Src/DNI.o ./Core/Src/DNI.su ./Core/Src/LIS302DL.cyclo ./Core/Src/LIS302DL.d ./Core/Src/LIS302DL.o ./Core/Src/LIS302DL.su ./Core/Src/PCA9685.cyclo ./Core/Src/PCA9685.d ./Core/Src/PCA9685.o ./Core/Src/PCA9685.su ./Core/Src/SST25VF016B.cyclo ./Core/Src/SST25VF016B.d ./Core/Src/SST25VF016B.o ./Core/Src/SST25VF016B.su ./Core/Src/lcd.cyclo ./Core/Src/lcd.d ./Core/Src/lcd.o ./Core/Src/lcd.su ./Core/Src/main.cyclo ./Core/Src/main.d ./Core/Src/main.o ./Core/Src/main.su ./Core/Src/stm32f4xx_hal_msp.cyclo ./Core/Src/stm32f4xx_hal_msp.d ./Core/Src/stm32f4xx_hal_msp.o ./Core/Src/stm32f4xx_hal_msp.su ./Core/Src/stm32f4xx_it.cyclo ./Core/Src/stm32f4xx_it.d ./Core/Src/stm32f4xx_it.o ./Core/Src/stm32f4xx_it.su ./Core/Src/syscalls.cyclo ./Core/Src/syscalls.d ./Core/Src/syscalls.o ./Core/Src/syscalls.su ./Core/Src/sysmem.cyclo ./Core/Src/sysmem.d ./Core/Src/sysmem.o ./Core/Src/sysmem.su ./Core/Src/system_stm32f4xx.cyclo ./Core/Src/system_stm32f4xx.d ./Core/Src/system_stm32f4xx.o ./Core/Src/system_stm32f4xx.su
|
-$(RM) ./Core/Src/24AA02E48.cyclo ./Core/Src/24AA02E48.d ./Core/Src/24AA02E48.o ./Core/Src/24AA02E48.su ./Core/Src/CS43L22.cyclo ./Core/Src/CS43L22.d ./Core/Src/CS43L22.o ./Core/Src/CS43L22.su ./Core/Src/DNI.cyclo ./Core/Src/DNI.d ./Core/Src/DNI.o ./Core/Src/DNI.su ./Core/Src/LIS302DL.cyclo ./Core/Src/LIS302DL.d ./Core/Src/LIS302DL.o ./Core/Src/LIS302DL.su ./Core/Src/LSM9DS1.cyclo ./Core/Src/LSM9DS1.d ./Core/Src/LSM9DS1.o ./Core/Src/LSM9DS1.su ./Core/Src/MP45DT02.cyclo ./Core/Src/MP45DT02.d ./Core/Src/MP45DT02.o ./Core/Src/MP45DT02.su ./Core/Src/PCA9685.cyclo ./Core/Src/PCA9685.d ./Core/Src/PCA9685.o ./Core/Src/PCA9685.su ./Core/Src/SST25VF016B.cyclo ./Core/Src/SST25VF016B.d ./Core/Src/SST25VF016B.o ./Core/Src/SST25VF016B.su ./Core/Src/lcd.cyclo ./Core/Src/lcd.d ./Core/Src/lcd.o ./Core/Src/lcd.su ./Core/Src/main.cyclo ./Core/Src/main.d ./Core/Src/main.o ./Core/Src/main.su ./Core/Src/stm32f4xx_hal_msp.cyclo ./Core/Src/stm32f4xx_hal_msp.d ./Core/Src/stm32f4xx_hal_msp.o ./Core/Src/stm32f4xx_hal_msp.su ./Core/Src/stm32f4xx_it.cyclo ./Core/Src/stm32f4xx_it.d ./Core/Src/stm32f4xx_it.o ./Core/Src/stm32f4xx_it.su ./Core/Src/syscalls.cyclo ./Core/Src/syscalls.d ./Core/Src/syscalls.o ./Core/Src/syscalls.su ./Core/Src/sysmem.cyclo ./Core/Src/sysmem.d ./Core/Src/sysmem.o ./Core/Src/sysmem.su ./Core/Src/system_stm32f4xx.cyclo ./Core/Src/system_stm32f4xx.d ./Core/Src/system_stm32f4xx.o ./Core/Src/system_stm32f4xx.su
|
||||||
|
|
||||||
.PHONY: clean-Core-2f-Src
|
.PHONY: clean-Core-2f-Src
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,6 +2,8 @@
|
|||||||
"./Core/Src/CS43L22.o"
|
"./Core/Src/CS43L22.o"
|
||||||
"./Core/Src/DNI.o"
|
"./Core/Src/DNI.o"
|
||||||
"./Core/Src/LIS302DL.o"
|
"./Core/Src/LIS302DL.o"
|
||||||
|
"./Core/Src/LSM9DS1.o"
|
||||||
|
"./Core/Src/MP45DT02.o"
|
||||||
"./Core/Src/PCA9685.o"
|
"./Core/Src/PCA9685.o"
|
||||||
"./Core/Src/SST25VF016B.o"
|
"./Core/Src/SST25VF016B.o"
|
||||||
"./Core/Src/lcd.o"
|
"./Core/Src/lcd.o"
|
||||||
@ -25,6 +27,8 @@
|
|||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.o"
|
||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.o"
|
||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.o"
|
||||||
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.o"
|
||||||
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.o"
|
||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.o"
|
||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.o"
|
||||||
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o"
|
"./Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.o"
|
||||||
|
4096
Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h
Normal file
4096
Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h
Normal file
File diff suppressed because it is too large
Load Diff
113
test1.ioc
113
test1.ioc
@ -21,37 +21,42 @@ Mcu.IP2=NVIC
|
|||||||
Mcu.IP3=RCC
|
Mcu.IP3=RCC
|
||||||
Mcu.IP4=SPI1
|
Mcu.IP4=SPI1
|
||||||
Mcu.IP5=SYS
|
Mcu.IP5=SYS
|
||||||
Mcu.IPNb=6
|
Mcu.IP6=TIM2
|
||||||
|
Mcu.IPNb=7
|
||||||
Mcu.Name=STM32F407V(E-G)Tx
|
Mcu.Name=STM32F407V(E-G)Tx
|
||||||
Mcu.Package=LQFP100
|
Mcu.Package=LQFP100
|
||||||
Mcu.Pin0=PA0-WKUP
|
Mcu.Pin0=PC3
|
||||||
Mcu.Pin1=PA5
|
Mcu.Pin1=PA0-WKUP
|
||||||
Mcu.Pin10=PD12
|
Mcu.Pin10=PE15
|
||||||
Mcu.Pin11=PD13
|
Mcu.Pin11=PB10
|
||||||
Mcu.Pin12=PD14
|
Mcu.Pin12=PD11
|
||||||
Mcu.Pin13=PD15
|
Mcu.Pin13=PD12
|
||||||
Mcu.Pin14=PC6
|
Mcu.Pin14=PD13
|
||||||
Mcu.Pin15=PC8
|
Mcu.Pin15=PD14
|
||||||
Mcu.Pin16=PC9
|
Mcu.Pin16=PD15
|
||||||
Mcu.Pin17=PA15
|
Mcu.Pin17=PC6
|
||||||
Mcu.Pin18=PC11
|
Mcu.Pin18=PC8
|
||||||
Mcu.Pin19=PD4
|
Mcu.Pin19=PC9
|
||||||
Mcu.Pin2=PB1
|
Mcu.Pin2=PA5
|
||||||
Mcu.Pin20=PD7
|
Mcu.Pin20=PA15
|
||||||
Mcu.Pin21=PB4
|
Mcu.Pin21=PC11
|
||||||
Mcu.Pin22=PB5
|
Mcu.Pin22=PD4
|
||||||
Mcu.Pin23=PB6
|
Mcu.Pin23=PD7
|
||||||
Mcu.Pin24=PB7
|
Mcu.Pin24=PB4
|
||||||
Mcu.Pin25=PB9
|
Mcu.Pin25=PB5
|
||||||
Mcu.Pin26=VP_SYS_VS_Systick
|
Mcu.Pin26=PB6
|
||||||
Mcu.Pin3=PE7
|
Mcu.Pin27=PB7
|
||||||
Mcu.Pin4=PE10
|
Mcu.Pin28=PB9
|
||||||
Mcu.Pin5=PE11
|
Mcu.Pin29=VP_SYS_VS_Systick
|
||||||
Mcu.Pin6=PE12
|
Mcu.Pin3=PB1
|
||||||
Mcu.Pin7=PE13
|
Mcu.Pin30=VP_TIM2_VS_ClockSourceINT
|
||||||
Mcu.Pin8=PE14
|
Mcu.Pin4=PE7
|
||||||
Mcu.Pin9=PE15
|
Mcu.Pin5=PE10
|
||||||
Mcu.PinsNb=27
|
Mcu.Pin6=PE11
|
||||||
|
Mcu.Pin7=PE12
|
||||||
|
Mcu.Pin8=PE13
|
||||||
|
Mcu.Pin9=PE14
|
||||||
|
Mcu.PinsNb=31
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F407VGTx
|
Mcu.UserName=STM32F407VGTx
|
||||||
@ -76,6 +81,10 @@ PA5.Mode=Full_Duplex_Master
|
|||||||
PA5.Signal=SPI1_SCK
|
PA5.Signal=SPI1_SCK
|
||||||
PB1.Locked=true
|
PB1.Locked=true
|
||||||
PB1.Signal=ADCx_IN9
|
PB1.Signal=ADCx_IN9
|
||||||
|
PB10.GPIOParameters=GPIO_Speed
|
||||||
|
PB10.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
|
||||||
|
PB10.Locked=true
|
||||||
|
PB10.Signal=GPIO_Output
|
||||||
PB4.Locked=true
|
PB4.Locked=true
|
||||||
PB4.Mode=Full_Duplex_Master
|
PB4.Mode=Full_Duplex_Master
|
||||||
PB4.Signal=SPI1_MISO
|
PB4.Signal=SPI1_MISO
|
||||||
@ -91,12 +100,18 @@ PB9.Mode=I2C
|
|||||||
PB9.Signal=I2C1_SDA
|
PB9.Signal=I2C1_SDA
|
||||||
PC11.Locked=true
|
PC11.Locked=true
|
||||||
PC11.Signal=GPIO_Input
|
PC11.Signal=GPIO_Input
|
||||||
|
PC3.Locked=true
|
||||||
|
PC3.Signal=GPIO_Input
|
||||||
PC6.Locked=true
|
PC6.Locked=true
|
||||||
PC6.Signal=GPIO_Input
|
PC6.Signal=GPIO_Input
|
||||||
PC8.Locked=true
|
PC8.Locked=true
|
||||||
PC8.Signal=GPIO_Input
|
PC8.Signal=GPIO_Input
|
||||||
PC9.Locked=true
|
PC9.Locked=true
|
||||||
PC9.Signal=GPIO_Input
|
PC9.Signal=GPIO_Input
|
||||||
|
PD11.GPIOParameters=GPIO_Speed
|
||||||
|
PD11.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
|
||||||
|
PD11.Locked=true
|
||||||
|
PD11.Signal=GPIO_Output
|
||||||
PD12.Locked=true
|
PD12.Locked=true
|
||||||
PD12.Signal=GPIO_Output
|
PD12.Signal=GPIO_Output
|
||||||
PD13.Locked=true
|
PD13.Locked=true
|
||||||
@ -154,42 +169,52 @@ ProjectManager.ToolChainLocation=
|
|||||||
ProjectManager.UAScriptAfterPath=
|
ProjectManager.UAScriptAfterPath=
|
||||||
ProjectManager.UAScriptBeforePath=
|
ProjectManager.UAScriptBeforePath=
|
||||||
ProjectManager.UnderRoot=true
|
ProjectManager.UnderRoot=true
|
||||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_ADC1_Init-ADC1-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true
|
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_ADC1_Init-ADC1-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_ETH_Init-ETH-false-HAL-true
|
||||||
RCC.AHBFreq_Value=16000000
|
RCC.48MHZClocksFreq_Value=32000000
|
||||||
RCC.APB1Freq_Value=16000000
|
RCC.AHBFreq_Value=32000000
|
||||||
|
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||||
|
RCC.APB1Freq_Value=8000000
|
||||||
RCC.APB1TimFreq_Value=16000000
|
RCC.APB1TimFreq_Value=16000000
|
||||||
RCC.APB2Freq_Value=16000000
|
RCC.APB2CLKDivider=RCC_HCLK_DIV4
|
||||||
|
RCC.APB2Freq_Value=8000000
|
||||||
RCC.APB2TimFreq_Value=16000000
|
RCC.APB2TimFreq_Value=16000000
|
||||||
RCC.CortexFreq_Value=16000000
|
RCC.CortexFreq_Value=32000000
|
||||||
RCC.EthernetFreq_Value=16000000
|
RCC.EthernetFreq_Value=32000000
|
||||||
RCC.FCLKCortexFreq_Value=16000000
|
RCC.FCLKCortexFreq_Value=32000000
|
||||||
RCC.FamilyName=M
|
RCC.FamilyName=M
|
||||||
RCC.HCLKFreq_Value=16000000
|
RCC.HCLKFreq_Value=32000000
|
||||||
RCC.HSE_VALUE=25000000
|
RCC.HSE_VALUE=25000000
|
||||||
RCC.HSI_VALUE=16000000
|
RCC.HSI_VALUE=16000000
|
||||||
RCC.I2SClocksFreq_Value=96000000
|
RCC.I2SClocksFreq_Value=96000000
|
||||||
RCC.IPParameters=AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLN,PLLP,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
||||||
RCC.LSE_VALUE=32768
|
RCC.LSE_VALUE=32768
|
||||||
RCC.LSI_VALUE=32000
|
RCC.LSI_VALUE=32000
|
||||||
RCC.MCO2PinFreq_Value=16000000
|
RCC.MCO2PinFreq_Value=32000000
|
||||||
RCC.PLLCLKFreq_Value=96000000
|
RCC.PLLCLKFreq_Value=32000000
|
||||||
RCC.PLLQCLKFreq_Value=48000000
|
RCC.PLLN=128
|
||||||
|
RCC.PLLP=RCC_PLLP_DIV4
|
||||||
|
RCC.PLLQCLKFreq_Value=32000000
|
||||||
RCC.RTCFreq_Value=32000
|
RCC.RTCFreq_Value=32000
|
||||||
RCC.RTCHSEDivFreq_Value=12500000
|
RCC.RTCHSEDivFreq_Value=12500000
|
||||||
RCC.SYSCLKFreq_VALUE=16000000
|
RCC.SYSCLKFreq_VALUE=32000000
|
||||||
|
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||||
RCC.VCOI2SOutputFreq_Value=192000000
|
RCC.VCOI2SOutputFreq_Value=192000000
|
||||||
RCC.VCOInputFreq_Value=1000000
|
RCC.VCOInputFreq_Value=1000000
|
||||||
RCC.VCOOutputFreq_Value=192000000
|
RCC.VCOOutputFreq_Value=128000000
|
||||||
RCC.VcooutputI2S=96000000
|
RCC.VcooutputI2S=96000000
|
||||||
SH.ADCx_IN9.0=ADC1_IN9,IN9
|
SH.ADCx_IN9.0=ADC1_IN9,IN9
|
||||||
SH.ADCx_IN9.ConfNb=1
|
SH.ADCx_IN9.ConfNb=1
|
||||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16
|
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_16
|
||||||
SPI1.CalculateBaudRate=1000.0 KBits/s
|
SPI1.CalculateBaudRate=500.0 KBits/s
|
||||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler
|
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler
|
||||||
SPI1.Mode=SPI_MODE_MASTER
|
SPI1.Mode=SPI_MODE_MASTER
|
||||||
SPI1.VirtualType=VM_MASTER
|
SPI1.VirtualType=VM_MASTER
|
||||||
|
TIM2.IPParameters=Period
|
||||||
|
TIM2.Period=0xffffffff
|
||||||
VP_SYS_VS_Systick.Mode=SysTick
|
VP_SYS_VS_Systick.Mode=SysTick
|
||||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||||
|
VP_TIM2_VS_ClockSourceINT.Mode=Internal
|
||||||
|
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||||
board=custom
|
board=custom
|
||||||
isbadioc=false
|
isbadioc=false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user