First release - game engine
This commit is contained in:
commit
60a8090bf3
258
2P-ProjectPong/.cproject
Normal file
258
2P-ProjectPong/.cproject
Normal file
@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings />
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser" />
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration 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.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex" && arm-none-eabi-size "${BuildArtifactFileName}"">
|
||||
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279." name="/" resourcePath="">
|
||||
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1480060909" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.327330765" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1292439930" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F412ZGTx" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.board.1989889501" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="32F412GDISCOVERY" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="ARM Cortex-M4" />
|
||||
<listOptionValue builtIn="false" value="CM4" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1462895718" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.fpu.1842363514" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.979114293" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated" />
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.711669049" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross" />
|
||||
<builder buildPath="${workspace_loc:/2P-ProjectPong}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1795211660" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="fr.ac6.managedbuild.builder.gnu.cross">
|
||||
<outputEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug" />
|
||||
</outputEntries>
|
||||
</builder>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1810252623" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.991062419" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.debug" valueType="enumerated" />
|
||||
<option id="gnu.c.compiler.option.debugging.level.785975152" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated" />
|
||||
<option id="gnu.c.compiler.option.include.paths.139148132" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../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/CMSIS/Device/ST/STM32F4xx/Include" />
|
||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Utilities/Fonts}"" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Drivers/BSP/Components}"" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Drivers/BSP/STM32412G-Discovery}"" />
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1001009273" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))" />
|
||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))" />
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER" />
|
||||
<listOptionValue builtIn="false" value="STM32F412Zx" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1766545486" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1168227265" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1676226394" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s" />
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.953536380" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
|
||||
<option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1745085217" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.debug" valueType="enumerated" />
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.1358937795" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated" />
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1851773756" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../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/CMSIS/Device/ST/STM32F4xx/Include" />
|
||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" />
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.preprocessor.def.1101027785" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))" />
|
||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))" />
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER" />
|
||||
<listOptionValue builtIn="false" value="STM32F412Zx" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.203056511" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.759185457" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.182469992" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s" />
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.778712005" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
|
||||
<option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.608352848" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../STM32F412ZGTx_FLASH.ld" valueType="string" />
|
||||
<option id="gnu.c.link.option.libs.1229088125" name="Libraries (-l)" superClass="gnu.c.link.option.libs" />
|
||||
<option id="gnu.c.link.option.paths.2017226878" name="Library search path (-L)" superClass="gnu.c.link.option.paths" />
|
||||
<option id="gnu.c.link.option.ldflags.1752926105" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
|
||||
<option id="gnu.c.link.option.other.1704386579" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.556710932" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)" />
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.660094099" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
|
||||
<option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.778521967" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../STM32F412ZGTx_FLASH.ld" valueType="string" />
|
||||
<option id="gnu.cpp.link.option.libs.825816723" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" />
|
||||
<option id="gnu.cpp.link.option.paths.573701591" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" />
|
||||
<option id="gnu.cpp.link.option.flags.1511117039" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
|
||||
<option id="gnu.cpp.link.option.other.451653290" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1153958275" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)" />
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.380069542" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver" />
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.385533957" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
|
||||
<option id="gnu.both.asm.option.include.paths.1830336522" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1011383858" superClass="cdt.managedbuild.tool.gnu.assembler.input" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1157759614" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input" />
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Packs" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Inc" />
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings" />
|
||||
</cconfiguration>
|
||||
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings />
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser" />
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration 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="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex" && arm-none-eabi-size "${BuildArtifactFileName}"">
|
||||
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661." name="/" resourcePath="">
|
||||
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.293738536" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release">
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.327330765" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix" value="arm-none-eabi-" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1292439930" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F412ZGTx" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.board.1989889501" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="32F412GDISCOVERY" valueType="string" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="ARM Cortex-M4" />
|
||||
<listOptionValue builtIn="false" value="CM4" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1462895718" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet" value="fr.ac6.managedbuild.option.gnu.cross.instructionSet.thumbII" valueType="enumerated" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.fpu.1842363514" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu" value="fr.ac6.managedbuild.option.gnu.cross.fpu.fpv4-sp-d16" valueType="enumerated" />
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.979114293" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi" value="fr.ac6.managedbuild.option.gnu.cross.floatabi.hard" valueType="enumerated" />
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.711669049" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross" />
|
||||
<builder buildPath="${workspace_loc:/2P-ProjectPong}/Release" id="fr.ac6.managedbuild.builder.gnu.cross.1795211660" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="fr.ac6.managedbuild.builder.gnu.cross">
|
||||
<outputEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release" />
|
||||
</outputEntries>
|
||||
</builder>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1810252623" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.991062419" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.debug" valueType="enumerated" />
|
||||
<option id="gnu.c.compiler.option.debugging.level.785975152" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated" />
|
||||
<option id="gnu.c.compiler.option.include.paths.139148132" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../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/CMSIS/Device/ST/STM32F4xx/Include" />
|
||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Utilities/Fonts}"" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Drivers/BSP/Components}"" />
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/2P-ProjectPong/Drivers/BSP/STM32412G-Discovery}"" />
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1001009273" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))" />
|
||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))" />
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER" />
|
||||
<listOptionValue builtIn="false" value="STM32F412Zx" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1766545486" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1168227265" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1676226394" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s" />
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.953536380" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
|
||||
<option defaultValue="gnu.cpp.optimization.level.none" id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1745085217" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.debug" valueType="enumerated" />
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.1358937795" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.debugging.level.max" valueType="enumerated" />
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1851773756" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../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/CMSIS/Device/ST/STM32F4xx/Include" />
|
||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" />
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.preprocessor.def.symbols.1532878882" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))" />
|
||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))" />
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER" />
|
||||
<listOptionValue builtIn="false" value="STM32F412Zx" />
|
||||
</option>
|
||||
<option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other.203056511" name="Other flags" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.759185457" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.182469992" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s" />
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.778712005" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
|
||||
<option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.608352848" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../STM32F412ZGTx_FLASH.ld" valueType="string" />
|
||||
<option id="gnu.c.link.option.libs.1229088125" name="Libraries (-l)" superClass="gnu.c.link.option.libs" />
|
||||
<option id="gnu.c.link.option.paths.2017226878" name="Library search path (-L)" superClass="gnu.c.link.option.paths" />
|
||||
<option id="gnu.c.link.option.ldflags.1752926105" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
|
||||
<option id="gnu.c.link.option.other.1704386579" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.556710932" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)" />
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.660094099" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker">
|
||||
<option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script.778521967" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.script" value="../STM32F412ZGTx_FLASH.ld" valueType="string" />
|
||||
<option id="gnu.cpp.link.option.libs.825816723" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" />
|
||||
<option id="gnu.cpp.link.option.paths.573701591" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" />
|
||||
<option id="gnu.cpp.link.option.ldflags.1267310836" superClass="gnu.cpp.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string" />
|
||||
<option id="gnu.cpp.link.option.other.451653290" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1153958275" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)" />
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)" />
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.380069542" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver" />
|
||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release.360082764" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release">
|
||||
<option id="gnu.both.asm.option.include.paths.1830336522" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" />
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1011383858" superClass="cdt.managedbuild.tool.gnu.assembler.input" />
|
||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1157759614" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input" />
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Packs" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="startup" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src" />
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Inc" />
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings" />
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="2P-ProjectPong.fr.ac6.managedbuild.target.gnu.cross.exe.1687714442" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe" />
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="2P-ProjectPong" />
|
||||
</configuration>
|
||||
<configuration configurationName="Release" />
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="" />
|
||||
<scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661;fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1810252623;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1168227265">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="" />
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279;fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279.;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1810252623;fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1168227265">
|
||||
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="" />
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings" />
|
||||
</cproject>
|
2
2P-ProjectPong/.gitignore
vendored
Normal file
2
2P-ProjectPong/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/Debug/
|
||||
/Release/
|
14
2P-ProjectPong/.mxproject
Normal file
14
2P-ProjectPong/.mxproject
Normal file
@ -0,0 +1,14 @@
|
||||
[PreviousGenFiles]
|
||||
HeaderPath=D:/JCS/Documents/STM32_PROJECTS/2P-ProjectPong/Inc
|
||||
HeaderFiles=gpio.h;stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h;usart.h;i2c.h;quadspi.h;fsmc.h;RTE_Components.h;rng.h;tim.h;
|
||||
SourcePath=D:/JCS/Documents/STM32_PROJECTS/2P-ProjectPong/Src
|
||||
SourceFiles=gpio.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c;usart.c;i2c.c;quadspi.c;fsmc.c;rng.c;tim.c;
|
||||
|
||||
[PreviousLibFiles]
|
||||
LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_qspi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rng.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_qspi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rng.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f412zx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;
|
||||
|
||||
[PreviousUsedSW4STM32Files]
|
||||
SourceFiles=..\Src\main.c;..\Src\gpio.c;..\Src\fsmc.c;..\Src\i2c.c;..\Src\quadspi.c;..\Src\rng.c;..\Src\tim.c;..\Src\usart.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;../\Src/system_stm32f4xx.c;../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;null;
|
||||
HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc;
|
||||
CDefines=__weak:__attribute__((weak));__packed:__attribute__((__packed__));
|
||||
|
34
2P-ProjectPong/.project
Normal file
34
2P-ProjectPong/.project
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>2P-ProjectPong</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
<nature>fr.ac6.mcu.ide.core.MCUProjectNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>Utilities</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-3-PROJECT_LOC/STM32Cube/Repository/STM32Cube_FW_F4_V1.23.0/Utilities</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
25
2P-ProjectPong/.settings/language.settings.xml
Normal file
25
2P-ProjectPong/.settings/language.settings.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.549955279" name="Debug">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-260496995610817078" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
<configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1627959661" name="Release">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-260496995610817078" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
36
2P-ProjectPong/2P-ProjectPong Debug.cfg
Normal file
36
2P-ProjectPong/2P-ProjectPong Debug.cfg
Normal file
@ -0,0 +1,36 @@
|
||||
# This is an 32F412GDISCOVERY board with a single STM32F412ZGTx chip
|
||||
#
|
||||
# Generated by System Workbench for STM32
|
||||
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
|
||||
|
||||
source [find interface/stlink.cfg]
|
||||
|
||||
set WORKAREASIZE 0x8000
|
||||
|
||||
transport select "hla_swd"
|
||||
|
||||
set CHIPNAME STM32F412ZGTx
|
||||
set BOARDNAME 32F412GDISCOVERY
|
||||
|
||||
# CHIPNAMES state
|
||||
set CHIPNAME_CPU0_ACTIVATED 1
|
||||
|
||||
# Enable debug when in low power modes
|
||||
set ENABLE_LOW_POWER 1
|
||||
|
||||
# Stop Watchdog counters when halt
|
||||
set STOP_WATCHDOG 1
|
||||
|
||||
# STlink Debug clock frequency
|
||||
set CLOCK_FREQ 8000
|
||||
|
||||
# use hardware reset, connect under reset
|
||||
# connect_assert_srst needed if low power mode application running (WFI...)
|
||||
reset_config srst_only srst_nogate connect_assert_srst
|
||||
set CONNECT_UNDER_RESET 1
|
||||
|
||||
# BCTM CPU variables
|
||||
|
||||
|
||||
|
||||
source [find target/stm32f4x.cfg]
|
36
2P-ProjectPong/2P-ProjectPong Run.cfg
Normal file
36
2P-ProjectPong/2P-ProjectPong Run.cfg
Normal file
@ -0,0 +1,36 @@
|
||||
# This is an 32F412GDISCOVERY board with a single STM32F412ZGTx chip
|
||||
#
|
||||
# Generated by System Workbench for STM32
|
||||
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
|
||||
|
||||
source [find interface/stlink.cfg]
|
||||
|
||||
set WORKAREASIZE 0x8000
|
||||
|
||||
transport select "hla_swd"
|
||||
|
||||
set CHIPNAME STM32F412ZGTx
|
||||
set BOARDNAME 32F412GDISCOVERY
|
||||
|
||||
# CHIPNAMES state
|
||||
set CHIPNAME_CPU0_ACTIVATED 1
|
||||
|
||||
# Enable debug when in low power modes
|
||||
set ENABLE_LOW_POWER 1
|
||||
|
||||
# Stop Watchdog counters when halt
|
||||
set STOP_WATCHDOG 1
|
||||
|
||||
# STlink Debug clock frequency
|
||||
set CLOCK_FREQ 8000
|
||||
|
||||
# use hardware reset, connect under reset
|
||||
# connect_assert_srst needed if low power mode application running (WFI...)
|
||||
reset_config srst_only srst_nogate connect_assert_srst
|
||||
set CONNECT_UNDER_RESET 1
|
||||
|
||||
# BCTM CPU variables
|
||||
|
||||
|
||||
|
||||
source [find target/stm32f4x.cfg]
|
627
2P-ProjectPong/2P-ProjectPong.ioc
Normal file
627
2P-ProjectPong/2P-ProjectPong.ioc
Normal file
@ -0,0 +1,627 @@
|
||||
#MicroXplorer Configuration settings - do not modify
|
||||
File.Version=6
|
||||
KeepUserPlacement=false
|
||||
Mcu.Family=STM32F4
|
||||
Mcu.IP0=FSMC
|
||||
Mcu.IP1=I2C1
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=QUADSPI
|
||||
Mcu.IP4=RCC
|
||||
Mcu.IP5=RNG
|
||||
Mcu.IP6=SYS
|
||||
Mcu.IP7=TIM6
|
||||
Mcu.IP8=USART1
|
||||
Mcu.IPNb=9
|
||||
Mcu.Name=STM32F412Z(E-G)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PE2
|
||||
Mcu.Pin1=PE3
|
||||
Mcu.Pin10=PF9
|
||||
Mcu.Pin11=PH0 - OSC_IN
|
||||
Mcu.Pin12=PH1 - OSC_OUT
|
||||
Mcu.Pin13=PC2
|
||||
Mcu.Pin14=PA0
|
||||
Mcu.Pin15=PA2
|
||||
Mcu.Pin16=PA3
|
||||
Mcu.Pin17=PA4
|
||||
Mcu.Pin18=PB1
|
||||
Mcu.Pin19=PB2
|
||||
Mcu.Pin2=PE4
|
||||
Mcu.Pin20=PF11
|
||||
Mcu.Pin21=PF12
|
||||
Mcu.Pin22=PF14
|
||||
Mcu.Pin23=PF15
|
||||
Mcu.Pin24=PG0
|
||||
Mcu.Pin25=PG1
|
||||
Mcu.Pin26=PE7
|
||||
Mcu.Pin27=PE8
|
||||
Mcu.Pin28=PE9
|
||||
Mcu.Pin29=PE10
|
||||
Mcu.Pin3=PC14-OSC32_IN
|
||||
Mcu.Pin30=PE11
|
||||
Mcu.Pin31=PE12
|
||||
Mcu.Pin32=PE13
|
||||
Mcu.Pin33=PE14
|
||||
Mcu.Pin34=PE15
|
||||
Mcu.Pin35=PB10
|
||||
Mcu.Pin36=PB11
|
||||
Mcu.Pin37=PB12
|
||||
Mcu.Pin38=PD8
|
||||
Mcu.Pin39=PD9
|
||||
Mcu.Pin4=PC15-OSC32_OUT
|
||||
Mcu.Pin40=PD10
|
||||
Mcu.Pin41=PD11
|
||||
Mcu.Pin42=PD14
|
||||
Mcu.Pin43=PD15
|
||||
Mcu.Pin44=PG2
|
||||
Mcu.Pin45=PG4
|
||||
Mcu.Pin46=PG5
|
||||
Mcu.Pin47=PG6
|
||||
Mcu.Pin48=PG7
|
||||
Mcu.Pin49=PG8
|
||||
Mcu.Pin5=PF0
|
||||
Mcu.Pin50=PC7
|
||||
Mcu.Pin51=PC8
|
||||
Mcu.Pin52=PC9
|
||||
Mcu.Pin53=PA8
|
||||
Mcu.Pin54=PA9
|
||||
Mcu.Pin55=PA10
|
||||
Mcu.Pin56=PA11
|
||||
Mcu.Pin57=PA12
|
||||
Mcu.Pin58=PA13
|
||||
Mcu.Pin59=PA14
|
||||
Mcu.Pin6=PF5
|
||||
Mcu.Pin60=PA15
|
||||
Mcu.Pin61=PC10
|
||||
Mcu.Pin62=PC11
|
||||
Mcu.Pin63=PC12
|
||||
Mcu.Pin64=PD0
|
||||
Mcu.Pin65=PD1
|
||||
Mcu.Pin66=PD2
|
||||
Mcu.Pin67=PD3
|
||||
Mcu.Pin68=PD4
|
||||
Mcu.Pin69=PD5
|
||||
Mcu.Pin7=PF6
|
||||
Mcu.Pin70=PD7
|
||||
Mcu.Pin71=PB3
|
||||
Mcu.Pin72=PB4
|
||||
Mcu.Pin73=PB5
|
||||
Mcu.Pin74=PB6
|
||||
Mcu.Pin75=PB7
|
||||
Mcu.Pin76=PB9
|
||||
Mcu.Pin77=PE0
|
||||
Mcu.Pin78=PE1
|
||||
Mcu.Pin79=VP_FATFS_VS_SDIO
|
||||
Mcu.Pin8=PF7
|
||||
Mcu.Pin80=VP_RNG_VS_RNG
|
||||
Mcu.Pin81=VP_SYS_VS_Systick
|
||||
Mcu.Pin82=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin9=PF8
|
||||
Mcu.PinsNb=83
|
||||
Mcu.ThirdParty0=STMicroelectronics.X-CUBE-MEMS1.7.0.0
|
||||
Mcu.ThirdPartyNb=1
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F412ZGTx
|
||||
MxCube.Version=5.0.1
|
||||
MxDb.Version=DB.5.0.1
|
||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.EXTI0_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.I2C1_EV_IRQn=true\:0\:0\:true\:false\:true\:true
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
NVIC.TIM6_IRQn=true\:0\:0\:true\:false\:true\:true
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true
|
||||
PA0.GPIOParameters=GPIO_Label
|
||||
PA0.GPIO_Label=JOY_SEL [MT008-A_CENTER]
|
||||
PA0.Locked=true
|
||||
PA0.Signal=GPXTI0
|
||||
PA10.GPIOParameters=GPIO_Label
|
||||
PA10.GPIO_Label=USB_OTGFS_ID
|
||||
PA10.Locked=true
|
||||
PA10.Signal=USB_OTG_FS_ID
|
||||
PA11.GPIOParameters=GPIO_Label
|
||||
PA11.GPIO_Label=USB_OTGFS_DM
|
||||
PA11.Locked=true
|
||||
PA11.Signal=USB_OTG_FS_DM
|
||||
PA12.Locked=true
|
||||
PA12.Signal=USB_OTG_FS_DP
|
||||
PA13.GPIOParameters=GPIO_Label
|
||||
PA13.GPIO_Label=SWDIO
|
||||
PA13.Locked=true
|
||||
PA13.Signal=SYS_JTMS-SWDIO
|
||||
PA14.GPIOParameters=GPIO_Label
|
||||
PA14.GPIO_Label=SWCLK
|
||||
PA14.Locked=true
|
||||
PA14.Signal=SYS_JTCK-SWCLK
|
||||
PA15.Mode=Half_duplex(single_wire_mode)
|
||||
PA15.Signal=USART1_TX
|
||||
PA2.GPIOParameters=GPIO_Label
|
||||
PA2.GPIO_Label=STLINK_RX [STLINK_U2_RX]
|
||||
PA2.Locked=true
|
||||
PA2.Signal=USART2_TX
|
||||
PA3.GPIOParameters=GPIO_Label
|
||||
PA3.GPIO_Label=STLINK_TX [STLINK_U2_TX]
|
||||
PA3.Locked=true
|
||||
PA3.Signal=USART2_RX
|
||||
PA4.GPIOParameters=GPIO_Label
|
||||
PA4.GPIO_Label=CODEC_I2S3_WS [WM8994ECS/R_LRCLK1]
|
||||
PA4.Locked=true
|
||||
PA4.Signal=I2S3_WS
|
||||
PA8.GPIOParameters=GPIO_Label
|
||||
PA8.GPIO_Label=M2_CKIN
|
||||
PA8.Locked=true
|
||||
PA8.Signal=RCC_MCO_1
|
||||
PA9.GPIOParameters=GPIO_Label
|
||||
PA9.GPIO_Label=USB_OTGFS_VBUS
|
||||
PA9.Locked=true
|
||||
PA9.Signal=USB_OTG_FS_VBUS
|
||||
PB1.GPIOParameters=GPIO_Label
|
||||
PB1.GPIO_Label=DFSDM_DATIN0 [MP34DT01TR_DOUT]
|
||||
PB1.Locked=true
|
||||
PB1.Signal=S_DATAIN0DFSDM1
|
||||
PB10.GPIOParameters=GPIO_Label
|
||||
PB10.GPIO_Label=I2C2_SCL
|
||||
PB10.Locked=true
|
||||
PB10.Signal=I2C2_SCL
|
||||
PB11.GPIOParameters=GPIO_Label
|
||||
PB11.GPIO_Label=M2_CKIN
|
||||
PB11.Locked=true
|
||||
PB11.Signal=I2S_CKIN
|
||||
PB12.GPIOParameters=GPIO_Label
|
||||
PB12.GPIO_Label=CODEC_I2S3_SCK [WM8994ECS/R_BCLK1]
|
||||
PB12.Locked=true
|
||||
PB12.Signal=I2S3_CK
|
||||
PB2.GPIOParameters=GPIO_Label
|
||||
PB2.GPIO_Label=QSPI_CLK [N25Q128A13EF840F_C]
|
||||
PB2.Locked=true
|
||||
PB2.Mode=Single Bank 1
|
||||
PB2.Signal=QUADSPI_CLK
|
||||
PB3.GPIOParameters=GPIO_Label
|
||||
PB3.GPIO_Label=SWO
|
||||
PB3.Locked=true
|
||||
PB3.Signal=SYS_JTDO-SWO
|
||||
PB4.GPIOParameters=GPIO_Label
|
||||
PB4.GPIO_Label=CODEC_I2S3ext_SD [WM8994ECS/R_ACDAT1]
|
||||
PB4.Locked=true
|
||||
PB4.Signal=I2S3_ext_SD
|
||||
PB5.GPIOParameters=GPIO_Label
|
||||
PB5.GPIO_Label=CODEC_I2S3_SD [WM8994ECS/R_DACDAT1]
|
||||
PB5.Locked=true
|
||||
PB5.Signal=I2S3_SD
|
||||
PB6.GPIOParameters=GPIO_Label
|
||||
PB6.GPIO_Label=I2C1_SCL [WM8994ECS/R_SCLK]
|
||||
PB6.Locked=true
|
||||
PB6.Mode=I2C
|
||||
PB6.Signal=I2C1_SCL
|
||||
PB7.GPIOParameters=GPIO_Label
|
||||
PB7.GPIO_Label=I2C1_SDA [WM8994ECS/R_SDA]
|
||||
PB7.Locked=true
|
||||
PB7.Mode=I2C
|
||||
PB7.Signal=I2C1_SDA
|
||||
PB9.GPIOParameters=GPIO_Label
|
||||
PB9.GPIO_Label=I2C2_SDA
|
||||
PB9.Locked=true
|
||||
PB9.Signal=I2C2_SDA
|
||||
PC10.GPIOParameters=GPIO_Label
|
||||
PC10.GPIO_Label=uSD_D2
|
||||
PC10.Locked=true
|
||||
PC10.Signal=SDIO_D2
|
||||
PC11.GPIOParameters=GPIO_Label
|
||||
PC11.GPIO_Label=uSD_D3
|
||||
PC11.Locked=true
|
||||
PC11.Signal=SDIO_D3
|
||||
PC12.GPIOParameters=GPIO_Label
|
||||
PC12.GPIO_Label=uSD_CLK
|
||||
PC12.Locked=true
|
||||
PC12.Signal=SDIO_CK
|
||||
PC14-OSC32_IN.Locked=true
|
||||
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT.Locked=true
|
||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||
PC2.GPIOParameters=GPIO_Label
|
||||
PC2.GPIO_Label=DFSDM_CKOUT [MP34DT01TR_CLK]
|
||||
PC2.Locked=true
|
||||
PC2.Signal=S_CKOUTDFSDM1
|
||||
PC7.GPIOParameters=GPIO_Label
|
||||
PC7.GPIO_Label=CODEC_I2S3_MCK [WM8994ECS/R_MCLK1]
|
||||
PC7.Locked=true
|
||||
PC7.Signal=I2S3_MCK
|
||||
PC8.GPIOParameters=GPIO_Label
|
||||
PC8.GPIO_Label=uSD_D0
|
||||
PC8.Locked=true
|
||||
PC8.Signal=SDIO_D0
|
||||
PC9.GPIOParameters=GPIO_Label
|
||||
PC9.GPIO_Label=uSD_D1
|
||||
PC9.Locked=true
|
||||
PC9.Signal=SDIO_D1
|
||||
PCC.Checker=false
|
||||
PCC.Line=STM32F412
|
||||
PCC.MCU=STM32F412Z(E-G)Tx
|
||||
PCC.PartNumber=STM32F412ZGTx
|
||||
PCC.Seq0=0
|
||||
PCC.Series=STM32F4
|
||||
PCC.Temperature=25
|
||||
PCC.Vdd=null
|
||||
PD0.GPIOParameters=GPIO_Label
|
||||
PD0.GPIO_Label=D2
|
||||
PD0.Locked=true
|
||||
PD0.Signal=FSMC_D2_DA2
|
||||
PD1.GPIOParameters=GPIO_Label
|
||||
PD1.GPIO_Label=D3
|
||||
PD1.Locked=true
|
||||
PD1.Signal=FSMC_D3_DA3
|
||||
PD10.GPIOParameters=GPIO_Label
|
||||
PD10.GPIO_Label=D15
|
||||
PD10.Locked=true
|
||||
PD10.Signal=FSMC_D15_DA15
|
||||
PD11.GPIOParameters=GPIO_Label
|
||||
PD11.GPIO_Label=LCD_RESET
|
||||
PD11.Locked=true
|
||||
PD11.Signal=GPIO_Output
|
||||
PD14.GPIOParameters=GPIO_Label
|
||||
PD14.GPIO_Label=D0
|
||||
PD14.Locked=true
|
||||
PD14.Signal=FSMC_D0_DA0
|
||||
PD15.GPIOParameters=GPIO_Label
|
||||
PD15.GPIO_Label=D1
|
||||
PD15.Locked=true
|
||||
PD15.Signal=FSMC_D1_DA1
|
||||
PD2.GPIOParameters=GPIO_Label
|
||||
PD2.GPIO_Label=uSD_CMD
|
||||
PD2.Locked=true
|
||||
PD2.Signal=SDIO_CMD
|
||||
PD3.GPIOParameters=GPIO_Label
|
||||
PD3.GPIO_Label=uSD_DETECT
|
||||
PD3.Locked=true
|
||||
PD3.Signal=GPIO_Input
|
||||
PD4.GPIOParameters=GPIO_Label
|
||||
PD4.GPIO_Label=FMC_NOE
|
||||
PD4.Locked=true
|
||||
PD4.Signal=FSMC_NOE
|
||||
PD5.GPIOParameters=GPIO_Label
|
||||
PD5.GPIO_Label=FMC_NWE
|
||||
PD5.Locked=true
|
||||
PD5.Signal=FSMC_NWE
|
||||
PD7.GPIOParameters=GPIO_Label
|
||||
PD7.GPIO_Label=FMC_NE1
|
||||
PD7.Locked=true
|
||||
PD7.Mode=NorPsramChipSelect1_1
|
||||
PD7.Signal=FSMC_NE1
|
||||
PD8.GPIOParameters=GPIO_Label
|
||||
PD8.GPIO_Label=D13
|
||||
PD8.Locked=true
|
||||
PD8.Signal=FSMC_D13_DA13
|
||||
PD9.GPIOParameters=GPIO_Label
|
||||
PD9.GPIO_Label=D14
|
||||
PD9.Locked=true
|
||||
PD9.Signal=FSMC_D14_DA14
|
||||
PE0.GPIOParameters=GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PE0.GPIO_Label=LED1 [Green]
|
||||
PE0.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD
|
||||
PE0.Locked=true
|
||||
PE0.Signal=GPIO_Output
|
||||
PE1.GPIOParameters=GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PE1.GPIO_Label=LED2 [Orange]
|
||||
PE1.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD
|
||||
PE1.Locked=true
|
||||
PE1.Signal=GPIO_Output
|
||||
PE10.GPIOParameters=GPIO_Label
|
||||
PE10.GPIO_Label=D7
|
||||
PE10.Locked=true
|
||||
PE10.Signal=FSMC_D7_DA7
|
||||
PE11.GPIOParameters=GPIO_Label
|
||||
PE11.GPIO_Label=D8
|
||||
PE11.Locked=true
|
||||
PE11.Signal=FSMC_D8_DA8
|
||||
PE12.GPIOParameters=GPIO_Label
|
||||
PE12.GPIO_Label=D9
|
||||
PE12.Locked=true
|
||||
PE12.Signal=FSMC_D9_DA9
|
||||
PE13.GPIOParameters=GPIO_Label
|
||||
PE13.GPIO_Label=D10
|
||||
PE13.Locked=true
|
||||
PE13.Signal=FSMC_D10_DA10
|
||||
PE14.GPIOParameters=GPIO_Label
|
||||
PE14.GPIO_Label=D11
|
||||
PE14.Locked=true
|
||||
PE14.Signal=FSMC_D11_DA11
|
||||
PE15.GPIOParameters=GPIO_Label
|
||||
PE15.GPIO_Label=D12
|
||||
PE15.Locked=true
|
||||
PE15.Signal=FSMC_D12_DA12
|
||||
PE2.GPIOParameters=GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PE2.GPIO_Label=LED3 [Red]
|
||||
PE2.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD
|
||||
PE2.Locked=true
|
||||
PE2.Signal=GPIO_Output
|
||||
PE3.GPIOParameters=GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PE3.GPIO_Label=LED4 [Blue]
|
||||
PE3.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD
|
||||
PE3.Locked=true
|
||||
PE3.Signal=GPIO_Output
|
||||
PE4.GPIOParameters=GPIO_Label
|
||||
PE4.GPIO_Label=DFSDM_DATIN3 [MP23DB01MM_DOUT]
|
||||
PE4.Locked=true
|
||||
PE4.Signal=S_DATAIN3DFSDM1
|
||||
PE7.GPIOParameters=GPIO_Label
|
||||
PE7.GPIO_Label=D4
|
||||
PE7.Locked=true
|
||||
PE7.Signal=FSMC_D4_DA4
|
||||
PE8.GPIOParameters=GPIO_Label
|
||||
PE8.GPIO_Label=D5
|
||||
PE8.Locked=true
|
||||
PE8.Signal=FSMC_D5_DA5
|
||||
PE9.GPIOParameters=GPIO_Label
|
||||
PE9.GPIO_Label=D6
|
||||
PE9.Locked=true
|
||||
PE9.Signal=FSMC_D6_DA6
|
||||
PF0.GPIOParameters=GPIO_Label
|
||||
PF0.GPIO_Label=A0
|
||||
PF0.Locked=true
|
||||
PF0.Signal=FSMC_A0
|
||||
PF11.GPIOParameters=GPIO_Label
|
||||
PF11.GPIO_Label=EXT_RESET
|
||||
PF11.Locked=true
|
||||
PF11.Signal=GPIO_Output
|
||||
PF12.GPIOParameters=GPIO_Label
|
||||
PF12.GPIO_Label=CTP_RST
|
||||
PF12.Locked=true
|
||||
PF12.Signal=GPIO_Output
|
||||
PF14.GPIOParameters=GPIO_Label
|
||||
PF14.GPIO_Label=JOY_RIGHT [MT008-A_RIGHT]
|
||||
PF14.Locked=true
|
||||
PF14.Signal=GPIO_Input
|
||||
PF15.GPIOParameters=GPIO_Label
|
||||
PF15.GPIO_Label=JOY_LEFT [MT008-A_LEFT]
|
||||
PF15.Locked=true
|
||||
PF15.Signal=GPIO_Input
|
||||
PF5.GPIOParameters=GPIO_Label
|
||||
PF5.GPIO_Label=LCD_BLCTRL [STT5N2VH5_Gate]
|
||||
PF5.Locked=true
|
||||
PF5.Signal=GPIO_Output
|
||||
PF6.GPIOParameters=GPIO_Label
|
||||
PF6.GPIO_Label=QSPI_BK1_IO3 [N25Q128A13EF840F_DQ3]
|
||||
PF6.Locked=true
|
||||
PF6.Mode=Single Bank 1
|
||||
PF6.Signal=QUADSPI_BK1_IO3
|
||||
PF7.GPIOParameters=GPIO_Label
|
||||
PF7.GPIO_Label=QSPI_BK1_IO2 [N25Q128A13EF840F_DQ2]
|
||||
PF7.Locked=true
|
||||
PF7.Mode=Single Bank 1
|
||||
PF7.Signal=QUADSPI_BK1_IO2
|
||||
PF8.GPIOParameters=GPIO_Label
|
||||
PF8.GPIO_Label=QSPI_BK1_IO0 [N25Q128A13EF840F_DQ0]
|
||||
PF8.Locked=true
|
||||
PF8.Mode=Single Bank 1
|
||||
PF8.Signal=QUADSPI_BK1_IO0
|
||||
PF9.GPIOParameters=GPIO_Label
|
||||
PF9.GPIO_Label=QSPI_BK1_IO1 [N25Q128A13EF840F_DQ1]
|
||||
PF9.Locked=true
|
||||
PF9.Mode=Single Bank 1
|
||||
PF9.Signal=QUADSPI_BK1_IO1
|
||||
PG0.GPIOParameters=GPIO_Label
|
||||
PG0.GPIO_Label=JOY_UP [MT008-A_UP]
|
||||
PG0.Locked=true
|
||||
PG0.Signal=GPIO_Input
|
||||
PG1.GPIOParameters=GPIO_Label
|
||||
PG1.GPIO_Label=JOY_DOWN [MT008-A_DOWN]
|
||||
PG1.Locked=true
|
||||
PG1.Signal=GPIO_Input
|
||||
PG2.GPIOParameters=GPIO_Label
|
||||
PG2.GPIO_Label=CODEC_INT [WM8994ECS/R_ADCLRCLK1/GPIO1]
|
||||
PG2.Locked=true
|
||||
PG2.Signal=GPXTI2
|
||||
PG4.GPIOParameters=GPIO_Label
|
||||
PG4.GPIO_Label=LCD_TE
|
||||
PG4.Locked=true
|
||||
PG4.Signal=GPIO_Input
|
||||
PG5.GPIOParameters=GPIO_Label
|
||||
PG5.GPIO_Label=CTP_INT
|
||||
PG5.Locked=true
|
||||
PG5.Signal=GPXTI5
|
||||
PG6.GPIOParameters=GPIO_Label
|
||||
PG6.GPIO_Label=QSPI_BK1_NCS [N25Q128A13EF840F_S]
|
||||
PG6.Locked=true
|
||||
PG6.Mode=Single Bank 1
|
||||
PG6.Signal=QUADSPI_BK1_NCS
|
||||
PG7.GPIOParameters=GPIO_Label
|
||||
PG7.GPIO_Label=USB_OTGFS_OVRCR [STMPS2141STR_FAULT]
|
||||
PG7.Locked=true
|
||||
PG7.Signal=GPIO_Input
|
||||
PG8.GPIOParameters=PinState,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PG8.GPIO_Label=USB_OTGFS_PPWR_EN [STMPS2141STR_EN]
|
||||
PG8.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_OD
|
||||
PG8.Locked=true
|
||||
PG8.PinState=GPIO_PIN_SET
|
||||
PG8.Signal=GPIO_Output
|
||||
PH0\ -\ OSC_IN.GPIOParameters=GPIO_Label
|
||||
PH0\ -\ OSC_IN.GPIO_Label=STLK_MCO
|
||||
PH0\ -\ OSC_IN.Locked=true
|
||||
PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator
|
||||
PH0\ -\ OSC_IN.Signal=RCC_OSC_IN
|
||||
PH1\ -\ OSC_OUT.Locked=true
|
||||
PH1\ -\ OSC_OUT.Mode=HSE-External-Oscillator
|
||||
PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT
|
||||
PinOutPanel.RotationAngle=0
|
||||
ProjectManager.AskForMigrate=true
|
||||
ProjectManager.BackupPrevious=false
|
||||
ProjectManager.CompilerOptimize=6
|
||||
ProjectManager.ComputerToolchain=false
|
||||
ProjectManager.CoupleFile=true
|
||||
ProjectManager.CustomerFirmwarePackage=
|
||||
ProjectManager.DefaultFWLocation=true
|
||||
ProjectManager.DeletePrevious=true
|
||||
ProjectManager.DeviceId=STM32F412ZGTx
|
||||
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.23.0
|
||||
ProjectManager.FreePins=false
|
||||
ProjectManager.HalAssertFull=false
|
||||
ProjectManager.HeapSize=0x200
|
||||
ProjectManager.KeepUserCode=true
|
||||
ProjectManager.LastFirmware=true
|
||||
ProjectManager.LibraryCopy=1
|
||||
ProjectManager.MainLocation=Src
|
||||
ProjectManager.NoMain=false
|
||||
ProjectManager.PreviousToolchain=SW4STM32
|
||||
ProjectManager.ProjectBuild=false
|
||||
ProjectManager.ProjectFileName=2P-ProjectPong.ioc
|
||||
ProjectManager.ProjectName=2P-ProjectPong
|
||||
ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=SW4STM32
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_FSMC_Init-FSMC-false-HAL-true,6-MX_QUADSPI_Init-QUADSPI-false-HAL-true,7-MX_RNG_Init-RNG-false-HAL-true,8-MX_TIM6_Init-TIM6-false-HAL-true
|
||||
RCC.48MHZClocksFreq_Value=48000000
|
||||
RCC.AHBFreq_Value=16000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV2
|
||||
RCC.APB1Freq_Value=8000000
|
||||
RCC.APB1TimFreq_Value=16000000
|
||||
RCC.APB2Freq_Value=16000000
|
||||
RCC.APB2TimFreq_Value=16000000
|
||||
RCC.CortexFreq_Value=16000000
|
||||
RCC.DFSDMAudioFreq_Value=100000000
|
||||
RCC.DFSDMFreq_Value=16000000
|
||||
RCC.FCLKCortexFreq_Value=16000000
|
||||
RCC.FMPI2C1Freq_Value=8000000
|
||||
RCC.FamilyName=M
|
||||
RCC.HCLKFreq_Value=16000000
|
||||
RCC.HSE_VALUE=8000000
|
||||
RCC.HSI_VALUE=16000000
|
||||
RCC.I2S1Freq_Value=100000000
|
||||
RCC.I2S2Freq_Value=100000000
|
||||
RCC.I2SClocksFreq_Value=150000000
|
||||
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDMAudioFreq_Value,DFSDMFreq_Value,FCLKCortexFreq_Value,FMPI2C1Freq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2S1Freq_Value,I2S2Freq_Value,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLI2SM,PLLI2SN,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SQoutputFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SoutputFreq_Value,PLLM,PLLN,PLLP,PLLQ,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLRoutputFreq_Value,PWRFreq_Value,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SDIOFreq_Value,SYSCLKFreq_VALUE,USBFreq_Value,VCOI2SInputFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOInputMFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
||||
RCC.LSE_VALUE=0.032768
|
||||
RCC.LSI_VALUE=32000
|
||||
RCC.MCO2PinFreq_Value=16000000
|
||||
RCC.PLLCLKFreq_Value=36000000
|
||||
RCC.PLLI2SM=4
|
||||
RCC.PLLI2SN=50
|
||||
RCC.PLLI2SPCLKFreq_Value=100000000
|
||||
RCC.PLLI2SQCLKFreq_Value=100000000
|
||||
RCC.PLLI2SQoutputFreq_Value=100000000
|
||||
RCC.PLLI2SRCLKFreq_Value=100000000
|
||||
RCC.PLLI2SoutputFreq_Value=100000000
|
||||
RCC.PLLM=8
|
||||
RCC.PLLN=72
|
||||
RCC.PLLP=RCC_PLLP_DIV4
|
||||
RCC.PLLQ=3
|
||||
RCC.PLLQCLKFreq_Value=48000000
|
||||
RCC.PLLQoutputFreq_Value=48000000
|
||||
RCC.PLLRCLKFreq_Value=72000000
|
||||
RCC.PLLRoutputFreq_Value=72000000
|
||||
RCC.PWRFreq_Value=16000000
|
||||
RCC.RNGFreq_Value=48000000
|
||||
RCC.RTCFreq_Value=32000
|
||||
RCC.RTCHSEDivFreq_Value=12500000
|
||||
RCC.SDIOFreq_Value=48000000
|
||||
RCC.SYSCLKFreq_VALUE=16000000
|
||||
RCC.USBFreq_Value=48000000
|
||||
RCC.VCOI2SInputFreq_Value=4000000
|
||||
RCC.VCOI2SOutputFreq_Value=200000000
|
||||
RCC.VCOInputFreq_Value=2000000
|
||||
RCC.VCOInputMFreq_Value=1562500
|
||||
RCC.VCOOutputFreq_Value=144000000
|
||||
RCC.VcooutputI2S=150000000
|
||||
SH.FSMC_A0.0=FSMC_A0,A0_1
|
||||
SH.FSMC_A0.ConfNb=1
|
||||
SH.FSMC_D0_DA0.0=FSMC_D0,16b-d1
|
||||
SH.FSMC_D0_DA0.ConfNb=1
|
||||
SH.FSMC_D10_DA10.0=FSMC_D10,16b-d1
|
||||
SH.FSMC_D10_DA10.ConfNb=1
|
||||
SH.FSMC_D11_DA11.0=FSMC_D11,16b-d1
|
||||
SH.FSMC_D11_DA11.ConfNb=1
|
||||
SH.FSMC_D12_DA12.0=FSMC_D12,16b-d1
|
||||
SH.FSMC_D12_DA12.ConfNb=1
|
||||
SH.FSMC_D13_DA13.0=FSMC_D13,16b-d1
|
||||
SH.FSMC_D13_DA13.ConfNb=1
|
||||
SH.FSMC_D14_DA14.0=FSMC_D14,16b-d1
|
||||
SH.FSMC_D14_DA14.ConfNb=1
|
||||
SH.FSMC_D15_DA15.0=FSMC_D15,16b-d1
|
||||
SH.FSMC_D15_DA15.ConfNb=1
|
||||
SH.FSMC_D1_DA1.0=FSMC_D1,16b-d1
|
||||
SH.FSMC_D1_DA1.ConfNb=1
|
||||
SH.FSMC_D2_DA2.0=FSMC_D2,16b-d1
|
||||
SH.FSMC_D2_DA2.ConfNb=1
|
||||
SH.FSMC_D3_DA3.0=FSMC_D3,16b-d1
|
||||
SH.FSMC_D3_DA3.ConfNb=1
|
||||
SH.FSMC_D4_DA4.0=FSMC_D4,16b-d1
|
||||
SH.FSMC_D4_DA4.ConfNb=1
|
||||
SH.FSMC_D5_DA5.0=FSMC_D5,16b-d1
|
||||
SH.FSMC_D5_DA5.ConfNb=1
|
||||
SH.FSMC_D6_DA6.0=FSMC_D6,16b-d1
|
||||
SH.FSMC_D6_DA6.ConfNb=1
|
||||
SH.FSMC_D7_DA7.0=FSMC_D7,16b-d1
|
||||
SH.FSMC_D7_DA7.ConfNb=1
|
||||
SH.FSMC_D8_DA8.0=FSMC_D8,16b-d1
|
||||
SH.FSMC_D8_DA8.ConfNb=1
|
||||
SH.FSMC_D9_DA9.0=FSMC_D9,16b-d1
|
||||
SH.FSMC_D9_DA9.ConfNb=1
|
||||
SH.FSMC_NOE.0=FSMC_NOE,Lcd1
|
||||
SH.FSMC_NOE.ConfNb=1
|
||||
SH.FSMC_NWE.0=FSMC_NWE,Lcd1
|
||||
SH.FSMC_NWE.ConfNb=1
|
||||
SH.GPXTI0.0=GPIO_EXTI0
|
||||
SH.GPXTI0.ConfNb=1
|
||||
SH.GPXTI2.0=GPIO_EXTI2
|
||||
SH.GPXTI2.ConfNb=1
|
||||
SH.GPXTI5.0=GPIO_EXTI5
|
||||
SH.GPXTI5.ConfNb=1
|
||||
SH.S_CKOUTDFSDM1.0=DFSDM1_CKOUT
|
||||
SH.S_CKOUTDFSDM1.ConfNb=1
|
||||
SH.S_DATAIN0DFSDM1.0=DFSDM1_DATIN0
|
||||
SH.S_DATAIN0DFSDM1.ConfNb=1
|
||||
SH.S_DATAIN3DFSDM1.0=DFSDM1_DATIN3
|
||||
SH.S_DATAIN3DFSDM1.ConfNb=1
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiComponent0=Board Extension\:IKS01A3
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiComponent1=Board Extension\:IKS01A2
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiComponent2=Board Extension\:IKS02A1
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiDoc0=Documentation/X_CUBE_MEMS1.chm
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiDoc1=Documentation/X_CUBE_MEMS1.chm
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.apiDoc2=Documentation/X_CUBE_MEMS1.chm
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.cmp_version0=7.0.0
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.component0=Board Extension
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.description0=MEMS Expansion Boards Library,X-NUCLEO-IKS01A2 BSP component drivers
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.diagnostic0=This component should operate correctly.
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.documentation0=Documentation/STMicroelectronics.X-CUBE-MEMS1_GettingStarted.pdf
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.group0=IKS01A2
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.paramName0=MEMSCcBoardOoExtensionJjIKS01A2
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS.sevirity0=none
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_Checked=false
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_apiSize=3
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_bundle=MEMS
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_class=BoardOoExtension
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_name=X-CUBE-MEMS1
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_size=1
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_vendor=STMicroelectronics
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.BoardOoExtensionJjMEMS_version=7.0.0
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.IPParameters=MEMSCcBoardOoExtensionJjIKS01A2
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0.MEMSCcBoardOoExtensionJjIKS01A2=true
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_BoardOoComponentJjMEMS_RteComponentsize=0
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_BoardOoExtensionJjMEMS_RteComponent0=\#define IKS01A2
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_BoardOoExtensionJjMEMS_RteComponentsize=1
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_BoardOoSupportJjSTM32CubeIiCustomIiBSPIiDrivers_RteComponentsize=0
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_DeviceJjApplication_RteComponentsize=0
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_SwParameter=MEMSCcBoardOoExtensionJjIKS01A2\:true;
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_description=Drivers and sample applications for MEMS components
|
||||
STMicroelectronics.X-CUBE-MEMS1.7.0.0_license=en.DM00367782.pdf
|
||||
TIM6.IPParameters=Prescaler,TIM_MasterOutputTrigger,Period
|
||||
TIM6.Period=9
|
||||
TIM6.Prescaler=16000
|
||||
TIM6.TIM_MasterOutputTrigger=TIM_TRGO_RESET
|
||||
USART1.IPParameters=VirtualMode
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
VP_FATFS_VS_SDIO.Signal=FATFS_VS_SDIO
|
||||
VP_RNG_VS_RNG.Mode=RNG_Activate
|
||||
VP_RNG_VS_RNG.Signal=RNG_VS_RNG
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT
|
||||
board=32F412GDISCOVERY
|
||||
boardIOC=true
|
19
2P-ProjectPong/32F412GDISCOVERY.xml
Normal file
19
2P-ProjectPong/32F412GDISCOVERY.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE targetDefinitions [
|
||||
<!ELEMENT targetDefinitions (board)>
|
||||
<!ELEMENT board (name, dbgIF+, dbgDEV, mcuId)>
|
||||
<!ELEMENT name (#PCDATA)>
|
||||
<!ELEMENT dbgIF (#PCDATA)>
|
||||
<!ELEMENT dbgDEV (#PCDATA)>
|
||||
<!ELEMENT mcuId (#PCDATA)>
|
||||
<!ATTLIST board id CDATA #REQUIRED>
|
||||
]>
|
||||
|
||||
<targetDefinitions>
|
||||
<board id="32f412gdiscovery">
|
||||
<name>32F412GDISCOVERY</name>
|
||||
<dbgIF>SWD</dbgIF>
|
||||
<dbgDEV>ST-Link</dbgDEV>
|
||||
<mcuId>stm32f412zgtx</mcuId>
|
||||
</board>
|
||||
</targetDefinitions>
|
759
2P-ProjectPong/Drivers/BSP/Components/Common/Release_Notes.html
Normal file
759
2P-ProjectPong/Drivers/BSP/Components/Common/Release_Notes.html
Normal file
@ -0,0 +1,759 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for BSP Components Common Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for BSP Components Common Drivers</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.1 / 21-July-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">tsensor.h: Fix compilation issue on TSENSOR_InitTypeDef</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0 / 22-June-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">accelero.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">ACCELERO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">audio.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">AUDIO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">idd.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">Shunt0StabDelay, Shunt1StabDelay, Shunt2StabDelay, Shunt3StabDelay, Shunt4StabDelay and ShuntNbOnBoard </span></span><span style="font-size: 10pt; font-family: Verdana;">fields in <span style="font-style: italic;">IDD_ConfigTypeDef</span> </span><span style="font-size: 10pt; font-family: Verdana;">structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">rename <span style="font-style: italic;">ShuntNumber</span> field to <span style="font-style: italic;">ShuntNbUsed</span> in </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">magneto.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">MAGNETO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">Important Note:</span> this release V4.0.0 is not backward compatible with V3.0.0</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0 / 28-April-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">accelero.h: </span><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">*LowPower</span> field in <span style="font-style: italic;">ACCELERO_DrvTypeDef</span> structure</span><span style="font-size: 10pt; font-family: Verdana;"></span></li><li><span style="font-size: 10pt; font-family: Verdana;">magneto.h: </span><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">*LowPower</span> field in <span style="font-style: italic;">MAGNETO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">gyro.h: add <span style="font-style: italic;">*DeInit</span> and <span style="font-style: italic;">*LowPower</span> fields in <span style="font-style: italic;">GYRO_DrvTypeDef</span> structure<br></span></li><li><span style="font-size: 10pt; font-family: Verdana;">camera.h: add <span style="font-style: italic;">CAMERA_COLOR_EFFECT_NONE</span> define</span></li><li><span style="font-size: 10pt; font-family: Verdana;">idd.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">MeasureNb</span>, <span style="font-style: italic;">DeltaDelayUnit</span> and <span style="font-style: italic;">DeltaDelayValue</span> fields in <span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">rename <span style="font-style: italic;">PreDelay</span> field to <span style="font-style: italic;">PreDelayUnit</span> in </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li></ul>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">Important Note:</span> this release V3.0.0 is not backward compatible with V2.2.0<br>
|
||||
</span></li>
|
||||
</ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.2.0 / 09-February-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Magnetometer </span><span style="font-size: 10pt; font-family: Verdana;">driver function prototypes added (magneto.h file)</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Update "idd.h" file to provide DeInit() and WakeUp() services in IDD current measurement driver</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.1.0 / 06-February-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">IDD current measurement </span><span style="font-size: 10pt; font-family: Verdana;">driver function prototypes added (idd.h file)</span></li><li><span style="font-size: 10pt; font-family: Verdana;">io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values<br></span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 15-December-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update "io.h" file to support MFX (Multi Function eXpander) device available on some STM32 boards</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add new entries for IO_ModeTypedef enumeration structure</span><span style="font-size: 10pt; font-family: Verdana;"></span></li><li><span style="font-size: 10pt; font-family: Verdana;">update the IO_DrvTypeDef structure</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update all return values and function parameters to uint32_t</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add a return value for Config field</span></li></ul></ul><li style="font-family: Verdana;"><small><span style="font-weight: bold;">Important Note</span>: this version V2.0.0 is not backward compatible with V1.2.1</small></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.1 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.0 / 18-June-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">EPD (</span><span style="font-size: 10pt; font-family: Verdana;">E Paper Display) driver function prototype added (epd.h file)<br>
|
||||
</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 21-March-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Temperature Sensor driver function prototype added</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">First official release with </span><span style="font-size: 10pt; font-family: Verdana;">Accelerometer, </span><span style="font-size: 10pt; font-family: Verdana;">Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes </span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
143
2P-ProjectPong/Drivers/BSP/Components/Common/accelero.h
Normal file
143
2P-ProjectPong/Drivers/BSP/Components/Common/accelero.h
Normal file
@ -0,0 +1,143 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file accelero.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the Accelerometer driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ACCELERO_H
|
||||
#define __ACCELERO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ACCELERO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Driver_structure Accelerometer Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(void);
|
||||
void (*ConfigIT)(void);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t);
|
||||
void (*ClearIT)(void);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(int16_t *);
|
||||
}ACCELERO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Configuration_structure Accelerometer Configuration structure
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* ACCELERO struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Power_Mode; /* Power-down/Normal Mode */
|
||||
uint8_t AccOutput_DataRate; /* OUT data rate */
|
||||
uint8_t Axes_Enable; /* Axes enable */
|
||||
uint8_t High_Resolution; /* High Resolution enabling/disabling */
|
||||
uint8_t BlockData_Update; /* Block Data Update */
|
||||
uint8_t Endianness; /* Endian Data selection */
|
||||
uint8_t AccFull_Scale; /* Full Scale selection */
|
||||
uint8_t Communication_Mode;
|
||||
}ACCELERO_InitTypeDef;
|
||||
|
||||
/* ACCELERO High Pass Filter struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
|
||||
uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
|
||||
uint8_t HighPassFilter_AOI1; /* HPF_enabling/disabling for AOI function on interrupt 1 */
|
||||
uint8_t HighPassFilter_AOI2; /* HPF_enabling/disabling for AOI function on interrupt 2 */
|
||||
uint8_t HighPassFilter_Data_Sel;
|
||||
uint8_t HighPassFilter_Stat;
|
||||
}ACCELERO_FilterConfigTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ACCELERO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
122
2P-ProjectPong/Drivers/BSP/Components/Common/audio.h
Normal file
122
2P-ProjectPong/Drivers/BSP/Components/Common/audio.h
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file audio.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the Audio driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AUDIO_H
|
||||
#define __AUDIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup AUDIO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Codec audio Standards */
|
||||
#define CODEC_STANDARD 0x04
|
||||
#define I2S_STANDARD I2S_STANDARD_PHILIPS
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Driver_structure Audio Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t);
|
||||
void (*DeInit)(void);
|
||||
uint32_t (*ReadID)(uint16_t);
|
||||
uint32_t (*Play)(uint16_t, uint16_t*, uint16_t);
|
||||
uint32_t (*Pause)(uint16_t);
|
||||
uint32_t (*Resume)(uint16_t);
|
||||
uint32_t (*Stop)(uint16_t, uint32_t);
|
||||
uint32_t (*SetFrequency)(uint16_t, uint32_t);
|
||||
uint32_t (*SetVolume)(uint16_t, uint8_t);
|
||||
uint32_t (*SetMute)(uint16_t, uint32_t);
|
||||
uint32_t (*SetOutputMode)(uint16_t, uint8_t);
|
||||
uint32_t (*Reset)(uint16_t);
|
||||
}AUDIO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AUDIO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
141
2P-ProjectPong/Drivers/BSP/Components/Common/camera.h
Normal file
141
2P-ProjectPong/Drivers/BSP/Components/Common/camera.h
Normal file
@ -0,0 +1,141 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file camera.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __CAMERA_H
|
||||
#define __CAMERA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CAMERA
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup CAMERA_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Driver_structure Camera Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, uint32_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Config)(uint16_t, uint32_t, uint32_t, uint32_t);
|
||||
}CAMERA_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define CAMERA_R160x120 0x00 /* QQVGA Resolution */
|
||||
#define CAMERA_R320x240 0x01 /* QVGA Resolution */
|
||||
#define CAMERA_R480x272 0x02 /* 480x272 Resolution */
|
||||
#define CAMERA_R640x480 0x03 /* VGA Resolution */
|
||||
|
||||
#define CAMERA_CONTRAST_BRIGHTNESS 0x00 /* Camera contrast brightness features */
|
||||
#define CAMERA_BLACK_WHITE 0x01 /* Camera black white feature */
|
||||
#define CAMERA_COLOR_EFFECT 0x03 /* Camera color effect feature */
|
||||
|
||||
#define CAMERA_BRIGHTNESS_LEVEL0 0x00 /* Brightness level -2 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL1 0x01 /* Brightness level -1 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL2 0x02 /* Brightness level 0 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL3 0x03 /* Brightness level +1 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL4 0x04 /* Brightness level +2 */
|
||||
|
||||
#define CAMERA_CONTRAST_LEVEL0 0x05 /* Contrast level -2 */
|
||||
#define CAMERA_CONTRAST_LEVEL1 0x06 /* Contrast level -1 */
|
||||
#define CAMERA_CONTRAST_LEVEL2 0x07 /* Contrast level 0 */
|
||||
#define CAMERA_CONTRAST_LEVEL3 0x08 /* Contrast level +1 */
|
||||
#define CAMERA_CONTRAST_LEVEL4 0x09 /* Contrast level +2 */
|
||||
|
||||
#define CAMERA_BLACK_WHITE_BW 0x00 /* Black and white effect */
|
||||
#define CAMERA_BLACK_WHITE_NEGATIVE 0x01 /* Negative effect */
|
||||
#define CAMERA_BLACK_WHITE_BW_NEGATIVE 0x02 /* BW and Negative effect */
|
||||
#define CAMERA_BLACK_WHITE_NORMAL 0x03 /* Normal effect */
|
||||
|
||||
#define CAMERA_COLOR_EFFECT_NONE 0x00 /* No effects */
|
||||
#define CAMERA_COLOR_EFFECT_BLUE 0x01 /* Blue effect */
|
||||
#define CAMERA_COLOR_EFFECT_GREEN 0x02 /* Green effect */
|
||||
#define CAMERA_COLOR_EFFECT_RED 0x03 /* Red effect */
|
||||
#define CAMERA_COLOR_EFFECT_ANTIQUE 0x04 /* Antique effect */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CAMERA_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
104
2P-ProjectPong/Drivers/BSP/Components/Common/dpredriver.h
Normal file
104
2P-ProjectPong/Drivers/BSP/Components/Common/dpredriver.h
Normal file
@ -0,0 +1,104 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file dpredriver.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* DisplayPort Linear Redriver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __DPREDRIVER_H
|
||||
#define __DPREDRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup DPREDRIVER
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Channel_Identifier Channel Identifier
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CHANNEL_DP0 = 0,
|
||||
CHANNEL_DP1,
|
||||
CHANNEL_DP2,
|
||||
CHANNEL_DP3,
|
||||
CHANNEL_RX1,
|
||||
CHANNEL_RX2,
|
||||
CHANNEL_SSTX
|
||||
} DPREDRIVER_ChannelId_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Driver_structure DisplayPort Linear Redriver Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetEQGain)(uint16_t, DPREDRIVER_ChannelId_t, uint8_t);
|
||||
uint32_t (*EnableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
uint32_t (*DisableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
}DPREDRIVER_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __DPREDRIVER_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
100
2P-ProjectPong/Drivers/BSP/Components/Common/env_sensor.h
Normal file
100
2P-ProjectPong/Drivers/BSP/Components/Common/env_sensor.h
Normal file
@ -0,0 +1,100 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file env_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* temperature driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef ENV_SENSORS_H
|
||||
#define ENV_SENSORS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS ENV_SENSORS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS_Public_Types ENV_SENSORS Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ENV_SENSORS driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} ENV_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetValue ) ( void *, float * );
|
||||
} ENV_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ENV_SENSORS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
115
2P-ProjectPong/Drivers/BSP/Components/Common/epd.h
Normal file
115
2P-ProjectPong/Drivers/BSP/Components/Common/epd.h
Normal file
@ -0,0 +1,115 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file epd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* EPD (E Paper Display) driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __EPD_H
|
||||
#define __EPD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EPD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Driver_structure E Paper Display Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
void (*WritePixel)(uint8_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*RefreshDisplay)(void);
|
||||
void (*CloseChargePump)(void);
|
||||
|
||||
uint16_t (*GetEpdPixelWidth)(void);
|
||||
uint16_t (*GetEpdPixelHeight)(void);
|
||||
void (*DrawImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}
|
||||
EPD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
145
2P-ProjectPong/Drivers/BSP/Components/Common/gyro.h
Normal file
145
2P-ProjectPong/Drivers/BSP/Components/Common/gyro.h
Normal file
@ -0,0 +1,145 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file gyro.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the gyroscope driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __GYRO_H
|
||||
#define __GYRO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup GYRO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Driver_structure Gyroscope Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(uint16_t);
|
||||
void (*ConfigIT)(uint16_t);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t, uint16_t);
|
||||
void (*ClearIT)(uint16_t, uint16_t);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(float *);
|
||||
}GYRO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Config_structure Gyroscope Configuration structure
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Power_Mode; /* Power-down/Sleep/Normal Mode */
|
||||
uint8_t Output_DataRate; /* OUT data rate */
|
||||
uint8_t Axes_Enable; /* Axes enable */
|
||||
uint8_t Band_Width; /* Bandwidth selection */
|
||||
uint8_t BlockData_Update; /* Block Data Update */
|
||||
uint8_t Endianness; /* Endian Data selection */
|
||||
uint8_t Full_Scale; /* Full Scale selection */
|
||||
}GYRO_InitTypeDef;
|
||||
|
||||
/* GYRO High Pass Filter struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
|
||||
uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
|
||||
}GYRO_FilterConfigTypeDef;
|
||||
|
||||
/*GYRO Interrupt struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Latch_Request; /* Latch interrupt request into CLICK_SRC register */
|
||||
uint8_t Interrupt_Axes; /* X, Y, Z Axes Interrupts */
|
||||
uint8_t Interrupt_ActiveEdge; /* Interrupt Active edge */
|
||||
}GYRO_InterruptConfigTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GYRO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
168
2P-ProjectPong/Drivers/BSP/Components/Common/idd.h
Normal file
168
2P-ProjectPong/Drivers/BSP/Components/Common/idd.h
Normal file
@ -0,0 +1,168 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file idd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the IDD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __IDD_H
|
||||
#define __IDD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IDD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Exported_Types IDD Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Config_structure IDD Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t AmpliGain; /*!< Specifies ampli gain value
|
||||
*/
|
||||
uint16_t VddMin; /*!< Specifies minimum MCU VDD can reach to protect MCU from reset
|
||||
*/
|
||||
uint16_t Shunt0Value; /*!< Specifies value of Shunt 0 if existing
|
||||
*/
|
||||
uint16_t Shunt1Value; /*!< Specifies value of Shunt 1 if existing
|
||||
*/
|
||||
uint16_t Shunt2Value; /*!< Specifies value of Shunt 2 if existing
|
||||
*/
|
||||
uint16_t Shunt3Value; /*!< Specifies value of Shunt 3 if existing
|
||||
*/
|
||||
uint16_t Shunt4Value; /*!< Specifies value of Shunt 4 if existing
|
||||
*/
|
||||
uint16_t Shunt0StabDelay; /*!< Specifies delay of Shunt 0 stabilization if existing
|
||||
*/
|
||||
uint16_t Shunt1StabDelay; /*!< Specifies delay of Shunt 1 stabilization if existing
|
||||
*/
|
||||
uint16_t Shunt2StabDelay; /*!< Specifies delay of Shunt 2 stabilization if existing
|
||||
*/
|
||||
uint16_t Shunt3StabDelay; /*!< Specifies delay of Shunt 3 stabilization if existing
|
||||
*/
|
||||
uint16_t Shunt4StabDelay; /*!< Specifies delay of Shunt 4 stabilization if existing
|
||||
*/
|
||||
uint8_t ShuntNbOnBoard; /*!< Specifies number of shunts that are present on board
|
||||
This parameter can be a value of @ref IDD_shunt_number */
|
||||
uint8_t ShuntNbUsed; /*!< Specifies number of shunts used for measurement
|
||||
This parameter can be a value of @ref IDD_shunt_number */
|
||||
uint8_t VrefMeasurement; /*!< Specifies if Vref is automatically measured before each Idd measurement
|
||||
This parameter can be a value of @ref IDD_Vref_Measurement */
|
||||
uint8_t Calibration; /*!< Specifies if calibration is done before each Idd measurement
|
||||
*/
|
||||
uint8_t PreDelayUnit; /*!< Specifies Pre delay unit
|
||||
This parameter can be a value of @ref IDD_PreDelay */
|
||||
uint8_t PreDelayValue; /*!< Specifies Pre delay value in selected unit
|
||||
*/
|
||||
uint8_t MeasureNb; /*!< Specifies number of Measure to be performed
|
||||
This parameter can be a value between 1 and 256 */
|
||||
uint8_t DeltaDelayUnit; /*!< Specifies Delta delay unit
|
||||
This parameter can be a value of @ref IDD_DeltaDelay */
|
||||
uint8_t DeltaDelayValue; /*!< Specifies Delta delay between 2 measures
|
||||
value can be between 1 and 128 */
|
||||
}IDD_ConfigTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Driver_structure IDD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*LowPower)(uint16_t);
|
||||
void (*WakeUp)(uint16_t);
|
||||
void (*Start)(uint16_t);
|
||||
void (*Config)(uint16_t,IDD_ConfigTypeDef);
|
||||
void (*GetValue)(uint16_t, uint32_t *);
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*ClearIT)(uint16_t);
|
||||
uint8_t (*GetITStatus)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
void (*ErrorEnableIT)(uint16_t);
|
||||
void (*ErrorClearIT)(uint16_t);
|
||||
uint8_t (*ErrorGetITStatus)(uint16_t);
|
||||
void (*ErrorDisableIT)(uint16_t);
|
||||
uint8_t (*ErrorGetSrc)(uint16_t);
|
||||
uint8_t (*ErrorGetCode)(uint16_t);
|
||||
}IDD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IDD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
150
2P-ProjectPong/Drivers/BSP/Components/Common/io.h
Normal file
150
2P-ProjectPong/Drivers/BSP/Components/Common/io.h
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file io.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the IO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __IO_H
|
||||
#define __IO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief IO Bit SET and Bit RESET enumeration
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
IO_PIN_RESET = 0,
|
||||
IO_PIN_SET
|
||||
}IO_PinState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
IO_MODE_INPUT = 0, /* input floating */
|
||||
IO_MODE_OUTPUT, /* output Push Pull */
|
||||
IO_MODE_IT_RISING_EDGE, /* float input - irq detect on rising edge */
|
||||
IO_MODE_IT_FALLING_EDGE, /* float input - irq detect on falling edge */
|
||||
IO_MODE_IT_LOW_LEVEL, /* float input - irq detect on low level */
|
||||
IO_MODE_IT_HIGH_LEVEL, /* float input - irq detect on high level */
|
||||
/* following modes only available on MFX*/
|
||||
IO_MODE_ANALOG, /* analog mode */
|
||||
IO_MODE_OFF, /* when pin isn't used*/
|
||||
IO_MODE_INPUT_PU, /* input with internal pull up resistor */
|
||||
IO_MODE_INPUT_PD, /* input with internal pull down resistor */
|
||||
IO_MODE_OUTPUT_OD, /* Open Drain output without internal resistor */
|
||||
IO_MODE_OUTPUT_OD_PU, /* Open Drain output with internal pullup resistor */
|
||||
IO_MODE_OUTPUT_OD_PD, /* Open Drain output with internal pulldown resistor */
|
||||
IO_MODE_OUTPUT_PP, /* PushPull output without internal resistor */
|
||||
IO_MODE_OUTPUT_PP_PU, /* PushPull output with internal pullup resistor */
|
||||
IO_MODE_OUTPUT_PP_PD, /* PushPull output with internal pulldown resistor */
|
||||
IO_MODE_IT_RISING_EDGE_PU, /* push up resistor input - irq on rising edge */
|
||||
IO_MODE_IT_RISING_EDGE_PD, /* push dw resistor input - irq on rising edge */
|
||||
IO_MODE_IT_FALLING_EDGE_PU, /* push up resistor input - irq on falling edge */
|
||||
IO_MODE_IT_FALLING_EDGE_PD, /* push dw resistor input - irq on falling edge */
|
||||
IO_MODE_IT_LOW_LEVEL_PU, /* push up resistor input - irq detect on low level */
|
||||
IO_MODE_IT_LOW_LEVEL_PD, /* push dw resistor input - irq detect on low level */
|
||||
IO_MODE_IT_HIGH_LEVEL_PU, /* push up resistor input - irq detect on high level */
|
||||
IO_MODE_IT_HIGH_LEVEL_PD, /* push dw resistor input - irq detect on high level */
|
||||
|
||||
}IO_ModeTypedef;
|
||||
|
||||
/** @defgroup IO_Driver_structure IO Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
|
||||
void (*Start)(uint16_t, uint32_t);
|
||||
uint8_t (*Config)(uint16_t, uint32_t, IO_ModeTypedef);
|
||||
void (*WritePin)(uint16_t, uint32_t, uint8_t);
|
||||
uint32_t (*ReadPin)(uint16_t, uint32_t);
|
||||
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
uint32_t (*ITStatus)(uint16_t, uint32_t);
|
||||
void (*ClearIT)(uint16_t, uint32_t);
|
||||
|
||||
}IO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
114
2P-ProjectPong/Drivers/BSP/Components/Common/lcd.h
Normal file
114
2P-ProjectPong/Drivers/BSP/Components/Common/lcd.h
Normal file
@ -0,0 +1,114 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the LCD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LCD_H
|
||||
#define __LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Driver_structure LCD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
uint16_t (*ReadID)(void);
|
||||
void (*DisplayOn)(void);
|
||||
void (*DisplayOff)(void);
|
||||
void (*SetCursor)(uint16_t, uint16_t);
|
||||
void (*WritePixel)(uint16_t, uint16_t, uint16_t);
|
||||
uint16_t (*ReadPixel)(uint16_t, uint16_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*DrawHLine)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*DrawVLine)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
|
||||
uint16_t (*GetLcdPixelWidth)(void);
|
||||
uint16_t (*GetLcdPixelHeight)(void);
|
||||
void (*DrawBitmap)(uint16_t, uint16_t, uint8_t*);
|
||||
void (*DrawRGBImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}LCD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LCD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
125
2P-ProjectPong/Drivers/BSP/Components/Common/magneto.h
Normal file
125
2P-ProjectPong/Drivers/BSP/Components/Common/magneto.h
Normal file
@ -0,0 +1,125 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file magneto.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the MAGNETO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAGNETO_H
|
||||
#define __MAGNETO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MAGNETO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Config_structure Magnetometer Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Register1;
|
||||
uint8_t Register2;
|
||||
uint8_t Register3;
|
||||
uint8_t Register4;
|
||||
uint8_t Register5;
|
||||
}MAGNETO_InitTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Driver_structure Magnetometer Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(MAGNETO_InitTypeDef);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(void);
|
||||
void (*ConfigIT)(void);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t);
|
||||
void (*ClearIT)(void);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(int16_t *);
|
||||
}MAGNETO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAGNETO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
104
2P-ProjectPong/Drivers/BSP/Components/Common/motion_sensor.h
Normal file
104
2P-ProjectPong/Drivers/BSP/Components/Common/motion_sensor.h
Normal file
@ -0,0 +1,104 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file motion_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* accelerometer driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef MOTION_SENSOR_H
|
||||
#define MOTION_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR MOTION SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR_Public_Types MOTION SENSOR Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief MOTION_SENSOR driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} MOTION_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetSensitivity ) ( void *, float * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetFullScale ) ( void *, int32_t * );
|
||||
int32_t ( *SetFullScale ) ( void *, int32_t );
|
||||
int32_t ( *GetAxes ) ( void *, void * );
|
||||
int32_t ( *GetAxesRaw ) ( void *, void * );
|
||||
} MOTION_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MOTION_SENSOR_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
246
2P-ProjectPong/Drivers/BSP/Components/Common/pwrmon.h
Normal file
246
2P-ProjectPong/Drivers/BSP/Components/Common/pwrmon.h
Normal file
@ -0,0 +1,246 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file pwrmon.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Current/Power Monitor device driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __PWRMON_H
|
||||
#define __PWRMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup PWRMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Operating_Mode_enum Power Monitor Operating Mode enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
OPERATING_MODE_TRIGGERED = 0,
|
||||
OPERATING_MODE_CONTINUOUS,
|
||||
OPERATING_MODE_NB
|
||||
} PWRMON_OperatingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CONVERT_TIME_140 = 0,
|
||||
CONVERT_TIME_204,
|
||||
CONVERT_TIME_332,
|
||||
CONVERT_TIME_588,
|
||||
CONVERT_TIME_1100,
|
||||
CONVERT_TIME_2116,
|
||||
CONVERT_TIME_4156,
|
||||
CONVERT_TIME_8244,
|
||||
CONVERT_TIME_NB
|
||||
} PWRMON_ConvertTime_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
AVERAGING_MODE_1 = 0,
|
||||
AVERAGING_MODE_4,
|
||||
AVERAGING_MODE_16,
|
||||
AVERAGING_MODE_64,
|
||||
AVERAGING_MODE_128,
|
||||
AVERAGING_MODE_256,
|
||||
AVERAGING_MODE_512,
|
||||
AVERAGING_MODE_1024,
|
||||
AVERAGING_MODE_NB
|
||||
} PWRMON_AveragingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Device_Configuration_structure Power Monitor Device Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_ConvertTime_t ShuntConvertTime;
|
||||
PWRMON_ConvertTime_t BusConvertTime;
|
||||
PWRMON_AveragingMode_t AveragingMode;
|
||||
} PWRMON_Config_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Polarity_enum Power Monitor Alert Polarity enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_POLARITY_NORMAL = 0,
|
||||
ALERT_POLARITY_INVERTED,
|
||||
ALERT_POLARITY_NB
|
||||
} PWRMON_AlertPolarity_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Latch_Enable_enum Power Monitor Alert Latch Enable enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_LATCH_DISABLE = 0,
|
||||
ALERT_LATCH_ENABLE,
|
||||
ALERT_LATCH_NB
|
||||
} PWRMON_AlertLatchEnable_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Function_enum Power Monitor Alert Function enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_FUNCTION_NONE = 0,
|
||||
ALERT_FUNCTION_SOL,
|
||||
ALERT_FUNCTION_SUL,
|
||||
ALERT_FUNCTION_BOL,
|
||||
ALERT_FUNCTION_BUL,
|
||||
ALERT_FUNCTION_POL,
|
||||
ALERT_FUNCTION_NB,
|
||||
} PWRMON_AlertFunction_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Configuration_structure Power Monitor Alert Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_AlertPolarity_t Polarity;
|
||||
PWRMON_AlertLatchEnable_t LatchEnable;
|
||||
} PWRMON_AlertPinConfig_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Voltage_Input_enum Power Monitor Voltage Input enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
VOLTAGE_INPUT_SHUNT = 0,
|
||||
VOLTAGE_INPUT_BUS,
|
||||
VOLTAGE_INPUT_ALL,
|
||||
VOLTAGE_INPUT_NB
|
||||
} PWRMON_InputSignal_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Flag_enum Power Monitor Flag enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
FLAG_ALERT_FUNCTION = 0,
|
||||
FLAG_CONVERSION_READY,
|
||||
FLAG_MATH_OVERFLOW,
|
||||
FLAG_NB
|
||||
} PWRMON_Flag_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Driver_structure Power Monitor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, PWRMON_Config_t *);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint16_t (*ReadId)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*SetCalibration)(uint16_t, uint16_t);
|
||||
uint16_t (*GetCalibration)(uint16_t);
|
||||
void (*SetAlertFunction)(uint16_t, PWRMON_AlertFunction_t);
|
||||
PWRMON_AlertFunction_t (*GetAlertFunction)(uint16_t);
|
||||
void (*AlertPinConfig)(uint16_t, PWRMON_AlertPinConfig_t *);
|
||||
void (*SetVBusThreshold)(uint16_t, uint16_t);
|
||||
uint16_t (*GetVBusThreshold)(uint16_t);
|
||||
void (*SetVShuntThreshold)(uint16_t, int16_t);
|
||||
int16_t (*GetVShuntThreshold)(uint16_t);
|
||||
void (*SetPowerThreshold)(uint16_t, uint32_t);
|
||||
uint32_t (*GetPowerThreshold)(uint16_t);
|
||||
void (*AlertThresholdEnableIT)(uint16_t);
|
||||
void (*AlertThresholdDisableIT)(uint16_t);
|
||||
void (*ConversionReadyEnableIT)(uint16_t);
|
||||
void (*ConversionReadyDisableIT)(uint16_t);
|
||||
void (*StartConversion)(uint16_t, PWRMON_InputSignal_t, PWRMON_OperatingMode_t);
|
||||
void (*StopConversion)(uint16_t);
|
||||
uint16_t (*GetVBus)(uint16_t);
|
||||
int16_t (*GetVShunt)(uint16_t);
|
||||
uint16_t (*GetPower)(uint16_t);
|
||||
int16_t (*GetCurrent)(uint16_t);
|
||||
uint8_t (*GetFlag)(uint16_t, PWRMON_Flag_t);
|
||||
} PWRMON_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PWRMON_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
107
2P-ProjectPong/Drivers/BSP/Components/Common/ts.h
Normal file
107
2P-ProjectPong/Drivers/BSP/Components/Common/ts.h
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ts.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the Touch Screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __TS_H
|
||||
#define __TS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Driver_structure Touch Sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*Start)(uint16_t);
|
||||
uint8_t (*DetectTouch)(uint16_t);
|
||||
void (*GetXY)(uint16_t, uint16_t*, uint16_t*);
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*ClearIT)(uint16_t);
|
||||
uint8_t (*GetITStatus)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
}TS_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
118
2P-ProjectPong/Drivers/BSP/Components/Common/tsensor.h
Normal file
118
2P-ProjectPong/Drivers/BSP/Components/Common/tsensor.h
Normal file
@ -0,0 +1,118 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file tsensor.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Temperature Sensor driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __TSENSOR_H
|
||||
#define __TSENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TSENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Config_structure Temperature Sensor Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t AlertMode; /* Alert Mode Temperature out of range*/
|
||||
uint8_t ConversionMode; /* Continuous/One Shot Mode */
|
||||
uint8_t ConversionResolution; /* Temperature Resolution */
|
||||
uint8_t ConversionRate; /* Number of measure per second */
|
||||
uint8_t TemperatureLimitHigh; /* High Temperature Limit Range */
|
||||
uint8_t TemperatureLimitLow; /* Low Temperature Limit Range */
|
||||
}TSENSOR_InitTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Driver_structure Temperature Sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, TSENSOR_InitTypeDef *);
|
||||
uint8_t (*IsReady)(uint16_t, uint32_t);
|
||||
uint8_t (*ReadStatus)(uint16_t);
|
||||
uint16_t (*ReadTemp)(uint16_t);
|
||||
}TSENSOR_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TSENSOR_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
114
2P-ProjectPong/Drivers/BSP/Components/Common/usbtypecswitch.h
Normal file
114
2P-ProjectPong/Drivers/BSP/Components/Common/usbtypecswitch.h
Normal file
@ -0,0 +1,114 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usbtypecswitch.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* crossbar switch device for USB Type-C systems.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __USBTYPECSWITCH_H
|
||||
#define __USBTYPECSWITCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TYPECSWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TYPECSWITCH_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
USB_NORMAL = 0,
|
||||
USB_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_F_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_F_FLIPPED
|
||||
} TYPECSWITCH_Mode_t;
|
||||
|
||||
/** @defgroup TYPECSWITCH_Driver_structure USB Type-C Crossbar Switch Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetMode)(uint16_t, TYPECSWITCH_Mode_t);
|
||||
uint32_t (*IsSupportedMode)(TYPECSWITCH_Mode_t);
|
||||
} TYPECSWITCH_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __USBTYPECSWITCH_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,231 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for Ampire480272 LCD Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for Ampire480272 LCD Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank"></a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
@ -0,0 +1,121 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ampire480272.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 18-February-2014
|
||||
* @brief This file contains all the constants parameters for the ampire480272
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE480272_H
|
||||
#define __AMPIRE480272_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire480272
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Size
|
||||
*/
|
||||
#define AMPIRE480272_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE480272_HEIGHT ((uint16_t)272) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Timing
|
||||
*/
|
||||
#define AMPIRE480272_HSYNC ((uint16_t)41) /* Horizontal synchronization */
|
||||
#define AMPIRE480272_HBP ((uint16_t)2) /* Horizontal back porch */
|
||||
#define AMPIRE480272_HFP ((uint16_t)2) /* Horizontal front porch */
|
||||
#define AMPIRE480272_VSYNC ((uint16_t)10) /* Vertical synchronization */
|
||||
#define AMPIRE480272_VBP ((uint16_t)2) /* Vertical back porch */
|
||||
#define AMPIRE480272_VFP ((uint16_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 frequency divider
|
||||
*/
|
||||
#define AMPIRE480272_FREQUENCY_DIVIDER 5 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE480272_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,232 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for Ampire480272 LCD Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for Ampire640480 LCD Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
@ -0,0 +1,121 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ampire640480.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 18-February-2014
|
||||
* @brief This file contains all the constants parameters for the ampire640480
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE640480_H
|
||||
#define __AMPIRE640480_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire640480
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Size
|
||||
*/
|
||||
#define AMPIRE640480_WIDTH ((uint16_t)640) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE640480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Timing
|
||||
*/
|
||||
#define AMPIRE640480_HSYNC ((uint16_t)30) /* Horizontal synchronization */
|
||||
#define AMPIRE640480_HBP ((uint16_t)114) /* Horizontal back porch */
|
||||
#define AMPIRE640480_HFP ((uint16_t)16) /* Horizontal front porch */
|
||||
#define AMPIRE640480_VSYNC ((uint16_t)3) /* Vertical synchronization */
|
||||
#define AMPIRE640480_VBP ((uint16_t)32) /* Vertical back porch */
|
||||
#define AMPIRE640480_VFP ((uint16_t)10) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 frequency divider
|
||||
*/
|
||||
#define AMPIRE640480_FREQUENCY_DIVIDER 3 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE640480_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
743
2P-ProjectPong/Drivers/BSP/Components/cs43l22/Release_Notes.html
Normal file
743
2P-ProjectPong/Drivers/BSP/Components/cs43l22/Release_Notes.html
Normal file
@ -0,0 +1,743 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for CS43L22 Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for CS43L22 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 206px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.3 / 05-October-2017 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.c/.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update VOLUME_CONVERT macro to return 255 if the input volume is greater than 100.</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Update cs43l22_SetVolume API to check on convertedvol instead of Volume</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 206px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.2 / 02-October-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.c/.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Move VOLUME_CONVERT macro from cs43l22.h to cs43l22.c as internally used to convert volume.</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add literals instead of magic number for cs34l22 registers.</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 220px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.1 / 16-September-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Enable the digital soft ramp to avoid clac noise.</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Improve mute/unmute by muting/unmuting also the DAC inputs. </span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 24-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.h/.c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Add codec de-initialization function: cs43l22_DeInit()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add Audio IO </span><span style="font-size: 10pt; font-family: Verdana;">de-initialization function prototype: AUDIO_IO_DeInit()</span></li><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common
|
||||
driver V4.0.0 or later</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 10-February-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.h/.c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Add AUDIO_FREQUENCY_xxx defines for frequencies capabilities (8K to 192K)</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add codec reset function: cs43l22_Reset()<br></span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">cs43l22.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release of CS43L22 audio codec </span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
493
2P-ProjectPong/Drivers/BSP/Components/cs43l22/cs43l22.c
Normal file
493
2P-ProjectPong/Drivers/BSP/Components/cs43l22/cs43l22.c
Normal file
@ -0,0 +1,493 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs43l22.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the CS43L22 Audio Codec driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "cs43l22.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS43L22
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* CS43L22 audio codec.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Private_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
#define VOLUME_CONVERT(Volume) (((Volume) > 100)? 255:((uint8_t)(((Volume) * 255) / 100)))
|
||||
/* Uncomment this line to enable verifying data sent to codec after each write
|
||||
operation (for debug purpose) */
|
||||
#if !defined (VERIFY_WRITTENDATA)
|
||||
/* #define VERIFY_WRITTENDATA */
|
||||
#endif /* VERIFY_WRITTENDATA */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Audio codec driver structure initialization */
|
||||
AUDIO_DrvTypeDef cs43l22_drv =
|
||||
{
|
||||
cs43l22_Init,
|
||||
cs43l22_DeInit,
|
||||
cs43l22_ReadID,
|
||||
|
||||
cs43l22_Play,
|
||||
cs43l22_Pause,
|
||||
cs43l22_Resume,
|
||||
cs43l22_Stop,
|
||||
|
||||
cs43l22_SetFrequency,
|
||||
cs43l22_SetVolume,
|
||||
cs43l22_SetMute,
|
||||
cs43l22_SetOutputMode,
|
||||
cs43l22_Reset,
|
||||
};
|
||||
|
||||
static uint8_t Is_cs43l22_Stop = 1;
|
||||
|
||||
volatile uint8_t OutputDev = 0;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Function_Prototypes
|
||||
* @{
|
||||
*/
|
||||
static uint8_t CODEC_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the audio codec and the control interface.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param OutputDevice: can be OUTPUT_DEVICE_SPEAKER, OUTPUT_DEVICE_HEADPHONE,
|
||||
* OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO .
|
||||
* @param Volume: Initial volume level (from 0 (Mute) to 100 (Max))
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Init(uint16_t DeviceAddr, uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
/* Initialize the Control interface of the Audio Codec */
|
||||
AUDIO_IO_Init();
|
||||
|
||||
/* Keep Codec powered OFF */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x01);
|
||||
|
||||
/*Save Output device for mute ON/OFF procedure*/
|
||||
switch (OutputDevice)
|
||||
{
|
||||
case OUTPUT_DEVICE_SPEAKER:
|
||||
OutputDev = 0xFA;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_HEADPHONE:
|
||||
OutputDev = 0xAF;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_BOTH:
|
||||
OutputDev = 0xAA;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_AUTO:
|
||||
OutputDev = 0x05;
|
||||
break;
|
||||
|
||||
default:
|
||||
OutputDev = 0x05;
|
||||
break;
|
||||
}
|
||||
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, OutputDev);
|
||||
|
||||
/* Clock configuration: Auto detection */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_CLOCKING_CTL, 0x81);
|
||||
|
||||
/* Set the Slave Mode and the audio Standard */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_INTERFACE_CTL1, CODEC_STANDARD);
|
||||
|
||||
/* Set the Master volume */
|
||||
counter += cs43l22_SetVolume(DeviceAddr, Volume);
|
||||
|
||||
/* If the Speaker is enabled, set the Mono mode and volume attenuation level */
|
||||
if(OutputDevice != OUTPUT_DEVICE_HEADPHONE)
|
||||
{
|
||||
/* Set the Speaker Mono mode */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_PLAYBACK_CTL2, 0x06);
|
||||
|
||||
/* Set the Speaker attenuation level */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_SPEAKER_A_VOL, 0x00);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_SPEAKER_B_VOL, 0x00);
|
||||
}
|
||||
|
||||
/* Additional configuration for the CODEC. These configurations are done to reduce
|
||||
the time needed for the Codec to power off. If these configurations are removed,
|
||||
then a long delay should be added between powering off the Codec and switching
|
||||
off the I2S peripheral MCLK clock (which is the operating clock for Codec).
|
||||
If this delay is not inserted, then the codec will not shut down properly and
|
||||
it results in high noise after shut down. */
|
||||
|
||||
/* Disable the analog soft ramp */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_ANALOG_ZC_SR_SETT, 0x00);
|
||||
/* Disable the digital soft ramp */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MISC_CTL, 0x04);
|
||||
/* Disable the limiter attack level */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_LIMIT_CTL1, 0x00);
|
||||
/* Adjust Bass and Treble levels */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_TONE_CTL, 0x0F);
|
||||
/* Adjust PCM volume level */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_PCMA_VOL, 0x0A);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_PCMB_VOL, 0x0A);
|
||||
|
||||
/* Return communication control value */
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deinitializes the audio codec.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void cs43l22_DeInit(void)
|
||||
{
|
||||
/* Deinitialize Audio Codec interface */
|
||||
AUDIO_IO_DeInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the CS43L22 ID.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval The CS43L22 ID
|
||||
*/
|
||||
uint32_t cs43l22_ReadID(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t Value;
|
||||
/* Initialize the Control interface of the Audio Codec */
|
||||
AUDIO_IO_Init();
|
||||
|
||||
Value = AUDIO_IO_Read(DeviceAddr, CS43L22_CHIPID_ADDR);
|
||||
Value = (Value & CS43L22_ID_MASK);
|
||||
|
||||
return((uint32_t) Value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the audio Codec play feature.
|
||||
* @note For this codec no Play options are required.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
if(Is_cs43l22_Stop == 1)
|
||||
{
|
||||
/* Enable the digital soft ramp */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MISC_CTL, 0x06);
|
||||
|
||||
/* Enable Output device */
|
||||
counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_OFF);
|
||||
|
||||
/* Power on the Codec */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x9E);
|
||||
Is_cs43l22_Stop = 0;
|
||||
}
|
||||
|
||||
/* Return communication control value */
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pauses playing on the audio codec.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Pause(uint16_t DeviceAddr)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
/* Pause the audio file playing */
|
||||
/* Mute the output first */
|
||||
counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_ON);
|
||||
|
||||
/* Put the Codec in Power save mode */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x01);
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resumes playing on the audio codec.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Resume(uint16_t DeviceAddr)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
volatile uint32_t index = 0x00;
|
||||
/* Resumes the audio file playing */
|
||||
/* Unmute the output first */
|
||||
counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_OFF);
|
||||
|
||||
for(index = 0x00; index < 0xFF; index++);
|
||||
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, OutputDev);
|
||||
|
||||
/* Exit the Power save mode */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x9E);
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops audio Codec playing. It powers down the codec.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param CodecPdwnMode: selects the power down mode.
|
||||
* - CODEC_PDWN_HW: Physically power down the codec. When resuming from this
|
||||
* mode, the codec is set to default configuration
|
||||
* (user should re-Initialize the codec in order to
|
||||
* play again the audio stream).
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Stop(uint16_t DeviceAddr, uint32_t CodecPdwnMode)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
/* Mute the output first */
|
||||
counter += cs43l22_SetMute(DeviceAddr, AUDIO_MUTE_ON);
|
||||
|
||||
/* Disable the digital soft ramp */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MISC_CTL, 0x04);
|
||||
|
||||
/* Power down the DAC and the speaker (PMDAC and PMSPK bits)*/
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL1, 0x9F);
|
||||
|
||||
Is_cs43l22_Stop = 1;
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets higher or lower the codec volume level.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param Volume: a byte value from 0 to 255 (refer to codec registers
|
||||
* description for more details).
|
||||
*
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_SetVolume(uint16_t DeviceAddr, uint8_t Volume)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
uint8_t convertedvol = VOLUME_CONVERT(Volume);
|
||||
|
||||
if(convertedvol > 0xE6)
|
||||
{
|
||||
/* Set the Master volume */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MASTER_A_VOL, convertedvol - 0xE7);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MASTER_B_VOL, convertedvol - 0xE7);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set the Master volume */
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MASTER_A_VOL, convertedvol + 0x19);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_MASTER_B_VOL, convertedvol + 0x19);
|
||||
}
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets new frequency.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param AudioFreq: Audio frequency used to play the audio stream.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_SetFrequency(uint16_t DeviceAddr, uint32_t AudioFreq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables or disables the mute feature on the audio codec.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param Cmd: AUDIO_MUTE_ON to enable the mute or AUDIO_MUTE_OFF to disable the
|
||||
* mute mode.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_SetMute(uint16_t DeviceAddr, uint32_t Cmd)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
/* Set the Mute mode */
|
||||
if(Cmd == AUDIO_MUTE_ON)
|
||||
{
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0xFF);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_HEADPHONE_A_VOL, 0x01);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_HEADPHONE_B_VOL, 0x01);
|
||||
}
|
||||
else /* AUDIO_MUTE_OFF Disable the Mute */
|
||||
{
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_HEADPHONE_A_VOL, 0x00);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_HEADPHONE_B_VOL, 0x00);
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, OutputDev);
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch dynamically (while audio file is played) the output target
|
||||
* (speaker or headphone).
|
||||
* @note This function modifies a global variable of the audio codec driver: OutputDev.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param Output: specifies the audio output target: OUTPUT_DEVICE_SPEAKER,
|
||||
* OUTPUT_DEVICE_HEADPHONE, OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_AUTO
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_SetOutputMode(uint16_t DeviceAddr, uint8_t Output)
|
||||
{
|
||||
uint32_t counter = 0;
|
||||
|
||||
switch (Output)
|
||||
{
|
||||
case OUTPUT_DEVICE_SPEAKER:
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0xFA); /* SPK always ON & HP always OFF */
|
||||
OutputDev = 0xFA;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_HEADPHONE:
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0xAF); /* SPK always OFF & HP always ON */
|
||||
OutputDev = 0xAF;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_BOTH:
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0xAA); /* SPK always ON & HP always ON */
|
||||
OutputDev = 0xAA;
|
||||
break;
|
||||
|
||||
case OUTPUT_DEVICE_AUTO:
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0x05); /* Detect the HP or the SPK automatically */
|
||||
OutputDev = 0x05;
|
||||
break;
|
||||
|
||||
default:
|
||||
counter += CODEC_IO_Write(DeviceAddr, CS43L22_REG_POWER_CTL2, 0x05); /* Detect the HP or the SPK automatically */
|
||||
OutputDev = 0x05;
|
||||
break;
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resets cs43l22 registers.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval 0 if correct communication, else wrong communication
|
||||
*/
|
||||
uint32_t cs43l22_Reset(uint16_t DeviceAddr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes/Read a single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @param Value: Data to be written
|
||||
* @retval None
|
||||
*/
|
||||
static uint8_t CODEC_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
AUDIO_IO_Write(Addr, Reg, Value);
|
||||
|
||||
#ifdef VERIFY_WRITTENDATA
|
||||
/* Verify that the data has been correctly written */
|
||||
result = (AUDIO_IO_Read(Addr, Reg) == Value)? 0:1;
|
||||
#endif /* VERIFY_WRITTENDATA */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
226
2P-ProjectPong/Drivers/BSP/Components/cs43l22/cs43l22.h
Normal file
226
2P-ProjectPong/Drivers/BSP/Components/cs43l22/cs43l22.h
Normal file
@ -0,0 +1,226 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs43l22.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the cs43l22.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __CS43L22_H
|
||||
#define __CS43L22_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/audio.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS43L22
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** Codec User defines ******************************/
|
||||
/******************************************************************************/
|
||||
/* Codec output DEVICE */
|
||||
#define OUTPUT_DEVICE_SPEAKER 1
|
||||
#define OUTPUT_DEVICE_HEADPHONE 2
|
||||
#define OUTPUT_DEVICE_BOTH 3
|
||||
#define OUTPUT_DEVICE_AUTO 4
|
||||
|
||||
/* Volume Levels values */
|
||||
#define DEFAULT_VOLMIN 0x00
|
||||
#define DEFAULT_VOLMAX 0xFF
|
||||
#define DEFAULT_VOLSTEP 0x04
|
||||
|
||||
#define AUDIO_PAUSE 0
|
||||
#define AUDIO_RESUME 1
|
||||
|
||||
/* Codec POWER DOWN modes */
|
||||
#define CODEC_PDWN_HW 1
|
||||
#define CODEC_PDWN_SW 2
|
||||
|
||||
/* MUTE commands */
|
||||
#define AUDIO_MUTE_ON 1
|
||||
#define AUDIO_MUTE_OFF 0
|
||||
|
||||
/* AUDIO FREQUENCY */
|
||||
#define AUDIO_FREQUENCY_192K ((uint32_t)192000)
|
||||
#define AUDIO_FREQUENCY_96K ((uint32_t)96000)
|
||||
#define AUDIO_FREQUENCY_48K ((uint32_t)48000)
|
||||
#define AUDIO_FREQUENCY_44K ((uint32_t)44100)
|
||||
#define AUDIO_FREQUENCY_32K ((uint32_t)32000)
|
||||
#define AUDIO_FREQUENCY_22K ((uint32_t)22050)
|
||||
#define AUDIO_FREQUENCY_16K ((uint32_t)16000)
|
||||
#define AUDIO_FREQUENCY_11K ((uint32_t)11025)
|
||||
#define AUDIO_FREQUENCY_8K ((uint32_t)8000)
|
||||
|
||||
/** CS43l22 Registers ***/
|
||||
#define CS43L22_REG_ID 0x01
|
||||
#define CS43L22_REG_POWER_CTL1 0x02
|
||||
#define CS43L22_REG_POWER_CTL2 0x04
|
||||
#define CS43L22_REG_CLOCKING_CTL 0x05
|
||||
#define CS43L22_REG_INTERFACE_CTL1 0x06
|
||||
#define CS43L22_REG_INTERFACE_CTL2 0x07
|
||||
#define CS43L22_REG_PASSTHR_A_SELECT 0x08
|
||||
#define CS43L22_REG_PASSTHR_B_SELECT 0x09
|
||||
#define CS43L22_REG_ANALOG_ZC_SR_SETT 0x0A
|
||||
#define CS43L22_REG_PASSTHR_GANG_CTL 0x0C
|
||||
#define CS43L22_REG_PLAYBACK_CTL1 0x0D
|
||||
#define CS43L22_REG_MISC_CTL 0x0E
|
||||
#define CS43L22_REG_PLAYBACK_CTL2 0x0F
|
||||
#define CS43L22_REG_PASSTHR_A_VOL 0x14
|
||||
#define CS43L22_REG_PASSTHR_B_VOL 0x15
|
||||
#define CS43L22_REG_PCMA_VOL 0x1A
|
||||
#define CS43L22_REG_PCMB_VOL 0x1B
|
||||
#define CS43L22_REG_BEEP_FREQ_ON_TIME 0x1C
|
||||
#define CS43L22_REG_BEEP_VOL_OFF_TIME 0x1D
|
||||
#define CS43L22_REG_BEEP_TONE_CFG 0x1E
|
||||
#define CS43L22_REG_TONE_CTL 0x1F
|
||||
#define CS43L22_REG_MASTER_A_VOL 0x20
|
||||
#define CS43L22_REG_MASTER_B_VOL 0x21
|
||||
#define CS43L22_REG_HEADPHONE_A_VOL 0x22
|
||||
#define CS43L22_REG_HEADPHONE_B_VOL 0x23
|
||||
#define CS43L22_REG_SPEAKER_A_VOL 0x24
|
||||
#define CS43L22_REG_SPEAKER_B_VOL 0x25
|
||||
#define CS43L22_REG_CH_MIXER_SWAP 0x26
|
||||
#define CS43L22_REG_LIMIT_CTL1 0x27
|
||||
#define CS43L22_REG_LIMIT_CTL2 0x28
|
||||
#define CS43L22_REG_LIMIT_ATTACK_RATE 0x29
|
||||
#define CS43L22_REG_OVF_CLK_STATUS 0x2E
|
||||
#define CS43L22_REG_BATT_COMPENSATION 0x2F
|
||||
#define CS43L22_REG_VP_BATTERY_LEVEL 0x30
|
||||
#define CS43L22_REG_SPEAKER_STATUS 0x31
|
||||
#define CS43L22_REG_TEMPMONITOR_CTL 0x32
|
||||
#define CS43L22_REG_THERMAL_FOLDBACK 0x33
|
||||
#define CS43L22_REG_CHARGE_PUMP_FREQ 0x34
|
||||
|
||||
/******************************************************************************/
|
||||
/****************************** REGISTER MAPPING ******************************/
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief CS43L22 ID
|
||||
*/
|
||||
#define CS43L22_ID 0xE0
|
||||
#define CS43L22_ID_MASK 0xF8
|
||||
/**
|
||||
* @brief Chip ID Register: Chip I.D. and Revision Register
|
||||
* Read only register
|
||||
* Default value: 0x01
|
||||
* [7:3] CHIPID[4:0]: I.D. code for the CS43L22.
|
||||
* Default value: 11100b
|
||||
* [2:0] REVID[2:0]: CS43L22 revision level.
|
||||
* Default value:
|
||||
* 000 - Rev A0
|
||||
* 001 - Rev A1
|
||||
* 010 - Rev B0
|
||||
* 011 - Rev B1
|
||||
*/
|
||||
#define CS43L22_CHIPID_ADDR 0x01
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS43L22_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
Audio Codec functions
|
||||
------------------------------------------------------------------------------*/
|
||||
/* High Layer codec functions */
|
||||
uint32_t cs43l22_Init(uint16_t DeviceAddr, uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);
|
||||
void cs43l22_DeInit(void);
|
||||
uint32_t cs43l22_ReadID(uint16_t DeviceAddr);
|
||||
uint32_t cs43l22_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size);
|
||||
uint32_t cs43l22_Pause(uint16_t DeviceAddr);
|
||||
uint32_t cs43l22_Resume(uint16_t DeviceAddr);
|
||||
uint32_t cs43l22_Stop(uint16_t DeviceAddr, uint32_t Cmd);
|
||||
uint32_t cs43l22_SetVolume(uint16_t DeviceAddr, uint8_t Volume);
|
||||
uint32_t cs43l22_SetFrequency(uint16_t DeviceAddr, uint32_t AudioFreq);
|
||||
uint32_t cs43l22_SetMute(uint16_t DeviceAddr, uint32_t Cmd);
|
||||
uint32_t cs43l22_SetOutputMode(uint16_t DeviceAddr, uint8_t Output);
|
||||
uint32_t cs43l22_Reset(uint16_t DeviceAddr);
|
||||
|
||||
/* AUDIO IO functions */
|
||||
void AUDIO_IO_Init(void);
|
||||
void AUDIO_IO_DeInit(void);
|
||||
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg);
|
||||
|
||||
/* Audio driver structure */
|
||||
extern AUDIO_DrvTypeDef cs43l22_drv;
|
||||
|
||||
#endif /* __CS43L22_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
162
2P-ProjectPong/Drivers/BSP/Components/exc7200/Release_Notes.html
Normal file
162
2P-ProjectPong/Drivers/BSP/Components/exc7200/Release_Notes.html
Normal file
@ -0,0 +1,162 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP EXC7200 Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for EXC7200 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><br><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 21-September-2015 <o:p></o:p></span></h3>
|
||||
<b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes</span></u></b><br><ul><li><span style="font-family: Verdana; font-size: 10pt;">exc7200.c:</span></li><ul><li><span style="font-family: Verdana; font-size: 10pt;">Update the I2C slave read address within exc7200_TS_DetectTouch() function.</span></li><li><span style="font-family: Verdana; font-size: 10pt;">Update exc7200_TS_GetXY() function to return correct Touch Screen positions.</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 28-April-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-family: Verdana; font-size: 10pt;">First official
|
||||
release</span><span style="font-family: Verdana; font-size: 10pt;"></span> </li></ul><span style="font-family: Verdana; font-size: 10pt;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
242
2P-ProjectPong/Drivers/BSP/Components/exc7200/exc7200.c
Normal file
242
2P-ProjectPong/Drivers/BSP/Components/exc7200/exc7200.c
Normal file
@ -0,0 +1,242 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 21-September-2015
|
||||
* @brief This file provides a set of functions needed to manage the EXC7200
|
||||
* Touch-screen controller.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc7200.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Types_Definitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
TS_DrvTypeDef exc7200_ts_drv =
|
||||
{
|
||||
exc7200_Init,
|
||||
exc7200_ReadID,
|
||||
exc7200_Reset,
|
||||
|
||||
exc7200_TS_Start,
|
||||
exc7200_TS_DetectTouch,
|
||||
exc7200_TS_GetXY,
|
||||
|
||||
exc7200_TS_EnableIT,
|
||||
exc7200_TS_ClearIT,
|
||||
exc7200_TS_ITStatus,
|
||||
exc7200_TS_DisableIT,
|
||||
};
|
||||
|
||||
uint8_t aBufferTS[10];
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
|
||||
/** @defgroup exc7200_Private_Function_Prototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/** @defgroup exc7200_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize the exc7200 and configure the needed hardware resources
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None
|
||||
*/
|
||||
void exc7200_Init(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
IOE_Init();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reset the exc7200 by Software.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None
|
||||
*/
|
||||
void exc7200_Reset(uint16_t DeviceAddr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the exc7200 IO Expander device ID.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint16_t exc7200_ReadID(uint16_t DeviceAddr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures the touch Screen Controller (Single point detection)
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None.
|
||||
*/
|
||||
void exc7200_TS_Start(uint16_t DeviceAddr)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return if there is touch detected or not.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval Touch detected state.
|
||||
*/
|
||||
uint8_t exc7200_TS_DetectTouch(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Read TS data : Send I2C Slave address + 1 Bit0=1 for:read */
|
||||
IOE_ReadMultiple(DeviceAddr | 1, EXC7200_READ_CMD, aBufferTS, 10);
|
||||
|
||||
/* check for first byte */
|
||||
if (aBufferTS[1]==0x83)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param X: Pointer to X position value
|
||||
* @param Y: Pointer to Y position value
|
||||
* @retval None.
|
||||
*/
|
||||
void exc7200_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
|
||||
{
|
||||
/* Calculate positions */
|
||||
*X = (((aBufferTS[3]&0x00ff) << 4) | ((aBufferTS[2]&0x00f0) >> 4)) << 1;
|
||||
*Y = (((aBufferTS[5]&0x00ff) << 4) | ((aBufferTS[4]&0x00f0) >> 4)) << 1;
|
||||
|
||||
/* Dummy Read to deactivate read mode */
|
||||
IOE_ReadMultiple(DeviceAddr, EXC7200_READ_CMD, aBufferTS, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the selected source to generate a global interrupt or not
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None
|
||||
*/
|
||||
void exc7200_TS_EnableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the selected source to generate a global interrupt or not
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None
|
||||
*/
|
||||
void exc7200_TS_DisableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the selected source to generate a global interrupt or not
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval TS interrupts status
|
||||
*/
|
||||
uint8_t exc7200_TS_ITStatus(uint16_t DeviceAddr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the selected source to generate a global interrupt or not
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval None
|
||||
*/
|
||||
void exc7200_TS_ClearIT(uint16_t DeviceAddr)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
137
2P-ProjectPong/Drivers/BSP/Components/exc7200/exc7200.h
Normal file
137
2P-ProjectPong/Drivers/BSP/Components/exc7200/exc7200.h
Normal file
@ -0,0 +1,137 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 21-September-2015
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* exc7200.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __EXC7200_H
|
||||
#define __EXC7200_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/ts.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* */
|
||||
#define EXC7200_READ_CMD 0x09
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup exc7200_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup exc7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief exc7200 Control functions
|
||||
*/
|
||||
void exc7200_Init(uint16_t DeviceAddr);
|
||||
void exc7200_Reset(uint16_t DeviceAddr);
|
||||
uint16_t exc7200_ReadID(uint16_t DeviceAddr);
|
||||
void exc7200_TS_Start(uint16_t DeviceAddr);
|
||||
uint8_t exc7200_TS_DetectTouch(uint16_t DeviceAddr);
|
||||
void exc7200_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y);
|
||||
void exc7200_TS_EnableIT(uint16_t DeviceAddr);
|
||||
void exc7200_TS_DisableIT(uint16_t DeviceAddr);
|
||||
uint8_t exc7200_TS_ITStatus (uint16_t DeviceAddr);
|
||||
void exc7200_TS_ClearIT (uint16_t DeviceAddr);
|
||||
|
||||
void IOE_Init(void);
|
||||
void IOE_Delay(uint32_t delay);
|
||||
uint8_t IOE_Read(uint8_t addr, uint8_t reg);
|
||||
uint16_t IOE_ReadMultiple(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t length);
|
||||
void IOE_WriteMultiple(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t length);
|
||||
|
||||
/* Touch screen driver structure */
|
||||
extern TS_DrvTypeDef exc7200_ts_drv;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __EXC7200_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
179
2P-ProjectPong/Drivers/BSP/Components/ft6x06/Release_Notes.html
Normal file
179
2P-ProjectPong/Drivers/BSP/Components/ft6x06/Release_Notes.html
Normal file
@ -0,0 +1,179 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for FT6X06 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2016 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 03-May-2016 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add support of FT6x36 Touch controller<br>
|
||||
</span></li>
|
||||
</ul>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 03-August-2015 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
514
2P-ProjectPong/Drivers/BSP/Components/ft6x06/ft6x06.c
Normal file
514
2P-ProjectPong/Drivers/BSP/Components/ft6x06/ft6x06.c
Normal file
@ -0,0 +1,514 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 03-May-2016
|
||||
* @brief This file provides a set of functions needed to manage the FT6X06
|
||||
* IO Expander devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ft6x06.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Private_Defines FT6X06 Private Defines
|
||||
* @{
|
||||
*/
|
||||
#define FT6x06_MAX_INSTANCE 2
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Private_Variables FT6X06 Private Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
TS_DrvTypeDef ft6x06_ts_drv =
|
||||
{
|
||||
ft6x06_Init,
|
||||
ft6x06_ReadID,
|
||||
ft6x06_Reset,
|
||||
|
||||
ft6x06_TS_Start,
|
||||
ft6x06_TS_DetectTouch,
|
||||
ft6x06_TS_GetXY,
|
||||
|
||||
ft6x06_TS_EnableIT,
|
||||
ft6x06_TS_ClearIT,
|
||||
ft6x06_TS_ITStatus,
|
||||
ft6x06_TS_DisableIT
|
||||
};
|
||||
|
||||
/* ft6x06 instances by address */
|
||||
uint8_t ft6x06[FT6x06_MAX_INSTANCE] = {0};
|
||||
|
||||
/* Global ft6x06 handle */
|
||||
static ft6x06_handle_TypeDef ft6x06_handle = { FT6206_I2C_NOT_INITIALIZED, 0, 0};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ft6x06_Private_Function_Prototypes ft6x06 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static uint8_t ft6x06_GetInstance(uint16_t DeviceAddr);
|
||||
/* Private functions prototypes-----------------------------------------------*/
|
||||
#if (TS_AUTO_CALIBRATION_SUPPORTED == 1)
|
||||
/**
|
||||
* @brief Start TouchScreen calibration phase
|
||||
* @param DeviceAddr: FT6206 Device address for communication on I2C Bus.
|
||||
* @retval Status FT6206_STATUS_OK or FT6206_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft6x06_TS_Calibration(uint16_t DeviceAddr);
|
||||
#endif /* TS_AUTO_CALIBRATION_SUPPORTED == 1 */
|
||||
|
||||
/**
|
||||
* @brief Basic static configuration of TouchScreen
|
||||
* @param DeviceAddr: FT6206 Device address for communication on I2C Bus.
|
||||
* @retval Status FT6206_STATUS_OK or FT6206_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft6x06_TS_Configure(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ft6x06_Private_Functions ft6x06 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize the ft6x06 communication bus
|
||||
* from MCU to FT6206 : ie I2C channel initialization (if required).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_Init(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t instance;
|
||||
uint8_t empty;
|
||||
|
||||
/* Check if device instance already exists */
|
||||
instance = ft6x06_GetInstance(DeviceAddr);
|
||||
|
||||
/* To prevent double initialization */
|
||||
if(instance == 0xFF)
|
||||
{
|
||||
/* Look for empty instance */
|
||||
empty = ft6x06_GetInstance(0);
|
||||
|
||||
if(empty < FT6x06_MAX_INSTANCE)
|
||||
{
|
||||
/* Register the current device instance */
|
||||
ft6x06[empty] = DeviceAddr;
|
||||
|
||||
/* Initialize IO BUS layer */
|
||||
TS_IO_Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Software Reset the ft6x06.
|
||||
* @note : Not applicable to FT6206.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_Reset(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Do nothing */
|
||||
/* No software reset sequence available in FT6206 IC */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the ft6x06 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the FT6206 device ID, and verify this is a FT6206.
|
||||
* @param DeviceAddr: I2C FT6x06 Slave address.
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint16_t ft6x06_ReadID(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Initialize I2C link if needed */
|
||||
TS_IO_Init();
|
||||
|
||||
/* Return the device ID value */
|
||||
return (TS_IO_Read(DeviceAddr, FT6206_CHIP_ID_REG));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures the touch Screen IC device to start detecting touches
|
||||
* It goes through an internal calibration process (Hw calibration sequence of
|
||||
* the touch screen).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address).
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_Start(uint16_t DeviceAddr)
|
||||
{
|
||||
#if (TS_AUTO_CALIBRATION_SUPPORTED == 1)
|
||||
/* Hw Calibration sequence start : should be done once after each power up */
|
||||
/* This is called internal calibration of the touch screen */
|
||||
ft6x06_TS_Calibration(DeviceAddr);
|
||||
#endif
|
||||
/* Minimum static configuration of FT6206 */
|
||||
ft6x06_TS_Configure(DeviceAddr);
|
||||
|
||||
/* By default set FT6206 IC in Polling mode : no INT generation on FT6206 for new touch available */
|
||||
/* Note TS_INT is active low */
|
||||
ft6x06_TS_DisableIT(DeviceAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval : Number of active touches detected (can be 0, 1 or 2).
|
||||
*/
|
||||
uint8_t ft6x06_TS_DetectTouch(uint16_t DeviceAddr)
|
||||
{
|
||||
volatile uint8_t nbTouch = 0;
|
||||
|
||||
/* Read register FT6206_TD_STAT_REG to check number of touches detection */
|
||||
nbTouch = TS_IO_Read(DeviceAddr, FT6206_TD_STAT_REG);
|
||||
nbTouch &= FT6206_TD_STAT_MASK;
|
||||
|
||||
if(nbTouch > FT6206_MAX_DETECTABLE_TOUCH)
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
nbTouch = 0;
|
||||
}
|
||||
|
||||
/* Update ft6x06 driver internal global : current number of active touches */
|
||||
ft6x06_handle.currActiveTouchNb = nbTouch;
|
||||
|
||||
/* Reset current active touch index on which to work on */
|
||||
ft6x06_handle.currActiveTouchIdx = 0;
|
||||
|
||||
return(nbTouch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* Manage multi touch thanks to touch Index global
|
||||
* variable 'ft6x06_handle.currActiveTouchIdx'.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param X: Pointer to X position value
|
||||
* @param Y: Pointer to Y position value
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
|
||||
{
|
||||
uint8_t regAddress = 0;
|
||||
uint8_t dataxy[4];
|
||||
|
||||
if(ft6x06_handle.currActiveTouchIdx < ft6x06_handle.currActiveTouchNb)
|
||||
{
|
||||
switch(ft6x06_handle.currActiveTouchIdx)
|
||||
{
|
||||
case 0 :
|
||||
regAddress = FT6206_P1_XH_REG;
|
||||
break;
|
||||
case 1 :
|
||||
regAddress = FT6206_P2_XH_REG;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read X and Y positions */
|
||||
TS_IO_ReadMultiple(DeviceAddr, regAddress, dataxy, sizeof(dataxy));
|
||||
|
||||
/* Send back ready X position to caller */
|
||||
*X = ((dataxy[0] & FT6206_MSB_MASK) << 8) | (dataxy[1] & FT6206_LSB_MASK);
|
||||
|
||||
/* Send back ready Y position to caller */
|
||||
*Y = ((dataxy[2] & FT6206_MSB_MASK) << 8) | (dataxy[3] & FT6206_LSB_MASK);
|
||||
|
||||
ft6x06_handle.currActiveTouchIdx++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6206 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_TS_EnableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t regValue = 0;
|
||||
regValue = (FT6206_G_MODE_INTERRUPT_TRIGGER & (FT6206_G_MODE_INTERRUPT_MASK >> FT6206_G_MODE_INTERRUPT_SHIFT)) << FT6206_G_MODE_INTERRUPT_SHIFT;
|
||||
|
||||
/* Set interrupt trigger mode in FT6206_GMODE_REG */
|
||||
TS_IO_Write(DeviceAddr, FT6206_GMODE_REG, regValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6206 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_TS_DisableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t regValue = 0;
|
||||
regValue = (FT6206_G_MODE_INTERRUPT_POLLING & (FT6206_G_MODE_INTERRUPT_MASK >> FT6206_G_MODE_INTERRUPT_SHIFT)) << FT6206_G_MODE_INTERRUPT_SHIFT;
|
||||
|
||||
/* Set interrupt polling mode in FT6206_GMODE_REG */
|
||||
TS_IO_Write(DeviceAddr, FT6206_GMODE_REG, regValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT6206 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to FT6206.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval TS interrupts status : always return 0 here
|
||||
*/
|
||||
uint8_t ft6x06_TS_ITStatus(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Always return 0 as feature not applicable to FT6206 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT6206 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to FT6206.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_TS_ClearIT(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Nothing to be done here for FT6206 */
|
||||
}
|
||||
|
||||
/**** NEW FEATURES enabled when Multi-touch support is enabled ****/
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
/**
|
||||
* @brief Get the last touch gesture identification (zoom, move up/down...).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6x06).
|
||||
* @param pGestureId : Pointer to get last touch gesture Identification.
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetGestureID(uint16_t DeviceAddr, uint32_t * pGestureId)
|
||||
{
|
||||
volatile uint8_t ucReadData = 0;
|
||||
|
||||
ucReadData = TS_IO_Read(DeviceAddr, FT6206_GEST_ID_REG);
|
||||
|
||||
* pGestureId = ucReadData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch detailed informations on touch number 'touchIdx' (0..1)
|
||||
* This touch detailed information contains :
|
||||
* - weight that was applied to this touch
|
||||
* - sub-area of the touch in the touch panel
|
||||
* - event of linked to the touch (press down, lift up, ...)
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6x06).
|
||||
* @param touchIdx : Passed index of the touch (0..1) on which we want to get the
|
||||
* detailed information.
|
||||
* @param pWeight : Pointer to to get the weight information of 'touchIdx'.
|
||||
* @param pArea : Pointer to to get the sub-area information of 'touchIdx'.
|
||||
* @param pEvent : Pointer to to get the event information of 'touchIdx'.
|
||||
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetTouchInfo(uint16_t DeviceAddr,
|
||||
uint32_t touchIdx,
|
||||
uint32_t * pWeight,
|
||||
uint32_t * pArea,
|
||||
uint32_t * pEvent)
|
||||
{
|
||||
uint8_t regAddress = 0;
|
||||
uint8_t dataxy[3];
|
||||
|
||||
if(touchIdx < ft6x06_handle.currActiveTouchNb)
|
||||
{
|
||||
switch(touchIdx)
|
||||
{
|
||||
case 0 :
|
||||
regAddress = FT6206_P1_WEIGHT_REG;
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
regAddress = FT6206_P2_WEIGHT_REG;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
|
||||
} /* end switch(touchIdx) */
|
||||
|
||||
/* Read weight, area and Event Id of touch index */
|
||||
TS_IO_ReadMultiple(DeviceAddr, regAddress, dataxy, sizeof(dataxy));
|
||||
|
||||
/* Return weight of touch index */
|
||||
* pWeight = (dataxy[0] & FT6206_TOUCH_WEIGHT_MASK) >> FT6206_TOUCH_WEIGHT_SHIFT;
|
||||
/* Return area of touch index */
|
||||
* pArea = (dataxy[1] & FT6206_TOUCH_AREA_MASK) >> FT6206_TOUCH_AREA_SHIFT;
|
||||
/* Return Event Id of touch index */
|
||||
* pEvent = (dataxy[2] & FT6206_TOUCH_EVT_FLAG_MASK) >> FT6206_TOUCH_EVT_FLAG_SHIFT;
|
||||
|
||||
} /* of if(touchIdx < ft6x06_handle.currActiveTouchNb) */
|
||||
}
|
||||
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
#if (TS_AUTO_CALIBRATION_SUPPORTED == 1)
|
||||
/**
|
||||
* @brief Start TouchScreen calibration phase
|
||||
* @param DeviceAddr: FT6206 Device address for communication on I2C Bus.
|
||||
* @retval Status FT6206_STATUS_OK or FT6206_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft6x06_TS_Calibration(uint16_t DeviceAddr)
|
||||
{
|
||||
uint32_t nbAttempt = 0;
|
||||
volatile uint8_t ucReadData;
|
||||
volatile uint8_t regValue;
|
||||
uint32_t status = FT6206_STATUS_OK;
|
||||
uint8_t bEndCalibration = 0;
|
||||
|
||||
/* >> Calibration sequence start */
|
||||
|
||||
/* Switch FT6206 back to factory mode to calibrate */
|
||||
regValue = (FT6206_DEV_MODE_FACTORY & FT6206_DEV_MODE_MASK) << FT6206_DEV_MODE_SHIFT;
|
||||
TS_IO_Write(DeviceAddr, FT6206_DEV_MODE_REG, regValue); /* 0x40 */
|
||||
|
||||
/* Read back the same register FT6206_DEV_MODE_REG */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, FT6206_DEV_MODE_REG);
|
||||
TS_IO_Delay(300); /* Wait 300 ms */
|
||||
|
||||
if(((ucReadData & (FT6206_DEV_MODE_MASK << FT6206_DEV_MODE_SHIFT)) >> FT6206_DEV_MODE_SHIFT) != FT6206_DEV_MODE_FACTORY )
|
||||
{
|
||||
/* Return error to caller */
|
||||
return(FT6206_STATUS_NOT_OK);
|
||||
}
|
||||
|
||||
/* Start calibration command */
|
||||
TS_IO_Write(DeviceAddr, FT6206_TD_STAT_REG, 0x04);
|
||||
TS_IO_Delay(300); /* Wait 300 ms */
|
||||
|
||||
/* 100 attempts to wait switch from factory mode (calibration) to working mode */
|
||||
for (nbAttempt=0; ((nbAttempt < 100) && (!bEndCalibration)) ; nbAttempt++)
|
||||
{
|
||||
ucReadData = TS_IO_Read(DeviceAddr, FT6206_DEV_MODE_REG);
|
||||
ucReadData = (ucReadData & (FT6206_DEV_MODE_MASK << FT6206_DEV_MODE_SHIFT)) >> FT6206_DEV_MODE_SHIFT;
|
||||
if(ucReadData == FT6206_DEV_MODE_WORKING)
|
||||
{
|
||||
/* Auto Switch to FT6206_DEV_MODE_WORKING : means calibration have ended */
|
||||
bEndCalibration = 1; /* exit for loop */
|
||||
}
|
||||
|
||||
TS_IO_Delay(200); /* Wait 200 ms */
|
||||
}
|
||||
|
||||
/* Calibration sequence end << */
|
||||
|
||||
return(status);
|
||||
}
|
||||
#endif /* TS_AUTO_CALIBRATION_SUPPORTED == 1 */
|
||||
|
||||
/**
|
||||
* @brief Basic static configuration of TouchScreen
|
||||
* @param DeviceAddr: FT6206 Device address for communication on I2C Bus.
|
||||
* @retval Status FT6206_STATUS_OK or FT6206_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft6x06_TS_Configure(uint16_t DeviceAddr)
|
||||
{
|
||||
uint32_t status = FT6206_STATUS_OK;
|
||||
|
||||
/* Nothing special to be done for FT6206 */
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the device instance of the selected address is already registered
|
||||
* and return its index
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval Index of the device instance if registered, 0xFF if not.
|
||||
*/
|
||||
static uint8_t ft6x06_GetInstance(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t idx = 0;
|
||||
|
||||
/* Check all the registered instances */
|
||||
for(idx = 0; idx < FT6x06_MAX_INSTANCE ; idx ++)
|
||||
{
|
||||
if(ft6x06[idx] == DeviceAddr)
|
||||
{
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
471
2P-ProjectPong/Drivers/BSP/Components/ft6x06/ft6x06.h
Normal file
471
2P-ProjectPong/Drivers/BSP/Components/ft6x06/ft6x06.h
Normal file
@ -0,0 +1,471 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 03-May-2016
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* ft6x06.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __FT6X06_H
|
||||
#define __FT6X06_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Set Multi-touch as non supported */
|
||||
#ifndef TS_MULTI_TOUCH_SUPPORTED
|
||||
#define TS_MULTI_TOUCH_SUPPORTED 0
|
||||
#endif
|
||||
|
||||
/* Set Auto-calibration as non supported */
|
||||
#ifndef TS_AUTO_CALIBRATION_SUPPORTED
|
||||
#define TS_AUTO_CALIBRATION_SUPPORTED 0
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/ts.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @typedef ft6x06_handle_TypeDef
|
||||
* ft6x06 Handle definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t i2cInitialized;
|
||||
|
||||
/* field holding the current number of simultaneous active touches */
|
||||
uint8_t currActiveTouchNb;
|
||||
|
||||
/* field holding the touch index currently managed */
|
||||
uint8_t currActiveTouchIdx;
|
||||
|
||||
} ft6x06_handle_TypeDef;
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Maximum border values of the touchscreen pad */
|
||||
#define FT_6206_MAX_WIDTH ((uint16_t)800) /* Touchscreen pad max width */
|
||||
#define FT_6206_MAX_HEIGHT ((uint16_t)480) /* Touchscreen pad max height */
|
||||
|
||||
/* Touchscreen pad max width and height values for FT6x36 Touch*/
|
||||
#define FT_6206_MAX_WIDTH_HEIGHT ((uint16_t)240)
|
||||
|
||||
/* Possible values of driver functions return status */
|
||||
#define FT6206_STATUS_OK 0
|
||||
#define FT6206_STATUS_NOT_OK 1
|
||||
|
||||
/* Possible values of global variable 'TS_I2C_Initialized' */
|
||||
#define FT6206_I2C_NOT_INITIALIZED 0
|
||||
#define FT6206_I2C_INITIALIZED 1
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define FT6206_MAX_DETECTABLE_TOUCH 2
|
||||
|
||||
/**
|
||||
* @brief : Definitions for FT6206 I2C register addresses on 8 bit
|
||||
**/
|
||||
|
||||
/* Current mode register of the FT6206 (R/W) */
|
||||
#define FT6206_DEV_MODE_REG 0x00
|
||||
|
||||
/* Possible values of FT6206_DEV_MODE_REG */
|
||||
#define FT6206_DEV_MODE_WORKING 0x00
|
||||
#define FT6206_DEV_MODE_FACTORY 0x04
|
||||
|
||||
#define FT6206_DEV_MODE_MASK 0x7
|
||||
#define FT6206_DEV_MODE_SHIFT 4
|
||||
|
||||
/* Gesture ID register */
|
||||
#define FT6206_GEST_ID_REG 0x01
|
||||
|
||||
/* Possible values of FT6206_GEST_ID_REG */
|
||||
#define FT6206_GEST_ID_NO_GESTURE 0x00
|
||||
#define FT6206_GEST_ID_MOVE_UP 0x10
|
||||
#define FT6206_GEST_ID_MOVE_RIGHT 0x14
|
||||
#define FT6206_GEST_ID_MOVE_DOWN 0x18
|
||||
#define FT6206_GEST_ID_MOVE_LEFT 0x1C
|
||||
#define FT6206_GEST_ID_ZOOM_IN 0x48
|
||||
#define FT6206_GEST_ID_ZOOM_OUT 0x49
|
||||
|
||||
/* Touch Data Status register : gives number of active touch points (0..2) */
|
||||
#define FT6206_TD_STAT_REG 0x02
|
||||
|
||||
/* Values related to FT6206_TD_STAT_REG */
|
||||
#define FT6206_TD_STAT_MASK 0x0F
|
||||
#define FT6206_TD_STAT_SHIFT 0x00
|
||||
|
||||
/* Values Pn_XH and Pn_YH related */
|
||||
#define FT6206_TOUCH_EVT_FLAG_PRESS_DOWN 0x00
|
||||
#define FT6206_TOUCH_EVT_FLAG_LIFT_UP 0x01
|
||||
#define FT6206_TOUCH_EVT_FLAG_CONTACT 0x02
|
||||
#define FT6206_TOUCH_EVT_FLAG_NO_EVENT 0x03
|
||||
|
||||
#define FT6206_TOUCH_EVT_FLAG_SHIFT 6
|
||||
#define FT6206_TOUCH_EVT_FLAG_MASK (3 << FT6206_TOUCH_EVT_FLAG_SHIFT)
|
||||
|
||||
#define FT6206_MSB_MASK 0x0F
|
||||
#define FT6206_MSB_SHIFT 0
|
||||
|
||||
/* Values Pn_XL and Pn_YL related */
|
||||
#define FT6206_LSB_MASK 0xFF
|
||||
#define FT6206_LSB_SHIFT 0
|
||||
|
||||
#define FT6206_P1_XH_REG 0x03
|
||||
#define FT6206_P1_XL_REG 0x04
|
||||
#define FT6206_P1_YH_REG 0x05
|
||||
#define FT6206_P1_YL_REG 0x06
|
||||
|
||||
/* Touch Pressure register value (R) */
|
||||
#define FT6206_P1_WEIGHT_REG 0x07
|
||||
|
||||
/* Values Pn_WEIGHT related */
|
||||
#define FT6206_TOUCH_WEIGHT_MASK 0xFF
|
||||
#define FT6206_TOUCH_WEIGHT_SHIFT 0
|
||||
|
||||
/* Touch area register */
|
||||
#define FT6206_P1_MISC_REG 0x08
|
||||
|
||||
/* Values related to FT6206_Pn_MISC_REG */
|
||||
#define FT6206_TOUCH_AREA_MASK (0x04 << 4)
|
||||
#define FT6206_TOUCH_AREA_SHIFT 0x04
|
||||
|
||||
#define FT6206_P2_XH_REG 0x09
|
||||
#define FT6206_P2_XL_REG 0x0A
|
||||
#define FT6206_P2_YH_REG 0x0B
|
||||
#define FT6206_P2_YL_REG 0x0C
|
||||
#define FT6206_P2_WEIGHT_REG 0x0D
|
||||
#define FT6206_P2_MISC_REG 0x0E
|
||||
|
||||
/* Threshold for touch detection */
|
||||
#define FT6206_TH_GROUP_REG 0x80
|
||||
|
||||
/* Values FT6206_TH_GROUP_REG : threshold related */
|
||||
#define FT6206_THRESHOLD_MASK 0xFF
|
||||
#define FT6206_THRESHOLD_SHIFT 0
|
||||
|
||||
/* Filter function coefficients */
|
||||
#define FT6206_TH_DIFF_REG 0x85
|
||||
|
||||
/* Control register */
|
||||
#define FT6206_CTRL_REG 0x86
|
||||
|
||||
/* Values related to FT6206_CTRL_REG */
|
||||
|
||||
/* Will keep the Active mode when there is no touching */
|
||||
#define FT6206_CTRL_KEEP_ACTIVE_MODE 0x00
|
||||
|
||||
/* Switching from Active mode to Monitor mode automatically when there is no touching */
|
||||
#define FT6206_CTRL_KEEP_AUTO_SWITCH_MONITOR_MODE 0x01
|
||||
|
||||
/* The time period of switching from Active mode to Monitor mode when there is no touching */
|
||||
#define FT6206_TIMEENTERMONITOR_REG 0x87
|
||||
|
||||
/* Report rate in Active mode */
|
||||
#define FT6206_PERIODACTIVE_REG 0x88
|
||||
|
||||
/* Report rate in Monitor mode */
|
||||
#define FT6206_PERIODMONITOR_REG 0x89
|
||||
|
||||
/* The value of the minimum allowed angle while Rotating gesture mode */
|
||||
#define FT6206_RADIAN_VALUE_REG 0x91
|
||||
|
||||
/* Maximum offset while Moving Left and Moving Right gesture */
|
||||
#define FT6206_OFFSET_LEFT_RIGHT_REG 0x92
|
||||
|
||||
/* Maximum offset while Moving Up and Moving Down gesture */
|
||||
#define FT6206_OFFSET_UP_DOWN_REG 0x93
|
||||
|
||||
/* Minimum distance while Moving Left and Moving Right gesture */
|
||||
#define FT6206_DISTANCE_LEFT_RIGHT_REG 0x94
|
||||
|
||||
/* Minimum distance while Moving Up and Moving Down gesture */
|
||||
#define FT6206_DISTANCE_UP_DOWN_REG 0x95
|
||||
|
||||
/* Maximum distance while Zoom In and Zoom Out gesture */
|
||||
#define FT6206_DISTANCE_ZOOM_REG 0x96
|
||||
|
||||
/* High 8-bit of LIB Version info */
|
||||
#define FT6206_LIB_VER_H_REG 0xA1
|
||||
|
||||
/* Low 8-bit of LIB Version info */
|
||||
#define FT6206_LIB_VER_L_REG 0xA2
|
||||
|
||||
/* Chip Selecting */
|
||||
#define FT6206_CIPHER_REG 0xA3
|
||||
|
||||
/* Interrupt mode register (used when in interrupt mode) */
|
||||
#define FT6206_GMODE_REG 0xA4
|
||||
|
||||
#define FT6206_G_MODE_INTERRUPT_MASK 0x03
|
||||
#define FT6206_G_MODE_INTERRUPT_SHIFT 0x00
|
||||
|
||||
/* Possible values of FT6206_GMODE_REG */
|
||||
#define FT6206_G_MODE_INTERRUPT_POLLING 0x00
|
||||
#define FT6206_G_MODE_INTERRUPT_TRIGGER 0x01
|
||||
|
||||
/* Current power mode the FT6206 system is in (R) */
|
||||
#define FT6206_PWR_MODE_REG 0xA5
|
||||
|
||||
/* FT6206 firmware version */
|
||||
#define FT6206_FIRMID_REG 0xA6
|
||||
|
||||
/* FT6206 Chip identification register */
|
||||
#define FT6206_CHIP_ID_REG 0xA8
|
||||
|
||||
/* Possible values of FT6206_CHIP_ID_REG */
|
||||
#define FT6206_ID_VALUE 0x11
|
||||
#define FT6x36_ID_VALUE 0xCD
|
||||
|
||||
/* Release code version */
|
||||
#define FT6206_RELEASE_CODE_ID_REG 0xAF
|
||||
|
||||
/* Current operating mode the FT6206 system is in (R) */
|
||||
#define FT6206_STATE_REG 0xBC
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft6x06_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft6x06_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ft6x06 Control functions
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the ft6x06 communication bus
|
||||
* from MCU to FT6206 : ie I2C channel initialization (if required).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_Init(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Software Reset the ft6x06.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_Reset(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Read the ft6x06 device ID, pre intitalize I2C in case of need to be
|
||||
* able to read the FT6206 device ID, and verify this is a FT6206.
|
||||
* @param DeviceAddr: I2C FT6x06 Slave address.
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint16_t ft6x06_ReadID(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Configures the touch Screen IC device to start detecting touches
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address).
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_Start(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval : Number of active touches detected (can be 0, 1 or 2).
|
||||
*/
|
||||
uint8_t ft6x06_TS_DetectTouch(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* Manage multi touch thanks to touch Index global
|
||||
* variable 'ft6x06_handle.currActiveTouchIdx'.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param X: Pointer to X position value
|
||||
* @param Y: Pointer to Y position value
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y);
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6206 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_TS_EnableIT(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6206 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT6206).
|
||||
* @retval None
|
||||
*/
|
||||
void ft6x06_TS_DisableIT(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT6206 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval TS interrupts status
|
||||
*/
|
||||
uint8_t ft6x06_TS_ITStatus (uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT6206 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6206).
|
||||
* @retval TS interrupts status
|
||||
*/
|
||||
void ft6x06_TS_ClearIT (uint16_t DeviceAddr);
|
||||
|
||||
/**** NEW FEATURES enabled when Multi-touch support is enabled ****/
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
|
||||
/**
|
||||
* @brief Get the last touch gesture identification (zoom, move up/down...).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6x06).
|
||||
* @param pGestureId : Pointer to get last touch gesture Identification.
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetGestureID(uint16_t DeviceAddr, uint32_t * pGestureId);
|
||||
|
||||
/**
|
||||
* @brief Get the touch detailed informations on touch number 'touchIdx' (0..1)
|
||||
* This touch detailed information contains :
|
||||
* - weight that was applied to this touch
|
||||
* - sub-area of the touch in the touch panel
|
||||
* - event of linked to the touch (press down, lift up, ...)
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT6x06).
|
||||
* @param touchIdx : Passed index of the touch (0..1) on which we want to get the
|
||||
* detailed information.
|
||||
* @param pWeight : Pointer to to get the weight information of 'touchIdx'.
|
||||
* @param pArea : Pointer to to get the sub-area information of 'touchIdx'.
|
||||
* @param pEvent : Pointer to to get the event information of 'touchIdx'.
|
||||
|
||||
* @retval None.
|
||||
*/
|
||||
void ft6x06_TS_GetTouchInfo(uint16_t DeviceAddr,
|
||||
uint32_t touchIdx,
|
||||
uint32_t * pWeight,
|
||||
uint32_t * pArea,
|
||||
uint32_t * pEvent);
|
||||
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
/* Imported TS IO functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft6x06_Imported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* TouchScreen (TS) external IO functions */
|
||||
extern void TS_IO_Init(void);
|
||||
extern void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
extern uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
|
||||
extern uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
|
||||
extern void TS_IO_Delay(uint32_t Delay);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Imported global variables --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft6x06_Imported_Globals
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/* Touch screen driver structure */
|
||||
extern TS_DrvTypeDef ft6x06_ts_drv;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __FT6X06_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
313
2P-ProjectPong/Drivers/BSP/Components/hts221/Release_Notes.html
Normal file
313
2P-ProjectPong/Drivers/BSP/Components/hts221/Release_Notes.html
Normal file
@ -0,0 +1,313 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for HTS221 component</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes for HTS221 component</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2019 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.2
|
||||
/ 11-October-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Rename context type to universal stmdev_ctx_t</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Move unions from PID to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.1
|
||||
/ 18-June-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update license on Release Notes</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.0
|
||||
/ 4-April-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add new APIs</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.1.0
|
||||
/ 31-Jan-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update PID files</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add One-Shot support</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.0
|
||||
/ 12-Jul-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Source Code Refactoring according new BSP v2.5 specifications</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0
|
||||
/ 1-May-2017</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Unify driver to have the same files for X-NUCLEO-IKS01Ax and SensorTile</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0
|
||||
/ 12-August-2016</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add support for ReadReg and WriteReg APIs</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0
|
||||
/ 10-December-2015</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add support for Platform Independent Drivers</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.0
|
||||
/ 11-February-2015</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add extended features support for the Component</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0
|
||||
/ 12-December-2014</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add error control in the Component API</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 10-September-2014</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First
|
||||
official release</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br>
|
||||
</h2>
|
||||
|
||||
|
||||
<div style="text-align: justify;">
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
</div>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
</body></html>
|
814
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221.c
Normal file
814
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221.c
Normal file
@ -0,0 +1,814 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file hts221.c
|
||||
* @author MEMS Software Solutions Team
|
||||
* @brief HTS221 driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "hts221.h"
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221 HTS221
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Exported_Variables HTS221 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
HTS221_CommonDrv_t HTS221_COMMON_Driver =
|
||||
{
|
||||
HTS221_Init,
|
||||
HTS221_DeInit,
|
||||
HTS221_ReadID,
|
||||
HTS221_GetCapabilities,
|
||||
};
|
||||
|
||||
HTS221_HUM_Drv_t HTS221_HUM_Driver =
|
||||
{
|
||||
HTS221_HUM_Enable,
|
||||
HTS221_HUM_Disable,
|
||||
HTS221_HUM_GetOutputDataRate,
|
||||
HTS221_HUM_SetOutputDataRate,
|
||||
HTS221_HUM_GetHumidity,
|
||||
};
|
||||
|
||||
HTS221_TEMP_Drv_t HTS221_TEMP_Driver =
|
||||
{
|
||||
HTS221_TEMP_Enable,
|
||||
HTS221_TEMP_Disable,
|
||||
HTS221_TEMP_GetOutputDataRate,
|
||||
HTS221_TEMP_SetOutputDataRate,
|
||||
HTS221_TEMP_GetTemperature,
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Private_Function_Prototypes HTS221 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
static int32_t ReadRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length);
|
||||
static int32_t HTS221_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr);
|
||||
static int32_t HTS221_SetOutputDataRate(HTS221_Object_t *pObj, float Odr);
|
||||
static int32_t HTS221_Initialize(HTS221_Object_t *pObj);
|
||||
static float Linear_Interpolation(lin_t *Lin, float Coeff);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Exported_Functions HTS221 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register Component Bus IO operations
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_RegisterBusIO(HTS221_Object_t *pObj, HTS221_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = HTS221_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.BusType = pIO->BusType;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.read_reg = ReadRegWrap;
|
||||
pObj->Ctx.write_reg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if (pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the HTS221 sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Init(HTS221_Object_t *pObj)
|
||||
{
|
||||
if (pObj->is_initialized == 0U)
|
||||
{
|
||||
if (HTS221_Initialize(pObj) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->is_initialized = 1;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deinitialize the HTS221 sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_DeInit(HTS221_Object_t *pObj)
|
||||
{
|
||||
if (pObj->is_initialized == 1U)
|
||||
{
|
||||
if (HTS221_HUM_Disable(pObj) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
if (HTS221_TEMP_Disable(pObj) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->is_initialized = 0;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get WHO_AM_I value
|
||||
* @param pObj the device pObj
|
||||
* @param Id the WHO_AM_I value
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_ReadID(HTS221_Object_t *pObj, uint8_t *Id)
|
||||
{
|
||||
if (hts221_device_id_get(&(pObj->Ctx), Id) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get HTS221 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to HTS221 sensor capabilities
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_GetCapabilities(HTS221_Object_t *pObj, HTS221_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
Capabilities->Humidity = 1;
|
||||
Capabilities->Pressure = 0;
|
||||
Capabilities->Temperature = 1;
|
||||
Capabilities->LowPower = 0;
|
||||
Capabilities->HumMaxOdr = 12.5f;
|
||||
Capabilities->TempMaxOdr = 12.5f;
|
||||
Capabilities->PressMaxOdr = 0.0f;
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 initialization status
|
||||
* @param pObj the device pObj
|
||||
* @param Status 1 if initialized, 0 otherwise
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Get_Init_Status(HTS221_Object_t *pObj, uint8_t *Status)
|
||||
{
|
||||
if (pObj == NULL)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
*Status = pObj->is_initialized;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the HTS221 humidity sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_Enable(HTS221_Object_t *pObj)
|
||||
{
|
||||
/* Check if the component is already enabled */
|
||||
if (pObj->hum_is_enabled == 1U)
|
||||
{
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/* Check if the HTS221 temperature sensor is already enabled. */
|
||||
/* If yes, skip the enable function, if not call enable function */
|
||||
if (pObj->temp_is_enabled == 0U)
|
||||
{
|
||||
/* Power on the component. */
|
||||
if (hts221_power_on_set(&(pObj->Ctx), PROPERTY_ENABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->hum_is_enabled = 1;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable the HTS221 humidity sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_Disable(HTS221_Object_t *pObj)
|
||||
{
|
||||
/* Check if the component is already disabled */
|
||||
if (pObj->hum_is_enabled == 0U)
|
||||
{
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/* Check if the HTS221 temperature sensor is still enable. */
|
||||
/* If yes, skip the disable function, if not call disable function */
|
||||
if (pObj->temp_is_enabled == 0U)
|
||||
{
|
||||
/* Power off the component. */
|
||||
if (hts221_power_on_set(&(pObj->Ctx), PROPERTY_DISABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->hum_is_enabled = 0;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 humidity sensor output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr pointer where the output data rate is written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr)
|
||||
{
|
||||
return HTS221_GetOutputDataRate(pObj, Odr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the HTS221 humidity sensor output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr the output data rate value to be set
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_SetOutputDataRate(HTS221_Object_t *pObj, float Odr)
|
||||
{
|
||||
return HTS221_SetOutputDataRate(pObj, Odr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 humidity value
|
||||
* @param pObj the device pObj
|
||||
* @param Value pointer where the humidity value is written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_GetHumidity(HTS221_Object_t *pObj, float *Value)
|
||||
{
|
||||
hts221_axis1bit16_t data_raw_humidity;
|
||||
hts221_axis1bit16_t coeff;
|
||||
lin_t lin_hum;
|
||||
|
||||
if (hts221_hum_adc_point_0_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_hum.x0 = (float)coeff.i16bit;
|
||||
|
||||
if (hts221_hum_rh_point_0_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_hum.y0 = (float)coeff.u8bit[0];
|
||||
|
||||
if (hts221_hum_adc_point_1_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_hum.x1 = (float)coeff.i16bit;
|
||||
|
||||
if (hts221_hum_rh_point_1_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_hum.y1 = (float)coeff.u8bit[0];
|
||||
|
||||
(void)memset(data_raw_humidity.u8bit, 0x00, sizeof(int16_t));
|
||||
if (hts221_humidity_raw_get(&(pObj->Ctx), data_raw_humidity.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
*Value = Linear_Interpolation(&lin_hum, (float)data_raw_humidity.i16bit);
|
||||
|
||||
if (*Value < 0.0f)
|
||||
{
|
||||
*Value = 0.0f;
|
||||
}
|
||||
|
||||
if (*Value > 100.0f)
|
||||
{
|
||||
*Value = 100.0f;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 humidity data ready bit value
|
||||
* @param pObj the device pObj
|
||||
* @param Status the status of data ready bit
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_HUM_Get_DRDY_Status(HTS221_Object_t *pObj, uint8_t *Status)
|
||||
{
|
||||
if (hts221_hum_data_ready_get(&(pObj->Ctx), Status) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the HTS221 temperature sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_Enable(HTS221_Object_t *pObj)
|
||||
{
|
||||
/* Check if the component is already enabled */
|
||||
if (pObj->temp_is_enabled == 1U)
|
||||
{
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/* Check if the HTS221 humidity sensor is already enabled. */
|
||||
/* If yes, skip the enable function, if not call enable function */
|
||||
if (pObj->hum_is_enabled == 0U)
|
||||
{
|
||||
/* Power on the component. */
|
||||
if (hts221_power_on_set(&(pObj->Ctx), PROPERTY_ENABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->temp_is_enabled = 1;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable the HTS221 temperature sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_Disable(HTS221_Object_t *pObj)
|
||||
{
|
||||
/* Check if the component is already disabled */
|
||||
if (pObj->temp_is_enabled == 0U)
|
||||
{
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/* Check if the HTS221 humidity sensor is still enable. */
|
||||
/* If yes, skip the disable function, if not call disable function */
|
||||
if (pObj->hum_is_enabled == 0U)
|
||||
{
|
||||
/* Power off the component. */
|
||||
if (hts221_power_on_set(&(pObj->Ctx), PROPERTY_DISABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->temp_is_enabled = 0;
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 temperature sensor output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr pointer where the output data rate is written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr)
|
||||
{
|
||||
return HTS221_GetOutputDataRate(pObj, Odr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the HTS221 temperature sensor output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr the output data rate value to be set
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_SetOutputDataRate(HTS221_Object_t *pObj, float Odr)
|
||||
{
|
||||
return HTS221_SetOutputDataRate(pObj, Odr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 temperature value
|
||||
* @param pObj the device pObj
|
||||
* @param Value pointer where the temperature value is written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_GetTemperature(HTS221_Object_t *pObj, float *Value)
|
||||
{
|
||||
hts221_axis1bit16_t data_raw_temperature;
|
||||
hts221_axis1bit16_t coeff;
|
||||
lin_t lin_temp;
|
||||
|
||||
if (hts221_temp_adc_point_0_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_temp.x0 = (float)coeff.i16bit;
|
||||
|
||||
if (hts221_temp_deg_point_0_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_temp.y0 = (float)coeff.u8bit[0];
|
||||
|
||||
if (hts221_temp_adc_point_1_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_temp.x1 = (float)coeff.i16bit;
|
||||
|
||||
if (hts221_temp_deg_point_1_get(&(pObj->Ctx), coeff.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
lin_temp.y1 = (float)coeff.u8bit[0];
|
||||
|
||||
(void)memset(data_raw_temperature.u8bit, 0x00, sizeof(int16_t));
|
||||
if (hts221_temperature_raw_get(&(pObj->Ctx), data_raw_temperature.u8bit) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
*Value = Linear_Interpolation(&lin_temp, (float)data_raw_temperature.i16bit);
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 temperature data ready bit value
|
||||
* @param pObj the device pObj
|
||||
* @param Status the status of data ready bit
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_TEMP_Get_DRDY_Status(HTS221_Object_t *pObj, uint8_t *Status)
|
||||
{
|
||||
if (hts221_temp_data_ready_get(&(pObj->Ctx), Status) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the HTS221 One Shot Mode
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Set_One_Shot(HTS221_Object_t *pObj)
|
||||
{
|
||||
|
||||
/* Set ODR */
|
||||
if(hts221_data_rate_set(&(pObj->Ctx), HTS221_ONE_SHOT)!= HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
/* Start One Shot Measurement */
|
||||
if(hts221_one_shoot_trigger_set(&(pObj->Ctx), 1) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 One Shot Status
|
||||
* @param pObj the device pObj
|
||||
* @param Status pointer to the one shot status (1 means measurements available, 0 means measurements not available yet)
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Get_One_Shot_Status(HTS221_Object_t *pObj, uint8_t *Status)
|
||||
{
|
||||
uint8_t h_da;
|
||||
uint8_t t_da;
|
||||
|
||||
/* Get DataReady for humidity */
|
||||
if(hts221_hum_data_ready_get(&(pObj->Ctx), &h_da) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
/* Get DataReady for temperature */
|
||||
if(hts221_temp_data_ready_get(&(pObj->Ctx), &t_da) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
if(h_da && t_da)
|
||||
{
|
||||
*Status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*Status = 0;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the HTS221 register value
|
||||
* @param pObj the device pObj
|
||||
* @param Reg address to be read
|
||||
* @param Data pointer where the value is written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Read_Reg(HTS221_Object_t *pObj, uint8_t Reg, uint8_t *Data)
|
||||
{
|
||||
if (hts221_read_reg(&(pObj->Ctx), Reg, Data, 1) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the HTS221 register value
|
||||
* @param pObj the device pObj
|
||||
* @param Reg address to be written
|
||||
* @param Data value to be written
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Write_Reg(HTS221_Object_t *pObj, uint8_t Reg, uint8_t Data)
|
||||
{
|
||||
if (hts221_write_reg(&(pObj->Ctx), Reg, &Data, 1) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Private_Functions HTS221 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Get output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr the output data rate value
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
static int32_t HTS221_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr)
|
||||
{
|
||||
int32_t ret = HTS221_OK;
|
||||
hts221_odr_t odr_low_level;
|
||||
|
||||
if (hts221_data_rate_get(&(pObj->Ctx), &odr_low_level) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
switch (odr_low_level)
|
||||
{
|
||||
case HTS221_ONE_SHOT:
|
||||
*Odr = 0.0f;
|
||||
break;
|
||||
|
||||
case HTS221_ODR_1Hz:
|
||||
*Odr = 1.0f;
|
||||
break;
|
||||
|
||||
case HTS221_ODR_7Hz:
|
||||
*Odr = 7.0f;
|
||||
break;
|
||||
|
||||
case HTS221_ODR_12Hz5:
|
||||
*Odr = 12.5f;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = HTS221_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set output data rate
|
||||
* @param pObj the device pObj
|
||||
* @param Odr the output data rate value to be set
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
static int32_t HTS221_SetOutputDataRate(HTS221_Object_t *pObj, float Odr)
|
||||
{
|
||||
hts221_odr_t new_odr;
|
||||
|
||||
new_odr = (Odr <= 1.0f) ? HTS221_ODR_1Hz
|
||||
: (Odr <= 7.0f) ? HTS221_ODR_7Hz
|
||||
: HTS221_ODR_12Hz5;
|
||||
|
||||
if (hts221_data_rate_set(&(pObj->Ctx), new_odr) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the HTS221 sensor
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
static int32_t HTS221_Initialize(HTS221_Object_t *pObj)
|
||||
{
|
||||
/* Power off the component. */
|
||||
if (hts221_power_on_set(&(pObj->Ctx), PROPERTY_DISABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
/* Enable BDU */
|
||||
if (hts221_block_data_update_set(&(pObj->Ctx), PROPERTY_ENABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
/* Set default ODR */
|
||||
if (HTS221_SetOutputDataRate(pObj, 1.0f) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable HTS221 DRDY interrupt mode
|
||||
* @param pObj the device pObj
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
int32_t HTS221_Enable_DRDY_Interrupt(HTS221_Object_t *pObj)
|
||||
{
|
||||
if (hts221_drdy_on_int_set(&(pObj->Ctx), PROPERTY_ENABLE) != HTS221_OK)
|
||||
{
|
||||
return HTS221_ERROR;
|
||||
}
|
||||
|
||||
return HTS221_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function used to apply coefficient
|
||||
* @param Lin the line
|
||||
* @param Coeff the coefficient
|
||||
* @retval Calculation result
|
||||
*/
|
||||
static float Linear_Interpolation(lin_t *Lin, float Coeff)
|
||||
{
|
||||
return (((Lin->y1 - Lin->y0) * Coeff) + ((Lin->x1 * Lin->y0) - (Lin->x0 * Lin->y1))) / (Lin->x1 - Lin->x0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap Read register component function to Bus IO function
|
||||
* @param Handle the device handler
|
||||
* @param Reg the register address
|
||||
* @param pData the stored data pointer
|
||||
* @param Length the length
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
static int32_t ReadRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length)
|
||||
{
|
||||
HTS221_Object_t *pObj = (HTS221_Object_t *)Handle;
|
||||
|
||||
if (pObj->IO.BusType == (uint32_t)HTS221_I2C_BUS) /* I2C */
|
||||
{
|
||||
/* Enable Multi-byte read */
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, (Reg | 0x80U), pData, Length);
|
||||
}
|
||||
else /* SPI 3-Wires */
|
||||
{
|
||||
/* Enable Multi-byte read */
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, (Reg | 0x40U), pData, Length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap Write register component function to Bus IO function
|
||||
* @param Handle the device handler
|
||||
* @param Reg the register address
|
||||
* @param pData the stored data pointer
|
||||
* @param Length the length
|
||||
* @retval 0 in case of success, an error code otherwise
|
||||
*/
|
||||
static int32_t WriteRegWrap(void *Handle, uint8_t Reg, uint8_t *pData, uint16_t Length)
|
||||
{
|
||||
HTS221_Object_t *pObj = (HTS221_Object_t *)Handle;
|
||||
|
||||
if (pObj->IO.BusType == (uint32_t)HTS221_I2C_BUS) /* I2C */
|
||||
{
|
||||
/* Enable Multi-byte write */
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, (Reg | 0x80U), pData, Length);
|
||||
}
|
||||
else /* SPI 3-Wires */
|
||||
{
|
||||
/* Enable Multi-byte write */
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, (Reg | 0x40U), pData, Length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
225
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221.h
Normal file
225
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221.h
Normal file
@ -0,0 +1,225 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file hts221.h
|
||||
* @author MEMS Software Solutions Team
|
||||
* @brief HTS221 header driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef HTS221_H
|
||||
#define HTS221_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "hts221_reg.h"
|
||||
#include <string.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup HTS221 HTS221
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Exported_Types HTS221 Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*HTS221_Init_Func)(void);
|
||||
typedef int32_t (*HTS221_DeInit_Func)(void);
|
||||
typedef int32_t (*HTS221_GetTick_Func)(void);
|
||||
typedef int32_t (*HTS221_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
typedef int32_t (*HTS221_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HTS221_Init_Func Init;
|
||||
HTS221_DeInit_Func DeInit;
|
||||
uint32_t BusType; /*0 means I2C, 1 means SPI-3-Wires */
|
||||
uint8_t Address;
|
||||
HTS221_WriteReg_Func WriteReg;
|
||||
HTS221_ReadReg_Func ReadReg;
|
||||
HTS221_GetTick_Func GetTick;
|
||||
} HTS221_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x0;
|
||||
float y0;
|
||||
float x1;
|
||||
float y1;
|
||||
} lin_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HTS221_IO_t IO;
|
||||
stmdev_ctx_t Ctx;
|
||||
uint8_t is_initialized;
|
||||
uint8_t hum_is_enabled;
|
||||
uint8_t temp_is_enabled;
|
||||
} HTS221_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Temperature;
|
||||
uint8_t Pressure;
|
||||
uint8_t Humidity;
|
||||
uint8_t LowPower;
|
||||
float HumMaxOdr;
|
||||
float TempMaxOdr;
|
||||
float PressMaxOdr;
|
||||
} HTS221_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(HTS221_Object_t *);
|
||||
int32_t (*DeInit)(HTS221_Object_t *);
|
||||
int32_t (*ReadID)(HTS221_Object_t *, uint8_t *);
|
||||
int32_t (*GetCapabilities)(HTS221_Object_t *, HTS221_Capabilities_t *);
|
||||
} HTS221_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(HTS221_Object_t *);
|
||||
int32_t (*Disable)(HTS221_Object_t *);
|
||||
int32_t (*GetOutputDataRate)(HTS221_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(HTS221_Object_t *, float);
|
||||
int32_t (*GetHumidity)(HTS221_Object_t *, float *);
|
||||
} HTS221_HUM_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(HTS221_Object_t *);
|
||||
int32_t (*Disable)(HTS221_Object_t *);
|
||||
int32_t (*GetOutputDataRate)(HTS221_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(HTS221_Object_t *, float);
|
||||
int32_t (*GetTemperature)(HTS221_Object_t *, float *);
|
||||
} HTS221_TEMP_Drv_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit[3];
|
||||
uint8_t u8bit[6];
|
||||
} hts221_axis3bit16_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit;
|
||||
uint8_t u8bit[2];
|
||||
} hts221_axis1bit16_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit[3];
|
||||
uint8_t u8bit[12];
|
||||
} hts221_axis3bit32_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit;
|
||||
uint8_t u8bit[4];
|
||||
} hts221_axis1bit32_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Exported_Constants HTS221 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define HTS221_I2C_BUS 0U
|
||||
#define HTS221_SPI_3WIRES_BUS 1U
|
||||
|
||||
/** HTS221 error codes **/
|
||||
#define HTS221_OK 0
|
||||
#define HTS221_ERROR -1
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup HTS221_Exported_Functions HTS221 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t HTS221_RegisterBusIO(HTS221_Object_t *pObj, HTS221_IO_t *pIO);
|
||||
int32_t HTS221_Init(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_DeInit(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_ReadID(HTS221_Object_t *pObj, uint8_t *Id);
|
||||
int32_t HTS221_GetCapabilities(HTS221_Object_t *pObj, HTS221_Capabilities_t *Capabilities);
|
||||
int32_t HTS221_Get_Init_Status(HTS221_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t HTS221_HUM_Enable(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_HUM_Disable(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_HUM_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr);
|
||||
int32_t HTS221_HUM_SetOutputDataRate(HTS221_Object_t *pObj, float Odr);
|
||||
int32_t HTS221_HUM_GetHumidity(HTS221_Object_t *pObj, float *Value);
|
||||
int32_t HTS221_HUM_Get_DRDY_Status(HTS221_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t HTS221_TEMP_Enable(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_TEMP_Disable(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_TEMP_GetOutputDataRate(HTS221_Object_t *pObj, float *Odr);
|
||||
int32_t HTS221_TEMP_SetOutputDataRate(HTS221_Object_t *pObj, float Odr);
|
||||
int32_t HTS221_TEMP_GetTemperature(HTS221_Object_t *pObj, float *Value);
|
||||
int32_t HTS221_TEMP_Get_DRDY_Status(HTS221_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t HTS221_Read_Reg(HTS221_Object_t *pObj, uint8_t Reg, uint8_t *Data);
|
||||
int32_t HTS221_Write_Reg(HTS221_Object_t *pObj, uint8_t Reg, uint8_t Data);
|
||||
|
||||
int32_t HTS221_Set_One_Shot(HTS221_Object_t *pObj);
|
||||
int32_t HTS221_Get_One_Shot_Status(HTS221_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t HTS221_Enable_DRDY_Interrupt(HTS221_Object_t *pObj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup HTS221_Exported_Variables HTS221 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern HTS221_CommonDrv_t HTS221_COMMON_Driver;
|
||||
extern HTS221_HUM_Drv_t HTS221_HUM_Driver;
|
||||
extern HTS221_TEMP_Drv_t HTS221_TEMP_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
929
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221_reg.c
Normal file
929
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221_reg.c
Normal file
@ -0,0 +1,929 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* @file hts221_reg.c
|
||||
* @author Sensors Software Solution Team
|
||||
* @brief HTS221 driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "hts221_reg.h"
|
||||
|
||||
/**
|
||||
* @defgroup HTS221
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* hts221 enhanced inertial module.
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_interfaces_functions
|
||||
* @brief This section provide a set of functions used to read and write
|
||||
* a generic register of the device.
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Read generic device register
|
||||
*
|
||||
* @param ctx read / write interface definitions(ptr)
|
||||
* @param reg register to read
|
||||
* @param data pointer to buffer that store the data read(ptr)
|
||||
* @param len number of consecutive register to read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_read_reg(stmdev_ctx_t* ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = ctx->read_reg(ctx->handle, reg, data, len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write generic device register
|
||||
*
|
||||
* @param ctx read / write interface definitions(ptr)
|
||||
* @param reg register to write
|
||||
* @param data pointer to data to write in register reg(ptr)
|
||||
* @param len number of consecutive register to write
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_write_reg(stmdev_ctx_t* ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = ctx->write_reg(ctx->handle, reg, data, len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_Data_Generation
|
||||
* @brief This section group all the functions concerning data generation
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief The numbers of averaged humidity samples.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of avgh in reg AV_CONF
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_humidity_avg_set(stmdev_ctx_t *ctx, hts221_avgh_t val)
|
||||
{
|
||||
hts221_av_conf_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.avgh = (uint8_t)val;
|
||||
ret = hts221_write_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The numbers of averaged humidity samples.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Get the values of avgh in reg AV_CONF
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_humidity_avg_get(stmdev_ctx_t *ctx, hts221_avgh_t *val)
|
||||
{
|
||||
hts221_av_conf_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
|
||||
switch (reg.avgh) {
|
||||
case HTS221_H_AVG_4:
|
||||
*val = HTS221_H_AVG_4;
|
||||
break;
|
||||
case HTS221_H_AVG_8:
|
||||
*val = HTS221_H_AVG_8;
|
||||
break;
|
||||
case HTS221_H_AVG_16:
|
||||
*val = HTS221_H_AVG_16;
|
||||
break;
|
||||
case HTS221_H_AVG_32:
|
||||
*val = HTS221_H_AVG_32;
|
||||
break;
|
||||
case HTS221_H_AVG_64:
|
||||
*val = HTS221_H_AVG_64;
|
||||
break;
|
||||
case HTS221_H_AVG_128:
|
||||
*val = HTS221_H_AVG_128;
|
||||
break;
|
||||
case HTS221_H_AVG_256:
|
||||
*val = HTS221_H_AVG_256;
|
||||
break;
|
||||
case HTS221_H_AVG_512:
|
||||
*val = HTS221_H_AVG_512;
|
||||
break;
|
||||
default:
|
||||
*val = HTS221_H_AVG_ND;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The numbers of averaged temperature samples.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of avgt in reg AV_CONF
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temperature_avg_set(stmdev_ctx_t *ctx, hts221_avgt_t val)
|
||||
{
|
||||
hts221_av_conf_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.avgt = (uint8_t)val;
|
||||
ret = hts221_write_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The numbers of averaged temperature samples.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Get the values of avgt in reg AV_CONF
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temperature_avg_get(stmdev_ctx_t *ctx, hts221_avgt_t *val)
|
||||
{
|
||||
hts221_av_conf_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_AV_CONF, (uint8_t*) ®, 1);
|
||||
|
||||
switch (reg.avgh) {
|
||||
case HTS221_T_AVG_2:
|
||||
*val = HTS221_T_AVG_2;
|
||||
break;
|
||||
case HTS221_T_AVG_4:
|
||||
*val = HTS221_T_AVG_4;
|
||||
break;
|
||||
case HTS221_T_AVG_8:
|
||||
*val = HTS221_T_AVG_8;
|
||||
break;
|
||||
case HTS221_T_AVG_16:
|
||||
*val = HTS221_T_AVG_16;
|
||||
break;
|
||||
case HTS221_T_AVG_32:
|
||||
*val = HTS221_T_AVG_32;
|
||||
break;
|
||||
case HTS221_T_AVG_64:
|
||||
*val = HTS221_T_AVG_64;
|
||||
break;
|
||||
case HTS221_T_AVG_128:
|
||||
*val = HTS221_T_AVG_128;
|
||||
break;
|
||||
case HTS221_T_AVG_256:
|
||||
*val = HTS221_T_AVG_256;
|
||||
break;
|
||||
default:
|
||||
*val = HTS221_T_AVG_ND;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Output data rate selection.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of odr in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_data_rate_set(stmdev_ctx_t *ctx, hts221_odr_t val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.odr = (uint8_t)val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Output data rate selection.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Get the values of odr in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_data_rate_get(stmdev_ctx_t *ctx, hts221_odr_t *val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
|
||||
switch (reg.odr) {
|
||||
case HTS221_ONE_SHOT:
|
||||
*val = HTS221_ONE_SHOT;
|
||||
break;
|
||||
case HTS221_ODR_1Hz:
|
||||
*val = HTS221_ODR_1Hz;
|
||||
break;
|
||||
case HTS221_ODR_7Hz:
|
||||
*val = HTS221_ODR_7Hz;
|
||||
break;
|
||||
case HTS221_ODR_12Hz5:
|
||||
*val = HTS221_ODR_12Hz5;
|
||||
break;
|
||||
default:
|
||||
*val = HTS221_ODR_ND;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Block data update.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of bdu in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.bdu = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Block data update.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of bdu in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_block_data_update_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
*val = reg.bdu;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief One-shot mode. Device perform a single measure.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of one_shot in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_one_shoot_trigger_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.one_shot = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief One-shot mode. Device perform a single measure.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of one_shot in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_one_shoot_trigger_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
*val = reg.one_shot;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Temperature data available.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of t_da in reg STATUS_REG
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temp_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_status_reg_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_STATUS_REG, (uint8_t*) ®, 1);
|
||||
*val = reg.t_da;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Humidity data available.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of h_da in reg STATUS_REG
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_hum_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_status_reg_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_STATUS_REG, (uint8_t*) ®, 1);
|
||||
*val = reg.h_da;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Humidity output value[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_humidity_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_HUMIDITY_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Temperature output value[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temperature_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_TEMP_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_common
|
||||
* @brief This section group common usefull functions
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Device Who amI.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_WHO_AM_I, buff, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch device on/off.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of pd in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_power_on_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.pd = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch device on/off.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of pd in reg CTRL_REG1
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_power_on_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg1_t reg;
|
||||
int32_t mm_error;
|
||||
|
||||
mm_error = hts221_read_reg(ctx, HTS221_CTRL_REG1, (uint8_t*) ®, 1);
|
||||
*val = reg.pd;
|
||||
|
||||
return mm_error;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Heater enable / disable.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of heater in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_heater_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.heater = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Heater enable / disable.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of heater in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_heater_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
*val = reg.heater;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content. Reload the calibration parameters.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of boot in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_boot_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.boot = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content. Reload the calibration parameters.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of boot in reg CTRL_REG2
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_boot_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg2_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG2, (uint8_t*) ®, 1);
|
||||
*val = reg.boot;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Info about device status.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Registers STATUS_REG
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_status_get(stmdev_ctx_t *ctx, hts221_status_reg_t *val)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_STATUS_REG, (uint8_t*) val, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_interrupts
|
||||
* @brief This section group all the functions that manage interrupts
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Data-ready signal on INT_DRDY pin.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of drdy in reg CTRL_REG3
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_drdy_on_int_set(stmdev_ctx_t *ctx, uint8_t val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.drdy = val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Data-ready signal on INT_DRDY pin.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of drdy in reg CTRL_REG3
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_drdy_on_int_get(stmdev_ctx_t *ctx, uint8_t *val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
*val = reg.drdy;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push-pull/open drain selection on interrupt pads.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of pp_od in reg CTRL_REG3
|
||||
*
|
||||
*/
|
||||
int32_t hts221_pin_mode_set(stmdev_ctx_t *ctx, hts221_pp_od_t val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.pp_od = (uint8_t)val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push-pull/open drain selection on interrupt pads.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Get the values of pp_od in reg CTRL_REG3
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_pin_mode_get(stmdev_ctx_t *ctx, hts221_pp_od_t *val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
|
||||
switch (reg.pp_od) {
|
||||
case HTS221_PUSH_PULL:
|
||||
*val = HTS221_PUSH_PULL;
|
||||
break;
|
||||
case HTS221_OPEN_DRAIN:
|
||||
*val = HTS221_OPEN_DRAIN;
|
||||
break;
|
||||
default:
|
||||
*val = HTS221_PIN_MODE_ND;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Interrupt active-high/low.[set]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val change the values of drdy_h_l in reg CTRL_REG3
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_int_polarity_set(stmdev_ctx_t *ctx, hts221_drdy_h_l_t val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
|
||||
if(ret == 0){
|
||||
reg.drdy_h_l = (uint8_t)val;
|
||||
ret = hts221_write_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Interrupt active-high/low.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param val Get the values of drdy_h_l in reg CTRL_REG3
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_int_polarity_get(stmdev_ctx_t *ctx, hts221_drdy_h_l_t *val)
|
||||
{
|
||||
hts221_ctrl_reg3_t reg;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_CTRL_REG3, (uint8_t*) ®, 1);
|
||||
|
||||
switch (reg.drdy_h_l) {
|
||||
case HTS221_ACTIVE_HIGH:
|
||||
*val = HTS221_ACTIVE_HIGH;
|
||||
break;
|
||||
case HTS221_ACTIVE_LOW:
|
||||
*val = HTS221_ACTIVE_LOW;
|
||||
break;
|
||||
default:
|
||||
*val = HTS221_ACTIVE_ND;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_calibration
|
||||
* @brief This section group all the calibration coefficients need
|
||||
* for reading data
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief First calibration point for Rh Humidity.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_hum_rh_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_H0_RH_X2, buff, 1);
|
||||
*buff = (uint8_t)(((uint16_t)(*buff) >> 1) & 0x7FFFu);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Second calibration point for Rh Humidity.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_hum_rh_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_H1_RH_X2, buff, 1);
|
||||
*buff = (uint8_t)(((uint16_t)(*buff) >> 1) & 0x7FFFu);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief First calibration point for degC temperature.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temp_deg_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
hts221_t1_t0_msb_t reg;
|
||||
uint8_t coeff_h, coeff_l;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_T0_DEGC_X8, &coeff_l, 1);
|
||||
|
||||
if(ret == 0){
|
||||
ret = hts221_read_reg(ctx, HTS221_T1_T0_MSB, (uint8_t*) ®, 1);
|
||||
coeff_h = reg.t0_msb;
|
||||
*(buff) = (uint8_t)(((coeff_h << 8) + coeff_l) >> 3);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Second calibration point for degC temperature.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temp_deg_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
hts221_t1_t0_msb_t reg;
|
||||
uint8_t coeff_h, coeff_l;
|
||||
int32_t ret;
|
||||
|
||||
ret = hts221_read_reg(ctx, HTS221_T1_DEGC_X8, &coeff_l, 1);
|
||||
|
||||
if(ret == 0){
|
||||
ret = hts221_read_reg(ctx, HTS221_T1_T0_MSB, (uint8_t*) ®, 1);
|
||||
coeff_h = reg.t1_msb;
|
||||
*(buff) = (uint8_t)(((coeff_h << 8) + coeff_l) >> 3);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief First calibration point for humidity in LSB.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_hum_adc_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_H0_T0_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Second calibration point for humidity in LSB.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_hum_adc_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_H1_T0_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief First calibration point for temperature in LSB.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temp_adc_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_T0_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Second calibration point for temperature in LSB.[get]
|
||||
*
|
||||
* @param ctx read / write interface definitions
|
||||
* @param buff buffer that stores data read
|
||||
* @retval interface status (MANDATORY: return 0 -> no Error)
|
||||
*
|
||||
*/
|
||||
int32_t hts221_temp_adc_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff)
|
||||
{
|
||||
int32_t ret;
|
||||
ret = hts221_read_reg(ctx, HTS221_T1_OUT_L, buff, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
338
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221_reg.h
Normal file
338
2P-ProjectPong/Drivers/BSP/Components/hts221/hts221_reg.h
Normal file
@ -0,0 +1,338 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* @file hts221_reg.h
|
||||
* @author Sensors Software Solution Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* hts221_reg.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef HTS221_REGS_H
|
||||
#define HTS221_REGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
/** @addtogroup HTS221
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** @defgroup STMicroelectronics sensors common types
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEMS_SHARED_TYPES
|
||||
#define MEMS_SHARED_TYPES
|
||||
|
||||
typedef struct{
|
||||
uint8_t bit0 : 1;
|
||||
uint8_t bit1 : 1;
|
||||
uint8_t bit2 : 1;
|
||||
uint8_t bit3 : 1;
|
||||
uint8_t bit4 : 1;
|
||||
uint8_t bit5 : 1;
|
||||
uint8_t bit6 : 1;
|
||||
uint8_t bit7 : 1;
|
||||
} bitwise_t;
|
||||
|
||||
#define PROPERTY_DISABLE (0U)
|
||||
#define PROPERTY_ENABLE (1U)
|
||||
|
||||
/** @addtogroup Interfaces_Functions
|
||||
* @brief This section provide a set of functions used to read and
|
||||
* write a generic register of the device.
|
||||
* MANDATORY: return 0 -> no Error.
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*stmdev_read_ptr) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct {
|
||||
/** Component mandatory fields **/
|
||||
stmdev_write_ptr write_reg;
|
||||
stmdev_read_ptr read_reg;
|
||||
/** Customizable optional pointer **/
|
||||
void *handle;
|
||||
} stmdev_ctx_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_SHARED_TYPES */
|
||||
|
||||
#ifndef MEMS_UCF_SHARED_TYPES
|
||||
#define MEMS_UCF_SHARED_TYPES
|
||||
|
||||
/** @defgroup Generic address-data structure definition
|
||||
* @brief This structure is useful to load a predefined configuration
|
||||
* of a sensor.
|
||||
* You can create a sensor configuration by your own or using
|
||||
* Unico / Unicleo tools available on STMicroelectronics
|
||||
* web site.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t address;
|
||||
uint8_t data;
|
||||
} ucf_line_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_UCF_SHARED_TYPES */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/** @defgroup HTS221_Infos
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** I2C Device Address 8 bit format **/
|
||||
#define HTS221_I2C_ADDRESS 0xBFU
|
||||
|
||||
/** Device Identification (Who am I) **/
|
||||
#define HTS221_ID 0xBCU
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#define HTS221_WHO_AM_I 0x0FU
|
||||
#define HTS221_AV_CONF 0x10U
|
||||
typedef struct {
|
||||
uint8_t avgh : 3;
|
||||
uint8_t avgt : 3;
|
||||
uint8_t not_used_01 : 2;
|
||||
} hts221_av_conf_t;
|
||||
|
||||
#define HTS221_CTRL_REG1 0x20U
|
||||
typedef struct {
|
||||
uint8_t odr : 2;
|
||||
uint8_t bdu : 1;
|
||||
uint8_t not_used_01 : 4;
|
||||
uint8_t pd : 1;
|
||||
} hts221_ctrl_reg1_t;
|
||||
|
||||
#define HTS221_CTRL_REG2 0x21U
|
||||
typedef struct {
|
||||
uint8_t one_shot : 1;
|
||||
uint8_t heater : 1;
|
||||
uint8_t not_used_01 : 5;
|
||||
uint8_t boot : 1;
|
||||
} hts221_ctrl_reg2_t;
|
||||
|
||||
#define HTS221_CTRL_REG3 0x22U
|
||||
typedef struct {
|
||||
uint8_t not_used_01 : 2;
|
||||
uint8_t drdy : 1;
|
||||
uint8_t not_used_02 : 3;
|
||||
uint8_t pp_od : 1;
|
||||
uint8_t drdy_h_l : 1;
|
||||
} hts221_ctrl_reg3_t;
|
||||
|
||||
#define HTS221_STATUS_REG 0x27U
|
||||
typedef struct {
|
||||
uint8_t t_da : 1;
|
||||
uint8_t h_da : 1;
|
||||
uint8_t not_used_01 : 6;
|
||||
} hts221_status_reg_t;
|
||||
|
||||
#define HTS221_HUMIDITY_OUT_L 0x28U
|
||||
#define HTS221_HUMIDITY_OUT_H 0x29U
|
||||
#define HTS221_TEMP_OUT_L 0x2AU
|
||||
#define HTS221_TEMP_OUT_H 0x2BU
|
||||
#define HTS221_H0_RH_X2 0x30U
|
||||
#define HTS221_H1_RH_X2 0x31U
|
||||
#define HTS221_T0_DEGC_X8 0x32U
|
||||
#define HTS221_T1_DEGC_X8 0x33U
|
||||
#define HTS221_T1_T0_MSB 0x35U
|
||||
typedef struct {
|
||||
uint8_t t0_msb : 2;
|
||||
uint8_t t1_msb : 2;
|
||||
uint8_t not_used_01 : 4;
|
||||
} hts221_t1_t0_msb_t;
|
||||
|
||||
#define HTS221_H0_T0_OUT_L 0x36U
|
||||
#define HTS221_H0_T0_OUT_H 0x37U
|
||||
#define HTS221_H1_T0_OUT_L 0x3AU
|
||||
#define HTS221_H1_T0_OUT_H 0x3BU
|
||||
#define HTS221_T0_OUT_L 0x3CU
|
||||
#define HTS221_T0_OUT_H 0x3DU
|
||||
#define HTS221_T1_OUT_L 0x3EU
|
||||
#define HTS221_T1_OUT_H 0x3FU
|
||||
|
||||
/**
|
||||
* @defgroup HTS221_Register_Union
|
||||
* @brief This union group all the registers that has a bitfield
|
||||
* description.
|
||||
* This union is useful but not need by the driver.
|
||||
*
|
||||
* REMOVING this union you are compliant with:
|
||||
* MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
typedef union{
|
||||
hts221_av_conf_t av_conf;
|
||||
hts221_ctrl_reg1_t ctrl_reg1;
|
||||
hts221_ctrl_reg2_t ctrl_reg2;
|
||||
hts221_ctrl_reg3_t ctrl_reg3;
|
||||
hts221_status_reg_t status_reg;
|
||||
hts221_t1_t0_msb_t t1_t0_msb;
|
||||
bitwise_t bitwise;
|
||||
uint8_t byte;
|
||||
} hts221_reg_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
int32_t hts221_read_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
int32_t hts221_write_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
|
||||
typedef enum {
|
||||
HTS221_H_AVG_4 = 0,
|
||||
HTS221_H_AVG_8 = 1,
|
||||
HTS221_H_AVG_16 = 2,
|
||||
HTS221_H_AVG_32 = 3,
|
||||
HTS221_H_AVG_64 = 4,
|
||||
HTS221_H_AVG_128 = 5,
|
||||
HTS221_H_AVG_256 = 6,
|
||||
HTS221_H_AVG_512 = 7,
|
||||
HTS221_H_AVG_ND = 8,
|
||||
} hts221_avgh_t;
|
||||
int32_t hts221_humidity_avg_set(stmdev_ctx_t *ctx, hts221_avgh_t val);
|
||||
int32_t hts221_humidity_avg_get(stmdev_ctx_t *ctx, hts221_avgh_t *val);
|
||||
|
||||
typedef enum {
|
||||
HTS221_T_AVG_2 = 0,
|
||||
HTS221_T_AVG_4 = 1,
|
||||
HTS221_T_AVG_8 = 2,
|
||||
HTS221_T_AVG_16 = 3,
|
||||
HTS221_T_AVG_32 = 4,
|
||||
HTS221_T_AVG_64 = 5,
|
||||
HTS221_T_AVG_128 = 6,
|
||||
HTS221_T_AVG_256 = 7,
|
||||
HTS221_T_AVG_ND = 8,
|
||||
} hts221_avgt_t;
|
||||
int32_t hts221_temperature_avg_set(stmdev_ctx_t *ctx, hts221_avgt_t val);
|
||||
int32_t hts221_temperature_avg_get(stmdev_ctx_t *ctx, hts221_avgt_t *val);
|
||||
|
||||
typedef enum {
|
||||
HTS221_ONE_SHOT = 0,
|
||||
HTS221_ODR_1Hz = 1,
|
||||
HTS221_ODR_7Hz = 2,
|
||||
HTS221_ODR_12Hz5 = 3,
|
||||
HTS221_ODR_ND = 4,
|
||||
} hts221_odr_t;
|
||||
int32_t hts221_data_rate_set(stmdev_ctx_t *ctx, hts221_odr_t val);
|
||||
int32_t hts221_data_rate_get(stmdev_ctx_t *ctx, hts221_odr_t *val);
|
||||
|
||||
int32_t hts221_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t hts221_block_data_update_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_one_shoot_trigger_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t hts221_one_shoot_trigger_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_temp_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_hum_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_humidity_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_temperature_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_power_on_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
|
||||
int32_t hts221_power_on_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_heater_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t hts221_heater_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_boot_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t hts221_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t hts221_status_get(stmdev_ctx_t *ctx, hts221_status_reg_t *val);
|
||||
|
||||
int32_t hts221_drdy_on_int_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t hts221_drdy_on_int_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
HTS221_PUSH_PULL = 0,
|
||||
HTS221_OPEN_DRAIN = 1,
|
||||
HTS221_PIN_MODE_ND = 2,
|
||||
} hts221_pp_od_t;
|
||||
int32_t hts221_pin_mode_set(stmdev_ctx_t *ctx, hts221_pp_od_t val);
|
||||
int32_t hts221_pin_mode_get(stmdev_ctx_t *ctx, hts221_pp_od_t *val);
|
||||
|
||||
typedef enum {
|
||||
HTS221_ACTIVE_HIGH = 0,
|
||||
HTS221_ACTIVE_LOW = 1,
|
||||
HTS221_ACTIVE_ND = 2,
|
||||
} hts221_drdy_h_l_t;
|
||||
int32_t hts221_int_polarity_set(stmdev_ctx_t *ctx, hts221_drdy_h_l_t val);
|
||||
int32_t hts221_int_polarity_get(stmdev_ctx_t *ctx, hts221_drdy_h_l_t *val);
|
||||
|
||||
int32_t hts221_hum_rh_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t hts221_hum_rh_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_temp_deg_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t hts221_temp_deg_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_hum_adc_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t hts221_hum_adc_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t hts221_temp_adc_point_0_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t hts221_temp_adc_point_1_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*HTS221_REGS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
756
2P-ProjectPong/Drivers/BSP/Components/ili9325/Release_Notes.html
Normal file
756
2P-ProjectPong/Drivers/BSP/Components/ili9325/Release_Notes.html
Normal file
@ -0,0 +1,756 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for ILI9325 BSP Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for ILI9325 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2016 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.3 / 03-May-2016 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">ili9325.c: alignment with </span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">BSP</span><span style="font-size: 10pt; font-family: Verdana;"> </span><span style="font-size: 10pt; font-family: Verdana;">STM32446E_EVAL V1.1.2 and BSP STM324xG_EVAL V2.2.2</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update ili9325_ReadPixel() and ili9325_ReadReg() to support the new LCD_IO_ReadData() API</span><br><span style="font-size: 10pt; font-family: Arial; color: white;"></span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.2 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">ili9325.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.1 / 10-November-2014</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"> Official Final Release for LCD Controllers harmonization<br> Replace LCD_IO_WriteData() by LCD_IO_WriteMultipleData() to be compliant with SPI interface <br> Warning : break compatibility with old BSP common files - done for STM3210C-EVAL board </span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.1 / 5-September-2014</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"> Final Official Release for LCD Controller harmonization</span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 11-July-2014</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"> Beta Release to change the usage of LCD_IO_ReadData</span>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 19-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Align driver with the STM32Cube BSP architecture by removing check for initialization in ili9325_Init() <br>
|
||||
</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Initializes
|
||||
only the LCD IO in read ID APIs instead of all initialization sequence
|
||||
and remove the check for initialization in ili9325_ReadID() function</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Comments clean up and typo corrections</span></li></ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
</body></html>
|
518
2P-ProjectPong/Drivers/BSP/Components/ili9325/ili9325.c
Normal file
518
2P-ProjectPong/Drivers/BSP/Components/ili9325/ili9325.c
Normal file
@ -0,0 +1,518 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ili9325.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.2.3
|
||||
* @date 03-May-2016
|
||||
* @brief This file includes the LCD driver for ILI9325 LCD.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ili9325.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ili9325
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* ILI9325 LCD.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
LCD_DrvTypeDef ili9325_drv =
|
||||
{
|
||||
ili9325_Init,
|
||||
ili9325_ReadID,
|
||||
ili9325_DisplayOn,
|
||||
ili9325_DisplayOff,
|
||||
ili9325_SetCursor,
|
||||
ili9325_WritePixel,
|
||||
ili9325_ReadPixel,
|
||||
ili9325_SetDisplayWindow,
|
||||
ili9325_DrawHLine,
|
||||
ili9325_DrawVLine,
|
||||
ili9325_GetLcdPixelWidth,
|
||||
ili9325_GetLcdPixelHeight,
|
||||
ili9325_DrawBitmap,
|
||||
ili9325_DrawRGBImage,
|
||||
};
|
||||
|
||||
static uint16_t ArrayRGB[320] = {0};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize the ILI9325 LCD Component.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_Init(void)
|
||||
{
|
||||
/* Initialize ILI9325 low level bus layer ----------------------------------*/
|
||||
LCD_IO_Init();
|
||||
|
||||
/* Start Initial Sequence --------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_0, 0x0001); /* Start internal OSC. */
|
||||
ili9325_WriteReg(LCD_REG_1, 0x0100); /* Set SS and SM bit */
|
||||
ili9325_WriteReg(LCD_REG_2, 0x0700); /* Set 1 line inversion */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1018); /* Set GRAM write direction and BGR=1. */
|
||||
ili9325_WriteReg(LCD_REG_4, 0x0000); /* Resize register */
|
||||
ili9325_WriteReg(LCD_REG_8, 0x0202); /* Set the back porch and front porch */
|
||||
ili9325_WriteReg(LCD_REG_9, 0x0000); /* Set non-display area refresh cycle ISC[3:0] */
|
||||
ili9325_WriteReg(LCD_REG_10, 0x0000); /* FMARK function */
|
||||
ili9325_WriteReg(LCD_REG_12, 0x0000); /* RGB interface setting */
|
||||
ili9325_WriteReg(LCD_REG_13, 0x0000); /* Frame marker Position */
|
||||
ili9325_WriteReg(LCD_REG_15, 0x0000); /* RGB interface polarity */
|
||||
|
||||
/* Power On sequence -------------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_16, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
||||
ili9325_WriteReg(LCD_REG_17, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */
|
||||
ili9325_WriteReg(LCD_REG_18, 0x0000); /* VREG1OUT voltage */
|
||||
ili9325_WriteReg(LCD_REG_19, 0x0000); /* VDV[4:0] for VCOM amplitude */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_16, 0x17B0); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
||||
ili9325_WriteReg(LCD_REG_17, 0x0137); /* DC1[2:0], DC0[2:0], VC[2:0] */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_18, 0x0139); /* VREG1OUT voltage */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_19, 0x1d00); /* VDV[4:0] for VCOM amplitude */
|
||||
ili9325_WriteReg(LCD_REG_41, 0x0013); /* VCM[4:0] for VCOMH */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_32, 0x0000); /* GRAM horizontal Address */
|
||||
ili9325_WriteReg(LCD_REG_33, 0x0000); /* GRAM Vertical Address */
|
||||
|
||||
/* Adjust the Gamma Curve (ILI9325) ----------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_48, 0x0007);
|
||||
ili9325_WriteReg(LCD_REG_49, 0x0302);
|
||||
ili9325_WriteReg(LCD_REG_50, 0x0105);
|
||||
ili9325_WriteReg(LCD_REG_53, 0x0206);
|
||||
ili9325_WriteReg(LCD_REG_54, 0x0808);
|
||||
ili9325_WriteReg(LCD_REG_55, 0x0206);
|
||||
ili9325_WriteReg(LCD_REG_56, 0x0504);
|
||||
ili9325_WriteReg(LCD_REG_57, 0x0007);
|
||||
ili9325_WriteReg(LCD_REG_60, 0x0105);
|
||||
ili9325_WriteReg(LCD_REG_61, 0x0808);
|
||||
|
||||
/* Set GRAM area -----------------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_80, 0x0000); /* Horizontal GRAM Start Address */
|
||||
ili9325_WriteReg(LCD_REG_81, 0x00EF); /* Horizontal GRAM End Address */
|
||||
ili9325_WriteReg(LCD_REG_82, 0x0000); /* Vertical GRAM Start Address */
|
||||
ili9325_WriteReg(LCD_REG_83, 0x013F); /* Vertical GRAM End Address */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_96, 0xA700); /* Gate Scan Line(GS=1, scan direction is G320~G1) */
|
||||
ili9325_WriteReg(LCD_REG_97, 0x0001); /* NDL,VLE, REV */
|
||||
ili9325_WriteReg(LCD_REG_106, 0x0000); /* set scrolling line */
|
||||
|
||||
/* Partial Display Control -------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_128, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_129, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_130, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_131, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_132, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_133, 0x0000);
|
||||
|
||||
/* Panel Control -----------------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_144, 0x0010);
|
||||
ili9325_WriteReg(LCD_REG_146, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_147, 0x0003);
|
||||
ili9325_WriteReg(LCD_REG_149, 0x0110);
|
||||
ili9325_WriteReg(LCD_REG_151, 0x0000);
|
||||
ili9325_WriteReg(LCD_REG_152, 0x0000);
|
||||
|
||||
/* set GRAM write direction and BGR = 1 */
|
||||
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
|
||||
/* AM=1 (address is updated in vertical writing direction) */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1018);
|
||||
|
||||
/* 262K color and display ON */
|
||||
ili9325_WriteReg(LCD_REG_7, 0x0173);
|
||||
|
||||
/* Set the Cursor */
|
||||
ili9325_SetCursor(0, 0);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DisplayOn(void)
|
||||
{
|
||||
/* Power On sequence -------------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_16, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
||||
ili9325_WriteReg(LCD_REG_17, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */
|
||||
ili9325_WriteReg(LCD_REG_18, 0x0000); /* VREG1OUT voltage */
|
||||
ili9325_WriteReg(LCD_REG_19, 0x0000); /* VDV[4:0] for VCOM amplitude*/
|
||||
|
||||
ili9325_WriteReg(LCD_REG_16, 0x17B0); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
||||
ili9325_WriteReg(LCD_REG_17, 0x0137); /* DC1[2:0], DC0[2:0], VC[2:0] */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_18, 0x0139); /* VREG1OUT voltage */
|
||||
|
||||
ili9325_WriteReg(LCD_REG_19, 0x1d00); /* VDV[4:0] for VCOM amplitude */
|
||||
ili9325_WriteReg(LCD_REG_41, 0x0013); /* VCM[4:0] for VCOMH */
|
||||
|
||||
/* Display On */
|
||||
ili9325_WriteReg(LCD_REG_7, 0x0173); /* 262K color and display ON */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DisplayOff(void)
|
||||
{
|
||||
/* Power Off sequence ------------------------------------------------------*/
|
||||
ili9325_WriteReg(LCD_REG_16, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
|
||||
ili9325_WriteReg(LCD_REG_17, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */
|
||||
ili9325_WriteReg(LCD_REG_18, 0x0000); /* VREG1OUT voltage */
|
||||
ili9325_WriteReg(LCD_REG_19, 0x0000); /* VDV[4:0] for VCOM amplitude*/
|
||||
|
||||
ili9325_WriteReg(LCD_REG_41, 0x0000); /* VCM[4:0] for VCOMH */
|
||||
|
||||
/* Display Off */
|
||||
ili9325_WriteReg(LCD_REG_7, 0x0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the LCD pixel Width.
|
||||
* @param None
|
||||
* @retval The Lcd Pixel Width
|
||||
*/
|
||||
uint16_t ili9325_GetLcdPixelWidth(void)
|
||||
{
|
||||
return (uint16_t)320;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the LCD pixel Height.
|
||||
* @param None
|
||||
* @retval The Lcd Pixel Height
|
||||
*/
|
||||
uint16_t ili9325_GetLcdPixelHeight(void)
|
||||
{
|
||||
return (uint16_t)240;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the ILI9325 ID.
|
||||
* @param None
|
||||
* @retval The ILI9325 ID
|
||||
*/
|
||||
uint16_t ili9325_ReadID(void)
|
||||
{
|
||||
LCD_IO_Init();
|
||||
return (ili9325_ReadReg(0x00));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Cursor position.
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_SetCursor(uint16_t Xpos, uint16_t Ypos)
|
||||
{
|
||||
ili9325_WriteReg(LCD_REG_32, Ypos);
|
||||
ili9325_WriteReg(LCD_REG_33, (ILI9325_LCD_PIXEL_WIDTH - 1 - Xpos));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write pixel.
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param RGBCode: the RGB pixel color
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGBCode)
|
||||
{
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
|
||||
/* Write 16-bit GRAM Reg */
|
||||
LCD_IO_WriteMultipleData((uint8_t*)&RGBCode, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read pixel.
|
||||
* @param None
|
||||
* @retval The RGB pixel color
|
||||
*/
|
||||
uint16_t ili9325_ReadPixel(uint16_t Xpos, uint16_t Ypos)
|
||||
{
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Read 16-bit Reg */
|
||||
return (LCD_IO_ReadData(LCD_REG_34));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes to the selected LCD register.
|
||||
* @param LCDReg: Address of the selected register.
|
||||
* @param LCDRegValue: Value to write to the selected register.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_WriteReg(uint8_t LCDReg, uint16_t LCDRegValue)
|
||||
{
|
||||
LCD_IO_WriteReg(LCDReg);
|
||||
|
||||
/* Write 16-bit GRAM Reg */
|
||||
LCD_IO_WriteMultipleData((uint8_t*)&LCDRegValue, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads the selected LCD Register.
|
||||
* @param LCDReg: address of the selected register.
|
||||
* @retval LCD Register Value.
|
||||
*/
|
||||
uint16_t ili9325_ReadReg(uint8_t LCDReg)
|
||||
{
|
||||
/* Read 16-bit Reg */
|
||||
return (LCD_IO_ReadData(LCDReg));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets a display window
|
||||
* @param Xpos: specifies the X bottom left position.
|
||||
* @param Ypos: specifies the Y bottom left position.
|
||||
* @param Height: display window height.
|
||||
* @param Width: display window width.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
|
||||
{
|
||||
/* Horizontal GRAM Start Address */
|
||||
ili9325_WriteReg(LCD_REG_80, (Ypos));
|
||||
/* Horizontal GRAM End Address */
|
||||
ili9325_WriteReg(LCD_REG_81, (Ypos + Height - 1));
|
||||
|
||||
/* Vertical GRAM Start Address */
|
||||
ili9325_WriteReg(LCD_REG_82, ILI9325_LCD_PIXEL_WIDTH - Xpos - Width);
|
||||
/* Vertical GRAM End Address */
|
||||
ili9325_WriteReg(LCD_REG_83, ILI9325_LCD_PIXEL_WIDTH - Xpos - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw vertical line.
|
||||
* @param RGBCode: Specifies the RGB color
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param Length: specifies the Line length.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DrawHLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
|
||||
{
|
||||
uint16_t counter = 0;
|
||||
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
|
||||
/* Sent a complete line */
|
||||
for(counter = 0; counter < Length; counter++)
|
||||
{
|
||||
ArrayRGB[counter] = RGBCode;
|
||||
}
|
||||
|
||||
LCD_IO_WriteMultipleData((uint8_t*)&ArrayRGB[0], Length * 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw vertical line.
|
||||
* @param RGBCode: Specifies the RGB color
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param Length: specifies the Line length.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DrawVLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
|
||||
{
|
||||
uint16_t counter = 0;
|
||||
|
||||
/* set GRAM write direction and BGR = 1 */
|
||||
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
|
||||
/* AM=1 (address is updated in vertical writing direction) */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1010);
|
||||
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
|
||||
/* Fill a complete vertical line */
|
||||
for(counter = 0; counter < Length; counter++)
|
||||
{
|
||||
ArrayRGB[counter] = RGBCode;
|
||||
}
|
||||
|
||||
/* Write 16-bit GRAM Reg */
|
||||
LCD_IO_WriteMultipleData((uint8_t*)&ArrayRGB[0], Length * 2);
|
||||
|
||||
/* set GRAM write direction and BGR = 1 */
|
||||
/* I/D=00 (Horizontal : increment, Vertical : decrement) */
|
||||
/* AM=1 (address is updated in vertical writing direction) */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1018);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays a bitmap picture.
|
||||
* @param BmpAddress: Bmp picture address.
|
||||
* @param Xpos: Bmp X position in the LCD
|
||||
* @param Ypos: Bmp Y position in the LCD
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
|
||||
{
|
||||
uint32_t index = 0, size = 0;
|
||||
/* Read bitmap size */
|
||||
size = *(volatile uint16_t *) (pbmp + 2);
|
||||
size |= (*(volatile uint16_t *) (pbmp + 4)) << 16;
|
||||
/* Get bitmap data address offset */
|
||||
index = *(volatile uint16_t *) (pbmp + 10);
|
||||
index |= (*(volatile uint16_t *) (pbmp + 12)) << 16;
|
||||
size = (size - index)/2;
|
||||
pbmp += index;
|
||||
/* Set GRAM write direction and BGR = 1 */
|
||||
/* I/D=00 (Horizontal : decrement, Vertical : decrement) */
|
||||
/* AM=1 (address is updated in vertical writing direction) */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1008);
|
||||
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
|
||||
LCD_IO_WriteMultipleData((uint8_t*)pbmp, size*2);
|
||||
|
||||
/* Set GRAM write direction and BGR = 1 */
|
||||
/* I/D = 01 (Horizontal : increment, Vertical : decrement) */
|
||||
/* AM = 1 (address is updated in vertical writing direction) */
|
||||
ili9325_WriteReg(LCD_REG_3, 0x1018);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays picture.
|
||||
* @param pdata: picture address.
|
||||
* @param Xpos: Image X position in the LCD
|
||||
* @param Ypos: Image Y position in the LCD
|
||||
* @param Xsize: Image X size in the LCD
|
||||
* @param Ysize: Image Y size in the LCD
|
||||
* @retval None
|
||||
*/
|
||||
void ili9325_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
|
||||
{
|
||||
uint32_t size = 0;
|
||||
|
||||
size = (Xsize * Ysize);
|
||||
|
||||
/* Set Cursor */
|
||||
ili9325_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write GRAM */
|
||||
LCD_IO_WriteReg(LCD_REG_34);
|
||||
|
||||
LCD_IO_WriteMultipleData((uint8_t*)pdata, size*2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
256
2P-ProjectPong/Drivers/BSP/Components/ili9325/ili9325.h
Normal file
256
2P-ProjectPong/Drivers/BSP/Components/ili9325/ili9325.h
Normal file
@ -0,0 +1,256 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ili9325.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.2.3
|
||||
* @date 04-May-2016
|
||||
* @brief This file contains all the functions prototypes for the ili9325.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ILI9325_H
|
||||
#define __ILI9325_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/lcd.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ili9325
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief ILI9325 ID
|
||||
*/
|
||||
#define ILI9325_ID 0x9325
|
||||
|
||||
/**
|
||||
* @brief ILI9325 Size
|
||||
*/
|
||||
#define ILI9325_LCD_PIXEL_WIDTH ((uint16_t)320)
|
||||
#define ILI9325_LCD_PIXEL_HEIGHT ((uint16_t)240)
|
||||
|
||||
/**
|
||||
* @brief ILI9325 Registers
|
||||
*/
|
||||
#define LCD_REG_0 0x00
|
||||
#define LCD_REG_1 0x01
|
||||
#define LCD_REG_2 0x02
|
||||
#define LCD_REG_3 0x03
|
||||
#define LCD_REG_4 0x04
|
||||
#define LCD_REG_5 0x05
|
||||
#define LCD_REG_6 0x06
|
||||
#define LCD_REG_7 0x07
|
||||
#define LCD_REG_8 0x08
|
||||
#define LCD_REG_9 0x09
|
||||
#define LCD_REG_10 0x0A
|
||||
#define LCD_REG_12 0x0C
|
||||
#define LCD_REG_13 0x0D
|
||||
#define LCD_REG_14 0x0E
|
||||
#define LCD_REG_15 0x0F
|
||||
#define LCD_REG_16 0x10
|
||||
#define LCD_REG_17 0x11
|
||||
#define LCD_REG_18 0x12
|
||||
#define LCD_REG_19 0x13
|
||||
#define LCD_REG_20 0x14
|
||||
#define LCD_REG_21 0x15
|
||||
#define LCD_REG_22 0x16
|
||||
#define LCD_REG_23 0x17
|
||||
#define LCD_REG_24 0x18
|
||||
#define LCD_REG_25 0x19
|
||||
#define LCD_REG_26 0x1A
|
||||
#define LCD_REG_27 0x1B
|
||||
#define LCD_REG_28 0x1C
|
||||
#define LCD_REG_29 0x1D
|
||||
#define LCD_REG_30 0x1E
|
||||
#define LCD_REG_31 0x1F
|
||||
#define LCD_REG_32 0x20
|
||||
#define LCD_REG_33 0x21
|
||||
#define LCD_REG_34 0x22
|
||||
#define LCD_REG_36 0x24
|
||||
#define LCD_REG_37 0x25
|
||||
#define LCD_REG_40 0x28
|
||||
#define LCD_REG_41 0x29
|
||||
#define LCD_REG_43 0x2B
|
||||
#define LCD_REG_45 0x2D
|
||||
#define LCD_REG_48 0x30
|
||||
#define LCD_REG_49 0x31
|
||||
#define LCD_REG_50 0x32
|
||||
#define LCD_REG_51 0x33
|
||||
#define LCD_REG_52 0x34
|
||||
#define LCD_REG_53 0x35
|
||||
#define LCD_REG_54 0x36
|
||||
#define LCD_REG_55 0x37
|
||||
#define LCD_REG_56 0x38
|
||||
#define LCD_REG_57 0x39
|
||||
#define LCD_REG_58 0x3A
|
||||
#define LCD_REG_59 0x3B
|
||||
#define LCD_REG_60 0x3C
|
||||
#define LCD_REG_61 0x3D
|
||||
#define LCD_REG_62 0x3E
|
||||
#define LCD_REG_63 0x3F
|
||||
#define LCD_REG_64 0x40
|
||||
#define LCD_REG_65 0x41
|
||||
#define LCD_REG_66 0x42
|
||||
#define LCD_REG_67 0x43
|
||||
#define LCD_REG_68 0x44
|
||||
#define LCD_REG_69 0x45
|
||||
#define LCD_REG_70 0x46
|
||||
#define LCD_REG_71 0x47
|
||||
#define LCD_REG_72 0x48
|
||||
#define LCD_REG_73 0x49
|
||||
#define LCD_REG_74 0x4A
|
||||
#define LCD_REG_75 0x4B
|
||||
#define LCD_REG_76 0x4C
|
||||
#define LCD_REG_77 0x4D
|
||||
#define LCD_REG_78 0x4E
|
||||
#define LCD_REG_79 0x4F
|
||||
#define LCD_REG_80 0x50
|
||||
#define LCD_REG_81 0x51
|
||||
#define LCD_REG_82 0x52
|
||||
#define LCD_REG_83 0x53
|
||||
#define LCD_REG_96 0x60
|
||||
#define LCD_REG_97 0x61
|
||||
#define LCD_REG_106 0x6A
|
||||
#define LCD_REG_118 0x76
|
||||
#define LCD_REG_128 0x80
|
||||
#define LCD_REG_129 0x81
|
||||
#define LCD_REG_130 0x82
|
||||
#define LCD_REG_131 0x83
|
||||
#define LCD_REG_132 0x84
|
||||
#define LCD_REG_133 0x85
|
||||
#define LCD_REG_134 0x86
|
||||
#define LCD_REG_135 0x87
|
||||
#define LCD_REG_136 0x88
|
||||
#define LCD_REG_137 0x89
|
||||
#define LCD_REG_139 0x8B
|
||||
#define LCD_REG_140 0x8C
|
||||
#define LCD_REG_141 0x8D
|
||||
#define LCD_REG_143 0x8F
|
||||
#define LCD_REG_144 0x90
|
||||
#define LCD_REG_145 0x91
|
||||
#define LCD_REG_146 0x92
|
||||
#define LCD_REG_147 0x93
|
||||
#define LCD_REG_148 0x94
|
||||
#define LCD_REG_149 0x95
|
||||
#define LCD_REG_150 0x96
|
||||
#define LCD_REG_151 0x97
|
||||
#define LCD_REG_152 0x98
|
||||
#define LCD_REG_153 0x99
|
||||
#define LCD_REG_154 0x9A
|
||||
#define LCD_REG_157 0x9D
|
||||
#define LCD_REG_192 0xC0
|
||||
#define LCD_REG_193 0xC1
|
||||
#define LCD_REG_229 0xE5
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9325_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void ili9325_Init(void);
|
||||
uint16_t ili9325_ReadID(void);
|
||||
void ili9325_WriteReg(uint8_t LCDReg, uint16_t LCDRegValue);
|
||||
uint16_t ili9325_ReadReg(uint8_t LCDReg);
|
||||
|
||||
void ili9325_DisplayOn(void);
|
||||
void ili9325_DisplayOff(void);
|
||||
void ili9325_SetCursor(uint16_t Xpos, uint16_t Ypos);
|
||||
void ili9325_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGBCode);
|
||||
uint16_t ili9325_ReadPixel(uint16_t Xpos, uint16_t Ypos);
|
||||
|
||||
void ili9325_DrawHLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void ili9325_DrawVLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void ili9325_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp);
|
||||
void ili9325_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata);
|
||||
|
||||
void ili9325_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
|
||||
|
||||
uint16_t ili9325_GetLcdPixelWidth(void);
|
||||
uint16_t ili9325_GetLcdPixelHeight(void);
|
||||
|
||||
/* LCD driver structure */
|
||||
extern LCD_DrvTypeDef ili9325_drv;
|
||||
|
||||
/* LCD IO functions */
|
||||
void LCD_IO_Init(void);
|
||||
void LCD_IO_WriteMultipleData(uint8_t *pData, uint32_t Size);
|
||||
void LCD_IO_WriteReg(uint8_t Reg);
|
||||
uint16_t LCD_IO_ReadData(uint16_t Reg);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ILI9325_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
417
2P-ProjectPong/Drivers/BSP/Components/ili9341/Release_Notes.html
Normal file
417
2P-ProjectPong/Drivers/BSP/Components/ili9341/Release_Notes.html
Normal file
@ -0,0 +1,417 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for ILI9341 Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for ILI9341 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">ili9341.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 19-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Align driver with the STM32Cube BSP architecture by removing check for initialization in ili9341_Init() <br>
|
||||
</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Initializes
|
||||
only the LCD IO in read ID APIs instead of all initialization sequence
|
||||
and remove the check for initialization in ili9341_ReadID() function</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Comments clean up and typo corrections</span></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
346
2P-ProjectPong/Drivers/BSP/Components/ili9341/ili9341.c
Normal file
346
2P-ProjectPong/Drivers/BSP/Components/ili9341/ili9341.c
Normal file
@ -0,0 +1,346 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ili9341.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 02-December-2014
|
||||
* @brief This file includes the LCD driver for ILI9341 LCD.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ili9341.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ILI9341
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* ILI9341 LCD.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
LCD_DrvTypeDef ili9341_drv =
|
||||
{
|
||||
ili9341_Init,
|
||||
ili9341_ReadID,
|
||||
ili9341_DisplayOn,
|
||||
ili9341_DisplayOff,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ili9341_GetLcdPixelWidth,
|
||||
ili9341_GetLcdPixelHeight,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Power on the LCD.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9341_Init(void)
|
||||
{
|
||||
/* Initialize ILI9341 low level bus layer ----------------------------------*/
|
||||
LCD_IO_Init();
|
||||
|
||||
/* Configure LCD */
|
||||
ili9341_WriteReg(0xCA);
|
||||
ili9341_WriteData(0xC3);
|
||||
ili9341_WriteData(0x08);
|
||||
ili9341_WriteData(0x50);
|
||||
ili9341_WriteReg(LCD_POWERB);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0xC1);
|
||||
ili9341_WriteData(0x30);
|
||||
ili9341_WriteReg(LCD_POWER_SEQ);
|
||||
ili9341_WriteData(0x64);
|
||||
ili9341_WriteData(0x03);
|
||||
ili9341_WriteData(0x12);
|
||||
ili9341_WriteData(0x81);
|
||||
ili9341_WriteReg(LCD_DTCA);
|
||||
ili9341_WriteData(0x85);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x78);
|
||||
ili9341_WriteReg(LCD_POWERA);
|
||||
ili9341_WriteData(0x39);
|
||||
ili9341_WriteData(0x2C);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x34);
|
||||
ili9341_WriteData(0x02);
|
||||
ili9341_WriteReg(LCD_PRC);
|
||||
ili9341_WriteData(0x20);
|
||||
ili9341_WriteReg(LCD_DTCB);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteReg(LCD_FRMCTR1);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x1B);
|
||||
ili9341_WriteReg(LCD_DFC);
|
||||
ili9341_WriteData(0x0A);
|
||||
ili9341_WriteData(0xA2);
|
||||
ili9341_WriteReg(LCD_POWER1);
|
||||
ili9341_WriteData(0x10);
|
||||
ili9341_WriteReg(LCD_POWER2);
|
||||
ili9341_WriteData(0x10);
|
||||
ili9341_WriteReg(LCD_VCOM1);
|
||||
ili9341_WriteData(0x45);
|
||||
ili9341_WriteData(0x15);
|
||||
ili9341_WriteReg(LCD_VCOM2);
|
||||
ili9341_WriteData(0x90);
|
||||
ili9341_WriteReg(LCD_MAC);
|
||||
ili9341_WriteData(0xC8);
|
||||
ili9341_WriteReg(LCD_3GAMMA_EN);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteReg(LCD_RGB_INTERFACE);
|
||||
ili9341_WriteData(0xC2);
|
||||
ili9341_WriteReg(LCD_DFC);
|
||||
ili9341_WriteData(0x0A);
|
||||
ili9341_WriteData(0xA7);
|
||||
ili9341_WriteData(0x27);
|
||||
ili9341_WriteData(0x04);
|
||||
|
||||
/* Colomn address set */
|
||||
ili9341_WriteReg(LCD_COLUMN_ADDR);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0xEF);
|
||||
/* Page address set */
|
||||
ili9341_WriteReg(LCD_PAGE_ADDR);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x01);
|
||||
ili9341_WriteData(0x3F);
|
||||
ili9341_WriteReg(LCD_INTERFACE);
|
||||
ili9341_WriteData(0x01);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x06);
|
||||
|
||||
ili9341_WriteReg(LCD_GRAM);
|
||||
LCD_Delay(200);
|
||||
|
||||
ili9341_WriteReg(LCD_GAMMA);
|
||||
ili9341_WriteData(0x01);
|
||||
|
||||
ili9341_WriteReg(LCD_PGAMMA);
|
||||
ili9341_WriteData(0x0F);
|
||||
ili9341_WriteData(0x29);
|
||||
ili9341_WriteData(0x24);
|
||||
ili9341_WriteData(0x0C);
|
||||
ili9341_WriteData(0x0E);
|
||||
ili9341_WriteData(0x09);
|
||||
ili9341_WriteData(0x4E);
|
||||
ili9341_WriteData(0x78);
|
||||
ili9341_WriteData(0x3C);
|
||||
ili9341_WriteData(0x09);
|
||||
ili9341_WriteData(0x13);
|
||||
ili9341_WriteData(0x05);
|
||||
ili9341_WriteData(0x17);
|
||||
ili9341_WriteData(0x11);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteReg(LCD_NGAMMA);
|
||||
ili9341_WriteData(0x00);
|
||||
ili9341_WriteData(0x16);
|
||||
ili9341_WriteData(0x1B);
|
||||
ili9341_WriteData(0x04);
|
||||
ili9341_WriteData(0x11);
|
||||
ili9341_WriteData(0x07);
|
||||
ili9341_WriteData(0x31);
|
||||
ili9341_WriteData(0x33);
|
||||
ili9341_WriteData(0x42);
|
||||
ili9341_WriteData(0x05);
|
||||
ili9341_WriteData(0x0C);
|
||||
ili9341_WriteData(0x0A);
|
||||
ili9341_WriteData(0x28);
|
||||
ili9341_WriteData(0x2F);
|
||||
ili9341_WriteData(0x0F);
|
||||
|
||||
ili9341_WriteReg(LCD_SLEEP_OUT);
|
||||
LCD_Delay(200);
|
||||
ili9341_WriteReg(LCD_DISPLAY_ON);
|
||||
/* GRAM start writing */
|
||||
ili9341_WriteReg(LCD_GRAM);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disables the Display.
|
||||
* @param None
|
||||
* @retval LCD Register Value.
|
||||
*/
|
||||
uint16_t ili9341_ReadID(void)
|
||||
{
|
||||
LCD_IO_Init();
|
||||
return ((uint16_t)ili9341_ReadData(LCD_READ_ID4, LCD_READ_ID4_SIZE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9341_DisplayOn(void)
|
||||
{
|
||||
/* Display On */
|
||||
ili9341_WriteReg(LCD_DISPLAY_ON);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ili9341_DisplayOff(void)
|
||||
{
|
||||
/* Display Off */
|
||||
ili9341_WriteReg(LCD_DISPLAY_OFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes to the selected LCD register.
|
||||
* @param LCD_Reg: address of the selected register.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9341_WriteReg(uint8_t LCD_Reg)
|
||||
{
|
||||
LCD_IO_WriteReg(LCD_Reg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes data to the selected LCD register.
|
||||
* @param LCD_Reg: address of the selected register.
|
||||
* @retval None
|
||||
*/
|
||||
void ili9341_WriteData(uint16_t RegValue)
|
||||
{
|
||||
LCD_IO_WriteData(RegValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads the selected LCD Register.
|
||||
* @param RegValue: Address of the register to read
|
||||
* @param ReadSize: Number of bytes to read
|
||||
* @retval LCD Register Value.
|
||||
*/
|
||||
uint32_t ili9341_ReadData(uint16_t RegValue, uint8_t ReadSize)
|
||||
{
|
||||
/* Read a max of 4 bytes */
|
||||
return (LCD_IO_ReadData(RegValue, ReadSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get LCD PIXEL WIDTH.
|
||||
* @param None
|
||||
* @retval LCD PIXEL WIDTH.
|
||||
*/
|
||||
uint16_t ili9341_GetLcdPixelWidth(void)
|
||||
{
|
||||
/* Return LCD PIXEL WIDTH */
|
||||
return ILI9341_LCD_PIXEL_WIDTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get LCD PIXEL HEIGHT.
|
||||
* @param None
|
||||
* @retval LCD PIXEL HEIGHT.
|
||||
*/
|
||||
uint16_t ili9341_GetLcdPixelHeight(void)
|
||||
{
|
||||
/* Return LCD PIXEL HEIGHT */
|
||||
return ILI9341_LCD_PIXEL_HEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
249
2P-ProjectPong/Drivers/BSP/Components/ili9341/ili9341.h
Normal file
249
2P-ProjectPong/Drivers/BSP/Components/ili9341/ili9341.h
Normal file
@ -0,0 +1,249 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ili9341.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 02-December-2014
|
||||
* @brief This file contains all the functions prototypes for the ili9341.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ILI9341_H
|
||||
#define __ILI9341_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/lcd.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ILI9341
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ILI9341 chip IDs
|
||||
*/
|
||||
#define ILI9341_ID 0x9341
|
||||
|
||||
/**
|
||||
* @brief ILI9341 Size
|
||||
*/
|
||||
#define ILI9341_LCD_PIXEL_WIDTH ((uint16_t)240)
|
||||
#define ILI9341_LCD_PIXEL_HEIGHT ((uint16_t)320)
|
||||
|
||||
/**
|
||||
* @brief ILI9341 Timing
|
||||
*/
|
||||
/* Timing configuration (Typical configuration from ILI9341 datasheet)
|
||||
HSYNC=10 (9+1)
|
||||
HBP=20 (29-10+1)
|
||||
ActiveW=240 (269-20-10+1)
|
||||
HFP=10 (279-240-20-10+1)
|
||||
|
||||
VSYNC=2 (1+1)
|
||||
VBP=2 (3-2+1)
|
||||
ActiveH=320 (323-2-2+1)
|
||||
VFP=4 (327-320-2-2+1)
|
||||
*/
|
||||
#define ILI9341_HSYNC ((uint32_t)9) /* Horizontal synchronization */
|
||||
#define ILI9341_HBP ((uint32_t)29) /* Horizontal back porch */
|
||||
#define ILI9341_HFP ((uint32_t)2) /* Horizontal front porch */
|
||||
#define ILI9341_VSYNC ((uint32_t)1) /* Vertical synchronization */
|
||||
#define ILI9341_VBP ((uint32_t)3) /* Vertical back porch */
|
||||
#define ILI9341_VFP ((uint32_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief ILI9341 Registers
|
||||
*/
|
||||
|
||||
/* Level 1 Commands */
|
||||
#define LCD_SWRESET 0x01 /* Software Reset */
|
||||
#define LCD_READ_DISPLAY_ID 0x04 /* Read display identification information */
|
||||
#define LCD_RDDST 0x09 /* Read Display Status */
|
||||
#define LCD_RDDPM 0x0A /* Read Display Power Mode */
|
||||
#define LCD_RDDMADCTL 0x0B /* Read Display MADCTL */
|
||||
#define LCD_RDDCOLMOD 0x0C /* Read Display Pixel Format */
|
||||
#define LCD_RDDIM 0x0D /* Read Display Image Format */
|
||||
#define LCD_RDDSM 0x0E /* Read Display Signal Mode */
|
||||
#define LCD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */
|
||||
#define LCD_SPLIN 0x10 /* Enter Sleep Mode */
|
||||
#define LCD_SLEEP_OUT 0x11 /* Sleep out register */
|
||||
#define LCD_PTLON 0x12 /* Partial Mode ON */
|
||||
#define LCD_NORMAL_MODE_ON 0x13 /* Normal Display Mode ON */
|
||||
#define LCD_DINVOFF 0x20 /* Display Inversion OFF */
|
||||
#define LCD_DINVON 0x21 /* Display Inversion ON */
|
||||
#define LCD_GAMMA 0x26 /* Gamma register */
|
||||
#define LCD_DISPLAY_OFF 0x28 /* Display off register */
|
||||
#define LCD_DISPLAY_ON 0x29 /* Display on register */
|
||||
#define LCD_COLUMN_ADDR 0x2A /* Colomn address register */
|
||||
#define LCD_PAGE_ADDR 0x2B /* Page address register */
|
||||
#define LCD_GRAM 0x2C /* GRAM register */
|
||||
#define LCD_RGBSET 0x2D /* Color SET */
|
||||
#define LCD_RAMRD 0x2E /* Memory Read */
|
||||
#define LCD_PLTAR 0x30 /* Partial Area */
|
||||
#define LCD_VSCRDEF 0x33 /* Vertical Scrolling Definition */
|
||||
#define LCD_TEOFF 0x34 /* Tearing Effect Line OFF */
|
||||
#define LCD_TEON 0x35 /* Tearing Effect Line ON */
|
||||
#define LCD_MAC 0x36 /* Memory Access Control register*/
|
||||
#define LCD_VSCRSADD 0x37 /* Vertical Scrolling Start Address */
|
||||
#define LCD_IDMOFF 0x38 /* Idle Mode OFF */
|
||||
#define LCD_IDMON 0x39 /* Idle Mode ON */
|
||||
#define LCD_PIXEL_FORMAT 0x3A /* Pixel Format register */
|
||||
#define LCD_WRITE_MEM_CONTINUE 0x3C /* Write Memory Continue */
|
||||
#define LCD_READ_MEM_CONTINUE 0x3E /* Read Memory Continue */
|
||||
#define LCD_SET_TEAR_SCANLINE 0x44 /* Set Tear Scanline */
|
||||
#define LCD_GET_SCANLINE 0x45 /* Get Scanline */
|
||||
#define LCD_WDB 0x51 /* Write Brightness Display register */
|
||||
#define LCD_RDDISBV 0x52 /* Read Display Brightness */
|
||||
#define LCD_WCD 0x53 /* Write Control Display register*/
|
||||
#define LCD_RDCTRLD 0x54 /* Read CTRL Display */
|
||||
#define LCD_WRCABC 0x55 /* Write Content Adaptive Brightness Control */
|
||||
#define LCD_RDCABC 0x56 /* Read Content Adaptive Brightness Control */
|
||||
#define LCD_WRITE_CABC 0x5E /* Write CABC Minimum Brightness */
|
||||
#define LCD_READ_CABC 0x5F /* Read CABC Minimum Brightness */
|
||||
#define LCD_READ_ID1 0xDA /* Read ID1 */
|
||||
#define LCD_READ_ID2 0xDB /* Read ID2 */
|
||||
#define LCD_READ_ID3 0xDC /* Read ID3 */
|
||||
|
||||
/* Level 2 Commands */
|
||||
#define LCD_RGB_INTERFACE 0xB0 /* RGB Interface Signal Control */
|
||||
#define LCD_FRMCTR1 0xB1 /* Frame Rate Control (In Normal Mode) */
|
||||
#define LCD_FRMCTR2 0xB2 /* Frame Rate Control (In Idle Mode) */
|
||||
#define LCD_FRMCTR3 0xB3 /* Frame Rate Control (In Partial Mode) */
|
||||
#define LCD_INVTR 0xB4 /* Display Inversion Control */
|
||||
#define LCD_BPC 0xB5 /* Blanking Porch Control register */
|
||||
#define LCD_DFC 0xB6 /* Display Function Control register */
|
||||
#define LCD_ETMOD 0xB7 /* Entry Mode Set */
|
||||
#define LCD_BACKLIGHT1 0xB8 /* Backlight Control 1 */
|
||||
#define LCD_BACKLIGHT2 0xB9 /* Backlight Control 2 */
|
||||
#define LCD_BACKLIGHT3 0xBA /* Backlight Control 3 */
|
||||
#define LCD_BACKLIGHT4 0xBB /* Backlight Control 4 */
|
||||
#define LCD_BACKLIGHT5 0xBC /* Backlight Control 5 */
|
||||
#define LCD_BACKLIGHT7 0xBE /* Backlight Control 7 */
|
||||
#define LCD_BACKLIGHT8 0xBF /* Backlight Control 8 */
|
||||
#define LCD_POWER1 0xC0 /* Power Control 1 register */
|
||||
#define LCD_POWER2 0xC1 /* Power Control 2 register */
|
||||
#define LCD_VCOM1 0xC5 /* VCOM Control 1 register */
|
||||
#define LCD_VCOM2 0xC7 /* VCOM Control 2 register */
|
||||
#define LCD_NVMWR 0xD0 /* NV Memory Write */
|
||||
#define LCD_NVMPKEY 0xD1 /* NV Memory Protection Key */
|
||||
#define LCD_RDNVM 0xD2 /* NV Memory Status Read */
|
||||
#define LCD_READ_ID4 0xD3 /* Read ID4 */
|
||||
#define LCD_PGAMMA 0xE0 /* Positive Gamma Correction register */
|
||||
#define LCD_NGAMMA 0xE1 /* Negative Gamma Correction register */
|
||||
#define LCD_DGAMCTRL1 0xE2 /* Digital Gamma Control 1 */
|
||||
#define LCD_DGAMCTRL2 0xE3 /* Digital Gamma Control 2 */
|
||||
#define LCD_INTERFACE 0xF6 /* Interface control register */
|
||||
|
||||
/* Extend register commands */
|
||||
#define LCD_POWERA 0xCB /* Power control A register */
|
||||
#define LCD_POWERB 0xCF /* Power control B register */
|
||||
#define LCD_DTCA 0xE8 /* Driver timing control A */
|
||||
#define LCD_DTCB 0xEA /* Driver timing control B */
|
||||
#define LCD_POWER_SEQ 0xED /* Power on sequence register */
|
||||
#define LCD_3GAMMA_EN 0xF2 /* 3 Gamma enable register */
|
||||
#define LCD_PRC 0xF7 /* Pump ratio control register */
|
||||
|
||||
/* Size of read registers */
|
||||
#define LCD_READ_ID4_SIZE 3 /* Size of Read ID4 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ILI9341_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void ili9341_Init(void);
|
||||
uint16_t ili9341_ReadID(void);
|
||||
void ili9341_WriteReg(uint8_t LCD_Reg);
|
||||
void ili9341_WriteData(uint16_t RegValue);
|
||||
uint32_t ili9341_ReadData(uint16_t RegValue, uint8_t ReadSize);
|
||||
void ili9341_DisplayOn(void);
|
||||
void ili9341_DisplayOff(void);
|
||||
uint16_t ili9341_GetLcdPixelWidth(void);
|
||||
uint16_t ili9341_GetLcdPixelHeight(void);
|
||||
|
||||
/* LCD driver structure */
|
||||
extern LCD_DrvTypeDef ili9341_drv;
|
||||
|
||||
/* LCD IO functions */
|
||||
void LCD_IO_Init(void);
|
||||
void LCD_IO_WriteData(uint16_t RegValue);
|
||||
void LCD_IO_WriteReg(uint8_t Reg);
|
||||
uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize);
|
||||
void LCD_Delay (uint32_t delay);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ILI9341_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
461
2P-ProjectPong/Drivers/BSP/Components/l3gd20/Release_Notes.html
Normal file
461
2P-ProjectPong/Drivers/BSP/Components/l3gd20/Release_Notes.html
Normal file
@ -0,0 +1,461 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for L3GD20 Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for L3GD20 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 24-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">l3gd20.h/.c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Add gyroscope de-initialization function: L3GD20_DeInit()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add gyroscope low power configuration</span><span style="font-size: 10pt; font-family: Verdana;"> function: </span><span style="font-size: 10pt; font-family: Verdana;">L3GD20_LowPower</span><span style="font-size: 10pt; font-family: Verdana;">()</span></li><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common
|
||||
driver V4.0.0 or later</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.1 / 27-November-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">l3gd20.h: change "\" by "/" in the include path to fix compilation issue under Linux</span><br>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span></li><li><span style="font-size: 10pt; font-family: Verdana;">Miscellaneous formatting and comments update</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 10-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update to support new revision of L3GD20 component having new device ID 0xD5 (new define added: I_AM_L3GD20_TR)</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">First official release of L3GD20 gyroscope </span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
416
2P-ProjectPong/Drivers/BSP/Components/l3gd20/l3gd20.c
Normal file
416
2P-ProjectPong/Drivers/BSP/Components/l3gd20/l3gd20.c
Normal file
@ -0,0 +1,416 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file l3gd20.c
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 26-June-2015
|
||||
* @brief This file provides a set of functions needed to manage the L3GD20,
|
||||
* ST MEMS motion sensor, 3-axis digital output gyroscope.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "l3gd20.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup L3GD20
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
GYRO_DrvTypeDef L3gd20Drv =
|
||||
{
|
||||
L3GD20_Init,
|
||||
L3GD20_DeInit,
|
||||
L3GD20_ReadID,
|
||||
L3GD20_RebootCmd,
|
||||
L3GD20_LowPower,
|
||||
L3GD20_INT1InterruptConfig,
|
||||
L3GD20_EnableIT,
|
||||
L3GD20_DisableIT,
|
||||
0,
|
||||
0,
|
||||
L3GD20_FilterConfig,
|
||||
L3GD20_FilterCmd,
|
||||
L3GD20_ReadXYZAngRate
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set L3GD20 Initialization.
|
||||
* @param L3GD20_InitStruct: pointer to a L3GD20_InitTypeDef structure
|
||||
* that contains the configuration setting for the L3GD20.
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_Init(uint16_t InitStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Configure the low level interface */
|
||||
GYRO_IO_Init();
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ctrl = (uint8_t) InitStruct;
|
||||
GYRO_IO_Write(&ctrl, L3GD20_CTRL_REG1_ADDR, 1);
|
||||
|
||||
/* Write value to MEMS CTRL_REG4 register */
|
||||
ctrl = (uint8_t) (InitStruct >> 8);
|
||||
GYRO_IO_Write(&ctrl, L3GD20_CTRL_REG4_ADDR, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief L3GD20 De-initialization
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_DeInit(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read ID address of L3GD20
|
||||
* @param None
|
||||
* @retval ID name
|
||||
*/
|
||||
uint8_t L3GD20_ReadID(void)
|
||||
{
|
||||
uint8_t tmp;
|
||||
|
||||
/* Configure the low level interface */
|
||||
GYRO_IO_Init();
|
||||
|
||||
/* Read WHO I AM register */
|
||||
GYRO_IO_Read(&tmp, L3GD20_WHO_AM_I_ADDR, 1);
|
||||
|
||||
/* Return the ID */
|
||||
return (uint8_t)tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content of L3GD20
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_RebootCmd(void)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG5 register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_CTRL_REG5_ADDR, 1);
|
||||
|
||||
/* Enable or Disable the reboot memory */
|
||||
tmpreg |= L3GD20_BOOT_REBOOTMEMORY;
|
||||
|
||||
/* Write value to MEMS CTRL_REG5 register */
|
||||
GYRO_IO_Write(&tmpreg, L3GD20_CTRL_REG5_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set L3GD20 in low-power mode
|
||||
* @param
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_LowPower(uint16_t InitStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ctrl = (uint8_t) InitStruct;
|
||||
GYRO_IO_Write(&ctrl, L3GD20_CTRL_REG1_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set L3GD20 Interrupt INT1 configuration
|
||||
* @param Int1Config: the configuration setting for the L3GD20 Interrupt.
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_INT1InterruptConfig(uint16_t Int1Config)
|
||||
{
|
||||
uint8_t ctrl_cfr = 0x00, ctrl3 = 0x00;
|
||||
|
||||
/* Read INT1_CFG register */
|
||||
GYRO_IO_Read(&ctrl_cfr, L3GD20_INT1_CFG_ADDR, 1);
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
GYRO_IO_Read(&ctrl3, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
|
||||
ctrl_cfr &= 0x80;
|
||||
ctrl_cfr |= ((uint8_t) Int1Config >> 8);
|
||||
|
||||
ctrl3 &= 0xDF;
|
||||
ctrl3 |= ((uint8_t) Int1Config);
|
||||
|
||||
/* Write value to MEMS INT1_CFG register */
|
||||
GYRO_IO_Write(&ctrl_cfr, L3GD20_INT1_CFG_ADDR, 1);
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
GYRO_IO_Write(&ctrl3, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable INT1 or INT2 interrupt
|
||||
* @param IntSel: choice of INT1 or INT2
|
||||
* This parameter can be:
|
||||
* @arg L3GD20_INT1
|
||||
* @arg L3GD20_INT2
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_EnableIT(uint8_t IntSel)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
|
||||
if(IntSel == L3GD20_INT1)
|
||||
{
|
||||
tmpreg &= 0x7F;
|
||||
tmpreg |= L3GD20_INT1INTERRUPT_ENABLE;
|
||||
}
|
||||
else if(IntSel == L3GD20_INT2)
|
||||
{
|
||||
tmpreg &= 0xF7;
|
||||
tmpreg |= L3GD20_INT2INTERRUPT_ENABLE;
|
||||
}
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
GYRO_IO_Write(&tmpreg, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable INT1 or INT2 interrupt
|
||||
* @param IntSel: choice of INT1 or INT2
|
||||
* This parameter can be:
|
||||
* @arg L3GD20_INT1
|
||||
* @arg L3GD20_INT2
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_DisableIT(uint8_t IntSel)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
|
||||
if(IntSel == L3GD20_INT1)
|
||||
{
|
||||
tmpreg &= 0x7F;
|
||||
tmpreg |= L3GD20_INT1INTERRUPT_DISABLE;
|
||||
}
|
||||
else if(IntSel == L3GD20_INT2)
|
||||
{
|
||||
tmpreg &= 0xF7;
|
||||
tmpreg |= L3GD20_INT2INTERRUPT_DISABLE;
|
||||
}
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
GYRO_IO_Write(&tmpreg, L3GD20_CTRL_REG3_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set High Pass Filter Modality
|
||||
* @param FilterStruct: contains the configuration setting for the L3GD20.
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_FilterConfig(uint8_t FilterStruct)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG2 register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_CTRL_REG2_ADDR, 1);
|
||||
|
||||
tmpreg &= 0xC0;
|
||||
|
||||
/* Configure MEMS: mode and cutoff frequency */
|
||||
tmpreg |= FilterStruct;
|
||||
|
||||
/* Write value to MEMS CTRL_REG2 register */
|
||||
GYRO_IO_Write(&tmpreg, L3GD20_CTRL_REG2_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable or Disable High Pass Filter
|
||||
* @param HighPassFilterState: new state of the High Pass Filter feature.
|
||||
* This parameter can be:
|
||||
* @arg: L3GD20_HIGHPASSFILTER_DISABLE
|
||||
* @arg: L3GD20_HIGHPASSFILTER_ENABLE
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_FilterCmd(uint8_t HighPassFilterState)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG5 register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_CTRL_REG5_ADDR, 1);
|
||||
|
||||
tmpreg &= 0xEF;
|
||||
|
||||
tmpreg |= HighPassFilterState;
|
||||
|
||||
/* Write value to MEMS CTRL_REG5 register */
|
||||
GYRO_IO_Write(&tmpreg, L3GD20_CTRL_REG5_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get status for L3GD20 data
|
||||
* @param None
|
||||
* @retval Data status in a L3GD20 Data
|
||||
*/
|
||||
uint8_t L3GD20_GetDataStatus(void)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read STATUS_REG register */
|
||||
GYRO_IO_Read(&tmpreg, L3GD20_STATUS_REG_ADDR, 1);
|
||||
|
||||
return tmpreg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the L3GD20 angular data.
|
||||
* @param pfData: Data out pointer
|
||||
* @retval None
|
||||
*/
|
||||
void L3GD20_ReadXYZAngRate(float *pfData)
|
||||
{
|
||||
uint8_t tmpbuffer[6] ={0};
|
||||
int16_t RawData[3] = {0};
|
||||
uint8_t tmpreg = 0;
|
||||
float sensitivity = 0;
|
||||
int i =0;
|
||||
|
||||
GYRO_IO_Read(&tmpreg,L3GD20_CTRL_REG4_ADDR,1);
|
||||
|
||||
GYRO_IO_Read(tmpbuffer,L3GD20_OUT_X_L_ADDR,6);
|
||||
|
||||
/* check in the control register 4 the data alignment (Big Endian or Little Endian)*/
|
||||
if(!(tmpreg & L3GD20_BLE_MSB))
|
||||
{
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
RawData[i]=(int16_t)(((uint16_t)tmpbuffer[2*i+1] << 8) + tmpbuffer[2*i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
RawData[i]=(int16_t)(((uint16_t)tmpbuffer[2*i] << 8) + tmpbuffer[2*i+1]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Switch the sensitivity value set in the CRTL4 */
|
||||
switch(tmpreg & L3GD20_FULLSCALE_SELECTION)
|
||||
{
|
||||
case L3GD20_FULLSCALE_250:
|
||||
sensitivity=L3GD20_SENSITIVITY_250DPS;
|
||||
break;
|
||||
|
||||
case L3GD20_FULLSCALE_500:
|
||||
sensitivity=L3GD20_SENSITIVITY_500DPS;
|
||||
break;
|
||||
|
||||
case L3GD20_FULLSCALE_2000:
|
||||
sensitivity=L3GD20_SENSITIVITY_2000DPS;
|
||||
break;
|
||||
}
|
||||
/* Divide by sensitivity */
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pfData[i]=(float)(RawData[i] * sensitivity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
324
2P-ProjectPong/Drivers/BSP/Components/l3gd20/l3gd20.h
Normal file
324
2P-ProjectPong/Drivers/BSP/Components/l3gd20/l3gd20.h
Normal file
@ -0,0 +1,324 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file l3gd20.h
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 26-June-2015
|
||||
* @brief This file contains all the functions prototypes for the l3gd20.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __L3GD20_H
|
||||
#define __L3GD20_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/gyro.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup L3GD20
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup L3GD20_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** START REGISTER MAPPING **************************/
|
||||
/******************************************************************************/
|
||||
#define L3GD20_WHO_AM_I_ADDR 0x0F /* device identification register */
|
||||
#define L3GD20_CTRL_REG1_ADDR 0x20 /* Control register 1 */
|
||||
#define L3GD20_CTRL_REG2_ADDR 0x21 /* Control register 2 */
|
||||
#define L3GD20_CTRL_REG3_ADDR 0x22 /* Control register 3 */
|
||||
#define L3GD20_CTRL_REG4_ADDR 0x23 /* Control register 4 */
|
||||
#define L3GD20_CTRL_REG5_ADDR 0x24 /* Control register 5 */
|
||||
#define L3GD20_REFERENCE_REG_ADDR 0x25 /* Reference register */
|
||||
#define L3GD20_OUT_TEMP_ADDR 0x26 /* Out temp register */
|
||||
#define L3GD20_STATUS_REG_ADDR 0x27 /* Status register */
|
||||
#define L3GD20_OUT_X_L_ADDR 0x28 /* Output Register X */
|
||||
#define L3GD20_OUT_X_H_ADDR 0x29 /* Output Register X */
|
||||
#define L3GD20_OUT_Y_L_ADDR 0x2A /* Output Register Y */
|
||||
#define L3GD20_OUT_Y_H_ADDR 0x2B /* Output Register Y */
|
||||
#define L3GD20_OUT_Z_L_ADDR 0x2C /* Output Register Z */
|
||||
#define L3GD20_OUT_Z_H_ADDR 0x2D /* Output Register Z */
|
||||
#define L3GD20_FIFO_CTRL_REG_ADDR 0x2E /* Fifo control Register */
|
||||
#define L3GD20_FIFO_SRC_REG_ADDR 0x2F /* Fifo src Register */
|
||||
|
||||
#define L3GD20_INT1_CFG_ADDR 0x30 /* Interrupt 1 configuration Register */
|
||||
#define L3GD20_INT1_SRC_ADDR 0x31 /* Interrupt 1 source Register */
|
||||
#define L3GD20_INT1_TSH_XH_ADDR 0x32 /* Interrupt 1 Threshold X register */
|
||||
#define L3GD20_INT1_TSH_XL_ADDR 0x33 /* Interrupt 1 Threshold X register */
|
||||
#define L3GD20_INT1_TSH_YH_ADDR 0x34 /* Interrupt 1 Threshold Y register */
|
||||
#define L3GD20_INT1_TSH_YL_ADDR 0x35 /* Interrupt 1 Threshold Y register */
|
||||
#define L3GD20_INT1_TSH_ZH_ADDR 0x36 /* Interrupt 1 Threshold Z register */
|
||||
#define L3GD20_INT1_TSH_ZL_ADDR 0x37 /* Interrupt 1 Threshold Z register */
|
||||
#define L3GD20_INT1_DURATION_ADDR 0x38 /* Interrupt 1 DURATION register */
|
||||
|
||||
/******************************************************************************/
|
||||
/**************************** END REGISTER MAPPING ***************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#define I_AM_L3GD20 ((uint8_t)0xD4)
|
||||
#define I_AM_L3GD20_TR ((uint8_t)0xD5)
|
||||
|
||||
/** @defgroup Power_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_MODE_POWERDOWN ((uint8_t)0x00)
|
||||
#define L3GD20_MODE_ACTIVE ((uint8_t)0x08)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup OutPut_DataRate_Selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_OUTPUT_DATARATE_1 ((uint8_t)0x00)
|
||||
#define L3GD20_OUTPUT_DATARATE_2 ((uint8_t)0x40)
|
||||
#define L3GD20_OUTPUT_DATARATE_3 ((uint8_t)0x80)
|
||||
#define L3GD20_OUTPUT_DATARATE_4 ((uint8_t)0xC0)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Axes_Selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_X_ENABLE ((uint8_t)0x02)
|
||||
#define L3GD20_Y_ENABLE ((uint8_t)0x01)
|
||||
#define L3GD20_Z_ENABLE ((uint8_t)0x04)
|
||||
#define L3GD20_AXES_ENABLE ((uint8_t)0x07)
|
||||
#define L3GD20_AXES_DISABLE ((uint8_t)0x00)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Bandwidth_Selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_BANDWIDTH_1 ((uint8_t)0x00)
|
||||
#define L3GD20_BANDWIDTH_2 ((uint8_t)0x10)
|
||||
#define L3GD20_BANDWIDTH_3 ((uint8_t)0x20)
|
||||
#define L3GD20_BANDWIDTH_4 ((uint8_t)0x30)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Full_Scale_Selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_FULLSCALE_250 ((uint8_t)0x00)
|
||||
#define L3GD20_FULLSCALE_500 ((uint8_t)0x10)
|
||||
#define L3GD20_FULLSCALE_2000 ((uint8_t)0x20)
|
||||
#define L3GD20_FULLSCALE_SELECTION ((uint8_t)0x30)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Full_Scale_Sensitivity
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_SENSITIVITY_250DPS ((float)8.75f) /*!< gyroscope sensitivity with 250 dps full scale [DPS/LSB] */
|
||||
#define L3GD20_SENSITIVITY_500DPS ((float)17.50f) /*!< gyroscope sensitivity with 500 dps full scale [DPS/LSB] */
|
||||
#define L3GD20_SENSITIVITY_2000DPS ((float)70.00f) /*!< gyroscope sensitivity with 2000 dps full scale [DPS/LSB] */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup Block_Data_Update
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_BlockDataUpdate_Continous ((uint8_t)0x00)
|
||||
#define L3GD20_BlockDataUpdate_Single ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Endian_Data_selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_BLE_LSB ((uint8_t)0x00)
|
||||
#define L3GD20_BLE_MSB ((uint8_t)0x40)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup High_Pass_Filter_status
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_HIGHPASSFILTER_DISABLE ((uint8_t)0x00)
|
||||
#define L3GD20_HIGHPASSFILTER_ENABLE ((uint8_t)0x10)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup INT1_INT2_selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_INT1 ((uint8_t)0x00)
|
||||
#define L3GD20_INT2 ((uint8_t)0x01)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup INT1_Interrupt_status
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_INT1INTERRUPT_DISABLE ((uint8_t)0x00)
|
||||
#define L3GD20_INT1INTERRUPT_ENABLE ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup INT2_Interrupt_status
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_INT2INTERRUPT_DISABLE ((uint8_t)0x00)
|
||||
#define L3GD20_INT2INTERRUPT_ENABLE ((uint8_t)0x08)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup INT1_Interrupt_ActiveEdge
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_INT1INTERRUPT_LOW_EDGE ((uint8_t)0x20)
|
||||
#define L3GD20_INT1INTERRUPT_HIGH_EDGE ((uint8_t)0x00)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Boot_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_BOOT_NORMALMODE ((uint8_t)0x00)
|
||||
#define L3GD20_BOOT_REBOOTMEMORY ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup High_Pass_Filter_Mode
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_HPM_NORMAL_MODE_RES ((uint8_t)0x00)
|
||||
#define L3GD20_HPM_REF_SIGNAL ((uint8_t)0x10)
|
||||
#define L3GD20_HPM_NORMAL_MODE ((uint8_t)0x20)
|
||||
#define L3GD20_HPM_AUTORESET_INT ((uint8_t)0x30)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup High_Pass_CUT OFF_Frequency
|
||||
* @{
|
||||
*/
|
||||
#define L3GD20_HPFCF_0 0x00
|
||||
#define L3GD20_HPFCF_1 0x01
|
||||
#define L3GD20_HPFCF_2 0x02
|
||||
#define L3GD20_HPFCF_3 0x03
|
||||
#define L3GD20_HPFCF_4 0x04
|
||||
#define L3GD20_HPFCF_5 0x05
|
||||
#define L3GD20_HPFCF_6 0x06
|
||||
#define L3GD20_HPFCF_7 0x07
|
||||
#define L3GD20_HPFCF_8 0x08
|
||||
#define L3GD20_HPFCF_9 0x09
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/** @defgroup L3GD20_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/* Sensor Configuration Functions */
|
||||
void L3GD20_Init(uint16_t InitStruct);
|
||||
void L3GD20_DeInit(void);
|
||||
void L3GD20_LowPower(uint16_t InitStruct);
|
||||
uint8_t L3GD20_ReadID(void);
|
||||
void L3GD20_RebootCmd(void);
|
||||
|
||||
/* Interrupt Configuration Functions */
|
||||
void L3GD20_INT1InterruptConfig(uint16_t Int1Config);
|
||||
void L3GD20_EnableIT(uint8_t IntSel);
|
||||
void L3GD20_DisableIT(uint8_t IntSel);
|
||||
|
||||
/* High Pass Filter Configuration Functions */
|
||||
void L3GD20_FilterConfig(uint8_t FilterStruct);
|
||||
void L3GD20_FilterCmd(uint8_t HighPassFilterState);
|
||||
void L3GD20_ReadXYZAngRate(float *pfData);
|
||||
uint8_t L3GD20_GetDataStatus(void);
|
||||
|
||||
/* Gyroscope IO functions */
|
||||
void GYRO_IO_Init(void);
|
||||
void GYRO_IO_DeInit(void);
|
||||
void GYRO_IO_Write(uint8_t *pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite);
|
||||
void GYRO_IO_Read(uint8_t *pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead);
|
||||
|
||||
/* Gyroscope driver structure */
|
||||
extern GYRO_DrvTypeDef L3gd20Drv;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __L3GD20_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,510 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LIS302DL Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for LIS302DL Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 900px; height: 418px;" border="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 03-August-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">lis302dl.h/.c:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana; font-size: 10pt;">Add mems accelerometer de-initialization
|
||||
function: LIS302DL_DeInit()</span></li><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common
|
||||
driver V4.0.0 or later</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">lis302dl.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 19-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Comments clean up and typo corrections</span></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release</span></li>
|
||||
</ul>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License</span></h2>
|
||||
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
423
2P-ProjectPong/Drivers/BSP/Components/lis302dl/lis302dl.c
Normal file
423
2P-ProjectPong/Drivers/BSP/Components/lis302dl/lis302dl.c
Normal file
@ -0,0 +1,423 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lis302dl.c
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 03-August-2015
|
||||
* @brief This file provides a set of functions needed to manage the LIS302DL
|
||||
* MEMS accelerometer.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lis302dl.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LIS302DL
|
||||
* @brief This file includes the motion sensor driver for LIS302DL motion sensor
|
||||
* devices.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LIS302DL_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
ACCELERO_DrvTypeDef Lis302dlDrv =
|
||||
{
|
||||
LIS302DL_Init,
|
||||
LIS302DL_DeInit,
|
||||
LIS302DL_ReadID,
|
||||
LIS302DL_RebootCmd,
|
||||
LIS302DL_Click_IntConfig,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
LIS302DL_Click_IntClear,
|
||||
LIS302DL_FilterConfig,
|
||||
0,
|
||||
LIS302DL_ReadACC,
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set LIS302DL Initialization.
|
||||
* @param InitStruct: contains mask of different init parameters
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_Init(uint16_t InitStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Configure the low level interface */
|
||||
ACCELERO_IO_Init();
|
||||
|
||||
ctrl = (uint8_t) InitStruct;
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LIS302DL De-Initialization.
|
||||
* @param None
|
||||
* @retval None.
|
||||
*/
|
||||
void LIS302DL_DeInit(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read LIS302DL device ID.
|
||||
* @param None
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint8_t LIS302DL_ReadID(void)
|
||||
{
|
||||
uint8_t tmp = 0;
|
||||
|
||||
/* Configure the low level interface */
|
||||
ACCELERO_IO_Init();
|
||||
|
||||
/* Read WHO_AM_I register */
|
||||
ACCELERO_IO_Read(&tmp, LIS302DL_WHO_AM_I_ADDR, 1);
|
||||
|
||||
/* Return the ID */
|
||||
return (uint16_t)tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LIS302DL Internal High Pass Filter configuration.
|
||||
* @param FilterStruct: contains data for filter config
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_FilterConfig(uint8_t FilterStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Read CTRL_REG2 register */
|
||||
ACCELERO_IO_Read(&ctrl, LIS302DL_CTRL_REG2_ADDR, 1);
|
||||
|
||||
/* Clear high pass filter cut-off level, interrupt and data selection bits */
|
||||
ctrl &= (uint8_t)~(LIS302DL_FILTEREDDATASELECTION_OUTPUTREGISTER | \
|
||||
LIS302DL_HIGHPASSFILTER_LEVEL_3 | \
|
||||
LIS302DL_HIGHPASSFILTERINTERRUPT_1_2);
|
||||
|
||||
ctrl |= FilterStruct;
|
||||
|
||||
/* Write value to MEMS CTRL_REG2 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CTRL_REG2_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LIS302DL Interrupt configuration.
|
||||
* @param LIS302DL_InterruptConfig_TypeDef: pointer to a LIS302DL_InterruptConfig_TypeDef
|
||||
* structure that contains the configuration setting for the LIS302DL Interrupt.
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_InterruptConfig(LIS302DL_InterruptConfigTypeDef *LIS302DL_IntConfigStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Read CLICK_CFG register */
|
||||
ACCELERO_IO_Read(&ctrl, LIS302DL_CLICK_CFG_REG_ADDR, 1);
|
||||
|
||||
/* Configure latch Interrupt request, click interrupts and double click interrupts */
|
||||
ctrl = (uint8_t)(LIS302DL_IntConfigStruct->Latch_Request| \
|
||||
LIS302DL_IntConfigStruct->SingleClick_Axes | \
|
||||
LIS302DL_IntConfigStruct->DoubleClick_Axes);
|
||||
|
||||
/* Write value to MEMS CLICK_CFG register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_CFG_REG_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LIS302DL Interrupt configuration
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_Click_IntConfig(void)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
LIS302DL_InterruptConfigTypeDef LIS302DL_InterruptStruct;
|
||||
|
||||
ACCELERO_IO_ITConfig();
|
||||
|
||||
/* Set configuration of Internal High Pass Filter of LIS302DL */
|
||||
LIS302DL_InterruptStruct.Latch_Request = LIS302DL_INTERRUPTREQUEST_LATCHED;
|
||||
LIS302DL_InterruptStruct.SingleClick_Axes = LIS302DL_CLICKINTERRUPT_Z_ENABLE;
|
||||
LIS302DL_InterruptStruct.DoubleClick_Axes = LIS302DL_DOUBLECLICKINTERRUPT_Z_ENABLE;
|
||||
LIS302DL_InterruptConfig(&LIS302DL_InterruptStruct);
|
||||
|
||||
/* Configure Interrupt control register: enable Click interrupt on INT1 and
|
||||
INT2 on Z axis high event */
|
||||
ctrl = 0x3F;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CTRL_REG3_ADDR, 1);
|
||||
|
||||
/* Enable Interrupt generation on click on Z axis */
|
||||
ctrl = 0x50;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_CFG_REG_ADDR, 1);
|
||||
|
||||
/* Configure Click Threshold on X/Y axis (10 x 0.5g) */
|
||||
ctrl = 0xAA;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_THSY_X_REG_ADDR, 1);
|
||||
|
||||
/* Configure Click Threshold on Z axis (10 x 0.5g) */
|
||||
ctrl = 0x0A;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_THSZ_REG_ADDR, 1);
|
||||
|
||||
/* Enable interrupt on Y axis high event */
|
||||
ctrl = 0x4C;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_FF_WU_CFG1_REG_ADDR, 1);
|
||||
|
||||
/* Configure Time Limit */
|
||||
ctrl = 0x03;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_TIMELIMIT_REG_ADDR, 1);
|
||||
|
||||
/* Configure Latency */
|
||||
ctrl = 0x7F;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_LATENCY_REG_ADDR, 1);
|
||||
|
||||
/* Configure Click Window */
|
||||
ctrl = 0x7F;
|
||||
ACCELERO_IO_Write(&ctrl, LIS302DL_CLICK_WINDOW_REG_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear LIS302DL click Interrupt
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_Click_IntClear(void)
|
||||
{
|
||||
uint8_t buffer[6], clickreg = 0;
|
||||
|
||||
/* Read click and status registers if the available MEMS Accelerometer is LIS302DL */
|
||||
ACCELERO_IO_Read(&clickreg, LIS302DL_CLICK_SRC_REG_ADDR, 1);
|
||||
ACCELERO_IO_Read(buffer, LIS302DL_STATUS_REG_ADDR, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change the lowpower mode for LIS302DL
|
||||
* @param LowPowerMode: New state for the low power mode.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS302DL_LOWPOWERMODE_POWERDOWN: Power down mode
|
||||
* @arg LIS302DL_LOWPOWERMODE_ACTIVE: Active mode
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_LowpowerCmd(uint8_t LowPowerMode)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG1 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
|
||||
/* Set new low power mode configuration */
|
||||
tmpreg &= (uint8_t)~LIS302DL_LOWPOWERMODE_ACTIVE;
|
||||
tmpreg |= LowPowerMode;
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Data Rate command
|
||||
* @param DataRateValue: Data rate value
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS302DL_DATARATE_100: 100 Hz output data rate
|
||||
* @arg LIS302DL_DATARATE_400: 400 Hz output data rate
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_DataRateCmd(uint8_t DataRateValue)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG1 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
|
||||
/* Set new Data rate configuration */
|
||||
tmpreg &= (uint8_t)~LIS302DL_DATARATE_400;
|
||||
tmpreg |= DataRateValue;
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change the Full Scale of LIS302DL
|
||||
* @param FS_value: new full scale value.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS302DL_FULLSCALE_2_3: +-2.3g
|
||||
* @arg LIS302DL_FULLSCALE_9_2: +-9.2g
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_FullScaleCmd(uint8_t FS_value)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG1 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
|
||||
/* Set new full scale configuration */
|
||||
tmpreg &= (uint8_t)~LIS302DL_FULLSCALE_9_2;
|
||||
tmpreg |= FS_value;
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content of LIS302DL.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_RebootCmd(void)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
/* Read CTRL_REG2 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS302DL_CTRL_REG2_ADDR, 1);
|
||||
|
||||
/* Enable or Disable the reboot memory */
|
||||
tmpreg |= LIS302DL_BOOT_REBOOTMEMORY;
|
||||
|
||||
/* Write value to MEMS CTRL_REG2 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS302DL_CTRL_REG2_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read LIS302DL output register, and calculate the acceleration
|
||||
* ACC[mg]=SENSITIVITY* (out_h*256+out_l)/16 (12 bit rappresentation)
|
||||
* @param pfData: Data out pointer
|
||||
* @retval None
|
||||
*/
|
||||
void LIS302DL_ReadACC(int16_t *pData)
|
||||
{
|
||||
int8_t buffer[6];
|
||||
int16_t pnRawData[3];
|
||||
uint8_t sensitivity = LIS302DL_SENSITIVITY_2_3G;
|
||||
uint8_t crtl, i = 0x00;
|
||||
|
||||
ACCELERO_IO_Read(&crtl, LIS302DL_CTRL_REG1_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)buffer, LIS302DL_OUT_X_ADDR, 6);
|
||||
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pnRawData[i] = buffer[2*i];
|
||||
}
|
||||
|
||||
switch(crtl & LIS302DL_FULLSCALE_9_2)
|
||||
{
|
||||
/* FS bit = 0 ==> Sensitivity typical value = 18milligals/digit*/
|
||||
case LIS302DL_FULLSCALE_2_3:
|
||||
sensitivity = LIS302DL_SENSITIVITY_2_3G;
|
||||
break;
|
||||
|
||||
/* FS bit = 1 ==> Sensitivity typical value = 72milligals/digit*/
|
||||
case LIS302DL_FULLSCALE_9_2:
|
||||
sensitivity = LIS302DL_SENSITIVITY_9_2G;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Obtain the mg value for the three axis */
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pData[i]=(pnRawData[i] * sensitivity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
720
2P-ProjectPong/Drivers/BSP/Components/lis302dl/lis302dl.h
Normal file
720
2P-ProjectPong/Drivers/BSP/Components/lis302dl/lis302dl.h
Normal file
@ -0,0 +1,720 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lis302dl.h
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 03-August-2015
|
||||
* @brief This file contains all the functions prototypes for the lis302dl.c
|
||||
* firmware driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LIS302DL_H
|
||||
#define __LIS302DL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/accelero.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LIS302DL
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LIS302DL_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/* LIS302DL struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Power_Mode; /* Power-down/Active Mode */
|
||||
uint8_t Output_DataRate; /* OUT data rate 100 Hz / 400 Hz */
|
||||
uint8_t Axes_Enable; /* Axes enable */
|
||||
uint8_t Full_Scale; /* Full scale */
|
||||
uint8_t Self_Test; /* Self test */
|
||||
}LIS302DL_InitTypeDef;
|
||||
|
||||
/* Interrupt struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Latch_Request; /* Latch interrupt request into CLICK_SRC register*/
|
||||
uint8_t SingleClick_Axes; /* Single Click Axes Interrupts */
|
||||
uint8_t DoubleClick_Axes; /* Double Click Axes Interrupts */
|
||||
}LIS302DL_InterruptConfigTypeDef;
|
||||
|
||||
/* High Pass Filter struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t HighPassFilter_Data_Selection; /* Internal filter bypassed or data from internal filter send to output register*/
|
||||
uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
|
||||
uint8_t HighPassFilter_Interrupt; /* High pass filter enabled for Freefall/WakeUp #1 or #2 */
|
||||
}LIS302DL_FilterConfigTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** START REGISTER MAPPING **************************/
|
||||
/******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* WHO_AM_I Register: Device Identification Register
|
||||
* Read only register
|
||||
* Default value: 0x3B
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_WHO_AM_I_ADDR 0x0F
|
||||
|
||||
/*******************************************************************************
|
||||
* CTRL_REG1 Register: Control Register 1
|
||||
* Read Write register
|
||||
* Default value: 0x07
|
||||
* 7 DR: Data Rate selection.
|
||||
* 0 - 100 Hz output data rate
|
||||
* 1 - 400 Hz output data rate
|
||||
* 6 PD: Power Down control.
|
||||
* 0 - power down mode
|
||||
* 1 - active mode
|
||||
* 5 FS: Full Scale selection.
|
||||
* 0 - Typical measurement range 2.3
|
||||
* 1 - Typical measurement range 9.2
|
||||
* 4:3 STP-STM Self Test Enable:
|
||||
* STP | STM | mode
|
||||
* ----------------------------
|
||||
* 0 | 0 | Normal mode
|
||||
* 0 | 1 | Self Test M
|
||||
* 1 | 0 | Self Test P
|
||||
* 2 Zen: Z axis enable.
|
||||
* 0 - Z axis disabled
|
||||
* 1- Z axis enabled
|
||||
* 1 Yen: Y axis enable.
|
||||
* 0 - Y axis disabled
|
||||
* 1- Y axis enabled
|
||||
* 0 Xen: X axis enable.
|
||||
* 0 - X axis disabled
|
||||
* 1- X axis enabled
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CTRL_REG1_ADDR 0x20
|
||||
|
||||
/*******************************************************************************
|
||||
* CTRL_REG2 Regsiter: Control Register 2
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7 SIM: SPI Serial Interface Mode Selection.
|
||||
* 0 - 4 wire interface
|
||||
* 1 - 3 wire interface
|
||||
* 6 BOOT: Reboot memory content
|
||||
* 0 - normal mode
|
||||
* 1 - reboot memory content
|
||||
* 5 Reserved
|
||||
* 4 FDS: Filtered data selection.
|
||||
* 0 - internal filter bypassed
|
||||
* 1 - data from internal filter sent to output register
|
||||
* 3 HP FF_WU2: High pass filter enabled for FreeFall/WakeUp#2.
|
||||
* 0 - filter bypassed
|
||||
* 1 - filter enabled
|
||||
* 2 HP FF_WU1: High pass filter enabled for FreeFall/WakeUp#1.
|
||||
* 0 - filter bypassed
|
||||
* 1 - filter enabled
|
||||
* 1:0 HP coeff2-HP coeff1 High pass filter cut-off frequency (ft) configuration.
|
||||
* ft= ODR[hz]/6*HP coeff
|
||||
* HP coeff2 | HP coeff1 | HP coeff
|
||||
* -------------------------------------------
|
||||
* 0 | 0 | 8
|
||||
* 0 | 1 | 16
|
||||
* 1 | 0 | 32
|
||||
* 1 | 1 | 64
|
||||
* HP coeff | ft[hz] | ft[hz] |
|
||||
* |ODR 100Hz | ODR 400Hz |
|
||||
* --------------------------------------------
|
||||
* 00 | 2 | 8 |
|
||||
* 01 | 1 | 4 |
|
||||
* 10 | 0.5 | 2 |
|
||||
* 11 | 0.25 | 1 |
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CTRL_REG2_ADDR 0x21
|
||||
|
||||
/*******************************************************************************
|
||||
* CTRL_REG3 Register: Interrupt Control Register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7 IHL active: Interrupt active high/low.
|
||||
* 0 - active high
|
||||
* 1 - active low
|
||||
* 6 PP_OD: push-pull/open-drain.
|
||||
* 0 - push-pull
|
||||
* 1 - open-drain
|
||||
* 5:3 I2_CFG2 - I2_CFG0 Data signal on INT2 pad control bits
|
||||
* 2:0 I1_CFG2 - I1_CFG0 Data signal on INT1 pad control bits
|
||||
* I1(2)_CFG2 | I1(2)_CFG1 | I1(2)_CFG0 | INT1(2) Pad
|
||||
* ----------------------------------------------------------
|
||||
* 0 | 0 | 0 | GND
|
||||
* 0 | 0 | 1 | FreeFall/WakeUp#1
|
||||
* 0 | 1 | 0 | FreeFall/WakeUp#2
|
||||
* 0 | 1 | 1 | FreeFall/WakeUp#1 or FreeFall/WakeUp#2
|
||||
* 1 | 0 | 0 | Data ready
|
||||
* 1 | 1 | 1 | Click interrupt
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CTRL_REG3_ADDR 0x22
|
||||
|
||||
/*******************************************************************************
|
||||
* HP_FILTER_RESET Register: Dummy register. Reading at this address zeroes
|
||||
* instantaneously the content of the internal high pass filter. If the high pass
|
||||
* filter is enabled all three axes are instantaneously set to 0g.
|
||||
* This allows to overcome the settling time of the high pass filter.
|
||||
* Read only register
|
||||
* Default value: Dummy
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_HP_FILTER_RESET_REG_ADDR 0x23
|
||||
|
||||
/*******************************************************************************
|
||||
* STATUS_REG Register: Status Register
|
||||
* Default value: 0x00
|
||||
* 7 ZYXOR: X, Y and Z axis data overrun.
|
||||
* 0: no overrun has occurred
|
||||
* 1: new data has overwritten the previous one before it was read
|
||||
* 6 ZOR: Z axis data overrun.
|
||||
* 0: no overrun has occurred
|
||||
* 1: new data for Z-axis has overwritten the previous one before it was read
|
||||
* 5 yOR: y axis data overrun.
|
||||
* 0: no overrun has occurred
|
||||
* 1: new data for y-axis has overwritten the previous one before it was read
|
||||
* 4 XOR: X axis data overrun.
|
||||
* 0: no overrun has occurred
|
||||
* 1: new data for X-axis has overwritten the previous one before it was read
|
||||
* 3 ZYXDA: X, Y and Z axis new data available
|
||||
* 0: a new set of data is not yet available
|
||||
* 1: a new set of data is available
|
||||
* 2 ZDA: Z axis new data available.
|
||||
* 0: a new set of data is not yet available
|
||||
* 1: a new data for Z axis is available
|
||||
* 1 YDA: Y axis new data available
|
||||
* 0: a new set of data is not yet available
|
||||
* 1: a new data for Y axis is available
|
||||
* 0 XDA: X axis new data available
|
||||
* 0: a new set of data is not yet available
|
||||
* 1: a new data for X axis is available
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_STATUS_REG_ADDR 0x27
|
||||
|
||||
/*******************************************************************************
|
||||
* OUT_X Register: X-axis output Data
|
||||
* Read only register
|
||||
* Default value: output
|
||||
* 7:0 XD7-XD0: X-axis output Data
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_OUT_X_ADDR 0x29
|
||||
|
||||
/*******************************************************************************
|
||||
* OUT_Y Register: Y-axis output Data
|
||||
* Read only register
|
||||
* Default value: output
|
||||
* 7:0 YD7-YD0: Y-axis output Data
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_OUT_Y_ADDR 0x2B
|
||||
|
||||
/*******************************************************************************
|
||||
* OUT_Z Register: Z-axis output Data
|
||||
* Read only register
|
||||
* Default value: output
|
||||
* 7:0 ZD7-ZD0: Z-axis output Data
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_OUT_Z_ADDR 0x2D
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WW_CFG_1 Register: Configuration register for Interrupt 1 source.
|
||||
* Read write register
|
||||
* Default value: 0x00
|
||||
* 7 AOI: AND/OR combination of Interrupt events.
|
||||
* 0: OR combination of interrupt events
|
||||
* 1: AND combination of interrupt events
|
||||
* 6 LIR: Latch/not latch interrupt request
|
||||
* 0: interrupt request not latched
|
||||
* 1: interrupt request latched
|
||||
* 5 ZHIE: Enable interrupt generation on Z high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 4 ZLIE: Enable interrupt generation on Z low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
* 3 YHIE: Enable interrupt generation on Y high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 2 YLIE: Enable interrupt generation on Y low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
* 1 XHIE: Enable interrupt generation on X high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 0 XLIE: Enable interrupt generation on X low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_CFG1_REG_ADDR 0x30
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_SRC_1 Register: Interrupt 1 source register.
|
||||
* Reading at this address clears FF_WU_SRC_1 register and the FF, WU 1 interrupt
|
||||
* and allow the refreshment of data in the FF_WU_SRC_1 register if the latched option
|
||||
* was chosen.
|
||||
* Read only register
|
||||
* Default value: 0x00
|
||||
* 7 Reserved
|
||||
* 6 IA: Interrupt active.
|
||||
* 0: no interrupt has been generated
|
||||
* 1: one or more interrupts have been generated
|
||||
* 5 ZH: Z high.
|
||||
* 0: no interrupt
|
||||
* 1: ZH event has occurred
|
||||
* 4 ZL: Z low.
|
||||
* 0: no interrupt
|
||||
* 1: ZL event has occurred
|
||||
* 3 YH: Y high.
|
||||
* 0: no interrupt
|
||||
* 1: YH event has occurred
|
||||
* 2 YL: Y low.
|
||||
* 0: no interrupt
|
||||
* 1: YL event has occurred
|
||||
* 1 YH: X high.
|
||||
* 0: no interrupt
|
||||
* 1: XH event has occurred
|
||||
* 0 YL: X low.
|
||||
* 0: no interrupt
|
||||
* 1: XL event has occurred
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_SRC1_REG_ADDR 0x31
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_THS_1 Register: Threshold register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7 DCRM: Reset mode selection.
|
||||
* 0 - counter resetted
|
||||
* 1 - counter decremented
|
||||
* 6 THS6-THS0: Free-fall/wake-up threshold value.
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_THS1_REG_ADDR 0x32
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_DURATION_1 Register: duration Register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:0 D7-D0 Duration value. (Duration steps and maximum values depend on the ODR chosen)
|
||||
******************************************************************************/
|
||||
#define LIS302DL_FF_WU_DURATION1_REG_ADDR 0x33
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WW_CFG_2 Register: Configuration register for Interrupt 2 source.
|
||||
* Read write register
|
||||
* Default value: 0x00
|
||||
* 7 AOI: AND/OR combination of Interrupt events.
|
||||
* 0: OR combination of interrupt events
|
||||
* 1: AND combination of interrupt events
|
||||
* 6 LIR: Latch/not latch interrupt request
|
||||
* 0: interrupt request not latched
|
||||
* 1: interrupt request latched
|
||||
* 5 ZHIE: Enable interrupt generation on Z high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 4 ZLIE: Enable interrupt generation on Z low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
* 3 YHIE: Enable interrupt generation on Y high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 2 YLIE: Enable interrupt generation on Y low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
* 1 XHIE: Enable interrupt generation on X high event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value higher than preset threshold
|
||||
* 0 XLIE: Enable interrupt generation on X low event.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request on measured accel. value lower than preset threshold
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_CFG2_REG_ADDR 0x34
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_SRC_2 Register: Interrupt 2 source register.
|
||||
* Reading at this address clears FF_WU_SRC_2 register and the FF, WU 2 interrupt
|
||||
* and allow the refreshment of data in the FF_WU_SRC_2 register if the latched option
|
||||
* was chosen.
|
||||
* Read only register
|
||||
* Default value: 0x00
|
||||
* 7 Reserved
|
||||
* 6 IA: Interrupt active.
|
||||
* 0: no interrupt has been generated
|
||||
* 1: one or more interrupts have been generated
|
||||
* 5 ZH: Z high.
|
||||
* 0: no interrupt
|
||||
* 1: ZH event has occurred
|
||||
* 4 ZL: Z low.
|
||||
* 0: no interrupt
|
||||
* 1: ZL event has occurred
|
||||
* 3 YH: Y high.
|
||||
* 0: no interrupt
|
||||
* 1: YH event has occurred
|
||||
* 2 YL: Y low.
|
||||
* 0: no interrupt
|
||||
* 1: YL event has occurred
|
||||
* 1 YH: X high.
|
||||
* 0: no interrupt
|
||||
* 1: XH event has occurred
|
||||
* 0 YL: X low.
|
||||
* 0: no interrupt
|
||||
* 1: XL event has occurred
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_SRC2_REG_ADDR 0x35
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_THS_2 Register: Threshold register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7 DCRM: Reset mode selection.
|
||||
* 0 - counter resetted
|
||||
* 1 - counter decremented
|
||||
* 6 THS6-THS0: Free-fall/wake-up threshold value.
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_FF_WU_THS2_REG_ADDR 0x36
|
||||
|
||||
/*******************************************************************************
|
||||
* FF_WU_DURATION_2 Register: duration Register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:0 D7-D0 Duration value. (Duration steps and maximum values depend on the ODR chosen)
|
||||
******************************************************************************/
|
||||
#define LIS302DL_FF_WU_DURATION2_REG_ADDR 0x37
|
||||
|
||||
/******************************************************************************
|
||||
* CLICK_CFG Register: click Register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7 Reserved
|
||||
* 6 LIR: Latch Interrupt request.
|
||||
* 0: interrupt request not latched
|
||||
* 1: interrupt request latched
|
||||
* 5 Double_Z: Enable interrupt generation on double click event on Z axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
* 4 Single_Z: Enable interrupt generation on single click event on Z axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
* 3 Double_Y: Enable interrupt generation on double click event on Y axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
* 2 Single_Y: Enable interrupt generation on single click event on Y axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
* 1 Double_X: Enable interrupt generation on double click event on X axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
* 0 Single_y: Enable interrupt generation on single click event on X axis.
|
||||
* 0: disable interrupt request
|
||||
* 1: enable interrupt request
|
||||
******************************************************************************/
|
||||
#define LIS302DL_CLICK_CFG_REG_ADDR 0x38
|
||||
|
||||
/******************************************************************************
|
||||
* CLICK_SRC Register: click status Register
|
||||
* Read only register
|
||||
* Default value: 0x00
|
||||
* 7 Reserved
|
||||
* 6 IA: Interrupt active.
|
||||
* 0: no interrupt has been generated
|
||||
* 1: one or more interrupts have been generated
|
||||
* 5 Double_Z: Double click on Z axis event.
|
||||
* 0: no interrupt
|
||||
* 1: Double Z event has occurred
|
||||
* 4 Single_Z: Z low.
|
||||
* 0: no interrupt
|
||||
* 1: Single Z event has occurred
|
||||
* 3 Double_Y: Y high.
|
||||
* 0: no interrupt
|
||||
* 1: Double Y event has occurred
|
||||
* 2 Single_Y: Y low.
|
||||
* 0: no interrupt
|
||||
* 1: Single Y event has occurred
|
||||
* 1 Double_X: X high.
|
||||
* 0: no interrupt
|
||||
* 1: Double X event has occurred
|
||||
* 0 Single_X: X low.
|
||||
* 0: no interrupt
|
||||
* 1: Single X event has occurred
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_SRC_REG_ADDR 0x39
|
||||
|
||||
/*******************************************************************************
|
||||
* CLICK_THSY_X Register: Click threshold Y and X register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:4 THSy3-THSy0: Click threshold on Y axis, step 0.5g
|
||||
* 3:0 THSx3-THSx0: Click threshold on X axis, step 0.5g
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_THSY_X_REG_ADDR 0x3B
|
||||
|
||||
/*******************************************************************************
|
||||
* CLICK_THSZ Register: Click threshold Z register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:4 Reserved
|
||||
* 3:0 THSz3-THSz0: Click threshold on Z axis, step 0.5g
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_THSZ_REG_ADDR 0x3C
|
||||
|
||||
/*******************************************************************************
|
||||
* CLICK_TimeLimit Register: Time Limit register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:0 Dur7-Dur0: Time Limit value, step 0.5g
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_TIMELIMIT_REG_ADDR 0x3D
|
||||
|
||||
/*******************************************************************************
|
||||
* CLICK_Latency Register: Latency register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:0 Lat7-Lat0: Latency value, step 1msec
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_LATENCY_REG_ADDR 0x3E
|
||||
|
||||
/*******************************************************************************
|
||||
* CLICK_Window Register: Window register
|
||||
* Read Write register
|
||||
* Default value: 0x00
|
||||
* 7:0 Win7-Win0: Window value, step 1msec
|
||||
*******************************************************************************/
|
||||
#define LIS302DL_CLICK_WINDOW_REG_ADDR 0x3F
|
||||
|
||||
/******************************************************************************/
|
||||
/**************************** END REGISTER MAPPING ***************************/
|
||||
/******************************************************************************/
|
||||
#define I_AM_LIS302DL 0x3B
|
||||
|
||||
#define LIS302DL_SENSITIVITY_2_3G 18 /* 18 mg/digit*/
|
||||
#define LIS302DL_SENSITIVITY_9_2G 72 /* 72 mg/digit*/
|
||||
|
||||
/** @defgroup Data_Rate_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_DATARATE_100 ((uint8_t)0x00)
|
||||
#define LIS302DL_DATARATE_400 ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Power_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_LOWPOWERMODE_POWERDOWN ((uint8_t)0x00)
|
||||
#define LIS302DL_LOWPOWERMODE_ACTIVE ((uint8_t)0x40)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Full_Scale_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_FULLSCALE_2_3 ((uint8_t)0x00)
|
||||
#define LIS302DL_FULLSCALE_9_2 ((uint8_t)0x20)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Self_Test_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_SELFTEST_NORMAL ((uint8_t)0x00)
|
||||
#define LIS302DL_SELFTEST_P ((uint8_t)0x10)
|
||||
#define LIS302DL_SELFTEST_M ((uint8_t)0x08)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Direction_XYZ_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_X_ENABLE ((uint8_t)0x01)
|
||||
#define LIS302DL_Y_ENABLE ((uint8_t)0x02)
|
||||
#define LIS302DL_Z_ENABLE ((uint8_t)0x04)
|
||||
#define LIS302DL_XYZ_ENABLE ((uint8_t)0x07)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup SPI_Serial_Interface_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_SERIALINTERFACE_4WIRE ((uint8_t)0x00)
|
||||
#define LIS302DL_SERIALINTERFACE_3WIRE ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Boot_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_BOOT_NORMALMODE ((uint8_t)0x00)
|
||||
#define LIS302DL_BOOT_REBOOTMEMORY ((uint8_t)0x40)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Filtered_Data_Selection_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_FILTEREDDATASELECTION_BYPASSED ((uint8_t)0x00)
|
||||
#define LIS302DL_FILTEREDDATASELECTION_OUTPUTREGISTER ((uint8_t)0x20)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup High_Pass_Filter_Interrupt_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_HIGHPASSFILTERINTERRUPT_OFF ((uint8_t)0x00)
|
||||
#define LIS302DL_HIGHPASSFILTERINTERRUPT_1 ((uint8_t)0x04)
|
||||
#define LIS302DL_HIGHPASSFILTERINTERRUPT_2 ((uint8_t)0x08)
|
||||
#define LIS302DL_HIGHPASSFILTERINTERRUPT_1_2 ((uint8_t)0x0C)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup High_Pass_Filter_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_HIGHPASSFILTER_LEVEL_0 ((uint8_t)0x00)
|
||||
#define LIS302DL_HIGHPASSFILTER_LEVEL_1 ((uint8_t)0x01)
|
||||
#define LIS302DL_HIGHPASSFILTER_LEVEL_2 ((uint8_t)0x02)
|
||||
#define LIS302DL_HIGHPASSFILTER_LEVEL_3 ((uint8_t)0x03)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup latch_Interrupt_Request_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_INTERRUPTREQUEST_NOTLATCHED ((uint8_t)0x00)
|
||||
#define LIS302DL_INTERRUPTREQUEST_LATCHED ((uint8_t)0x40)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Click_Interrupt_XYZ_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_CLICKINTERRUPT_XYZ_DISABLE ((uint8_t)0x00)
|
||||
#define LIS302DL_CLICKINTERRUPT_X_ENABLE ((uint8_t)0x01)
|
||||
#define LIS302DL_CLICKINTERRUPT_Y_ENABLE ((uint8_t)0x04)
|
||||
#define LIS302DL_CLICKINTERRUPT_Z_ENABLE ((uint8_t)0x10)
|
||||
#define LIS302DL_CLICKINTERRUPT_XYZ_ENABLE ((uint8_t)0x15)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Double_Click_Interrupt_XYZ_selection
|
||||
* @{
|
||||
*/
|
||||
#define LIS302DL_DOUBLECLICKINTERRUPT_XYZ_DISABLE ((uint8_t)0x00)
|
||||
#define LIS302DL_DOUBLECLICKINTERRUPT_X_ENABLE ((uint8_t)0x02)
|
||||
#define LIS302DL_DOUBLECLICKINTERRUPT_Y_ENABLE ((uint8_t)0x08)
|
||||
#define LIS302DL_DOUBLECLICKINTERRUPT_Z_ENABLE ((uint8_t)0x20)
|
||||
#define LIS302DL_DOUBLECLICKINTERRUPT_XYZ_ENABLE ((uint8_t)0x2A)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS302DL_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void LIS302DL_Init(uint16_t InitStruct);
|
||||
void LIS302DL_DeInit(void);
|
||||
uint8_t LIS302DL_ReadID(void);
|
||||
void LIS302DL_FilterConfig(uint8_t FilterStruct);
|
||||
void LIS302DL_InterruptConfig(LIS302DL_InterruptConfigTypeDef *LIS302DL_IntConfigStruct);
|
||||
void LIS302DL_Click_IntConfig(void);
|
||||
void LIS302DL_Click_IntClear(void);
|
||||
void LIS302DL_LowpowerCmd(uint8_t LowPowerMode);
|
||||
void LIS302DL_FullScaleCmd(uint8_t FS_value);
|
||||
void LIS302DL_DataRateCmd(uint8_t DataRateValue);
|
||||
void LIS302DL_RebootCmd(void);
|
||||
void LIS302DL_ReadACC(int16_t *pData);
|
||||
|
||||
/* Accelerometer driver structure */
|
||||
extern ACCELERO_DrvTypeDef Lis302dlDrv;
|
||||
|
||||
/* Accelerometer IO functions */
|
||||
void ACCELERO_IO_Init(void);
|
||||
void ACCELERO_IO_ITConfig(void);
|
||||
void ACCELERO_IO_Write(uint8_t* pBuffer, uint8_t WriteAddr, uint16_t NumByteToWrite);
|
||||
void ACCELERO_IO_Read(uint8_t* pBuffer, uint8_t ReadAddr, uint16_t NumByteToRead);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LIS302DL_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
514
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/Release_Notes.html
Normal file
514
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/Release_Notes.html
Normal file
@ -0,0 +1,514 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LIS3DSH Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for LIS3DSH Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 03-August-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">lis3dsh.h/c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana; font-size: 10pt;">Add mems accelerometer de-initialization
|
||||
function: LIS3DSH_DeInit()</span></li></ul><ul><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common
|
||||
driver V4.0.0 or later</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">lis3dsh.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 19-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Comments clean up and typo corrections</span></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release</span></li>
|
||||
</ul>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><br><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
431
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/lis3dsh.c
Normal file
431
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/lis3dsh.c
Normal file
@ -0,0 +1,431 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lis3dsh.c
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 03-August-2015
|
||||
* @brief This file provides a set of functions needed to manage the LIS3DSH
|
||||
* MEMS Accelerometer.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lis3dsh.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LIS3DSH
|
||||
* @brief This file includes the motion sensor driver for LIS3DSH motion sensor
|
||||
* devices.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
ACCELERO_DrvTypeDef Lis3dshDrv =
|
||||
{
|
||||
LIS3DSH_Init,
|
||||
LIS3DSH_DeInit,
|
||||
LIS3DSH_ReadID,
|
||||
LIS3DSH_RebootCmd,
|
||||
LIS3DSH_Click_IntConfig,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
LIS3DSH_ReadACC,
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LIS3DSH_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set LIS3DSH Initialization.
|
||||
* @param InitStruct: contains mask of different init parameters
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_Init(uint16_t InitStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Configure the low level interface */
|
||||
ACCELERO_IO_Init();
|
||||
|
||||
/* Configure MEMS: power mode(ODR) and axes enable */
|
||||
ctrl = (uint8_t) (InitStruct);
|
||||
|
||||
/* Write value to MEMS CTRL_REG4 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_CTRL_REG4_ADDR, 1);
|
||||
|
||||
/* Configure MEMS: full scale and self test */
|
||||
ctrl = (uint8_t) (InitStruct >> 8);
|
||||
|
||||
/* Write value to MEMS CTRL_REG5 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_CTRL_REG5_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LIS3DSH De-Initialization.
|
||||
* @param None
|
||||
* @retval None.
|
||||
*/
|
||||
void LIS3DSH_DeInit(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read LIS3DSH device ID.
|
||||
* @param None
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint8_t LIS3DSH_ReadID(void)
|
||||
{
|
||||
uint8_t tmp = 0;
|
||||
|
||||
/* Configure the low level interface */
|
||||
ACCELERO_IO_Init();
|
||||
|
||||
/* Read WHO_AM_I register */
|
||||
ACCELERO_IO_Read(&tmp, LIS3DSH_WHO_AM_I_ADDR, 1);
|
||||
|
||||
/* Return the ID */
|
||||
return (uint16_t)tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LIS3DSH Interrupt configuration
|
||||
* @param LIS3DSH_InterruptConfig_TypeDef: pointer to a LIS3DSH_InterruptConfig_TypeDef
|
||||
* structure that contains the configuration setting for the LIS3DSH Interrupt.
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_InterruptConfig(LIS3DSH_InterruptConfigTypeDef *LIS3DSH_IntConfigStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Configure Interrupt Selection , Request and Signal */
|
||||
ctrl = (uint8_t)(LIS3DSH_IntConfigStruct->Interrupt_Selection_Enable | \
|
||||
LIS3DSH_IntConfigStruct->Interrupt_Request | \
|
||||
LIS3DSH_IntConfigStruct->Interrupt_Signal);
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_CTRL_REG3_ADDR, 1);
|
||||
|
||||
/* Configure State Machine 1 */
|
||||
ctrl = (uint8_t)(LIS3DSH_IntConfigStruct->State_Machine1_Enable | \
|
||||
LIS3DSH_IntConfigStruct->State_Machine1_Interrupt);
|
||||
|
||||
/* Write value to MEMS CTRL_REG1 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_CTRL_REG1_ADDR, 1);
|
||||
|
||||
/* Configure State Machine 2 */
|
||||
ctrl = (uint8_t)(LIS3DSH_IntConfigStruct->State_Machine2_Enable | \
|
||||
LIS3DSH_IntConfigStruct->State_Machine2_Interrupt);
|
||||
|
||||
/* Write value to MEMS CTRL_REG2 register */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_CTRL_REG2_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LIS3DSH for click detection
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_Click_IntConfig(void)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
LIS3DSH_InterruptConfigTypeDef LIS3DSH_InterruptStruct;
|
||||
|
||||
ACCELERO_IO_ITConfig();
|
||||
|
||||
/* Set LIS3DSH Interrupt configuration */
|
||||
LIS3DSH_InterruptStruct.Interrupt_Selection_Enable = LIS3DSH_INTERRUPT_2_ENABLE;
|
||||
LIS3DSH_InterruptStruct.Interrupt_Request = LIS3DSH_INTERRUPT_REQUEST_LATCHED;
|
||||
LIS3DSH_InterruptStruct.Interrupt_Signal = LIS3DSH_INTERRUPT_SIGNAL_HIGH;
|
||||
LIS3DSH_InterruptStruct.State_Machine1_Enable = LIS3DSH_SM_DISABLE;
|
||||
LIS3DSH_InterruptStruct.State_Machine2_Enable = LIS3DSH_SM_ENABLE;
|
||||
LIS3DSH_InterruptStruct.State_Machine2_Interrupt = LIS3DSH_SM_INT1;
|
||||
LIS3DSH_InterruptConfig(&LIS3DSH_InterruptStruct);
|
||||
|
||||
/* Set LIS3DSH State Machines configuration */
|
||||
ctrl=0x03;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_TIM2_1_L_ADDR,1);
|
||||
ctrl=0xC8;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_TIM1_1_L_ADDR,1);
|
||||
ctrl=0x45;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_THRS2_1_ADDR,1);
|
||||
ctrl=0xFC;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_MASK1_A_ADDR,1);
|
||||
ctrl=0xA1;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_SETT1_ADDR,1);
|
||||
ctrl=0x01;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_PR1_ADDR,1);
|
||||
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_SETT2_ADDR,1);
|
||||
|
||||
/* Configure State Machine 2 to detect single click */
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_ST2_1_ADDR,1);
|
||||
ctrl=0x06;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_ST2_2_ADDR,1);
|
||||
ctrl=0x28;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_ST2_3_ADDR,1);
|
||||
ctrl=0x11;
|
||||
ACCELERO_IO_Write(&ctrl, LIS3DSH_ST2_4_ADDR,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change the lowpower mode for LIS3DSH.
|
||||
* @param LowPowerMode: new state for the lowpower mode.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS3DSH_DATARATE_POWERDOWN: Power down mode
|
||||
* @arg LIS3DSH_DATARATE_3_125: Normal mode. ODR: 3.125 Hz
|
||||
* @arg LIS3DSH_DATARATE_6_25: Normal mode. ODR: 6.25 Hz
|
||||
* @arg LIS3DSH_DATARATE_12_5: Normal mode. ODR: 12.5 Hz
|
||||
* @arg LIS3DSH_DATARATE_25: Normal mode. ODR: 25 Hz
|
||||
* @arg LIS3DSH_DATARATE_50: Normal mode. ODR: 50 Hz
|
||||
* @arg LIS3DSH_DATARATE_100: Normal mode. ODR: 100 Hz
|
||||
* @arg LIS3DSH_DATARATE_400: Normal mode. ODR: 400 Hz
|
||||
* @arg LIS3DSH_DATARATE_800: Normal mode. ODR: 800 Hz
|
||||
* @arg LIS3DSH_DATARATE_1600: Normal mode. ODR: 1600 Hz
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_ODR_LowpowerCmd(uint8_t ODR_LowPowerMode)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG4 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS3DSH_CTRL_REG4_ADDR, 1);
|
||||
|
||||
/* Set new low power mode configuration */
|
||||
tmpreg &= (uint8_t)~LIS3DSH_DATARATE_100;
|
||||
tmpreg |= ODR_LowPowerMode;
|
||||
|
||||
/* Write value to MEMS CTRL_REG4 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS3DSH_CTRL_REG4_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Data Rate command.
|
||||
* @param DataRateValue: Data rate value.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS3DSH_DATARATE_3_125: 3.125 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_6_25: 6.25 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_12_5: 12.5 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_25: 25 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_50: 50 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_100: 100 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_400: 400 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_800: 800 Hz output data rate
|
||||
* @arg LIS3DSH_DATARATE_1600: 1600 Hz output data rate
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_DataRateCmd(uint8_t DataRateValue)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG4 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS3DSH_CTRL_REG4_ADDR, 1);
|
||||
|
||||
/* Set new data rate configuration from 100 to 400Hz */
|
||||
tmpreg &= (uint8_t)~LIS3DSH_DATARATE_400;
|
||||
tmpreg |= DataRateValue;
|
||||
|
||||
/* Write value to MEMS CTRL_REG4 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS3DSH_CTRL_REG4_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change the Full Scale of LIS3DSH.
|
||||
* @param FS_value: new full scale value.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LIS3DSH_FULLSCALE_2: +-2g
|
||||
* @arg LIS3DSH_FULLSCALE_4: +-4g
|
||||
* @arg LIS3DSH_FULLSCALE_6: +-6g
|
||||
* @arg LIS3DSH_FULLSCALE_8: +-8g
|
||||
* @arg LIS3DSH_FULLSCALE_16: +-16g
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_FullScaleCmd(uint8_t FS_value)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG5 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS3DSH_CTRL_REG5_ADDR, 1);
|
||||
|
||||
/* Set new full scale configuration */
|
||||
tmpreg &= (uint8_t)~LIS3DSH_FULLSCALE_16;
|
||||
tmpreg |= FS_value;
|
||||
|
||||
/* Write value to MEMS CTRL_REG5 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS3DSH_CTRL_REG5_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content of LIS3DSH.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_RebootCmd(void)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
/* Read CTRL_REG6 register */
|
||||
ACCELERO_IO_Read(&tmpreg, LIS3DSH_CTRL_REG6_ADDR, 1);
|
||||
|
||||
/* Enable or Disable the reboot memory */
|
||||
tmpreg |= LIS3DSH_BOOT_FORCED;
|
||||
|
||||
/* Write value to MEMS CTRL_REG6 register */
|
||||
ACCELERO_IO_Write(&tmpreg, LIS3DSH_CTRL_REG6_ADDR, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read LIS3DSH output register, and calculate the acceleration
|
||||
* ACC[mg]=SENSITIVITY* (out_h*256+out_l)/16 (12 bit representation).
|
||||
* @param pointer on floating buffer.
|
||||
* @retval None
|
||||
*/
|
||||
void LIS3DSH_ReadACC(int16_t *pData)
|
||||
{
|
||||
int8_t buffer[6];
|
||||
uint8_t crtl, i = 0x00;
|
||||
float sensitivity = LIS3DSH_SENSITIVITY_0_06G;
|
||||
float valueinfloat = 0;
|
||||
|
||||
ACCELERO_IO_Read(&crtl, LIS3DSH_CTRL_REG5_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[0], LIS3DSH_OUT_X_L_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[1], LIS3DSH_OUT_X_H_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[2], LIS3DSH_OUT_Y_L_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[3], LIS3DSH_OUT_Y_H_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[4], LIS3DSH_OUT_Z_L_ADDR, 1);
|
||||
ACCELERO_IO_Read((uint8_t*)&buffer[5], LIS3DSH_OUT_Z_H_ADDR, 1);
|
||||
|
||||
switch(crtl & LIS3DSH__FULLSCALE_SELECTION)
|
||||
{
|
||||
/* FS bit = 000 ==> Sensitivity typical value = 0.06milligals/digit */
|
||||
case LIS3DSH_FULLSCALE_2:
|
||||
sensitivity = LIS3DSH_SENSITIVITY_0_06G;
|
||||
break;
|
||||
|
||||
/* FS bit = 001 ==> Sensitivity typical value = 0.12milligals/digit */
|
||||
case LIS3DSH_FULLSCALE_4:
|
||||
sensitivity = LIS3DSH_SENSITIVITY_0_12G;
|
||||
break;
|
||||
|
||||
/* FS bit = 010 ==> Sensitivity typical value = 0.18milligals/digit */
|
||||
case LIS3DSH_FULLSCALE_6:
|
||||
sensitivity = LIS3DSH_SENSITIVITY_0_18G;
|
||||
break;
|
||||
|
||||
/* FS bit = 011 ==> Sensitivity typical value = 0.24milligals/digit */
|
||||
case LIS3DSH_FULLSCALE_8:
|
||||
sensitivity = LIS3DSH_SENSITIVITY_0_24G;
|
||||
break;
|
||||
|
||||
/* FS bit = 100 ==> Sensitivity typical value = 0.73milligals/digit */
|
||||
case LIS3DSH_FULLSCALE_16:
|
||||
sensitivity = LIS3DSH_SENSITIVITY_0_73G;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Obtain the mg value for the three axis */
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
valueinfloat = ((buffer[2*i+1] << 8) + buffer[2*i]) * sensitivity;
|
||||
pData[i] = (int16_t)valueinfloat;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
1255
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/lis3dsh.h
Normal file
1255
2P-ProjectPong/Drivers/BSP/Components/lis3dsh/lis3dsh.h
Normal file
File diff suppressed because it is too large
Load Diff
270
2P-ProjectPong/Drivers/BSP/Components/lps22hb/Release_Notes.html
Normal file
270
2P-ProjectPong/Drivers/BSP/Components/lps22hb/Release_Notes.html
Normal file
@ -0,0 +1,270 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LPS22HB component</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes for LPS22HB component</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2019 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.2
|
||||
/ 11-October-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Rename context type to universal stmdev_ctx_t</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Move unions from PID to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.1
|
||||
/ 18-June-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update license on Release Notes</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.0
|
||||
/ 28-May-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">PID update from ST GitHub</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">HLD update to reflect new PID</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.1.0
|
||||
/ 31-Jan-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update PID files</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add One-Shot support</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.1
|
||||
/ 14-Nov-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Fix issue in multi-byte write for I2C</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.0
|
||||
/ 12-Jul-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Source Code Refactoring according new BSP v2.5 specifications</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0
|
||||
/ 1-May-2017</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Unify driver to have the same files for X-NUCLEO-IKS01Ax and SensorTile</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0
|
||||
/ 12-August-2016</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add support for ReadReg and WriteReg APIs</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 4-April-2016</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First
|
||||
official release</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br>
|
||||
</h2>
|
||||
|
||||
|
||||
<div style="text-align: justify;">
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
</div>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
</body></html>
|
1073
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb.c
Normal file
1073
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb.c
Normal file
File diff suppressed because it is too large
Load Diff
244
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb.h
Normal file
244
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb.h
Normal file
@ -0,0 +1,244 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lps22hb.h
|
||||
* @author MEMS Software Solutions Team
|
||||
* @brief LPS22HB header driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LPS22HB_H
|
||||
#define LPS22HB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lps22hb_reg.h"
|
||||
#include <string.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LPS22HB LPS22HB
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LPS22HB_Exported_Types LPS22HB Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*LPS22HB_Init_Func)(void);
|
||||
typedef int32_t (*LPS22HB_DeInit_Func)(void);
|
||||
typedef int32_t (*LPS22HB_GetTick_Func)(void);
|
||||
typedef int32_t (*LPS22HB_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
typedef int32_t (*LPS22HB_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LPS22HB_Init_Func Init;
|
||||
LPS22HB_DeInit_Func DeInit;
|
||||
uint32_t BusType; /*0 means I2C, 1 means SPI 4-Wires, 2 means SPI-3-Wires */
|
||||
uint8_t Address;
|
||||
LPS22HB_WriteReg_Func WriteReg;
|
||||
LPS22HB_ReadReg_Func ReadReg;
|
||||
LPS22HB_GetTick_Func GetTick;
|
||||
} LPS22HB_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LPS22HB_IO_t IO;
|
||||
stmdev_ctx_t Ctx;
|
||||
uint8_t is_initialized;
|
||||
uint8_t press_is_enabled;
|
||||
uint8_t temp_is_enabled;
|
||||
lps22hb_odr_t last_odr;
|
||||
} LPS22HB_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Temperature;
|
||||
uint8_t Pressure;
|
||||
uint8_t Humidity;
|
||||
uint8_t LowPower;
|
||||
float HumMaxOdr;
|
||||
float TempMaxOdr;
|
||||
float PressMaxOdr;
|
||||
} LPS22HB_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(LPS22HB_Object_t *);
|
||||
int32_t (*DeInit)(LPS22HB_Object_t *);
|
||||
int32_t (*ReadID)(LPS22HB_Object_t *, uint8_t *);
|
||||
int32_t (*GetCapabilities)(LPS22HB_Object_t *, LPS22HB_Capabilities_t *);
|
||||
} LPS22HB_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LPS22HB_Object_t *);
|
||||
int32_t (*Disable)(LPS22HB_Object_t *);
|
||||
int32_t (*GetOutputDataRate)(LPS22HB_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LPS22HB_Object_t *, float);
|
||||
int32_t (*GetTemperature)(LPS22HB_Object_t *, float *);
|
||||
} LPS22HB_TEMP_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LPS22HB_Object_t *);
|
||||
int32_t (*Disable)(LPS22HB_Object_t *);
|
||||
int32_t (*GetOutputDataRate)(LPS22HB_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LPS22HB_Object_t *, float);
|
||||
int32_t (*GetPressure)(LPS22HB_Object_t *, float *);
|
||||
} LPS22HB_PRESS_Drv_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LPS22HB_FIFO_BYPASS_MODE = (uint8_t)0x00, /*!< The FIFO is disabled and empty. The pressure is read directly*/
|
||||
LPS22HB_FIFO_FIFO_MODE = (uint8_t)0x20, /*!< Stops collecting data when full */
|
||||
LPS22HB_FIFO_STREAM_MODE = (uint8_t)0x40, /*!< Keep the newest measurements in the FIFO*/
|
||||
LPS22HB_FIFO_TRIGGER_STREAMTOFIFO_MODE = (uint8_t)0x60, /*!< STREAM MODE until trigger deasserted, then change to FIFO MODE*/
|
||||
LPS22HB_FIFO_TRIGGER_BYPASSTOSTREAM_MODE = (uint8_t)0x80, /*!< BYPASS MODE until trigger deasserted, then STREAM MODE*/
|
||||
LPS22HB_FIFO_TRIGGER_BYPASSTOFIFO_MODE = (uint8_t)0xE0 /*!< BYPASS mode until trigger deasserted, then FIFO MODE*/
|
||||
} LPS22HB_FifoMode;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit[3];
|
||||
uint8_t u8bit[6];
|
||||
} lps22hb_axis3bit16_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit;
|
||||
uint8_t u8bit[2];
|
||||
} lps22hb_axis1bit16_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit[3];
|
||||
uint8_t u8bit[12];
|
||||
} lps22hb_axis3bit32_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit;
|
||||
uint8_t u8bit[4];
|
||||
} lps22hb_axis1bit32_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LPS22HB_Exported_Constants LPS22HB Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LPS22HB_OK 0
|
||||
#define LPS22HB_ERROR -1
|
||||
|
||||
#define LPS22HB_I2C_BUS 0U
|
||||
#define LPS22HB_SPI_4WIRES_BUS 1U
|
||||
#define LPS22HB_SPI_3WIRES_BUS 2U
|
||||
|
||||
#define LPS22HB_FIFO_FULL (uint8_t)0x20
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup LPS22HB_Exported_Functions LPS22HB Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t LPS22HB_RegisterBusIO(LPS22HB_Object_t *pObj, LPS22HB_IO_t *pIO);
|
||||
int32_t LPS22HB_Init(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_DeInit(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_ReadID(LPS22HB_Object_t *pObj, uint8_t *Id);
|
||||
int32_t LPS22HB_GetCapabilities(LPS22HB_Object_t *pObj, LPS22HB_Capabilities_t *Capabilities);
|
||||
int32_t LPS22HB_Get_Init_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t LPS22HB_PRESS_Enable(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_PRESS_Disable(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_PRESS_GetOutputDataRate(LPS22HB_Object_t *pObj, float *Odr);
|
||||
int32_t LPS22HB_PRESS_SetOutputDataRate(LPS22HB_Object_t *pObj, float Odr);
|
||||
int32_t LPS22HB_PRESS_GetPressure(LPS22HB_Object_t *pObj, float *Value);
|
||||
int32_t LPS22HB_PRESS_Get_DRDY_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LPS22HB_PRESS_Get_FThStatus(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t LPS22HB_TEMP_Enable(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_TEMP_Disable(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_TEMP_GetOutputDataRate(LPS22HB_Object_t *pObj, float *Odr);
|
||||
int32_t LPS22HB_TEMP_SetOutputDataRate(LPS22HB_Object_t *pObj, float Odr);
|
||||
int32_t LPS22HB_TEMP_GetTemperature(LPS22HB_Object_t *pObj, float *Value);
|
||||
int32_t LPS22HB_TEMP_Get_DRDY_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
int32_t LPS22HB_FIFO_Get_Data(LPS22HB_Object_t *pObj, float *Press, float *Temp);
|
||||
int32_t LPS22HB_FIFO_Get_FTh_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LPS22HB_FIFO_Get_Full_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LPS22HB_FIFO_Get_Level(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LPS22HB_FIFO_Get_Ovr_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LPS22HB_FIFO_Reset_Interrupt(LPS22HB_Object_t *pObj, uint8_t interrupt);
|
||||
int32_t LPS22HB_FIFO_Set_Interrupt(LPS22HB_Object_t *pObj, uint8_t interrupt);
|
||||
int32_t LPS22HB_FIFO_Set_Mode(LPS22HB_Object_t *pObj, uint8_t Mode);
|
||||
int32_t LPS22HB_FIFO_Set_Watermark_Level(LPS22HB_Object_t *pObj, uint8_t Watermark);
|
||||
int32_t LPS22HB_FIFO_Usage(LPS22HB_Object_t *pObj, uint8_t Status);
|
||||
|
||||
|
||||
int32_t LPS22HB_Read_Reg(LPS22HB_Object_t *pObj, uint8_t reg, uint8_t *Data);
|
||||
int32_t LPS22HB_Write_Reg(LPS22HB_Object_t *pObj, uint8_t reg, uint8_t Data);
|
||||
|
||||
int32_t LPS22HB_Get_Press(LPS22HB_Object_t *pObj, float *Data);
|
||||
int32_t LPS22HB_Get_Temp(LPS22HB_Object_t *pObj, float *Data);
|
||||
|
||||
int32_t LPS22HB_Set_One_Shot(LPS22HB_Object_t *pObj);
|
||||
int32_t LPS22HB_Get_One_Shot_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup LPS22HB_Exported_Variables LPS22HB Exported Variables
|
||||
* @{
|
||||
*/
|
||||
extern LPS22HB_CommonDrv_t LPS22HB_COMMON_Driver;
|
||||
extern LPS22HB_PRESS_Drv_t LPS22HB_PRESS_Driver;
|
||||
extern LPS22HB_TEMP_Drv_t LPS22HB_TEMP_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
1848
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb_reg.c
Normal file
1848
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb_reg.c
Normal file
File diff suppressed because it is too large
Load Diff
475
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb_reg.h
Normal file
475
2P-ProjectPong/Drivers/BSP/Components/lps22hb/lps22hb_reg.h
Normal file
@ -0,0 +1,475 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* @file lps22hb_reg.h
|
||||
* @author Sensors Software Solution Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* lps22hb_reg.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LPS22HB_REGS_H
|
||||
#define LPS22HB_REGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
/** @addtogroup LPS22HB
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** @defgroup STMicroelectronics sensors common types
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEMS_SHARED_TYPES
|
||||
#define MEMS_SHARED_TYPES
|
||||
|
||||
typedef struct{
|
||||
uint8_t bit0 : 1;
|
||||
uint8_t bit1 : 1;
|
||||
uint8_t bit2 : 1;
|
||||
uint8_t bit3 : 1;
|
||||
uint8_t bit4 : 1;
|
||||
uint8_t bit5 : 1;
|
||||
uint8_t bit6 : 1;
|
||||
uint8_t bit7 : 1;
|
||||
} bitwise_t;
|
||||
|
||||
#define PROPERTY_DISABLE (0U)
|
||||
#define PROPERTY_ENABLE (1U)
|
||||
|
||||
/** @addtogroup Interfaces_Functions
|
||||
* @brief This section provide a set of functions used to read and
|
||||
* write a generic register of the device.
|
||||
* MANDATORY: return 0 -> no Error.
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*stmdev_read_ptr) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct {
|
||||
/** Component mandatory fields **/
|
||||
stmdev_write_ptr write_reg;
|
||||
stmdev_read_ptr read_reg;
|
||||
/** Customizable optional pointer **/
|
||||
void *handle;
|
||||
} stmdev_ctx_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_SHARED_TYPES */
|
||||
|
||||
#ifndef MEMS_UCF_SHARED_TYPES
|
||||
#define MEMS_UCF_SHARED_TYPES
|
||||
|
||||
/** @defgroup Generic address-data structure definition
|
||||
* @brief This structure is useful to load a predefined configuration
|
||||
* of a sensor.
|
||||
* You can create a sensor configuration by your own or using
|
||||
* Unico / Unicleo tools available on STMicroelectronics
|
||||
* web site.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t address;
|
||||
uint8_t data;
|
||||
} ucf_line_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_UCF_SHARED_TYPES */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LSM9DS1_Infos
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** I2C Device Address 8 bit format: if SA0=0 -> 0xB9 if SA0=1 -> 0xBB **/
|
||||
#define LPS22HB_I2C_ADD_H 0xBBU
|
||||
#define LPS22HB_I2C_ADD_L 0xB9U
|
||||
|
||||
/** Device Identification (Who am I) **/
|
||||
#define LPS22HB_ID 0xB1U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#define LPS22HB_INTERRUPT_CFG 0x0BU
|
||||
typedef struct {
|
||||
uint8_t pe : 2; /* ple + phe -> pe */
|
||||
uint8_t lir : 1;
|
||||
uint8_t diff_en : 1;
|
||||
uint8_t reset_az : 1;
|
||||
uint8_t autozero : 1;
|
||||
uint8_t reset_arp : 1;
|
||||
uint8_t autorifp : 1;
|
||||
} lps22hb_interrupt_cfg_t;
|
||||
|
||||
#define LPS22HB_THS_P_L 0x0CU
|
||||
#define LPS22HB_THS_P_H 0x0DU
|
||||
#define LPS22HB_WHO_AM_I 0x0FU
|
||||
#define LPS22HB_CTRL_REG1 0x10U
|
||||
typedef struct {
|
||||
uint8_t sim : 1;
|
||||
uint8_t bdu : 1;
|
||||
uint8_t lpfp : 2; /* en_lpfp + lpfp_cfg -> lpfp */
|
||||
uint8_t odr : 3;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lps22hb_ctrl_reg1_t;
|
||||
|
||||
#define LPS22HB_CTRL_REG2 0x11U
|
||||
typedef struct {
|
||||
uint8_t one_shot : 1;
|
||||
uint8_t not_used_01 : 1;
|
||||
uint8_t swreset : 1;
|
||||
uint8_t i2c_dis : 1;
|
||||
uint8_t if_add_inc : 1;
|
||||
uint8_t stop_on_fth : 1;
|
||||
uint8_t fifo_en : 1;
|
||||
uint8_t boot : 1;
|
||||
} lps22hb_ctrl_reg2_t;
|
||||
|
||||
#define LPS22HB_CTRL_REG3 0x12U
|
||||
typedef struct {
|
||||
uint8_t int_s : 2;
|
||||
uint8_t drdy : 1;
|
||||
uint8_t f_ovr : 1;
|
||||
uint8_t f_fth : 1;
|
||||
uint8_t f_fss5 : 1;
|
||||
uint8_t pp_od : 1;
|
||||
uint8_t int_h_l : 1;
|
||||
} lps22hb_ctrl_reg3_t;
|
||||
|
||||
|
||||
#define LPS22HB_FIFO_CTRL 0x14U
|
||||
typedef struct {
|
||||
uint8_t wtm : 5;
|
||||
uint8_t f_mode : 3;
|
||||
} lps22hb_fifo_ctrl_t;
|
||||
|
||||
#define LPS22HB_REF_P_XL 0x15U
|
||||
#define LPS22HB_REF_P_L 0x16U
|
||||
#define LPS22HB_REF_P_H 0x17U
|
||||
#define LPS22HB_RPDS_L 0x18U
|
||||
#define LPS22HB_RPDS_H 0x19U
|
||||
|
||||
#define LPS22HB_RES_CONF 0x1AU
|
||||
typedef struct {
|
||||
uint8_t lc_en : 1;
|
||||
uint8_t not_used_01 : 7;
|
||||
} lps22hb_res_conf_t;
|
||||
|
||||
#define LPS22HB_INT_SOURCE 0x25U
|
||||
typedef struct {
|
||||
uint8_t ph : 1;
|
||||
uint8_t pl : 1;
|
||||
uint8_t ia : 1;
|
||||
uint8_t not_used_01 : 4;
|
||||
uint8_t boot_status : 1;
|
||||
} lps22hb_int_source_t;
|
||||
|
||||
#define LPS22HB_FIFO_STATUS 0x26U
|
||||
typedef struct {
|
||||
uint8_t fss : 6;
|
||||
uint8_t ovr : 1;
|
||||
uint8_t fth_fifo : 1;
|
||||
} lps22hb_fifo_status_t;
|
||||
|
||||
#define LPS22HB_STATUS 0x27U
|
||||
typedef struct {
|
||||
uint8_t p_da : 1;
|
||||
uint8_t t_da : 1;
|
||||
uint8_t not_used_02 : 2;
|
||||
uint8_t p_or : 1;
|
||||
uint8_t t_or : 1;
|
||||
uint8_t not_used_01 : 2;
|
||||
} lps22hb_status_t;
|
||||
|
||||
#define LPS22HB_PRESS_OUT_XL 0x28U
|
||||
#define LPS22HB_PRESS_OUT_L 0x29U
|
||||
#define LPS22HB_PRESS_OUT_H 0x2AU
|
||||
#define LPS22HB_TEMP_OUT_L 0x2BU
|
||||
#define LPS22HB_TEMP_OUT_H 0x2CU
|
||||
#define LPS22HB_LPFP_RES 0x33U
|
||||
|
||||
/**
|
||||
* @defgroup LPS22HB_Register_Union
|
||||
* @brief This union group all the registers that has a bit-field
|
||||
* description.
|
||||
* This union is useful but not need by the driver.
|
||||
*
|
||||
* REMOVING this union you are compliant with:
|
||||
* MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef union{
|
||||
lps22hb_interrupt_cfg_t interrupt_cfg;
|
||||
lps22hb_ctrl_reg1_t ctrl_reg1;
|
||||
lps22hb_ctrl_reg2_t ctrl_reg2;
|
||||
lps22hb_ctrl_reg3_t ctrl_reg3;
|
||||
lps22hb_fifo_ctrl_t fifo_ctrl;
|
||||
lps22hb_res_conf_t res_conf;
|
||||
lps22hb_int_source_t int_source;
|
||||
lps22hb_fifo_status_t fifo_status;
|
||||
lps22hb_status_t status;
|
||||
bitwise_t bitwise;
|
||||
uint8_t byte;
|
||||
} lps22hb_reg_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
int32_t lps22hb_read_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
int32_t lps22hb_write_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
|
||||
extern float_t lps22hb_from_lsb_to_hpa(int32_t lsb);
|
||||
extern float_t lps22hb_from_lsb_to_degc(int16_t lsb);
|
||||
|
||||
int32_t lps22hb_autozero_rst_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_autozero_rst_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_autozero_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_autozero_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_pressure_snap_rst_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_pressure_snap_rst_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_pressure_snap_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_pressure_snap_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_block_data_update_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_block_data_update_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_LPF_ODR_DIV_2 = 0,
|
||||
LPS22HB_LPF_ODR_DIV_9 = 2,
|
||||
LPS22HB_LPF_ODR_DIV_20 = 3,
|
||||
} lps22hb_lpfp_t;
|
||||
int32_t lps22hb_low_pass_filter_mode_set(stmdev_ctx_t *ctx,
|
||||
lps22hb_lpfp_t val);
|
||||
int32_t lps22hb_low_pass_filter_mode_get(stmdev_ctx_t *ctx,
|
||||
lps22hb_lpfp_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_POWER_DOWN = 0,
|
||||
LPS22HB_ODR_1_Hz = 1,
|
||||
LPS22HB_ODR_10_Hz = 2,
|
||||
LPS22HB_ODR_25_Hz = 3,
|
||||
LPS22HB_ODR_50_Hz = 4,
|
||||
LPS22HB_ODR_75_Hz = 5,
|
||||
} lps22hb_odr_t;
|
||||
int32_t lps22hb_data_rate_set(stmdev_ctx_t *ctx, lps22hb_odr_t val);
|
||||
int32_t lps22hb_data_rate_get(stmdev_ctx_t *ctx, lps22hb_odr_t *val);
|
||||
|
||||
int32_t lps22hb_one_shoot_trigger_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_one_shoot_trigger_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_pressure_ref_set(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t lps22hb_pressure_ref_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_pressure_offset_set(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t lps22hb_pressure_offset_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_press_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_temp_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_press_data_ovr_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_temp_data_ovr_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_pressure_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_temperature_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_low_pass_rst_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lps22hb_reset_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_reset_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_boot_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_low_power_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_low_power_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_boot_status_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef struct{
|
||||
lps22hb_fifo_status_t fifo_status;
|
||||
lps22hb_status_t status;
|
||||
} lps22hb_dev_stat_t;
|
||||
int32_t lps22hb_dev_status_get(stmdev_ctx_t *ctx, lps22hb_dev_stat_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_NO_THRESHOLD = 0,
|
||||
LPS22HB_POSITIVE = 1,
|
||||
LPS22HB_NEGATIVE = 2,
|
||||
LPS22HB_BOTH = 3,
|
||||
} lps22hb_pe_t;
|
||||
int32_t lps22hb_sign_of_int_threshold_set(stmdev_ctx_t *ctx,
|
||||
lps22hb_pe_t val);
|
||||
int32_t lps22hb_sign_of_int_threshold_get(stmdev_ctx_t *ctx,
|
||||
lps22hb_pe_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_INT_PULSED = 0,
|
||||
LPS22HB_INT_LATCHED = 1,
|
||||
} lps22hb_lir_t;
|
||||
int32_t lps22hb_int_notification_mode_set(stmdev_ctx_t *ctx,
|
||||
lps22hb_lir_t val);
|
||||
int32_t lps22hb_int_notification_mode_get(stmdev_ctx_t *ctx,
|
||||
lps22hb_lir_t *val);
|
||||
|
||||
int32_t lps22hb_int_generation_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_int_generation_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_int_threshold_set(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
int32_t lps22hb_int_threshold_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_DRDY_OR_FIFO_FLAGS = 0,
|
||||
LPS22HB_HIGH_PRES_INT = 1,
|
||||
LPS22HB_LOW_PRES_INT = 2,
|
||||
LPS22HB_EVERY_PRES_INT = 3,
|
||||
} lps22hb_int_s_t;
|
||||
int32_t lps22hb_int_pin_mode_set(stmdev_ctx_t *ctx, lps22hb_int_s_t val);
|
||||
int32_t lps22hb_int_pin_mode_get(stmdev_ctx_t *ctx, lps22hb_int_s_t *val);
|
||||
|
||||
int32_t lps22hb_drdy_on_int_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_drdy_on_int_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_ovr_on_int_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_fifo_ovr_on_int_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_threshold_on_int_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_fifo_threshold_on_int_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_full_on_int_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_fifo_full_on_int_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_PUSH_PULL = 0,
|
||||
LPS22HB_OPEN_DRAIN = 1,
|
||||
} lps22hb_pp_od_t;
|
||||
int32_t lps22hb_pin_mode_set(stmdev_ctx_t *ctx, lps22hb_pp_od_t val);
|
||||
int32_t lps22hb_pin_mode_get(stmdev_ctx_t *ctx, lps22hb_pp_od_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_ACTIVE_HIGH = 0,
|
||||
LPS22HB_ACTIVE_LOW = 1,
|
||||
} lps22hb_int_h_l_t;
|
||||
int32_t lps22hb_int_polarity_set(stmdev_ctx_t *ctx, lps22hb_int_h_l_t val);
|
||||
int32_t lps22hb_int_polarity_get(stmdev_ctx_t *ctx, lps22hb_int_h_l_t *val);
|
||||
|
||||
int32_t lps22hb_int_source_get(stmdev_ctx_t *ctx, lps22hb_int_source_t *val);
|
||||
|
||||
int32_t lps22hb_int_on_press_high_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_int_on_press_low_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_interrupt_event_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_stop_on_fifo_threshold_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_stop_on_fifo_threshold_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_fifo_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_watermark_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_fifo_watermark_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_BYPASS_MODE = 0,
|
||||
LPS22HB_FIFO_MODE = 1,
|
||||
LPS22HB_STREAM_MODE = 2,
|
||||
LPS22HB_STREAM_TO_FIFO_MODE = 3,
|
||||
LPS22HB_BYPASS_TO_STREAM_MODE = 4,
|
||||
LPS22HB_DYNAMIC_STREAM_MODE = 6,
|
||||
LPS22HB_BYPASS_TO_FIFO_MODE = 7,
|
||||
} lps22hb_f_mode_t;
|
||||
int32_t lps22hb_fifo_mode_set(stmdev_ctx_t *ctx, lps22hb_f_mode_t val);
|
||||
int32_t lps22hb_fifo_mode_get(stmdev_ctx_t *ctx, lps22hb_f_mode_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_data_level_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_ovr_flag_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lps22hb_fifo_fth_flag_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_SPI_4_WIRE = 0,
|
||||
LPS22HB_SPI_3_WIRE = 1,
|
||||
} lps22hb_sim_t;
|
||||
int32_t lps22hb_spi_mode_set(stmdev_ctx_t *ctx, lps22hb_sim_t val);
|
||||
int32_t lps22hb_spi_mode_get(stmdev_ctx_t *ctx, lps22hb_sim_t *val);
|
||||
|
||||
typedef enum {
|
||||
LPS22HB_I2C_ENABLE = 0,
|
||||
LPS22HB_I2C_DISABLE = 1,
|
||||
} lps22hb_i2c_dis_t;
|
||||
int32_t lps22hb_i2c_interface_set(stmdev_ctx_t *ctx, lps22hb_i2c_dis_t val);
|
||||
int32_t lps22hb_i2c_interface_get(stmdev_ctx_t *ctx, lps22hb_i2c_dis_t *val);
|
||||
|
||||
int32_t lps22hb_auto_add_inc_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lps22hb_auto_add_inc_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
/**
|
||||
*@}
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LPS22HB_REGS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,232 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LS016B8UY Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for LS016B8UY Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2016 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><br>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" background="" rgb(51="" 102="" 255="" none="" repeat="" scroll="" 0="" 50="" margin-right="" 500pt="" width="" 180px=""><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 22-April-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes</span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
671
2P-ProjectPong/Drivers/BSP/Components/ls016b8uy/ls016b8uy.c
Normal file
671
2P-ProjectPong/Drivers/BSP/Components/ls016b8uy/ls016b8uy.c
Normal file
@ -0,0 +1,671 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ls016b8uy.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 22-April-2016
|
||||
* @brief This file includes the LCD driver for LS016B8UY LCD.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ls016b8uy.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ls016b8uy
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* LS016B8UY LCD.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t red;
|
||||
uint8_t green;
|
||||
uint8_t blue;
|
||||
} LS016B8UY_Rgb888;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
LCD_DrvTypeDef ls016b8uy_drv =
|
||||
{
|
||||
ls016b8uy_Init,
|
||||
ls016b8uy_ReadID,
|
||||
ls016b8uy_DisplayOn,
|
||||
ls016b8uy_DisplayOff,
|
||||
ls016b8uy_SetCursor,
|
||||
ls016b8uy_WritePixel,
|
||||
ls016b8uy_ReadPixel,
|
||||
ls016b8uy_SetDisplayWindow,
|
||||
ls016b8uy_DrawHLine,
|
||||
ls016b8uy_DrawVLine,
|
||||
ls016b8uy_GetLcdPixelWidth,
|
||||
ls016b8uy_GetLcdPixelHeight,
|
||||
ls016b8uy_DrawBitmap,
|
||||
ls016b8uy_DrawRGBImage,
|
||||
};
|
||||
|
||||
static uint16_t WindowsXstart = 0;
|
||||
static uint16_t WindowsYstart = 0;
|
||||
static uint16_t WindowsXend = LS016B8UY_LCD_PIXEL_WIDTH-1;
|
||||
static uint16_t WindowsYend = LS016B8UY_LCD_PIXEL_HEIGHT-1;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
static LS016B8UY_Rgb888 ls016b8uy_ReadPixel_rgb888(uint16_t Xpos, uint16_t Ypos);
|
||||
static void ls016b8uy_DrawRGBHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint8_t *pdata);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize the LS016B8UY LCD Component.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_Init(void)
|
||||
{
|
||||
uint8_t parameter[4];
|
||||
uint32_t i;
|
||||
|
||||
/* Initialize LS016B8UY low level bus layer ----------------------------------*/
|
||||
LCD_IO_Init();
|
||||
|
||||
parameter[0] = 0x00; /* VSYNC output */
|
||||
ls016b8uy_WriteReg(LCD_CMD_VSYNC_OUTPUT, parameter, 1);
|
||||
parameter[0] = 0x06; /* 18 bits color mode */
|
||||
ls016b8uy_WriteReg(LCD_CMD_COLOR_MODE, parameter, 1);
|
||||
parameter[0] = 0x01; /* Panel setting command <No.1 UN-Lock> */
|
||||
parameter[1] = 0xFE;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_SETTING_1, parameter, 2);
|
||||
parameter[0] = 0xDE; /* Panel setting command <No.2 UN-Lock> */
|
||||
parameter[1] = 0x21;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_SETTING_2, parameter, 2);
|
||||
parameter[0] = 0x05; /* V-Porch setting */
|
||||
parameter[1] = 0x33;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_V_PORCH, parameter, 2);
|
||||
parameter[0] = 0x05; /* Idle mode V-Porch setting */
|
||||
parameter[1] = 0x33;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_IDLE_V_PORCH, parameter, 2);
|
||||
parameter[0] = 0x04; /* panel timing setting */
|
||||
parameter[1] = 0x03;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_TIMING_1, parameter, 2);
|
||||
parameter[0] = 0x5E; /* panel timing setting */
|
||||
parameter[1] = 0x08;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_TIMING_2, parameter, 2);
|
||||
parameter[0] = 0x0A; /* panel timing setting */
|
||||
parameter[1] = 0x0C;
|
||||
parameter[2] = 0x02;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_TIMING_3, parameter, 3);
|
||||
parameter[0] = 0x03; /* panel timing setting */
|
||||
parameter[1] = 0x04;
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_TIMING_4, parameter, 2);
|
||||
parameter[0] = 0x0C; /* panel power setting */
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_POWER, parameter, 1);
|
||||
parameter[0] = 0x02; /* Oscillator Setting = 2MHz */
|
||||
ls016b8uy_WriteReg(LCD_CMD_OSCILLATOR, parameter, 1);
|
||||
parameter[0] = 0x53; /* GVDD = 4.76V setting */
|
||||
ls016b8uy_WriteReg(LCD_CMD_GVDD, parameter, 1);
|
||||
parameter[0] = 0x00; /* Reload MTP After SLPOUT */
|
||||
parameter[1] = 0x45; /* VCOMH=3.76V */
|
||||
ls016b8uy_WriteReg(LCD_CMD_RELOAD_MTP_VCOMH, parameter, 2);
|
||||
parameter[0] = 0x03; /* OP-Amp Ability. (Normal) */
|
||||
parameter[1] = 0x12; /* Step-up Cycle for AVDD Booster Freq./4 */
|
||||
ls016b8uy_WriteReg(LCD_CMD_OPAMP, parameter, 2);
|
||||
parameter[0] = 0x00; /* Tearing Effect Option (00h:VSYNC Interface OFF, 01h:VSYNC Interface ON) */
|
||||
ls016b8uy_WriteReg(LCD_CMD_TEARING_EFFECT, parameter, 1);
|
||||
ls016b8uy_WriteReg(LCD_CMD_PANEL_SETTING_LOCK, parameter, 0); /* Panel setting command <Lock> */
|
||||
ls016b8uy_WriteReg(LCD_CMD_SLEEP_OUT, parameter, 0); /* Sleep Out Command */
|
||||
LCD_IO_Delay(150); /* Wait for 150ms */
|
||||
|
||||
parameter[0] = 0x00; /* CASET */
|
||||
parameter[1] = 0x1E;
|
||||
parameter[2] = 0x00;
|
||||
parameter[3] = 0xD1;
|
||||
ls016b8uy_WriteReg(LCD_CMD_CASET, parameter, 4);
|
||||
parameter[0] = 0x00; /* RASET */
|
||||
parameter[1] = 0x00;
|
||||
parameter[2] = 0x00;
|
||||
parameter[3] = 0xB3;
|
||||
ls016b8uy_WriteReg(LCD_CMD_RASET, parameter, 4);
|
||||
parameter[0] = 0x83; /* Normal display for Driver Down side */
|
||||
ls016b8uy_WriteReg(LCD_CMD_NORMAL_DISPLAY, parameter, 1);
|
||||
|
||||
ls016b8uy_DisplayOn(); /* Display ON command */
|
||||
|
||||
/* Fill LCD frame memory with black pixels */
|
||||
ls016b8uy_WriteReg(LCD_CMD_WRITE_RAM, parameter, 0); /* RAM Write Data */
|
||||
|
||||
for(i = 0; i < (LS016B8UY_LCD_PIXEL_WIDTH * LS016B8UY_LCD_PIXEL_HEIGHT * 3)/2; i++)
|
||||
{
|
||||
LCD_IO_WriteData(0x0000);
|
||||
}
|
||||
|
||||
LCD_IO_Delay(20); /* Wait for 20ms */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DisplayOn(void)
|
||||
{
|
||||
ls016b8uy_WriteReg(LCD_CMD_DISPLAY_ON, (uint8_t*)NULL, 0); /* Display ON command */
|
||||
ls016b8uy_WriteReg(LCD_CMD_IDLE_MODE_OFF, (uint8_t*)NULL, 0); /* Idle mode OFF command */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disables the Display.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DisplayOff(void)
|
||||
{
|
||||
ls016b8uy_WriteReg(LCD_CMD_DISPLAY_OFF, (uint8_t*)NULL, 0); /* Display OFF command */
|
||||
LCD_IO_Delay(20); /* Wait for 20ms */
|
||||
ls016b8uy_WriteReg(LCD_CMD_SLEEP_IN, (uint8_t*)NULL, 0); /* Sleep In Command */
|
||||
LCD_IO_Delay(150); /* Wait for 150ms */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the LCD pixel Width.
|
||||
* @param None
|
||||
* @retval The Lcd Pixel Width
|
||||
*/
|
||||
uint16_t ls016b8uy_GetLcdPixelWidth(void)
|
||||
{
|
||||
return (uint16_t)LS016B8UY_LCD_PIXEL_WIDTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the LCD pixel Height.
|
||||
* @param None
|
||||
* @retval The Lcd Pixel Height
|
||||
*/
|
||||
uint16_t ls016b8uy_GetLcdPixelHeight(void)
|
||||
{
|
||||
return (uint16_t)LS016B8UY_LCD_PIXEL_HEIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the LS016B8UY ID.
|
||||
* @param None
|
||||
* @retval The LS016B8UY ID
|
||||
*/
|
||||
uint16_t ls016b8uy_ReadID(void)
|
||||
{
|
||||
LCD_IO_Init();
|
||||
/* TODO : LCD read ID command not known for now, so assumption that the connected LCD is LS016B8UY */
|
||||
return (LS016B8UY_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Cursor position.
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_SetCursor(uint16_t Xpos, uint16_t Ypos)
|
||||
{
|
||||
uint8_t parameter[4];
|
||||
|
||||
parameter[0] = 0x00; /* CASET */
|
||||
parameter[1] = 0x1E + Xpos;
|
||||
parameter[2] = 0x00;
|
||||
parameter[3] = 0xD1 + Xpos;
|
||||
ls016b8uy_WriteReg(LCD_CMD_CASET, parameter, 4);
|
||||
parameter[0] = 0x00; /* RASET */
|
||||
parameter[1] = 0x00 + Ypos;
|
||||
parameter[2] = 0x00;
|
||||
parameter[3] = 0xB3 + Ypos;
|
||||
ls016b8uy_WriteReg(LCD_CMD_RASET, parameter, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write pixel.
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param RGBCode: the RGB pixel color in RGB565 format
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGBCode)
|
||||
{
|
||||
uint16_t r, g, b;
|
||||
uint16_t rgb888_part1, rgb888_part2;
|
||||
|
||||
r = (RGBCode & 0xF800) >> 11; /* Extract red component from RGB565 pixel data */
|
||||
g = (RGBCode & 0x07E0) >> 5; /* Extract green component from RGB565 pixel data */
|
||||
b = (RGBCode & 0x001F) >> 0; /* Extract blue component from RGB565 pixel data */
|
||||
|
||||
/* Prepare data to write with new pixel components and read old pixel component */
|
||||
rgb888_part1 = (r << 11) + (g << 2);
|
||||
rgb888_part2 = (b << 11);
|
||||
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write to LCD RAM */
|
||||
ls016b8uy_WriteReg(LCD_CMD_WRITE_RAM, (uint8_t*)NULL, 0); /* RAM write data command */
|
||||
|
||||
/* Write RAM data */
|
||||
LCD_IO_WriteData(rgb888_part1);
|
||||
LCD_IO_WriteData(rgb888_part2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read pixel.
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @retval The RGB pixel color in RGB565 format
|
||||
*/
|
||||
uint16_t ls016b8uy_ReadPixel(uint16_t Xpos, uint16_t Ypos)
|
||||
{
|
||||
LS016B8UY_Rgb888 rgb888;
|
||||
uint8_t r, g, b;
|
||||
uint16_t rgb565;
|
||||
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Read RGB888 data from LCD RAM */
|
||||
rgb888 = ls016b8uy_ReadPixel_rgb888(Xpos, Ypos);
|
||||
|
||||
/* Convert RGB888 to RGB565 */
|
||||
r = ((rgb888.red & 0xF8) >> 3); /* Extract the red component 5 most significant bits */
|
||||
g = ((rgb888.green & 0xFC) >> 2); /* Extract the green component 6 most significant bits */
|
||||
b = ((rgb888.blue & 0xF8) >> 3); /* Extract the blue component 5 most significant bits */
|
||||
|
||||
rgb565 = ((uint16_t)(r) << 11) + ((uint16_t)(g) << 5) + ((uint16_t)(b) << 0);
|
||||
|
||||
return (rgb565);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes to the selected LCD register.
|
||||
* @param Command: command value (or register address as named in LS016B8UY doc).
|
||||
* @param Parameters: pointer on parameters value (if command uses one or several parameters).
|
||||
* @param NbParameters: number of command parameters (0 if no parameter)
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_WriteReg(uint8_t Command, uint8_t *Parameters, uint8_t NbParameters)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
/* Send command */
|
||||
LCD_IO_WriteReg(Command);
|
||||
|
||||
/* Send command's parameters if any */
|
||||
for (i=0; i<NbParameters; i++)
|
||||
{
|
||||
LCD_IO_WriteData(Parameters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads the selected LCD Register.
|
||||
* @param Command: command value (or register address as named in LS016B8UY doc).
|
||||
* @retval Register Value.
|
||||
*/
|
||||
uint8_t ls016b8uy_ReadReg(uint8_t Command)
|
||||
{
|
||||
/* Send command */
|
||||
LCD_IO_WriteReg(Command);
|
||||
|
||||
/* Read dummy data */
|
||||
LCD_IO_ReadData();
|
||||
|
||||
/* Read register value */
|
||||
return (LCD_IO_ReadData());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets a display window
|
||||
* @param Xpos: specifies the X bottom left position.
|
||||
* @param Ypos: specifies the Y bottom left position.
|
||||
* @param Height: display window height.
|
||||
* @param Width: display window width.
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
|
||||
{
|
||||
if (Xpos < LS016B8UY_LCD_PIXEL_WIDTH)
|
||||
{
|
||||
WindowsXstart = Xpos;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowsXstart = 0;
|
||||
}
|
||||
|
||||
if (Ypos < LS016B8UY_LCD_PIXEL_HEIGHT)
|
||||
{
|
||||
WindowsYstart = Ypos;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowsYstart = 0;
|
||||
}
|
||||
|
||||
if (Width + Xpos <= LS016B8UY_LCD_PIXEL_WIDTH)
|
||||
{
|
||||
WindowsXend = Width + Xpos - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowsXend = LS016B8UY_LCD_PIXEL_WIDTH - 1;
|
||||
}
|
||||
|
||||
if (Height + Ypos <= LS016B8UY_LCD_PIXEL_HEIGHT)
|
||||
{
|
||||
WindowsYend = Height + Ypos - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowsYend = LS016B8UY_LCD_PIXEL_HEIGHT-1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw vertical line.
|
||||
* @param RGBCode: Specifies the RGB color in RGB565 format
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param Length: specifies the Line length.
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DrawHLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
|
||||
{
|
||||
uint16_t counter = 0;
|
||||
uint16_t r, g, b;
|
||||
uint16_t rgb888_part1, rgb888_part2, rgb888_part3;
|
||||
|
||||
r = (RGBCode & 0xF800) >> 11; /* Extract red component from RGB565 pixel data */
|
||||
g = (RGBCode & 0x07E0) >> 5; /* Extract green component from RGB565 pixel data */
|
||||
b = (RGBCode & 0x001F) >> 0; /* Extract blue component from RGB565 pixel data */
|
||||
|
||||
rgb888_part1 = (r << 11) + (g << 2); /* Build pattern first part to write in LCD RAM */
|
||||
rgb888_part2 = (b << 11) + (r << 3); /* Build pattern second part to write in LCD RAM */
|
||||
rgb888_part3 = (g << 10) + (b << 3); /* Build pattern third part to write in LCD RAM */
|
||||
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write to LCD RAM */
|
||||
ls016b8uy_WriteReg(LCD_CMD_WRITE_RAM, (uint8_t*)NULL, 0); /* RAM write data command */
|
||||
|
||||
/* Sent a complete line */
|
||||
for(counter = 0; counter < Length; counter+=2)
|
||||
{
|
||||
/* Write 2 pixels at a time by performing 3 access (pixels coded on 24 bits in LCD RAM whereas access are coded on 16 bits) */
|
||||
LCD_IO_WriteData(rgb888_part1);
|
||||
LCD_IO_WriteData(rgb888_part2);
|
||||
if (counter != (Length-1)) /* When writing last pixel when Length is odd, the third part is not written */
|
||||
{
|
||||
LCD_IO_WriteData(rgb888_part3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw vertical line.
|
||||
* @param RGBCode: Specifies the RGB color
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @param Length: specifies the Line length.
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DrawVLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length)
|
||||
{
|
||||
uint16_t counter = 0;
|
||||
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, Ypos);
|
||||
|
||||
/* Prepare to write to LCD RAM */
|
||||
ls016b8uy_WriteReg(LCD_CMD_WRITE_RAM, (uint8_t*)NULL, 0); /* RAM write data command */
|
||||
|
||||
/* Fill a complete vertical line */
|
||||
for(counter = 0; counter < Length; counter++)
|
||||
{
|
||||
ls016b8uy_WritePixel(Xpos, Ypos + counter, RGBCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays a bitmap picture.
|
||||
* @param BmpAddress: Bmp picture address.
|
||||
* @param Xpos: Bmp X position in the LCD
|
||||
* @param Ypos: Bmp Y position in the LCD
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
|
||||
{
|
||||
uint32_t index = 0, size = 0;
|
||||
uint32_t posY;
|
||||
uint32_t nb_line = 0;
|
||||
uint16_t Xsize = WindowsXend - WindowsXstart + 1;
|
||||
uint16_t Ysize = WindowsYend - WindowsYstart + 1;
|
||||
|
||||
/* Read bitmap size */
|
||||
size = *(volatile uint16_t *) (pbmp + 2);
|
||||
size |= (*(volatile uint16_t *) (pbmp + 4)) << 16;
|
||||
/* Get bitmap data address offset */
|
||||
index = *(volatile uint16_t *) (pbmp + 10);
|
||||
index |= (*(volatile uint16_t *) (pbmp + 12)) << 16;
|
||||
size = (size - index)/2;
|
||||
pbmp += index;
|
||||
|
||||
for (posY = (Ypos + Ysize); posY > Ypos; posY--) /* In BMP files the line order is inverted */
|
||||
{
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, posY - 1);
|
||||
|
||||
/* Draw one line of the picture */
|
||||
ls016b8uy_DrawRGBHLine(Xpos, posY - 1, Xsize, (pbmp + (nb_line * Xsize * 2)));
|
||||
nb_line++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays picture.
|
||||
* @param pdata: picture address.
|
||||
* @param Xpos: Image X position in the LCD
|
||||
* @param Ypos: Image Y position in the LCD
|
||||
* @param Xsize: Image X size in the LCD
|
||||
* @param Ysize: Image Y size in the LCD
|
||||
* @retval None
|
||||
*/
|
||||
void ls016b8uy_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
|
||||
{
|
||||
uint32_t posY;
|
||||
uint32_t nb_line = 0;
|
||||
|
||||
for (posY = Ypos; posY < (Ypos + Ysize); posY ++)
|
||||
{
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, posY);
|
||||
|
||||
/* Draw one line of the picture */
|
||||
ls016b8uy_DrawRGBHLine(Xpos, posY, Xsize, (pdata + (nb_line * Xsize * 2)));
|
||||
nb_line++;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
Static Functions
|
||||
*******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Read pixel from LCD RAM in RGB888 format
|
||||
* @param Xpos: specifies the X position.
|
||||
* @param Ypos: specifies the Y position.
|
||||
* @retval Each RGB pixel color components in a structure
|
||||
*/
|
||||
static LS016B8UY_Rgb888 ls016b8uy_ReadPixel_rgb888(uint16_t Xpos, uint16_t Ypos)
|
||||
{
|
||||
LS016B8UY_Rgb888 rgb888;
|
||||
uint16_t rgb888_part1, rgb888_part2;
|
||||
|
||||
/* In LCD RAM, pixels are 24 bits packed and read with 16 bits access
|
||||
* Here is the pixels components arrangement in memory :
|
||||
* bits: 15 14 13 12 11 10 09 08 | 07 06 05 04 03 02 01 00
|
||||
* address 0 : red pixel 0 X X | green pixel 0 X X
|
||||
* address 1 : blue pixel 0 X X | red pixel 1 X X
|
||||
* address 2 : green pixel 1 X X | blue pixel 1 X X
|
||||
*/
|
||||
|
||||
/* Set Cursor */
|
||||
ls016b8uy_SetCursor(Xpos, Ypos);
|
||||
/* Prepare to read LCD RAM */
|
||||
ls016b8uy_WriteReg(LCD_CMD_READ_RAM, (uint8_t*)NULL, 0); /* RAM read data command */
|
||||
/* Dummy read */
|
||||
LCD_IO_ReadData();
|
||||
/* Read first part of the RGB888 data */
|
||||
rgb888_part1 = LCD_IO_ReadData();
|
||||
/* Read first part of the RGB888 data */
|
||||
rgb888_part2 = LCD_IO_ReadData();
|
||||
|
||||
/* red component */
|
||||
rgb888.red = (rgb888_part1 & 0xFC00) >> 8;
|
||||
/* green component */
|
||||
rgb888.green = (rgb888_part1 & 0x00FC) >> 0;
|
||||
/* blue component */
|
||||
rgb888.blue = (rgb888_part2 & 0xFC00) >> 8;
|
||||
|
||||
return rgb888;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays a single picture line.
|
||||
* @param pdata: picture address.
|
||||
* @param Xpos: Image X position in the LCD
|
||||
* @param Ypos: Image Y position in the LCD
|
||||
* @param Xsize: Image X size in the LCD
|
||||
* @retval None
|
||||
*/
|
||||
static void ls016b8uy_DrawRGBHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint8_t *pdata)
|
||||
{
|
||||
uint32_t i = 0;
|
||||
uint32_t posX;
|
||||
uint16_t r, g, b;
|
||||
uint16_t rgb888_part;
|
||||
uint16_t *rgb565 = (uint16_t*)pdata;
|
||||
|
||||
/* Prepare to write to LCD RAM */
|
||||
ls016b8uy_WriteReg(LCD_CMD_WRITE_RAM, (uint8_t*)NULL, 0); /* RAM write data command */
|
||||
|
||||
for (posX = Xpos; posX < (Xsize + Xpos); posX += 2)
|
||||
{
|
||||
if ((posX >= WindowsXstart) && (Ypos >= WindowsYstart) && /* Check we are in the defined window */
|
||||
(posX <= WindowsXend) && (Ypos <= WindowsYend))
|
||||
{
|
||||
/* Write pixels in LCD RAM after RGB565 -> RGB888 conversion */
|
||||
/* As data in LCD RAM are 24bits packed, three 16 bits writes access are needed to transmit 2 pixels data */
|
||||
|
||||
r = (rgb565[i] & 0xF800) >> 11; /* Extract red component from first RGB565 pixel data */
|
||||
g = (rgb565[i] & 0x07E0) >> 5; /* Extract green component from first RGB565 pixel data */
|
||||
rgb888_part = (r << 11) + (g << 2); /* Build data to be written in LCD RAM */
|
||||
LCD_IO_WriteData(rgb888_part);
|
||||
|
||||
b = (rgb565[i] & 0x001F) >> 0; /* Extract blue component from first RGB565 pixel data */
|
||||
r = (rgb565[i+1] & 0xF800) >> 11; /* Extract red component from second RGB565 pixel data */
|
||||
rgb888_part = (b << 11) + (r << 3); /* Build data to be written in LCD RAM */
|
||||
LCD_IO_WriteData(rgb888_part);
|
||||
|
||||
if (posX != (Xsize + Xpos - 1)) /* When writing last pixel when size is odd, the third part is not written */
|
||||
{
|
||||
g = (rgb565[i+1] & 0x07E0) >> 5; /* Extract green component from second RGB565 pixel data */
|
||||
b = (rgb565[i+1] & 0x001F) >> 0; /* Extract blue component from second RGB565 pixel data */
|
||||
rgb888_part = (g << 10) + (b << 3); /* Build data to be written in LCD RAM */
|
||||
LCD_IO_WriteData(rgb888_part);
|
||||
}
|
||||
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
179
2P-ProjectPong/Drivers/BSP/Components/ls016b8uy/ls016b8uy.h
Normal file
179
2P-ProjectPong/Drivers/BSP/Components/ls016b8uy/ls016b8uy.h
Normal file
@ -0,0 +1,179 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ls016b8uy.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 22-April-2016
|
||||
* @brief This file contains all the functions prototypes for the ls016b8uy.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LS016B8UY_H
|
||||
#define __LS016B8UY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include "../Common/lcd.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ls016b8uy
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief LS016B8UY ID
|
||||
*/
|
||||
#define LS016B8UY_ID 0xFFFF
|
||||
|
||||
/**
|
||||
* @brief LS016B8UY Size
|
||||
*/
|
||||
#define LS016B8UY_LCD_PIXEL_WIDTH ((uint16_t)180)
|
||||
#define LS016B8UY_LCD_PIXEL_HEIGHT ((uint16_t)180)
|
||||
|
||||
/**
|
||||
* @brief LS016B8UY Registers
|
||||
*/
|
||||
#define LCD_CMD_SLEEP_IN 0x10
|
||||
#define LCD_CMD_SLEEP_OUT 0x11
|
||||
#define LCD_CMD_DISPLAY_OFF 0x28
|
||||
#define LCD_CMD_DISPLAY_ON 0x29
|
||||
#define LCD_CMD_WRITE_RAM 0x2C
|
||||
#define LCD_CMD_READ_RAM 0x2E
|
||||
#define LCD_CMD_CASET 0x2A
|
||||
#define LCD_CMD_RASET 0x2B
|
||||
#define LCD_CMD_VSYNC_OUTPUT 0x35
|
||||
#define LCD_CMD_NORMAL_DISPLAY 0x36
|
||||
#define LCD_CMD_IDLE_MODE_OFF 0x38
|
||||
#define LCD_CMD_IDLE_MODE_ON 0x39
|
||||
#define LCD_CMD_COLOR_MODE 0x3A
|
||||
#define LCD_CMD_PANEL_SETTING_1 0xB0
|
||||
#define LCD_CMD_PANEL_SETTING_2 0xB1
|
||||
#define LCD_CMD_OSCILLATOR 0xB3
|
||||
#define LCD_CMD_PANEL_SETTING_LOCK 0xB4
|
||||
#define LCD_CMD_PANEL_V_PORCH 0xB7
|
||||
#define LCD_CMD_PANEL_IDLE_V_PORCH 0xB8
|
||||
#define LCD_CMD_GVDD 0xC0
|
||||
#define LCD_CMD_OPAMP 0xC2
|
||||
#define LCD_CMD_RELOAD_MTP_VCOMH 0xC5
|
||||
#define LCD_CMD_PANEL_TIMING_1 0xC8
|
||||
#define LCD_CMD_PANEL_TIMING_2 0xC9
|
||||
#define LCD_CMD_PANEL_TIMING_3 0xCA
|
||||
#define LCD_CMD_PANEL_TIMING_4 0xCC
|
||||
#define LCD_CMD_PANEL_POWER 0xD0
|
||||
#define LCD_CMD_TEARING_EFFECT 0xDD
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LS016B8UY_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void ls016b8uy_Init(void);
|
||||
uint16_t ls016b8uy_ReadID(void);
|
||||
void ls016b8uy_WriteReg(uint8_t Command, uint8_t *Parameters, uint8_t NbParameters);
|
||||
uint8_t ls016b8uy_ReadReg(uint8_t Command);
|
||||
|
||||
void ls016b8uy_DisplayOn(void);
|
||||
void ls016b8uy_DisplayOff(void);
|
||||
void ls016b8uy_SetCursor(uint16_t Xpos, uint16_t Ypos);
|
||||
void ls016b8uy_WritePixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGBCode);
|
||||
uint16_t ls016b8uy_ReadPixel(uint16_t Xpos, uint16_t Ypos);
|
||||
|
||||
void ls016b8uy_DrawHLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void ls016b8uy_DrawVLine(uint16_t RGBCode, uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void ls016b8uy_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp);
|
||||
void ls016b8uy_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata);
|
||||
|
||||
void ls016b8uy_SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
|
||||
|
||||
uint16_t ls016b8uy_GetLcdPixelWidth(void);
|
||||
uint16_t ls016b8uy_GetLcdPixelHeight(void);
|
||||
|
||||
/* LCD driver structure */
|
||||
extern LCD_DrvTypeDef ls016b8uy_drv;
|
||||
|
||||
/* LCD IO functions */
|
||||
void LCD_IO_Init(void);
|
||||
void LCD_IO_WriteMultipleData(uint16_t *pData, uint32_t Size);
|
||||
void LCD_IO_WriteReg(uint8_t Reg);
|
||||
void LCD_IO_WriteData(uint16_t RegValue);
|
||||
uint16_t LCD_IO_ReadData(void);
|
||||
void LCD_IO_Delay(uint32_t delay);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LS016B8UY_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,253 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LSM303AGR component</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes for LSM303AGR component</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2019 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.3.1
|
||||
/ 11-October-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Rename context type to universal stmdev_ctx_t</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Move unions from PID to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.3.0
|
||||
/ 28-May-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">PID update from ST GitHub</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">HLD update to reflect new PID</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.1
|
||||
/ 4-April-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update some comments</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.0
|
||||
/ 31-January-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update PID files</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.1.0
|
||||
/ 14-November-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update PID files</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.0
|
||||
/ 12-July-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Source Code Refactoring according new BSP v2.5 specifications</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0
|
||||
/ 1-May-2017</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Unify driver to have the same files for X-NUCLEO-IKS01Ax and SensorTile</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0
|
||||
/ 12-August-2016</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First
|
||||
official release</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br>
|
||||
</h2>
|
||||
|
||||
|
||||
<div style="text-align: justify;">
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
</div>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
</body></html>
|
1449
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr.c
Normal file
1449
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr.c
Normal file
File diff suppressed because it is too large
Load Diff
290
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr.h
Normal file
290
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr.h
Normal file
@ -0,0 +1,290 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lsm303agr.h
|
||||
* @author MEMS Software Solutions Team
|
||||
* @brief LSM303AGR header driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LSM303AGR_H
|
||||
#define LSM303AGR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lsm303agr_reg.h"
|
||||
#include <string.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM303AGR LSM303AGR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303AGR_Exported_Types LSM303AGR Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*LSM303AGR_Init_Func)(void);
|
||||
typedef int32_t (*LSM303AGR_DeInit_Func)(void);
|
||||
typedef int32_t (*LSM303AGR_GetTick_Func)(void);
|
||||
typedef int32_t (*LSM303AGR_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
typedef int32_t (*LSM303AGR_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LSM303AGR_Init_Func Init;
|
||||
LSM303AGR_DeInit_Func DeInit;
|
||||
uint32_t BusType; /*0 means I2C, 1 means SPI-3-Wires */
|
||||
uint8_t Address;
|
||||
LSM303AGR_WriteReg_Func WriteReg;
|
||||
LSM303AGR_ReadReg_Func ReadReg;
|
||||
LSM303AGR_GetTick_Func GetTick;
|
||||
} LSM303AGR_IO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
int16_t z;
|
||||
} LSM303AGR_AxesRaw_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
int32_t z;
|
||||
} LSM303AGR_Axes_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LSM303AGR_IO_t IO;
|
||||
stmdev_ctx_t Ctx;
|
||||
uint8_t is_initialized;
|
||||
uint8_t acc_is_enabled;
|
||||
lsm303agr_odr_a_t acc_odr;
|
||||
} LSM303AGR_ACC_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LSM303AGR_IO_t IO;
|
||||
stmdev_ctx_t Ctx;
|
||||
uint8_t is_initialized;
|
||||
uint8_t mag_is_enabled;
|
||||
} LSM303AGR_MAG_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Acc;
|
||||
uint8_t Gyro;
|
||||
uint8_t Magneto;
|
||||
uint8_t LowPower;
|
||||
uint32_t GyroMaxFS;
|
||||
uint32_t AccMaxFS;
|
||||
uint32_t MagMaxFS;
|
||||
float GyroMaxOdr;
|
||||
float AccMaxOdr;
|
||||
float MagMaxOdr;
|
||||
} LSM303AGR_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(LSM303AGR_ACC_Object_t *);
|
||||
int32_t (*DeInit)(LSM303AGR_ACC_Object_t *);
|
||||
int32_t (*ReadID)(LSM303AGR_ACC_Object_t *, uint8_t *);
|
||||
int32_t (*GetCapabilities)(LSM303AGR_ACC_Object_t *, LSM303AGR_Capabilities_t *);
|
||||
} LSM303AGR_ACC_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LSM303AGR_ACC_Object_t *);
|
||||
int32_t (*Disable)(LSM303AGR_ACC_Object_t *);
|
||||
int32_t (*GetSensitivity)(LSM303AGR_ACC_Object_t *, float *);
|
||||
int32_t (*GetOutputDataRate)(LSM303AGR_ACC_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LSM303AGR_ACC_Object_t *, float);
|
||||
int32_t (*GetFullScale)(LSM303AGR_ACC_Object_t *, int32_t *);
|
||||
int32_t (*SetFullScale)(LSM303AGR_ACC_Object_t *, int32_t);
|
||||
int32_t (*GetAxes)(LSM303AGR_ACC_Object_t *, LSM303AGR_Axes_t *);
|
||||
int32_t (*GetAxesRaw)(LSM303AGR_ACC_Object_t *, LSM303AGR_AxesRaw_t *);
|
||||
} LSM303AGR_ACC_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(LSM303AGR_MAG_Object_t *);
|
||||
int32_t (*DeInit)(LSM303AGR_MAG_Object_t *);
|
||||
int32_t (*ReadID)(LSM303AGR_MAG_Object_t *, uint8_t *);
|
||||
int32_t (*GetCapabilities)(LSM303AGR_MAG_Object_t *, LSM303AGR_Capabilities_t *);
|
||||
} LSM303AGR_MAG_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LSM303AGR_MAG_Object_t *);
|
||||
int32_t (*Disable)(LSM303AGR_MAG_Object_t *);
|
||||
int32_t (*GetSensitivity)(LSM303AGR_MAG_Object_t *, float *);
|
||||
int32_t (*GetOutputDataRate)(LSM303AGR_MAG_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LSM303AGR_MAG_Object_t *, float);
|
||||
int32_t (*GetFullScale)(LSM303AGR_MAG_Object_t *, int32_t *);
|
||||
int32_t (*SetFullScale)(LSM303AGR_MAG_Object_t *, int32_t);
|
||||
int32_t (*GetAxes)(LSM303AGR_MAG_Object_t *, LSM303AGR_Axes_t *);
|
||||
int32_t (*GetAxesRaw)(LSM303AGR_MAG_Object_t *, LSM303AGR_AxesRaw_t *);
|
||||
} LSM303AGR_MAG_Drv_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit[3];
|
||||
uint8_t u8bit[6];
|
||||
} lsm303agr_axis3bit16_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit;
|
||||
uint8_t u8bit[2];
|
||||
} lsm303agr_axis1bit16_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit[3];
|
||||
uint8_t u8bit[12];
|
||||
} lsm303agr_axis3bit32_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit;
|
||||
uint8_t u8bit[4];
|
||||
} lsm303agr_axis1bit32_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303AGR_Exported_Constants LSM303AGR Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LSM303AGR_OK 0
|
||||
#define LSM303AGR_ERROR -1
|
||||
|
||||
#define LSM303AGR_I2C_BUS 0U
|
||||
#define LSM303AGR_SPI_3WIRES_BUS 1U
|
||||
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_2G_NORMAL_MODE 3.900f /**< Sensitivity value for 2 g full scale and normal mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_2G_HIGH_RESOLUTION_MODE 0.980f /**< Sensitivity value for 2 g full scale and high resolution mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_2G_LOW_POWER_MODE 15.630f /**< Sensitivity value for 2 g full scale and low power mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_4G_NORMAL_MODE 7.820f /**< Sensitivity value for 4 g full scale and normal mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_4G_HIGH_RESOLUTION_MODE 1.950f /**< Sensitivity value for 4 g full scale and high resolution mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_4G_LOW_POWER_MODE 31.260f /**< Sensitivity value for 4 g full scale and low power mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_8G_NORMAL_MODE 15.630f /**< Sensitivity value for 8 g full scale and normal mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_8G_HIGH_RESOLUTION_MODE 3.900f /**< Sensitivity value for 8 g full scale and high resolution mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_8G_LOW_POWER_MODE 62.520f /**< Sensitivity value for 8 g full scale and low power mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_16G_NORMAL_MODE 46.900f /**< Sensitivity value for 16 g full scale and normal mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_16G_HIGH_RESOLUTION_MODE 11.720f /**< Sensitivity value for 16 g full scale and high resolution mode [mg/LSB] */
|
||||
#define LSM303AGR_ACC_SENSITIVITY_FS_16G_LOW_POWER_MODE 187.580f /**< Sensitivity value for 16 g full scale and low power mode [mg/LSB] */
|
||||
|
||||
#define LSM303AGR_MAG_SENSITIVITY_FS_50GAUSS 1.500f /**< Sensitivity value for 50 gauss full scale [mgauss/LSB] */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303AGR_Exported_Functions LSM303AGR Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t LSM303AGR_ACC_RegisterBusIO(LSM303AGR_ACC_Object_t *pObj, LSM303AGR_IO_t *pIO);
|
||||
int32_t LSM303AGR_ACC_Init(LSM303AGR_ACC_Object_t *pObj);
|
||||
int32_t LSM303AGR_ACC_DeInit(LSM303AGR_ACC_Object_t *pObj);
|
||||
int32_t LSM303AGR_ACC_ReadID(LSM303AGR_ACC_Object_t *pObj, uint8_t *Id);
|
||||
int32_t LSM303AGR_ACC_GetCapabilities(LSM303AGR_ACC_Object_t *pObj, LSM303AGR_Capabilities_t *Capabilities);
|
||||
|
||||
int32_t LSM303AGR_ACC_Enable(LSM303AGR_ACC_Object_t *pObj);
|
||||
int32_t LSM303AGR_ACC_Disable(LSM303AGR_ACC_Object_t *pObj);
|
||||
int32_t LSM303AGR_ACC_GetSensitivity(LSM303AGR_ACC_Object_t *pObj, float *sensitivity);
|
||||
int32_t LSM303AGR_ACC_GetOutputDataRate(LSM303AGR_ACC_Object_t *pObj, float *odr);
|
||||
int32_t LSM303AGR_ACC_SetOutputDataRate(LSM303AGR_ACC_Object_t *pObj, float odr);
|
||||
int32_t LSM303AGR_ACC_GetFullScale(LSM303AGR_ACC_Object_t *pObj, int32_t *fullscale);
|
||||
int32_t LSM303AGR_ACC_SetFullScale(LSM303AGR_ACC_Object_t *pObj, int32_t fullscale);
|
||||
int32_t LSM303AGR_ACC_GetAxes(LSM303AGR_ACC_Object_t *pObj, LSM303AGR_Axes_t *acceleration);
|
||||
int32_t LSM303AGR_ACC_GetAxesRaw(LSM303AGR_ACC_Object_t *pObj, LSM303AGR_AxesRaw_t *value);
|
||||
|
||||
int32_t LSM303AGR_ACC_Read_Reg(LSM303AGR_ACC_Object_t *pObj, uint8_t reg, uint8_t *data);
|
||||
int32_t LSM303AGR_ACC_Write_Reg(LSM303AGR_ACC_Object_t *pObj, uint8_t reg, uint8_t data);
|
||||
|
||||
int32_t LSM303AGR_ACC_Get_DRDY_Status(LSM303AGR_ACC_Object_t *pObj, uint8_t *status);
|
||||
int32_t LSM303AGR_ACC_Get_Init_Status(LSM303AGR_ACC_Object_t *pObj, uint8_t *status);
|
||||
|
||||
int32_t LSM303AGR_MAG_RegisterBusIO(LSM303AGR_MAG_Object_t *pObj, LSM303AGR_IO_t *pIO);
|
||||
int32_t LSM303AGR_MAG_Init(LSM303AGR_MAG_Object_t *pObj);
|
||||
int32_t LSM303AGR_MAG_DeInit(LSM303AGR_MAG_Object_t *pObj);
|
||||
int32_t LSM303AGR_MAG_ReadID(LSM303AGR_MAG_Object_t *pObj, uint8_t *id);
|
||||
int32_t LSM303AGR_MAG_GetCapabilities(LSM303AGR_MAG_Object_t *pObj, LSM303AGR_Capabilities_t *Capabilities);
|
||||
|
||||
int32_t LSM303AGR_MAG_Enable(LSM303AGR_MAG_Object_t *pObj);
|
||||
int32_t LSM303AGR_MAG_Disable(LSM303AGR_MAG_Object_t *pObj);
|
||||
int32_t LSM303AGR_MAG_GetSensitivity(LSM303AGR_MAG_Object_t *pObj, float *sensitivity);
|
||||
int32_t LSM303AGR_MAG_GetOutputDataRate(LSM303AGR_MAG_Object_t *pObj, float *odr);
|
||||
int32_t LSM303AGR_MAG_SetOutputDataRate(LSM303AGR_MAG_Object_t *pObj, float odr);
|
||||
int32_t LSM303AGR_MAG_GetFullScale(LSM303AGR_MAG_Object_t *pObj, int32_t *fullscale);
|
||||
int32_t LSM303AGR_MAG_SetFullScale(LSM303AGR_MAG_Object_t *pObj, int32_t fullscale);
|
||||
int32_t LSM303AGR_MAG_GetAxes(LSM303AGR_MAG_Object_t *pObj, LSM303AGR_Axes_t *magnetic_field);
|
||||
int32_t LSM303AGR_MAG_GetAxesRaw(LSM303AGR_MAG_Object_t *pObj, LSM303AGR_AxesRaw_t *value);
|
||||
|
||||
int32_t LSM303AGR_MAG_Read_Reg(LSM303AGR_MAG_Object_t *pObj, uint8_t reg, uint8_t *data);
|
||||
int32_t LSM303AGR_MAG_Write_Reg(LSM303AGR_MAG_Object_t *pObj, uint8_t reg, uint8_t data);
|
||||
|
||||
int32_t LSM303AGR_MAG_Get_DRDY_Status(LSM303AGR_MAG_Object_t *pObj, uint8_t *status);
|
||||
int32_t LSM303AGR_MAG_Get_Init_Status(LSM303AGR_MAG_Object_t *pObj, uint8_t *status);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM303AGR_Exported_Variables LSM303AGR Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern LSM303AGR_ACC_CommonDrv_t LSM303AGR_ACC_COMMON_Driver;
|
||||
extern LSM303AGR_ACC_Drv_t LSM303AGR_ACC_Driver;
|
||||
extern LSM303AGR_MAG_CommonDrv_t LSM303AGR_MAG_COMMON_Driver;
|
||||
extern LSM303AGR_MAG_Drv_t LSM303AGR_MAG_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
3544
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr_reg.c
Normal file
3544
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr_reg.c
Normal file
File diff suppressed because it is too large
Load Diff
976
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr_reg.h
Normal file
976
2P-ProjectPong/Drivers/BSP/Components/lsm303agr/lsm303agr_reg.h
Normal file
@ -0,0 +1,976 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* @file lsm303agr_reg.h
|
||||
* @author Sensors Software Solution Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* lsm303agr_reg.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LSM303AGR_REGS_H
|
||||
#define LSM303AGR_REGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
/** @addtogroup LSM303AGR
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** @defgroup STMicroelectronics sensors common types
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEMS_SHARED_TYPES
|
||||
#define MEMS_SHARED_TYPES
|
||||
|
||||
typedef struct{
|
||||
uint8_t bit0 : 1;
|
||||
uint8_t bit1 : 1;
|
||||
uint8_t bit2 : 1;
|
||||
uint8_t bit3 : 1;
|
||||
uint8_t bit4 : 1;
|
||||
uint8_t bit5 : 1;
|
||||
uint8_t bit6 : 1;
|
||||
uint8_t bit7 : 1;
|
||||
} bitwise_t;
|
||||
|
||||
#define PROPERTY_DISABLE (0U)
|
||||
#define PROPERTY_ENABLE (1U)
|
||||
|
||||
/** @addtogroup Interfaces_Functions
|
||||
* @brief This section provide a set of functions used to read and
|
||||
* write a generic register of the device.
|
||||
* MANDATORY: return 0 -> no Error.
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef int32_t (*stmdev_write_ptr)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*stmdev_read_ptr) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct {
|
||||
/** Component mandatory fields **/
|
||||
stmdev_write_ptr write_reg;
|
||||
stmdev_read_ptr read_reg;
|
||||
/** Customizable optional pointer **/
|
||||
void *handle;
|
||||
} stmdev_ctx_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_SHARED_TYPES */
|
||||
|
||||
#ifndef MEMS_UCF_SHARED_TYPES
|
||||
#define MEMS_UCF_SHARED_TYPES
|
||||
|
||||
/** @defgroup Generic address-data structure definition
|
||||
* @brief This structure is useful to load a predefined configuration
|
||||
* of a sensor.
|
||||
* You can create a sensor configuration by your own or using
|
||||
* Unico / Unicleo tools available on STMicroelectronics
|
||||
* web site.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t address;
|
||||
uint8_t data;
|
||||
} ucf_line_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* MEMS_UCF_SHARED_TYPES */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
/** @defgroup lsm303agr_Infos
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/** I2C Device Address 8 bit format**/
|
||||
#define LSM303AGR_I2C_ADD_XL 0x33U
|
||||
#define LSM303AGR_I2C_ADD_MG 0x3DU
|
||||
|
||||
/** Device Identification (Who am I) **/
|
||||
#define LSM303AGR_ID_XL 0x33U
|
||||
#define LSM303AGR_ID_MG 0x40U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#define LSM303AGR_STATUS_REG_AUX_A 0x07U
|
||||
typedef struct {
|
||||
uint8_t not_used_01 : 2;
|
||||
uint8_t tda : 1;
|
||||
uint8_t not_used_02 : 3;
|
||||
uint8_t tor : 1;
|
||||
uint8_t not_used_03 : 1;
|
||||
} lsm303agr_status_reg_aux_a_t;
|
||||
|
||||
#define LSM303AGR_OUT_TEMP_L_A 0x0CU
|
||||
#define LSM303AGR_OUT_TEMP_H_A 0x0DU
|
||||
#define LSM303AGR_INT_COUNTER_REG_A 0x0EU
|
||||
#define LSM303AGR_WHO_AM_I_A 0x0FU
|
||||
|
||||
#define LSM303AGR_TEMP_CFG_REG_A 0x1FU
|
||||
typedef struct {
|
||||
uint8_t not_used_01 : 6;
|
||||
uint8_t temp_en : 2;
|
||||
} lsm303agr_temp_cfg_reg_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG1_A 0x20U
|
||||
typedef struct {
|
||||
uint8_t xen : 1;
|
||||
uint8_t yen : 1;
|
||||
uint8_t zen : 1;
|
||||
uint8_t lpen : 1;
|
||||
uint8_t odr : 4;
|
||||
} lsm303agr_ctrl_reg1_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG2_A 0x21U
|
||||
typedef struct {
|
||||
uint8_t hp : 3; /* HPCLICK + HPIS2 + HPIS1 -> HP */
|
||||
uint8_t fds : 1;
|
||||
uint8_t hpcf : 2;
|
||||
uint8_t hpm : 2;
|
||||
} lsm303agr_ctrl_reg2_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG3_A 0x22U
|
||||
typedef struct {
|
||||
uint8_t not_used_01 : 1;
|
||||
uint8_t i1_overrun : 1;
|
||||
uint8_t i1_wtm : 1;
|
||||
uint8_t i1_drdy2 : 1;
|
||||
uint8_t i1_drdy1 : 1;
|
||||
uint8_t i1_aoi2 : 1;
|
||||
uint8_t i1_aoi1 : 1;
|
||||
uint8_t i1_click : 1;
|
||||
} lsm303agr_ctrl_reg3_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG4_A 0x23U
|
||||
typedef struct {
|
||||
uint8_t spi_enable : 1;
|
||||
uint8_t st : 2;
|
||||
uint8_t hr : 1;
|
||||
uint8_t fs : 2;
|
||||
uint8_t ble : 1;
|
||||
uint8_t bdu : 1;
|
||||
} lsm303agr_ctrl_reg4_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG5_A 0x24U
|
||||
typedef struct {
|
||||
uint8_t d4d_int2 : 1;
|
||||
uint8_t lir_int2 : 1;
|
||||
uint8_t d4d_int1 : 1;
|
||||
uint8_t lir_int1 : 1;
|
||||
uint8_t not_used_01 : 2;
|
||||
uint8_t fifo_en : 1;
|
||||
uint8_t boot : 1;
|
||||
} lsm303agr_ctrl_reg5_a_t;
|
||||
|
||||
#define LSM303AGR_CTRL_REG6_A 0x25U
|
||||
typedef struct {
|
||||
uint8_t not_used_01 : 1;
|
||||
uint8_t h_lactive : 1;
|
||||
uint8_t not_used_02 : 1;
|
||||
uint8_t p2_act : 1;
|
||||
uint8_t boot_i2 : 1;
|
||||
uint8_t i2_int2 : 1;
|
||||
uint8_t i2_int1 : 1;
|
||||
uint8_t i2_clicken : 1;
|
||||
} lsm303agr_ctrl_reg6_a_t;
|
||||
|
||||
#define LSM303AGR_REFERENCE_A 0x26U
|
||||
#define LSM303AGR_STATUS_REG_A 0x27U
|
||||
typedef struct {
|
||||
uint8_t xda : 1;
|
||||
uint8_t yda : 1;
|
||||
uint8_t zda : 1;
|
||||
uint8_t zyxda : 1;
|
||||
uint8_t _xor : 1;
|
||||
uint8_t yor : 1;
|
||||
uint8_t zor : 1;
|
||||
uint8_t zyxor : 1;
|
||||
} lsm303agr_status_reg_a_t;
|
||||
|
||||
#define LSM303AGR_OUT_X_L_A 0x28U
|
||||
#define LSM303AGR_OUT_X_H_A 0x29U
|
||||
#define LSM303AGR_OUT_Y_L_A 0x2AU
|
||||
#define LSM303AGR_OUT_Y_H_A 0x2BU
|
||||
#define LSM303AGR_OUT_Z_L_A 0x2CU
|
||||
#define LSM303AGR_OUT_Z_H_A 0x2DU
|
||||
#define LSM303AGR_FIFO_CTRL_REG_A 0x2EU
|
||||
typedef struct {
|
||||
uint8_t fth : 5;
|
||||
uint8_t tr : 1;
|
||||
uint8_t fm : 2;
|
||||
} lsm303agr_fifo_ctrl_reg_a_t;
|
||||
|
||||
#define LSM303AGR_FIFO_SRC_REG_A 0x2FU
|
||||
typedef struct {
|
||||
uint8_t fss : 5;
|
||||
uint8_t empty : 1;
|
||||
uint8_t ovrn_fifo : 1;
|
||||
uint8_t wtm : 1;
|
||||
} lsm303agr_fifo_src_reg_a_t;
|
||||
|
||||
#define LSM303AGR_INT1_CFG_A 0x30U
|
||||
typedef struct {
|
||||
uint8_t xlie : 1; /* or XDOWNE */
|
||||
uint8_t xhie : 1; /* or XUPE */
|
||||
uint8_t ylie : 1; /* or YDOWNE */
|
||||
uint8_t yhie : 1; /* or YUPE */
|
||||
uint8_t zlie : 1; /* or ZDOWNE */
|
||||
uint8_t zhie : 1; /* or ZUPE */
|
||||
uint8_t _6d : 1;
|
||||
uint8_t aoi : 1;
|
||||
} lsm303agr_int1_cfg_a_t;
|
||||
|
||||
#define LSM303AGR_INT1_SRC_A 0x31U
|
||||
typedef struct {
|
||||
uint8_t xl : 1;
|
||||
uint8_t xh : 1;
|
||||
uint8_t yl : 1;
|
||||
uint8_t yh : 1;
|
||||
uint8_t zl : 1;
|
||||
uint8_t zh : 1;
|
||||
uint8_t ia : 1;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int1_src_a_t;
|
||||
|
||||
#define LSM303AGR_INT1_THS_A 0x32U
|
||||
typedef struct {
|
||||
uint8_t ths : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int1_ths_a_t;
|
||||
|
||||
#define LSM303AGR_INT1_DURATION_A 0x33U
|
||||
typedef struct {
|
||||
uint8_t d : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int1_duration_a_t;
|
||||
|
||||
#define LSM303AGR_INT2_CFG_A 0x34U
|
||||
typedef struct {
|
||||
uint8_t xlie : 1;
|
||||
uint8_t xhie : 1;
|
||||
uint8_t ylie : 1;
|
||||
uint8_t yhie : 1;
|
||||
uint8_t zlie : 1;
|
||||
uint8_t zhie : 1;
|
||||
uint8_t _6d : 1;
|
||||
uint8_t aoi : 1;
|
||||
} lsm303agr_int2_cfg_a_t;
|
||||
|
||||
#define LSM303AGR_INT2_SRC_A 0x35U
|
||||
typedef struct {
|
||||
uint8_t xl : 1;
|
||||
uint8_t xh : 1;
|
||||
uint8_t yl : 1;
|
||||
uint8_t yh : 1;
|
||||
uint8_t zl : 1;
|
||||
uint8_t zh : 1;
|
||||
uint8_t ia : 1;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int2_src_a_t;
|
||||
|
||||
#define LSM303AGR_INT2_THS_A 0x36U
|
||||
typedef struct {
|
||||
uint8_t ths : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int2_ths_a_t;
|
||||
|
||||
#define LSM303AGR_INT2_DURATION_A 0x37U
|
||||
typedef struct {
|
||||
uint8_t d : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_int2_duration_a_t;
|
||||
|
||||
#define LSM303AGR_CLICK_CFG_A 0x38U
|
||||
typedef struct {
|
||||
uint8_t xs : 1;
|
||||
uint8_t xd : 1;
|
||||
uint8_t ys : 1;
|
||||
uint8_t yd : 1;
|
||||
uint8_t zs : 1;
|
||||
uint8_t zd : 1;
|
||||
uint8_t not_used_01 : 2;
|
||||
} lsm303agr_click_cfg_a_t;
|
||||
|
||||
#define LSM303AGR_CLICK_SRC_A 0x39U
|
||||
typedef struct {
|
||||
uint8_t x : 1;
|
||||
uint8_t y : 1;
|
||||
uint8_t z : 1;
|
||||
uint8_t sign : 1;
|
||||
uint8_t sclick : 1;
|
||||
uint8_t dclick : 1;
|
||||
uint8_t ia : 1;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_click_src_a_t;
|
||||
|
||||
#define LSM303AGR_CLICK_THS_A 0x3AU
|
||||
typedef struct {
|
||||
uint8_t ths : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_click_ths_a_t;
|
||||
|
||||
#define LSM303AGR_TIME_LIMIT_A 0x3BU
|
||||
typedef struct {
|
||||
uint8_t tli : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_time_limit_a_t;
|
||||
|
||||
#define LSM303AGR_TIME_LATENCY_A 0x3CU
|
||||
typedef struct {
|
||||
uint8_t tla : 8;
|
||||
} lsm303agr_time_latency_a_t;
|
||||
|
||||
#define LSM303AGR_TIME_WINDOW_A 0x3DU
|
||||
typedef struct {
|
||||
uint8_t tw : 8;
|
||||
} lsm303agr_time_window_a_t;
|
||||
|
||||
#define LSM303AGR_ACT_THS_A 0x3EU
|
||||
typedef struct {
|
||||
uint8_t acth : 7;
|
||||
uint8_t not_used_01 : 1;
|
||||
} lsm303agr_act_ths_a_t;
|
||||
|
||||
#define LSM303AGR_ACT_DUR_A 0x3FU
|
||||
typedef struct {
|
||||
uint8_t actd : 8;
|
||||
} lsm303agr_act_dur_a_t;
|
||||
|
||||
#define LSM303AGR_OFFSET_X_REG_L_M 0x45U
|
||||
#define LSM303AGR_OFFSET_X_REG_H_M 0x46U
|
||||
#define LSM303AGR_OFFSET_Y_REG_L_M 0x47U
|
||||
#define LSM303AGR_OFFSET_Y_REG_H_M 0x48U
|
||||
#define LSM303AGR_OFFSET_Z_REG_L_M 0x49U
|
||||
#define LSM303AGR_OFFSET_Z_REG_H_M 0x4AU
|
||||
#define LSM303AGR_WHO_AM_I_M 0x4FU
|
||||
#define LSM303AGR_CFG_REG_A_M 0x60U
|
||||
typedef struct {
|
||||
uint8_t md : 2;
|
||||
uint8_t odr : 2;
|
||||
uint8_t lp : 1;
|
||||
uint8_t soft_rst : 1;
|
||||
uint8_t reboot : 1;
|
||||
uint8_t comp_temp_en : 1;
|
||||
} lsm303agr_cfg_reg_a_m_t;
|
||||
|
||||
#define LSM303AGR_CFG_REG_B_M 0x61U
|
||||
typedef struct {
|
||||
uint8_t lpf : 1;
|
||||
uint8_t set_rst : 2; /* OFF_CANC + Set_FREQ */
|
||||
uint8_t int_on_dataoff : 1;
|
||||
uint8_t off_canc_one_shot : 1;
|
||||
uint8_t not_used_01 : 3;
|
||||
} lsm303agr_cfg_reg_b_m_t;
|
||||
|
||||
#define LSM303AGR_CFG_REG_C_M 0x62U
|
||||
typedef struct {
|
||||
uint8_t int_mag : 1;
|
||||
uint8_t self_test : 1;
|
||||
uint8_t not_used_01 : 1;
|
||||
uint8_t ble : 1;
|
||||
uint8_t bdu : 1;
|
||||
uint8_t i2c_dis : 1;
|
||||
uint8_t int_mag_pin : 1;
|
||||
uint8_t not_used_02 : 1;
|
||||
} lsm303agr_cfg_reg_c_m_t;
|
||||
|
||||
#define LSM303AGR_INT_CRTL_REG_M 0x63U
|
||||
typedef struct {
|
||||
uint8_t ien : 1;
|
||||
uint8_t iel : 1;
|
||||
uint8_t iea : 1;
|
||||
uint8_t not_used_01 : 2;
|
||||
uint8_t zien : 1;
|
||||
uint8_t yien : 1;
|
||||
uint8_t xien : 1;
|
||||
} lsm303agr_int_crtl_reg_m_t;
|
||||
|
||||
#define LSM303AGR_INT_SOURCE_REG_M 0x64U
|
||||
typedef struct {
|
||||
uint8_t _int : 1;
|
||||
uint8_t mroi : 1;
|
||||
uint8_t n_th_s_z : 1;
|
||||
uint8_t n_th_s_y : 1;
|
||||
uint8_t n_th_s_x : 1;
|
||||
uint8_t p_th_s_z : 1;
|
||||
uint8_t p_th_s_y : 1;
|
||||
uint8_t p_th_s_x : 1;
|
||||
} lsm303agr_int_source_reg_m_t;
|
||||
|
||||
#define LSM303AGR_INT_THS_L_REG_M 0x65U
|
||||
#define LSM303AGR_INT_THS_H_REG_M 0x66U
|
||||
#define LSM303AGR_STATUS_REG_M 0x67U
|
||||
typedef struct {
|
||||
uint8_t xda : 1;
|
||||
uint8_t yda : 1;
|
||||
uint8_t zda : 1;
|
||||
uint8_t zyxda : 1;
|
||||
uint8_t _xor : 1;
|
||||
uint8_t yor : 1;
|
||||
uint8_t zor : 1;
|
||||
uint8_t zyxor : 1;
|
||||
} lsm303agr_status_reg_m_t;
|
||||
|
||||
#define LSM303AGR_OUTX_L_REG_M 0x68U
|
||||
#define LSM303AGR_OUTX_H_REG_M 0x69U
|
||||
#define LSM303AGR_OUTY_L_REG_M 0x6AU
|
||||
#define LSM303AGR_OUTY_H_REG_M 0x6BU
|
||||
#define LSM303AGR_OUTZ_L_REG_M 0x6CU
|
||||
#define LSM303AGR_OUTZ_H_REG_M 0x6DU
|
||||
|
||||
/**
|
||||
* @defgroup LSM303AGR_Register_Union
|
||||
* @brief This union group all the registers that has a bit-field
|
||||
* description.
|
||||
* This union is useful but not need by the driver.
|
||||
*
|
||||
* REMOVING this union you are compliant with:
|
||||
* MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
typedef union{
|
||||
lsm303agr_status_reg_aux_a_t status_reg_aux_a;
|
||||
lsm303agr_temp_cfg_reg_a_t temp_cfg_reg_a;
|
||||
lsm303agr_ctrl_reg1_a_t ctrl_reg1_a;
|
||||
lsm303agr_ctrl_reg2_a_t ctrl_reg2_a;
|
||||
lsm303agr_ctrl_reg3_a_t ctrl_reg3_a;
|
||||
lsm303agr_ctrl_reg4_a_t ctrl_reg4_a;
|
||||
lsm303agr_ctrl_reg5_a_t ctrl_reg5_a;
|
||||
lsm303agr_ctrl_reg6_a_t ctrl_reg6_a;
|
||||
lsm303agr_status_reg_a_t status_reg_a;
|
||||
lsm303agr_fifo_ctrl_reg_a_t fifo_ctrl_reg_a;
|
||||
lsm303agr_fifo_src_reg_a_t fifo_src_reg_a;
|
||||
lsm303agr_int1_cfg_a_t int1_cfg_a;
|
||||
lsm303agr_int1_src_a_t int1_src_a;
|
||||
lsm303agr_int1_ths_a_t int1_ths_a;
|
||||
lsm303agr_int1_duration_a_t int1_duration_a;
|
||||
lsm303agr_int2_cfg_a_t int2_cfg_a;
|
||||
lsm303agr_int2_src_a_t int2_src_a;
|
||||
lsm303agr_int2_ths_a_t int2_ths_a;
|
||||
lsm303agr_int2_duration_a_t int2_duration_a;
|
||||
lsm303agr_click_cfg_a_t click_cfg_a;
|
||||
lsm303agr_click_src_a_t click_src_a;
|
||||
lsm303agr_click_ths_a_t click_ths_a;
|
||||
lsm303agr_time_limit_a_t time_limit_a;
|
||||
lsm303agr_time_latency_a_t time_latency_a;
|
||||
lsm303agr_time_window_a_t time_window_a;
|
||||
lsm303agr_act_ths_a_t act_ths_a;
|
||||
lsm303agr_act_dur_a_t act_dur_a;
|
||||
lsm303agr_cfg_reg_a_m_t cfg_reg_a_m;
|
||||
lsm303agr_cfg_reg_b_m_t cfg_reg_b_m;
|
||||
lsm303agr_cfg_reg_c_m_t cfg_reg_c_m;
|
||||
lsm303agr_int_crtl_reg_m_t int_crtl_reg_m;
|
||||
lsm303agr_int_source_reg_m_t int_source_reg_m;
|
||||
lsm303agr_status_reg_m_t status_reg_m;
|
||||
bitwise_t bitwise;
|
||||
uint8_t byte;
|
||||
} lsm303agr_reg_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
int32_t lsm303agr_read_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
int32_t lsm303agr_write_reg(stmdev_ctx_t *ctx, uint8_t reg, uint8_t* data,
|
||||
uint16_t len);
|
||||
|
||||
extern float_t lsm303agr_from_fs_2g_hr_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_4g_hr_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_8g_hr_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_16g_hr_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_lsb_hr_to_celsius(int16_t lsb);
|
||||
|
||||
extern float_t lsm303agr_from_fs_2g_nm_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_4g_nm_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_8g_nm_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_16g_nm_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_lsb_nm_to_celsius(int16_t lsb);
|
||||
|
||||
extern float_t lsm303agr_from_fs_2g_lp_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_4g_lp_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_8g_lp_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_fs_16g_lp_to_mg(int16_t lsb);
|
||||
extern float_t lsm303agr_from_lsb_lp_to_celsius(int16_t lsb);
|
||||
|
||||
extern float_t lsm303agr_from_lsb_to_mgauss(int16_t lsb);
|
||||
|
||||
int32_t lsm303agr_temp_status_reg_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lsm303agr_temp_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_temp_data_ovr_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_temperature_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_TEMP_DISABLE = 0,
|
||||
LSM303AGR_TEMP_ENABLE = 3,
|
||||
} lsm303agr_temp_en_a_t;
|
||||
int32_t lsm303agr_temperature_meas_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_temp_en_a_t val);
|
||||
int32_t lsm303agr_temperature_meas_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_temp_en_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_HR_12bit = 0,
|
||||
LSM303AGR_NM_10bit = 1,
|
||||
LSM303AGR_LP_8bit = 2,
|
||||
} lsm303agr_op_md_a_t;
|
||||
int32_t lsm303agr_xl_operating_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_op_md_a_t val);
|
||||
int32_t lsm303agr_xl_operating_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_op_md_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_XL_POWER_DOWN = 0,
|
||||
LSM303AGR_XL_ODR_1Hz = 1,
|
||||
LSM303AGR_XL_ODR_10Hz = 2,
|
||||
LSM303AGR_XL_ODR_25Hz = 3,
|
||||
LSM303AGR_XL_ODR_50Hz = 4,
|
||||
LSM303AGR_XL_ODR_100Hz = 5,
|
||||
LSM303AGR_XL_ODR_200Hz = 6,
|
||||
LSM303AGR_XL_ODR_400Hz = 7,
|
||||
LSM303AGR_XL_ODR_1kHz620_LP = 8,
|
||||
LSM303AGR_XL_ODR_1kHz344_NM_HP_5kHz376_LP = 9,
|
||||
} lsm303agr_odr_a_t;
|
||||
int32_t lsm303agr_xl_data_rate_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_odr_a_t val);
|
||||
int32_t lsm303agr_xl_data_rate_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_odr_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_high_pass_on_outputs_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_high_pass_on_outputs_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_AGGRESSIVE = 0,
|
||||
LSM303AGR_STRONG = 1,
|
||||
LSM303AGR_MEDIUM = 2,
|
||||
LSM303AGR_LIGHT = 3,
|
||||
} lsm303agr_hpcf_a_t;
|
||||
int32_t lsm303agr_xl_high_pass_bandwidth_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hpcf_a_t val);
|
||||
int32_t lsm303agr_xl_high_pass_bandwidth_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hpcf_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_NORMAL_WITH_RST = 0,
|
||||
LSM303AGR_REFERENCE_MODE = 1,
|
||||
LSM303AGR_NORMAL = 2,
|
||||
LSM303AGR_AUTORST_ON_INT = 3,
|
||||
} lsm303agr_hpm_a_t;
|
||||
int32_t lsm303agr_xl_high_pass_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hpm_a_t val);
|
||||
int32_t lsm303agr_xl_high_pass_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hpm_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_2g = 0,
|
||||
LSM303AGR_4g = 1,
|
||||
LSM303AGR_8g = 2,
|
||||
LSM303AGR_16g = 3,
|
||||
} lsm303agr_fs_a_t;
|
||||
int32_t lsm303agr_xl_full_scale_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_fs_a_t val);
|
||||
int32_t lsm303agr_xl_full_scale_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_fs_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_block_data_update_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_block_data_update_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_filter_reference_set(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
int32_t lsm303agr_xl_filter_reference_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
|
||||
int32_t lsm303agr_xl_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_data_ovr_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_acceleration_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lsm303agr_xl_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_ST_DISABLE = 0,
|
||||
LSM303AGR_ST_POSITIVE = 1,
|
||||
LSM303AGR_ST_NEGATIVE = 2,
|
||||
} lsm303agr_st_a_t;
|
||||
int32_t lsm303agr_xl_self_test_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_st_a_t val);
|
||||
int32_t lsm303agr_xl_self_test_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_st_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_XL_LSB_AT_LOW_ADD = 0,
|
||||
LSM303AGR_XL_MSB_AT_LOW_ADD = 1,
|
||||
} lsm303agr_ble_a_t;
|
||||
int32_t lsm303agr_xl_data_format_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ble_a_t val);
|
||||
int32_t lsm303agr_xl_data_format_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ble_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_boot_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_xl_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_status_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_status_reg_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int1_gen_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int1_cfg_a_t *val);
|
||||
int32_t lsm303agr_xl_int1_gen_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int1_cfg_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int1_gen_source_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int1_src_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int1_gen_threshold_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int1_gen_threshold_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int1_gen_duration_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int1_gen_duration_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int2_gen_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int2_cfg_a_t *val);
|
||||
int32_t lsm303agr_xl_int2_gen_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int2_cfg_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int2_gen_source_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int2_src_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int2_gen_threshold_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int2_gen_threshold_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int2_gen_duration_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int2_gen_duration_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_DISC_FROM_INT_GENERATOR = 0,
|
||||
LSM303AGR_ON_INT1_GEN = 1,
|
||||
LSM303AGR_ON_INT2_GEN = 2,
|
||||
LSM303AGR_ON_TAP_GEN = 4,
|
||||
LSM303AGR_ON_INT1_INT2_GEN = 3,
|
||||
LSM303AGR_ON_INT1_TAP_GEN = 5,
|
||||
LSM303AGR_ON_INT2_TAP_GEN = 6,
|
||||
LSM303AGR_ON_INT1_INT2_TAP_GEN = 7,
|
||||
} lsm303agr_hp_a_t;
|
||||
int32_t lsm303agr_xl_high_pass_int_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hp_a_t val);
|
||||
int32_t lsm303agr_xl_high_pass_int_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_hp_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_pin_int1_config_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ctrl_reg3_a_t *val);
|
||||
int32_t lsm303agr_xl_pin_int1_config_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ctrl_reg3_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int2_pin_detect_4d_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int2_pin_detect_4d_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_INT2_PULSED = 0,
|
||||
LSM303AGR_INT2_LATCHED = 1,
|
||||
} lsm303agr_lir_int2_a_t;
|
||||
int32_t lsm303agr_xl_int2pin_notification_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lir_int2_a_t val);
|
||||
int32_t lsm303agr_xl_int2pin_notification_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lir_int2_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_int1_pin_detect_4d_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_xl_int1_pin_detect_4d_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_INT1_PULSED = 0,
|
||||
LSM303AGR_INT1_LATCHED = 1,
|
||||
} lsm303agr_lir_int1_a_t;
|
||||
int32_t lsm303agr_xl_int1pin_notification_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lir_int1_a_t val);
|
||||
int32_t lsm303agr_xl_int1pin_notification_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lir_int1_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_pin_int2_config_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ctrl_reg6_a_t *val);
|
||||
int32_t lsm303agr_xl_pin_int2_config_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ctrl_reg6_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_xl_fifo_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_watermark_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_xl_fifo_watermark_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_INT1_GEN = 0,
|
||||
LSM303AGR_INT2_GEN = 1,
|
||||
} lsm303agr_tr_a_t;
|
||||
int32_t lsm303agr_xl_fifo_trigger_event_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_tr_a_t val);
|
||||
int32_t lsm303agr_xl_fifo_trigger_event_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_tr_a_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_BYPASS_MODE = 0,
|
||||
LSM303AGR_FIFO_MODE = 1,
|
||||
LSM303AGR_DYNAMIC_STREAM_MODE = 2,
|
||||
LSM303AGR_STREAM_TO_FIFO_MODE = 3,
|
||||
} lsm303agr_fm_a_t;
|
||||
int32_t lsm303agr_xl_fifo_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_fm_a_t val);
|
||||
int32_t lsm303agr_xl_fifo_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_fm_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_status_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_fifo_src_reg_a_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_data_level_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_empty_flag_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_ovr_flag_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_xl_fifo_fth_flag_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_tap_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_click_cfg_a_t *val);
|
||||
int32_t lsm303agr_tap_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_click_cfg_a_t *val);
|
||||
|
||||
int32_t lsm303agr_tap_source_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_click_src_a_t *val);
|
||||
|
||||
int32_t lsm303agr_tap_threshold_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_tap_threshold_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_shock_dur_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_shock_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_quiet_dur_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_quiet_dur_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_double_tap_timeout_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_double_tap_timeout_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_act_threshold_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_act_threshold_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_act_timeout_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_act_timeout_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_SPI_4_WIRE = 0,
|
||||
LSM303AGR_SPI_3_WIRE = 1,
|
||||
} lsm303agr_sim_a_t;
|
||||
int32_t lsm303agr_xl_spi_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_sim_a_t val);
|
||||
int32_t lsm303agr_xl_spi_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_sim_a_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_user_offset_set(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
int32_t lsm303agr_mag_user_offset_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_CONTINUOUS_MODE = 0,
|
||||
LSM303AGR_SINGLE_TRIGGER = 1,
|
||||
LSM303AGR_POWER_DOWN = 2,
|
||||
} lsm303agr_md_m_t;
|
||||
int32_t lsm303agr_mag_operating_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_md_m_t val);
|
||||
int32_t lsm303agr_mag_operating_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_md_m_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_MG_ODR_10Hz = 0,
|
||||
LSM303AGR_MG_ODR_20Hz = 1,
|
||||
LSM303AGR_MG_ODR_50Hz = 2,
|
||||
LSM303AGR_MG_ODR_100Hz = 3,
|
||||
} lsm303agr_mg_odr_m_t;
|
||||
int32_t lsm303agr_mag_data_rate_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_mg_odr_m_t val);
|
||||
int32_t lsm303agr_mag_data_rate_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_mg_odr_m_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_HIGH_RESOLUTION = 0,
|
||||
LSM303AGR_LOW_POWER = 1,
|
||||
} lsm303agr_lp_m_t;
|
||||
int32_t lsm303agr_mag_power_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lp_m_t val);
|
||||
int32_t lsm303agr_mag_power_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lp_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_offset_temp_comp_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_mag_offset_temp_comp_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_ODR_DIV_2 = 0,
|
||||
LSM303AGR_ODR_DIV_4 = 1,
|
||||
} lsm303agr_lpf_m_t;
|
||||
int32_t lsm303agr_mag_low_pass_bandwidth_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lpf_m_t val);
|
||||
int32_t lsm303agr_mag_low_pass_bandwidth_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_lpf_m_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_SET_SENS_ODR_DIV_63 = 0,
|
||||
LSM303AGR_SENS_OFF_CANC_EVERY_ODR = 1,
|
||||
LSM303AGR_SET_SENS_ONLY_AT_POWER_ON = 2,
|
||||
} lsm303agr_set_rst_m_t;
|
||||
int32_t lsm303agr_mag_set_rst_mode_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_set_rst_m_t val);
|
||||
int32_t lsm303agr_mag_set_rst_mode_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_set_rst_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_set_rst_sensor_single_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_mag_set_rst_sensor_single_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_block_data_update_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_mag_block_data_update_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_data_ready_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_data_ovr_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_magnetic_raw_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lsm303agr_mag_device_id_get(stmdev_ctx_t *ctx, uint8_t *buff);
|
||||
|
||||
int32_t lsm303agr_mag_reset_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_mag_reset_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_boot_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_mag_boot_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_self_test_set(stmdev_ctx_t *ctx,
|
||||
uint8_t val);
|
||||
int32_t lsm303agr_mag_self_test_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_MG_LSB_AT_LOW_ADD = 0,
|
||||
LSM303AGR_MG_MSB_AT_LOW_ADD = 1,
|
||||
} lsm303agr_ble_m_t;
|
||||
int32_t lsm303agr_mag_data_format_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ble_m_t val);
|
||||
int32_t lsm303agr_mag_data_format_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_ble_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_status_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_status_reg_m_t *val);
|
||||
|
||||
typedef enum {
|
||||
LSM303AGR_CHECK_BEFORE = 0,
|
||||
LSM303AGR_CHECK_AFTER = 1,
|
||||
} lsm303agr_int_on_dataoff_m_t;
|
||||
int32_t lsm303agr_mag_offset_int_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int_on_dataoff_m_t val);
|
||||
int32_t lsm303agr_mag_offset_int_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int_on_dataoff_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_drdy_on_pin_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_mag_drdy_on_pin_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_int_on_pin_set(stmdev_ctx_t *ctx, uint8_t val);
|
||||
int32_t lsm303agr_mag_int_on_pin_get(stmdev_ctx_t *ctx, uint8_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_int_gen_conf_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int_crtl_reg_m_t *val);
|
||||
int32_t lsm303agr_mag_int_gen_conf_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int_crtl_reg_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_int_gen_source_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_int_source_reg_m_t *val);
|
||||
|
||||
int32_t lsm303agr_mag_int_gen_treshold_set(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
int32_t lsm303agr_mag_int_gen_treshold_get(stmdev_ctx_t *ctx,
|
||||
uint8_t *buff);
|
||||
typedef enum {
|
||||
LSM303AGR_I2C_ENABLE = 0,
|
||||
LSM303AGR_I2C_DISABLE = 1,
|
||||
} lsm303agr_i2c_dis_m_t;
|
||||
int32_t lsm303agr_mag_i2c_interface_set(stmdev_ctx_t *ctx,
|
||||
lsm303agr_i2c_dis_m_t val);
|
||||
int32_t lsm303agr_mag_i2c_interface_get(stmdev_ctx_t *ctx,
|
||||
lsm303agr_i2c_dis_m_t *val);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LSM303AGR_REGS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,365 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LSM303DLHC Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for LSM303DLHC Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 24-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">lsm303dlhc.c: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Add accelerometer de-initialization function: LSM303DLHC_AccDeInit()</span></li></ul><ul><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common
|
||||
driver V4.0.0</span><br>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 20-November-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">lsm303dlhc.h: change "\" by "/" in the include path to fix compilation issue under Linux</span><br>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Miscellaneous comments update</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Arial; color: white;"><o:p></o:p></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 160px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
578
2P-ProjectPong/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.c
Normal file
578
2P-ProjectPong/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.c
Normal file
@ -0,0 +1,578 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lsm303dlhc.c
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 24-June-2015
|
||||
* @brief This file provides a set of functions needed to manage the lsm303dlhc
|
||||
* MEMS accelerometer.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lsm303dlhc.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM303DLHC
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
ACCELERO_DrvTypeDef Lsm303dlhcDrv =
|
||||
{
|
||||
LSM303DLHC_AccInit,
|
||||
LSM303DLHC_AccDeInit,
|
||||
LSM303DLHC_AccReadID,
|
||||
LSM303DLHC_AccRebootCmd,
|
||||
0,
|
||||
LSM303DLHC_AccZClickITConfig,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
LSM303DLHC_AccFilterConfig,
|
||||
LSM303DLHC_AccFilterCmd,
|
||||
LSM303DLHC_AccReadXYZ
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set LSM303DLHC Initialization.
|
||||
* @param InitStruct: Init parameters
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccInit(uint16_t InitStruct)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Low level init */
|
||||
COMPASSACCELERO_IO_Init();
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG1 register */
|
||||
ctrl = (uint8_t) InitStruct;
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG1_A, ctrl);
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG4 register */
|
||||
ctrl = (uint8_t) (InitStruct << 8);
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG4_A, ctrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LSM303DLHC De-initialization.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccDeInit(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read LSM303DLHC ID.
|
||||
* @param None
|
||||
* @retval ID
|
||||
*/
|
||||
uint8_t LSM303DLHC_AccReadID(void)
|
||||
{
|
||||
uint8_t ctrl = 0x00;
|
||||
|
||||
/* Low level init */
|
||||
COMPASSACCELERO_IO_Init();
|
||||
|
||||
/* Read value at Who am I register address */
|
||||
ctrl = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_WHO_AM_I_ADDR);
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reboot memory content of LSM303DLHC
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccRebootCmd(void)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG5 register */
|
||||
tmpreg = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG5_A);
|
||||
|
||||
/* Enable or Disable the reboot memory */
|
||||
tmpreg |= LSM303DLHC_BOOT_REBOOTMEMORY;
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG5 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG5_A, tmpreg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set High Pass Filter Modality
|
||||
* @param FilterStruct: contains data for filter config
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccFilterConfig(uint8_t FilterStruct)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG2 register */
|
||||
tmpreg = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A);
|
||||
|
||||
tmpreg &= 0x0C;
|
||||
tmpreg |= FilterStruct;
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG2 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A, tmpreg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable or Disable High Pass Filter
|
||||
* @param HighPassFilterState: new state of the High Pass Filter feature.
|
||||
* This parameter can be:
|
||||
* @arg: LSM303DLHC_HIGHPASSFILTER_DISABLE
|
||||
* @arg: LSM303DLHC_HIGHPASSFILTER_ENABLE
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccFilterCmd(uint8_t HighPassFilterState)
|
||||
{
|
||||
uint8_t tmpreg;
|
||||
|
||||
/* Read CTRL_REG2 register */
|
||||
tmpreg = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A);
|
||||
|
||||
tmpreg &= 0xF7;
|
||||
|
||||
tmpreg |= HighPassFilterState;
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG2 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A, tmpreg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read X, Y & Z Acceleration values
|
||||
* @param pData: Data out pointer
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccReadXYZ(int16_t* pData)
|
||||
{
|
||||
int16_t pnRawData[3];
|
||||
uint8_t ctrlx[2]={0,0};
|
||||
int8_t buffer[6];
|
||||
uint8_t i = 0;
|
||||
uint8_t sensitivity = LSM303DLHC_ACC_SENSITIVITY_2G;
|
||||
|
||||
/* Read the acceleration control register content */
|
||||
ctrlx[0] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG4_A);
|
||||
ctrlx[1] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG5_A);
|
||||
|
||||
/* Read output register X, Y & Z acceleration */
|
||||
buffer[0] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_X_L_A);
|
||||
buffer[1] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_X_H_A);
|
||||
buffer[2] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_Y_L_A);
|
||||
buffer[3] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_Y_H_A);
|
||||
buffer[4] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_Z_L_A);
|
||||
buffer[5] = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_OUT_Z_H_A);
|
||||
|
||||
/* Check in the control register4 the data alignment*/
|
||||
if(!(ctrlx[0] & LSM303DLHC_BLE_MSB))
|
||||
{
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pnRawData[i]=((int16_t)((uint16_t)buffer[2*i+1] << 8) + buffer[2*i]);
|
||||
}
|
||||
}
|
||||
else /* Big Endian Mode */
|
||||
{
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pnRawData[i]=((int16_t)((uint16_t)buffer[2*i] << 8) + buffer[2*i+1]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Normal mode */
|
||||
/* Switch the sensitivity value set in the CRTL4 */
|
||||
switch(ctrlx[0] & LSM303DLHC_FULLSCALE_16G)
|
||||
{
|
||||
case LSM303DLHC_FULLSCALE_2G:
|
||||
sensitivity = LSM303DLHC_ACC_SENSITIVITY_2G;
|
||||
break;
|
||||
case LSM303DLHC_FULLSCALE_4G:
|
||||
sensitivity = LSM303DLHC_ACC_SENSITIVITY_4G;
|
||||
break;
|
||||
case LSM303DLHC_FULLSCALE_8G:
|
||||
sensitivity = LSM303DLHC_ACC_SENSITIVITY_8G;
|
||||
break;
|
||||
case LSM303DLHC_FULLSCALE_16G:
|
||||
sensitivity = LSM303DLHC_ACC_SENSITIVITY_16G;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Obtain the mg value for the three axis */
|
||||
for(i=0; i<3; i++)
|
||||
{
|
||||
pData[i]=(pnRawData[i] * sensitivity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable or Disable High Pass Filter on CLick
|
||||
* @param HighPassFilterState: new state of the High Pass Filter feature.
|
||||
* This parameter can be:
|
||||
* @arg: LSM303DLHC_HPF_CLICK_DISABLE
|
||||
* @arg: LSM303DLHC_HPF_CLICK_ENABLE
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccFilterClickCmd(uint8_t HighPassFilterClickState)
|
||||
{
|
||||
uint8_t tmpreg = 0x00;
|
||||
|
||||
/* Read CTRL_REG2 register */
|
||||
tmpreg = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A);
|
||||
|
||||
tmpreg &= ~(LSM303DLHC_HPF_CLICK_ENABLE);
|
||||
|
||||
tmpreg |= HighPassFilterClickState;
|
||||
|
||||
/* Write value to ACC MEMS CTRL_REG2 regsister */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG2_A, tmpreg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable LSM303DLHC Interrupt1
|
||||
* @param LSM303DLHC_IT: specifies the LSM303DLHC interrupt source to be enabled.
|
||||
* This parameter can be any combination of the following values:
|
||||
* @arg LSM303DLHC_IT1_CLICK
|
||||
* @arg LSM303DLHC_IT1_AOI1
|
||||
* @arg LSM303DLHC_IT1_AOI2
|
||||
* @arg LSM303DLHC_IT1_DRY1
|
||||
* @arg LSM303DLHC_IT1_DRY2
|
||||
* @arg LSM303DLHC_IT1_WTM
|
||||
* @arg LSM303DLHC_IT1_OVERRUN
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccIT1Enable(uint8_t LSM303DLHC_IT)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG3_A);
|
||||
|
||||
/* Enable IT1 */
|
||||
tmpval |= LSM303DLHC_IT;
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG3_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable LSM303DLHC Interrupt1
|
||||
* @param LSM303DLHC_IT: specifies the LSM303DLHC interrupt source to be disabled.
|
||||
* This parameter can be any combination of the following values:
|
||||
* @arg LSM303DLHC_IT1_CLICK
|
||||
* @arg LSM303DLHC_IT1_AOI1
|
||||
* @arg LSM303DLHC_IT1_AOI2
|
||||
* @arg LSM303DLHC_IT1_DRY1
|
||||
* @arg LSM303DLHC_IT1_DRY2
|
||||
* @arg LSM303DLHC_IT1_WTM
|
||||
* @arg LSM303DLHC_IT1_OVERRUN
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccIT1Disable(uint8_t LSM303DLHC_IT)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG3_A);
|
||||
|
||||
/* Disable IT1 */
|
||||
tmpval &= ~LSM303DLHC_IT;
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG3_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable LSM303DLHC Interrupt2
|
||||
* @param LSM303DLHC_IT: specifies the LSM303DLHC interrupt source to be enabled.
|
||||
* This parameter can be any combination of the following values:
|
||||
* @arg LSM303DLHC_IT2_CLICK
|
||||
* @arg LSM303DLHC_IT2_INT1
|
||||
* @arg LSM303DLHC_IT2_INT2
|
||||
* @arg LSM303DLHC_IT2_BOOT
|
||||
* @arg LSM303DLHC_IT2_ACT
|
||||
* @arg LSM303DLHC_IT2_HLACTIVE
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccIT2Enable(uint8_t LSM303DLHC_IT)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG6_A);
|
||||
|
||||
/* Enable IT2 */
|
||||
tmpval |= LSM303DLHC_IT;
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG6_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable LSM303DLHC Interrupt2
|
||||
* @param LSM303DLHC_IT: specifies the LSM303DLHC interrupt source to be disabled.
|
||||
* This parameter can be any combination of the following values:
|
||||
* @arg LSM303DLHC_IT2_CLICK
|
||||
* @arg LSM303DLHC_IT2_INT1
|
||||
* @arg LSM303DLHC_IT2_INT2
|
||||
* @arg LSM303DLHC_IT2_BOOT
|
||||
* @arg LSM303DLHC_IT2_ACT
|
||||
* @arg LSM303DLHC_IT2_HLACTIVE
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccIT2Disable(uint8_t LSM303DLHC_IT)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CTRL_REG3 register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG6_A);
|
||||
|
||||
/* Disable IT2 */
|
||||
tmpval &= ~LSM303DLHC_IT;
|
||||
|
||||
/* Write value to MEMS CTRL_REG3 register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CTRL_REG6_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief INT1 interrupt enable
|
||||
* @param ITCombination: Or or And combination
|
||||
* ITAxes: Axes to be enabled
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccINT1InterruptEnable(uint8_t ITCombination, uint8_t ITAxes)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read INT1_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_INT1_CFG_A);
|
||||
|
||||
/* Enable the selected interrupt */
|
||||
tmpval |= (ITAxes | ITCombination);
|
||||
|
||||
/* Write value to MEMS INT1_CFR register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_INT1_CFG_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief INT1 interrupt disable
|
||||
* @param ITCombination: Or or And combination
|
||||
* ITAxes: Axes to be enabled
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccINT1InterruptDisable(uint8_t ITCombination, uint8_t ITAxes)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read INT1_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_INT1_CFG_A);
|
||||
|
||||
/* Disable the selected interrupt */
|
||||
tmpval &= ~(ITAxes | ITCombination);
|
||||
|
||||
/* Write value to MEMS INT1_CFR register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_INT1_CFG_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief INT2 interrupt enable
|
||||
* @param ITCombination: Or or And combination
|
||||
* ITAxes: axes to be enabled
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccINT2InterruptEnable(uint8_t ITCombination, uint8_t ITAxes)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read INT2_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_INT2_CFG_A);
|
||||
|
||||
/* Enable the selected interrupt */
|
||||
tmpval |= (ITAxes | ITCombination);
|
||||
|
||||
/* Write value to MEMS INT2_CFR register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_INT2_CFG_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief INT2 interrupt config
|
||||
* @param ITCombination: Or or And combination
|
||||
* ITAxes: axes to be enabled
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccINT2InterruptDisable(uint8_t ITCombination, uint8_t ITAxes)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read INT2_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_INT2_CFG_A);
|
||||
|
||||
/* Disable the selected interrupt */
|
||||
tmpval &= ~(ITAxes | ITCombination);
|
||||
|
||||
/* Write value to MEMS INT2_CFR register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_INT2_CFG_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Click interrupt enable
|
||||
* @param ITClick: the selected interrupt to enable
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccClickITEnable(uint8_t ITClick)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CLICK_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CLICK_CFG_A);
|
||||
|
||||
/* Enable the selected interrupt */
|
||||
tmpval |= ITClick;
|
||||
|
||||
/* Write value to MEMS CLICK CFG register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CLICK_CFG_A, tmpval);
|
||||
|
||||
/* Configure Click Threshold on Z axis */
|
||||
tmpval = 0x0A;
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CLICK_THS_A, tmpval);
|
||||
|
||||
/* Configure Time Limit */
|
||||
tmpval = 0x05;
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_TIME_LIMIT_A, tmpval);
|
||||
|
||||
/* Configure Latency */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_TIME_LATENCY_A, tmpval);
|
||||
|
||||
/* Configure Click Window */
|
||||
tmpval = 0x32;
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_TIME_WINDOW_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Click interrupt disable
|
||||
* @param ITClick: the selected click interrupt to disable
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccClickITDisable(uint8_t ITClick)
|
||||
{
|
||||
uint8_t tmpval = 0x00;
|
||||
|
||||
/* Read CLICK_CFR register */
|
||||
tmpval = COMPASSACCELERO_IO_Read(ACC_I2C_ADDRESS, LSM303DLHC_CLICK_CFG_A);
|
||||
|
||||
/* Disable the selected interrupt */
|
||||
tmpval &= ~ITClick;
|
||||
|
||||
/* Write value to MEMS CLICK_CFR register */
|
||||
COMPASSACCELERO_IO_Write(ACC_I2C_ADDRESS, LSM303DLHC_CLICK_CFG_A, tmpval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Click on Z axis interrupt config
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LSM303DLHC_AccZClickITConfig(void)
|
||||
{
|
||||
/* Configure low level IT config */
|
||||
COMPASSACCELERO_IO_ITConfig();
|
||||
|
||||
/* Select click IT as INT1 interrupt */
|
||||
LSM303DLHC_AccIT1Enable(LSM303DLHC_IT1_CLICK);
|
||||
|
||||
/* Enable High pass filter for click IT */
|
||||
LSM303DLHC_AccFilterClickCmd(LSM303DLHC_HPF_CLICK_ENABLE);
|
||||
|
||||
/* Enable simple click IT on Z axis, */
|
||||
LSM303DLHC_AccClickITEnable(LSM303DLHC_Z_SINGLE_CLICK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
498
2P-ProjectPong/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.h
Normal file
498
2P-ProjectPong/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.h
Normal file
@ -0,0 +1,498 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lsm303dlhc.h
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 24-June-2015
|
||||
* @brief This file contains all the functions prototypes for the lsm303dlhc.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LSM303DLHC_H
|
||||
#define __LSM303DLHC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/accelero.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM303DLHC
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** START REGISTER MAPPING **************************/
|
||||
/******************************************************************************/
|
||||
/* Exported constant IO ------------------------------------------------------*/
|
||||
#define ACC_I2C_ADDRESS 0x32
|
||||
#define MAG_I2C_ADDRESS 0x3C
|
||||
|
||||
/* Acceleration Registers */
|
||||
#define LSM303DLHC_WHO_AM_I_ADDR 0x0F /* device identification register */
|
||||
#define LSM303DLHC_CTRL_REG1_A 0x20 /* Control register 1 acceleration */
|
||||
#define LSM303DLHC_CTRL_REG2_A 0x21 /* Control register 2 acceleration */
|
||||
#define LSM303DLHC_CTRL_REG3_A 0x22 /* Control register 3 acceleration */
|
||||
#define LSM303DLHC_CTRL_REG4_A 0x23 /* Control register 4 acceleration */
|
||||
#define LSM303DLHC_CTRL_REG5_A 0x24 /* Control register 5 acceleration */
|
||||
#define LSM303DLHC_CTRL_REG6_A 0x25 /* Control register 6 acceleration */
|
||||
#define LSM303DLHC_REFERENCE_A 0x26 /* Reference register acceleration */
|
||||
#define LSM303DLHC_STATUS_REG_A 0x27 /* Status register acceleration */
|
||||
#define LSM303DLHC_OUT_X_L_A 0x28 /* Output Register X acceleration */
|
||||
#define LSM303DLHC_OUT_X_H_A 0x29 /* Output Register X acceleration */
|
||||
#define LSM303DLHC_OUT_Y_L_A 0x2A /* Output Register Y acceleration */
|
||||
#define LSM303DLHC_OUT_Y_H_A 0x2B /* Output Register Y acceleration */
|
||||
#define LSM303DLHC_OUT_Z_L_A 0x2C /* Output Register Z acceleration */
|
||||
#define LSM303DLHC_OUT_Z_H_A 0x2D /* Output Register Z acceleration */
|
||||
#define LSM303DLHC_FIFO_CTRL_REG_A 0x2E /* Fifo control Register acceleration */
|
||||
#define LSM303DLHC_FIFO_SRC_REG_A 0x2F /* Fifo src Register acceleration */
|
||||
|
||||
#define LSM303DLHC_INT1_CFG_A 0x30 /* Interrupt 1 configuration Register acceleration */
|
||||
#define LSM303DLHC_INT1_SOURCE_A 0x31 /* Interrupt 1 source Register acceleration */
|
||||
#define LSM303DLHC_INT1_THS_A 0x32 /* Interrupt 1 Threshold register acceleration */
|
||||
#define LSM303DLHC_INT1_DURATION_A 0x33 /* Interrupt 1 DURATION register acceleration */
|
||||
|
||||
#define LSM303DLHC_INT2_CFG_A 0x34 /* Interrupt 2 configuration Register acceleration */
|
||||
#define LSM303DLHC_INT2_SOURCE_A 0x35 /* Interrupt 2 source Register acceleration */
|
||||
#define LSM303DLHC_INT2_THS_A 0x36 /* Interrupt 2 Threshold register acceleration */
|
||||
#define LSM303DLHC_INT2_DURATION_A 0x37 /* Interrupt 2 DURATION register acceleration */
|
||||
|
||||
#define LSM303DLHC_CLICK_CFG_A 0x38 /* Click configuration Register acceleration */
|
||||
#define LSM303DLHC_CLICK_SOURCE_A 0x39 /* Click 2 source Register acceleration */
|
||||
#define LSM303DLHC_CLICK_THS_A 0x3A /* Click 2 Threshold register acceleration */
|
||||
|
||||
#define LSM303DLHC_TIME_LIMIT_A 0x3B /* Time Limit Register acceleration */
|
||||
#define LSM303DLHC_TIME_LATENCY_A 0x3C /* Time Latency Register acceleration */
|
||||
#define LSM303DLHC_TIME_WINDOW_A 0x3D /* Time window register acceleration */
|
||||
|
||||
/* Magnetic field Registers */
|
||||
#define LSM303DLHC_CRA_REG_M 0x00 /* Control register A magnetic field */
|
||||
#define LSM303DLHC_CRB_REG_M 0x01 /* Control register B magnetic field */
|
||||
#define LSM303DLHC_MR_REG_M 0x02 /* Control register MR magnetic field */
|
||||
#define LSM303DLHC_OUT_X_H_M 0x03 /* Output Register X magnetic field */
|
||||
#define LSM303DLHC_OUT_X_L_M 0x04 /* Output Register X magnetic field */
|
||||
#define LSM303DLHC_OUT_Z_H_M 0x05 /* Output Register Z magnetic field */
|
||||
#define LSM303DLHC_OUT_Z_L_M 0x06 /* Output Register Z magnetic field */
|
||||
#define LSM303DLHC_OUT_Y_H_M 0x07 /* Output Register Y magnetic field */
|
||||
#define LSM303DLHC_OUT_Y_L_M 0x08 /* Output Register Y magnetic field */
|
||||
|
||||
#define LSM303DLHC_SR_REG_M 0x09 /* Status Register magnetic field */
|
||||
#define LSM303DLHC_IRA_REG_M 0x0A /* IRA Register magnetic field */
|
||||
#define LSM303DLHC_IRB_REG_M 0x0B /* IRB Register magnetic field */
|
||||
#define LSM303DLHC_IRC_REG_M 0x0C /* IRC Register magnetic field */
|
||||
|
||||
#define LSM303DLHC_TEMP_OUT_H_M 0x31 /* Temperature Register magnetic field */
|
||||
#define LSM303DLHC_TEMP_OUT_L_M 0x32 /* Temperature Register magnetic field */
|
||||
|
||||
/******************************************************************************/
|
||||
/**************************** END REGISTER MAPPING ***************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#define I_AM_LMS303DLHC ((uint8_t)0x33)
|
||||
|
||||
/** @defgroup Acc_Power_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_NORMAL_MODE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_LOWPOWER_MODE ((uint8_t)0x08)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_OutPut_DataRate_Selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_ODR_1_HZ ((uint8_t)0x10) /*!< Output Data Rate = 1 Hz */
|
||||
#define LSM303DLHC_ODR_10_HZ ((uint8_t)0x20) /*!< Output Data Rate = 10 Hz */
|
||||
#define LSM303DLHC_ODR_25_HZ ((uint8_t)0x30) /*!< Output Data Rate = 25 Hz */
|
||||
#define LSM303DLHC_ODR_50_HZ ((uint8_t)0x40) /*!< Output Data Rate = 50 Hz */
|
||||
#define LSM303DLHC_ODR_100_HZ ((uint8_t)0x50) /*!< Output Data Rate = 100 Hz */
|
||||
#define LSM303DLHC_ODR_200_HZ ((uint8_t)0x60) /*!< Output Data Rate = 200 Hz */
|
||||
#define LSM303DLHC_ODR_400_HZ ((uint8_t)0x70) /*!< Output Data Rate = 400 Hz */
|
||||
#define LSM303DLHC_ODR_1620_HZ_LP ((uint8_t)0x80) /*!< Output Data Rate = 1620 Hz only in Low Power Mode */
|
||||
#define LSM303DLHC_ODR_1344_HZ ((uint8_t)0x90) /*!< Output Data Rate = 1344 Hz in Normal mode and 5376 Hz in Low Power Mode */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Axes_Selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_X_ENABLE ((uint8_t)0x01)
|
||||
#define LSM303DLHC_Y_ENABLE ((uint8_t)0x02)
|
||||
#define LSM303DLHC_Z_ENABLE ((uint8_t)0x04)
|
||||
#define LSM303DLHC_AXES_ENABLE ((uint8_t)0x07)
|
||||
#define LSM303DLHC_AXES_DISABLE ((uint8_t)0x00)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Resolution
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HR_ENABLE ((uint8_t)0x08)
|
||||
#define LSM303DLHC_HR_DISABLE ((uint8_t)0x00)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Full_Scale_Selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_FULLSCALE_2G ((uint8_t)0x00) /*!< ±2 g */
|
||||
#define LSM303DLHC_FULLSCALE_4G ((uint8_t)0x10) /*!< ±4 g */
|
||||
#define LSM303DLHC_FULLSCALE_8G ((uint8_t)0x20) /*!< ±8 g */
|
||||
#define LSM303DLHC_FULLSCALE_16G ((uint8_t)0x30) /*!< ±16 g */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Full_Scale_Selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_ACC_SENSITIVITY_2G ((uint8_t)1) /*!< accelerometer sensitivity with 2 g full scale [mg/LSB] */
|
||||
#define LSM303DLHC_ACC_SENSITIVITY_4G ((uint8_t)2) /*!< accelerometer sensitivity with 4 g full scale [mg/LSB] */
|
||||
#define LSM303DLHC_ACC_SENSITIVITY_8G ((uint8_t)4) /*!< accelerometer sensitivity with 8 g full scale [mg/LSB] */
|
||||
#define LSM303DLHC_ACC_SENSITIVITY_16G ((uint8_t)12) /*!< accelerometer sensitivity with 12 g full scale [mg/LSB] */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Block_Data_Update
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_BlockUpdate_Continous ((uint8_t)0x00) /*!< Continuos Update */
|
||||
#define LSM303DLHC_BlockUpdate_Single ((uint8_t)0x80) /*!< Single Update: output registers not updated until MSB and LSB reading */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Endian_Data_selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_BLE_LSB ((uint8_t)0x00) /*!< Little Endian: data LSB @ lower address */
|
||||
#define LSM303DLHC_BLE_MSB ((uint8_t)0x40) /*!< Big Endian: data MSB @ lower address */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Boot_Mode_selection
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_BOOT_NORMALMODE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_BOOT_REBOOTMEMORY ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_Filter_Mode
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HPM_NORMAL_MODE_RES ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HPM_REF_SIGNAL ((uint8_t)0x40)
|
||||
#define LSM303DLHC_HPM_NORMAL_MODE ((uint8_t)0x80)
|
||||
#define LSM303DLHC_HPM_AUTORESET_INT ((uint8_t)0xC0)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_CUT OFF_Frequency
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HPFCF_8 ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HPFCF_16 ((uint8_t)0x10)
|
||||
#define LSM303DLHC_HPFCF_32 ((uint8_t)0x20)
|
||||
#define LSM303DLHC_HPFCF_64 ((uint8_t)0x30)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_Filter_status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HIGHPASSFILTER_DISABLE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HIGHPASSFILTER_ENABLE ((uint8_t)0x08)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_Filter_Click_status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HPF_CLICK_DISABLE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HPF_CLICK_ENABLE ((uint8_t)0x04)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_Filter_AOI1_status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HPF_AOI1_DISABLE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HPF_AOI1_ENABLE ((uint8_t)0x01)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_High_Pass_Filter_AOI2_status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_HPF_AOI2_DISABLE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_HPF_AOI2_ENABLE ((uint8_t)0x02)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Interrupt1_Configuration_definition
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_IT1_CLICK ((uint8_t)0x80)
|
||||
#define LSM303DLHC_IT1_AOI1 ((uint8_t)0x40)
|
||||
#define LSM303DLHC_IT1_AOI2 ((uint8_t)0x20)
|
||||
#define LSM303DLHC_IT1_DRY1 ((uint8_t)0x10)
|
||||
#define LSM303DLHC_IT1_DRY2 ((uint8_t)0x08)
|
||||
#define LSM303DLHC_IT1_WTM ((uint8_t)0x04)
|
||||
#define LSM303DLHC_IT1_OVERRUN ((uint8_t)0x02)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_Interrupt2_Configuration_definition
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_IT2_CLICK ((uint8_t)0x80)
|
||||
#define LSM303DLHC_IT2_INT1 ((uint8_t)0x40)
|
||||
#define LSM303DLHC_IT2_INT2 ((uint8_t)0x20)
|
||||
#define LSM303DLHC_IT2_BOOT ((uint8_t)0x10)
|
||||
#define LSM303DLHC_IT2_ACT ((uint8_t)0x08)
|
||||
#define LSM303DLHC_IT2_HLACTIVE ((uint8_t)0x02)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_INT_Combination_Status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_OR_COMBINATION ((uint8_t)0x00) /*!< OR combination of enabled IRQs */
|
||||
#define LSM303DLHC_AND_COMBINATION ((uint8_t)0x80) /*!< AND combination of enabled IRQs */
|
||||
#define LSM303DLHC_MOV_RECOGNITION ((uint8_t)0x40) /*!< 6D movement recognition */
|
||||
#define LSM303DLHC_POS_RECOGNITION ((uint8_t)0xC0) /*!< 6D position recognition */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_INT_Axes
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_Z_HIGH ((uint8_t)0x20) /*!< Z High enabled IRQs */
|
||||
#define LSM303DLHC_Z_LOW ((uint8_t)0x10) /*!< Z low enabled IRQs */
|
||||
#define LSM303DLHC_Y_HIGH ((uint8_t)0x08) /*!< Y High enabled IRQs */
|
||||
#define LSM303DLHC_Y_LOW ((uint8_t)0x04) /*!< Y low enabled IRQs */
|
||||
#define LSM303DLHC_X_HIGH ((uint8_t)0x02) /*!< X High enabled IRQs */
|
||||
#define LSM303DLHC_X_LOW ((uint8_t)0x01) /*!< X low enabled IRQs */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_INT_Click
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_Z_DOUBLE_CLICK ((uint8_t)0x20) /*!< Z double click IRQs */
|
||||
#define LSM303DLHC_Z_SINGLE_CLICK ((uint8_t)0x10) /*!< Z single click IRQs */
|
||||
#define LSM303DLHC_Y_DOUBLE_CLICK ((uint8_t)0x08) /*!< Y double click IRQs */
|
||||
#define LSM303DLHC_Y_SINGLE_CLICK ((uint8_t)0x04) /*!< Y single click IRQs */
|
||||
#define LSM303DLHC_X_DOUBLE_CLICK ((uint8_t)0x02) /*!< X double click IRQs */
|
||||
#define LSM303DLHC_X_SINGLE_CLICK ((uint8_t)0x01) /*!< X single click IRQs */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_INT1_Interrupt_status
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_INT1INTERRUPT_DISABLE ((uint8_t)0x00)
|
||||
#define LSM303DLHC_INT1INTERRUPT_ENABLE ((uint8_t)0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Acc_INT1_Interrupt_ActiveEdge
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_INT1INTERRUPT_LOW_EDGE ((uint8_t)0x20)
|
||||
#define LSM303DLHC_INT1INTERRUPT_HIGH_EDGE ((uint8_t)0x00)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Mag_Data_Rate
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_ODR_0_75_HZ ((uint8_t) 0x00) /*!< Output Data Rate = 0.75 Hz */
|
||||
#define LSM303DLHC_ODR_1_5_HZ ((uint8_t) 0x04) /*!< Output Data Rate = 1.5 Hz */
|
||||
#define LSM303DLHC_ODR_3_0_HZ ((uint8_t) 0x08) /*!< Output Data Rate = 3 Hz */
|
||||
#define LSM303DLHC_ODR_7_5_HZ ((uint8_t) 0x0C) /*!< Output Data Rate = 7.5 Hz */
|
||||
#define LSM303DLHC_ODR_15_HZ ((uint8_t) 0x10) /*!< Output Data Rate = 15 Hz */
|
||||
#define LSM303DLHC_ODR_30_HZ ((uint8_t) 0x14) /*!< Output Data Rate = 30 Hz */
|
||||
#define LSM303DLHC_ODR_75_HZ ((uint8_t) 0x18) /*!< Output Data Rate = 75 Hz */
|
||||
#define LSM303DLHC_ODR_220_HZ ((uint8_t) 0x1C) /*!< Output Data Rate = 220 Hz */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Mag_Full_Scale
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_FS_1_3_GA ((uint8_t) 0x20) /*!< Full scale = ±1.3 Gauss */
|
||||
#define LSM303DLHC_FS_1_9_GA ((uint8_t) 0x40) /*!< Full scale = ±1.9 Gauss */
|
||||
#define LSM303DLHC_FS_2_5_GA ((uint8_t) 0x60) /*!< Full scale = ±2.5 Gauss */
|
||||
#define LSM303DLHC_FS_4_0_GA ((uint8_t) 0x80) /*!< Full scale = ±4.0 Gauss */
|
||||
#define LSM303DLHC_FS_4_7_GA ((uint8_t) 0xA0) /*!< Full scale = ±4.7 Gauss */
|
||||
#define LSM303DLHC_FS_5_6_GA ((uint8_t) 0xC0) /*!< Full scale = ±5.6 Gauss */
|
||||
#define LSM303DLHC_FS_8_1_GA ((uint8_t) 0xE0) /*!< Full scale = ±8.1 Gauss */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup Magnetometer_Sensitivity
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_1_3Ga 1100 /*!< magnetometer X Y axes sensitivity for 1.3 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_1_9Ga 855 /*!< magnetometer X Y axes sensitivity for 1.9 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_2_5Ga 670 /*!< magnetometer X Y axes sensitivity for 2.5 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_4Ga 450 /*!< magnetometer X Y axes sensitivity for 4 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_4_7Ga 400 /*!< magnetometer X Y axes sensitivity for 4.7 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_5_6Ga 330 /*!< magnetometer X Y axes sensitivity for 5.6 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_XY_8_1Ga 230 /*!< magnetometer X Y axes sensitivity for 8.1 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_1_3Ga 980 /*!< magnetometer Z axis sensitivity for 1.3 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_1_9Ga 760 /*!< magnetometer Z axis sensitivity for 1.9 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_2_5Ga 600 /*!< magnetometer Z axis sensitivity for 2.5 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_4Ga 400 /*!< magnetometer Z axis sensitivity for 4 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_4_7Ga 355 /*!< magnetometer Z axis sensitivity for 4.7 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_5_6Ga 295 /*!< magnetometer Z axis sensitivity for 5.6 Ga full scale [LSB/Ga] */
|
||||
#define LSM303DLHC_M_SENSITIVITY_Z_8_1Ga 205 /*!< magnetometer Z axis sensitivity for 8.1 Ga full scale [LSB/Ga] */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Mag_Working_Mode
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_CONTINUOS_CONVERSION ((uint8_t) 0x00) /*!< Continuous-Conversion Mode */
|
||||
#define LSM303DLHC_SINGLE_CONVERSION ((uint8_t) 0x01) /*!< Single-Conversion Mode */
|
||||
#define LSM303DLHC_SLEEP ((uint8_t) 0x02) /*!< Sleep Mode */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup Mag_Temperature_Sensor
|
||||
* @{
|
||||
*/
|
||||
#define LSM303DLHC_TEMPSENSOR_ENABLE ((uint8_t) 0x80) /*!< Temp sensor Enable */
|
||||
#define LSM303DLHC_TEMPSENSOR_DISABLE ((uint8_t) 0x00) /*!< Temp sensor Disable */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM303DLHC_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/* ACC functions */
|
||||
void LSM303DLHC_AccInit(uint16_t InitStruct);
|
||||
void LSM303DLHC_AccDeInit(void);
|
||||
uint8_t LSM303DLHC_AccReadID(void);
|
||||
void LSM303DLHC_AccRebootCmd(void);
|
||||
void LSM303DLHC_AccFilterConfig(uint8_t FilterStruct);
|
||||
void LSM303DLHC_AccFilterCmd(uint8_t HighPassFilterState);
|
||||
void LSM303DLHC_AccReadXYZ(int16_t* pData);
|
||||
void LSM303DLHC_AccFilterClickCmd(uint8_t HighPassFilterClickState);
|
||||
void LSM303DLHC_AccIT1Enable(uint8_t LSM303DLHC_IT);
|
||||
void LSM303DLHC_AccIT1Disable(uint8_t LSM303DLHC_IT);
|
||||
void LSM303DLHC_AccIT2Enable(uint8_t LSM303DLHC_IT);
|
||||
void LSM303DLHC_AccIT2Disable(uint8_t LSM303DLHC_IT);
|
||||
void LSM303DLHC_AccINT1InterruptEnable(uint8_t ITCombination, uint8_t ITAxes);
|
||||
void LSM303DLHC_AccINT1InterruptDisable(uint8_t ITCombination, uint8_t ITAxes);
|
||||
void LSM303DLHC_AccINT2InterruptEnable(uint8_t ITCombination, uint8_t ITAxes);
|
||||
void LSM303DLHC_AccINT2InterruptDisable(uint8_t ITCombination, uint8_t ITAxes);
|
||||
void LSM303DLHC_AccClickITEnable(uint8_t ITClick);
|
||||
void LSM303DLHC_AccClickITDisable(uint8_t ITClick);
|
||||
void LSM303DLHC_AccZClickITConfig(void);
|
||||
|
||||
/* COMPASS / ACCELERO IO functions */
|
||||
void COMPASSACCELERO_IO_Init(void);
|
||||
void COMPASSACCELERO_IO_ITConfig(void);
|
||||
void COMPASSACCELERO_IO_Write(uint16_t DeviceAddr, uint8_t RegisterAddr, uint8_t Value);
|
||||
uint8_t COMPASSACCELERO_IO_Read(uint16_t DeviceAddr, uint8_t RegisterAddr);
|
||||
|
||||
/* ACC driver structure */
|
||||
extern ACCELERO_DrvTypeDef Lsm303dlhcDrv;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LSM303DLHC_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
238
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/Release_Notes.html
Normal file
238
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/Release_Notes.html
Normal file
@ -0,0 +1,238 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for LSM6DSL component</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release Notes for LSM6DSL component</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2019 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.2
|
||||
/ 11-October-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Rename context type to universal stmdev_ctx_t</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Move unions from PID to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.1
|
||||
/ 18-June-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update license on Release Notes</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.2.0
|
||||
/ 28-May-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">PID update from ST GitHub</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add new APIs for VibrationMonitoring to HLD</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">HLD coding style update</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.1.0
|
||||
/ 31-Jan-2019</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Update PID files</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add inactivity detection support</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.0
|
||||
/ 12-Jul-2018</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Source Code Refactoring according new BSP v2.5 specifications</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0
|
||||
/ 1-May-2017</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Unify driver to have the same files for X-NUCLEO-IKS01Ax and SensorTile</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Add support to hardware multiple events</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0
|
||||
/ 12-August-2016</span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First
|
||||
official release</span><span style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; display: inline ! important; float: none;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br>
|
||||
</h2>
|
||||
|
||||
|
||||
<div style="text-align: justify;">
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
</div>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
</body></html>
|
3214
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl.c
Normal file
3214
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl.c
Normal file
File diff suppressed because it is too large
Load Diff
348
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl.h
Normal file
348
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl.h
Normal file
@ -0,0 +1,348 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lsm6dsl.h
|
||||
* @author MEMS Software Solutions Team
|
||||
* @brief LSM6DSL header driver file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LSM6DSL_H
|
||||
#define LSM6DSL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lsm6dsl_reg.h"
|
||||
#include <string.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM6DSL LSM6DSL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LSM6DSL_Exported_Types LSM6DSL Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*LSM6DSL_Init_Func)(void);
|
||||
typedef int32_t (*LSM6DSL_DeInit_Func)(void);
|
||||
typedef int32_t (*LSM6DSL_GetTick_Func)(void);
|
||||
typedef int32_t (*LSM6DSL_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
typedef int32_t (*LSM6DSL_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LSM6DSL_INT1_PIN,
|
||||
LSM6DSL_INT2_PIN,
|
||||
} LSM6DSL_SensorIntPin_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LSM6DSL_Init_Func Init;
|
||||
LSM6DSL_DeInit_Func DeInit;
|
||||
uint32_t BusType; /*0 means I2C, 1 means SPI 4-Wires, 2 means SPI-3-Wires */
|
||||
uint8_t Address;
|
||||
LSM6DSL_WriteReg_Func WriteReg;
|
||||
LSM6DSL_ReadReg_Func ReadReg;
|
||||
LSM6DSL_GetTick_Func GetTick;
|
||||
} LSM6DSL_IO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
int16_t z;
|
||||
} LSM6DSL_AxesRaw_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
int32_t z;
|
||||
} LSM6DSL_Axes_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int FreeFallStatus : 1;
|
||||
unsigned int TapStatus : 1;
|
||||
unsigned int DoubleTapStatus : 1;
|
||||
unsigned int WakeUpStatus : 1;
|
||||
unsigned int StepStatus : 1;
|
||||
unsigned int TiltStatus : 1;
|
||||
unsigned int D6DOrientationStatus : 1;
|
||||
unsigned int SleepStatus : 1;
|
||||
} LSM6DSL_Event_Status_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LSM6DSL_IO_t IO;
|
||||
stmdev_ctx_t Ctx;
|
||||
uint8_t is_initialized;
|
||||
uint8_t acc_is_enabled;
|
||||
uint8_t gyro_is_enabled;
|
||||
lsm6dsl_odr_xl_t acc_odr;
|
||||
lsm6dsl_odr_g_t gyro_odr;
|
||||
} LSM6DSL_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Acc;
|
||||
uint8_t Gyro;
|
||||
uint8_t Magneto;
|
||||
uint8_t LowPower;
|
||||
uint32_t GyroMaxFS;
|
||||
uint32_t AccMaxFS;
|
||||
uint32_t MagMaxFS;
|
||||
float GyroMaxOdr;
|
||||
float AccMaxOdr;
|
||||
float MagMaxOdr;
|
||||
} LSM6DSL_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(LSM6DSL_Object_t *);
|
||||
int32_t (*DeInit)(LSM6DSL_Object_t *);
|
||||
int32_t (*ReadID)(LSM6DSL_Object_t *, uint8_t *);
|
||||
int32_t (*GetCapabilities)(LSM6DSL_Object_t *, LSM6DSL_Capabilities_t *);
|
||||
} LSM6DSL_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LSM6DSL_Object_t *);
|
||||
int32_t (*Disable)(LSM6DSL_Object_t *);
|
||||
int32_t (*GetSensitivity)(LSM6DSL_Object_t *, float *);
|
||||
int32_t (*GetOutputDataRate)(LSM6DSL_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LSM6DSL_Object_t *, float);
|
||||
int32_t (*GetFullScale)(LSM6DSL_Object_t *, int32_t *);
|
||||
int32_t (*SetFullScale)(LSM6DSL_Object_t *, int32_t);
|
||||
int32_t (*GetAxes)(LSM6DSL_Object_t *, LSM6DSL_Axes_t *);
|
||||
int32_t (*GetAxesRaw)(LSM6DSL_Object_t *, LSM6DSL_AxesRaw_t *);
|
||||
} LSM6DSL_ACC_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Enable)(LSM6DSL_Object_t *);
|
||||
int32_t (*Disable)(LSM6DSL_Object_t *);
|
||||
int32_t (*GetSensitivity)(LSM6DSL_Object_t *, float *);
|
||||
int32_t (*GetOutputDataRate)(LSM6DSL_Object_t *, float *);
|
||||
int32_t (*SetOutputDataRate)(LSM6DSL_Object_t *, float);
|
||||
int32_t (*GetFullScale)(LSM6DSL_Object_t *, int32_t *);
|
||||
int32_t (*SetFullScale)(LSM6DSL_Object_t *, int32_t);
|
||||
int32_t (*GetAxes)(LSM6DSL_Object_t *, LSM6DSL_Axes_t *);
|
||||
int32_t (*GetAxesRaw)(LSM6DSL_Object_t *, LSM6DSL_AxesRaw_t *);
|
||||
} LSM6DSL_GYRO_Drv_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit[3];
|
||||
uint8_t u8bit[6];
|
||||
} lsm6dsl_axis3bit16_t;
|
||||
|
||||
typedef union{
|
||||
int16_t i16bit;
|
||||
uint8_t u8bit[2];
|
||||
} lsm6dsl_axis1bit16_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit[3];
|
||||
uint8_t u8bit[12];
|
||||
} lsm6dsl_axis3bit32_t;
|
||||
|
||||
typedef union{
|
||||
int32_t i32bit;
|
||||
uint8_t u8bit[4];
|
||||
} lsm6dsl_axis1bit32_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LSM6DSL_Exported_Constants LSM6DSL Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LSM6DSL_OK 0
|
||||
#define LSM6DSL_ERROR -1
|
||||
|
||||
#define LSM6DSL_I2C_BUS 0U
|
||||
#define LSM6DSL_SPI_4WIRES_BUS 1U
|
||||
#define LSM6DSL_SPI_3WIRES_BUS 2U
|
||||
|
||||
#define LSM6DSL_ACC_SENSITIVITY_FS_2G 0.061f
|
||||
#define LSM6DSL_ACC_SENSITIVITY_FS_4G 0.122f
|
||||
#define LSM6DSL_ACC_SENSITIVITY_FS_8G 0.244f
|
||||
#define LSM6DSL_ACC_SENSITIVITY_FS_16G 0.488f
|
||||
|
||||
#define LSM6DSL_GYRO_SENSITIVITY_FS_125DPS 4.375f
|
||||
#define LSM6DSL_GYRO_SENSITIVITY_FS_250DPS 8.750f
|
||||
#define LSM6DSL_GYRO_SENSITIVITY_FS_500DPS 17.500f
|
||||
#define LSM6DSL_GYRO_SENSITIVITY_FS_1000DPS 35.000f
|
||||
#define LSM6DSL_GYRO_SENSITIVITY_FS_2000DPS 70.000f
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM6DSL_Exported_Functions LSM6DSL Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t LSM6DSL_RegisterBusIO(LSM6DSL_Object_t *pObj, LSM6DSL_IO_t *pIO);
|
||||
int32_t LSM6DSL_Init(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_DeInit(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ReadID(LSM6DSL_Object_t *pObj, uint8_t *Id);
|
||||
int32_t LSM6DSL_GetCapabilities(LSM6DSL_Object_t *pObj, LSM6DSL_Capabilities_t *Capabilities);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Disable(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_GetSensitivity(LSM6DSL_Object_t *pObj, float *Sensitivity);
|
||||
int32_t LSM6DSL_ACC_GetOutputDataRate(LSM6DSL_Object_t *pObj, float *Odr);
|
||||
int32_t LSM6DSL_ACC_SetOutputDataRate(LSM6DSL_Object_t *pObj, float Odr);
|
||||
int32_t LSM6DSL_ACC_GetFullScale(LSM6DSL_Object_t *pObj, int32_t *FullScale);
|
||||
int32_t LSM6DSL_ACC_SetFullScale(LSM6DSL_Object_t *pObj, int32_t FullScale);
|
||||
int32_t LSM6DSL_ACC_GetAxesRaw(LSM6DSL_Object_t *pObj, LSM6DSL_AxesRaw_t *Value);
|
||||
int32_t LSM6DSL_ACC_GetAxes(LSM6DSL_Object_t *pObj, LSM6DSL_Axes_t *Acceleration);
|
||||
|
||||
int32_t LSM6DSL_GYRO_Enable(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_GYRO_Disable(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_GYRO_GetSensitivity(LSM6DSL_Object_t *pObj, float *Sensitivity);
|
||||
int32_t LSM6DSL_GYRO_GetOutputDataRate(LSM6DSL_Object_t *pObj, float *Odr);
|
||||
int32_t LSM6DSL_GYRO_SetOutputDataRate(LSM6DSL_Object_t *pObj, float Odr);
|
||||
int32_t LSM6DSL_GYRO_GetFullScale(LSM6DSL_Object_t *pObj, int32_t *FullScale);
|
||||
int32_t LSM6DSL_GYRO_SetFullScale(LSM6DSL_Object_t *pObj, int32_t FullScale);
|
||||
int32_t LSM6DSL_GYRO_GetAxesRaw(LSM6DSL_Object_t *pObj, LSM6DSL_AxesRaw_t *Value);
|
||||
int32_t LSM6DSL_GYRO_GetAxes(LSM6DSL_Object_t *pObj, LSM6DSL_Axes_t *AngularRate);
|
||||
|
||||
int32_t LSM6DSL_Read_Reg(LSM6DSL_Object_t *pObj, uint8_t reg, uint8_t *Data);
|
||||
int32_t LSM6DSL_Write_Reg(LSM6DSL_Object_t *pObj, uint8_t reg, uint8_t Data);
|
||||
int32_t LSM6DSL_Set_Interrupt_Latch(LSM6DSL_Object_t *pObj, uint8_t Status);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Free_Fall_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Free_Fall_Detection(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_Free_Fall_Threshold(LSM6DSL_Object_t *pObj, uint8_t Threshold);
|
||||
int32_t LSM6DSL_ACC_Set_Free_Fall_Duration(LSM6DSL_Object_t *pObj, uint8_t Duration);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Pedometer(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Disable_Pedometer(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Get_Step_Count(LSM6DSL_Object_t *pObj, uint16_t *StepCount);
|
||||
int32_t LSM6DSL_ACC_Enable_Step_Counter_Reset(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Disable_Step_Counter_Reset(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_Pedometer_Threshold(LSM6DSL_Object_t *pObj, uint8_t Threshold);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Tilt_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Tilt_Detection(LSM6DSL_Object_t *pObj);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Wake_Up_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Wake_Up_Detection(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_Wake_Up_Threshold(LSM6DSL_Object_t *pObj, uint8_t Threshold);
|
||||
int32_t LSM6DSL_ACC_Set_Wake_Up_Duration(LSM6DSL_Object_t *pObj, uint8_t Duration);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Inactivity_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Inactivity_Detection(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_Sleep_Duration(LSM6DSL_Object_t *pObj, uint8_t Duration);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_Single_Tap_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Single_Tap_Detection(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Enable_Double_Tap_Detection(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_Double_Tap_Detection(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_Tap_Threshold(LSM6DSL_Object_t *pObj, uint8_t Threshold);
|
||||
int32_t LSM6DSL_ACC_Set_Tap_Shock_Time(LSM6DSL_Object_t *pObj, uint8_t Time);
|
||||
int32_t LSM6DSL_ACC_Set_Tap_Quiet_Time(LSM6DSL_Object_t *pObj, uint8_t Time);
|
||||
int32_t LSM6DSL_ACC_Set_Tap_Duration_Time(LSM6DSL_Object_t *pObj, uint8_t Time);
|
||||
|
||||
int32_t LSM6DSL_ACC_Enable_6D_Orientation(LSM6DSL_Object_t *pObj, LSM6DSL_SensorIntPin_t IntPin);
|
||||
int32_t LSM6DSL_ACC_Disable_6D_Orientation(LSM6DSL_Object_t *pObj);
|
||||
int32_t LSM6DSL_ACC_Set_6D_Orientation_Threshold(LSM6DSL_Object_t *pObj, uint8_t Threshold);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_XL(LSM6DSL_Object_t *pObj, uint8_t *XLow);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_XH(LSM6DSL_Object_t *pObj, uint8_t *XHigh);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_YL(LSM6DSL_Object_t *pObj, uint8_t *YLow);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_YH(LSM6DSL_Object_t *pObj, uint8_t *YHigh);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_ZL(LSM6DSL_Object_t *pObj, uint8_t *ZLow);
|
||||
int32_t LSM6DSL_ACC_Get_6D_Orientation_ZH(LSM6DSL_Object_t *pObj, uint8_t *ZHigh);
|
||||
|
||||
int32_t LSM6DSL_ACC_Get_Event_Status(LSM6DSL_Object_t *pObj, LSM6DSL_Event_Status_t *Status);
|
||||
int32_t LSM6DSL_ACC_Set_SelfTest(LSM6DSL_Object_t *pObj, uint8_t Val);
|
||||
int32_t LSM6DSL_ACC_Get_DRDY_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_ACC_Get_Init_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_ACC_Set_INT1_DRDY(LSM6DSL_Object_t *pObj, uint8_t Val);
|
||||
|
||||
int32_t LSM6DSL_GYRO_Set_SelfTest(LSM6DSL_Object_t *pObj, uint8_t Val);
|
||||
int32_t LSM6DSL_GYRO_Get_DRDY_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_GYRO_Get_Init_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_GYRO_Set_INT1_DRDY(LSM6DSL_Object_t *pObj, uint8_t Val);
|
||||
|
||||
int32_t LSM6DSL_Set_DRDY_Mode(LSM6DSL_Object_t *pObj, uint8_t Val);
|
||||
|
||||
int32_t LSM6DSL_FIFO_Get_Num_Samples(LSM6DSL_Object_t *pObj, uint16_t *NumSamples);
|
||||
int32_t LSM6DSL_FIFO_Get_Full_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_FIFO_Set_ODR_Value(LSM6DSL_Object_t *pObj, float Odr);
|
||||
int32_t LSM6DSL_FIFO_Set_INT1_FIFO_Full(LSM6DSL_Object_t *pObj, uint8_t Status);
|
||||
int32_t LSM6DSL_FIFO_Set_Watermark_Level(LSM6DSL_Object_t *pObj, uint16_t Watermark);
|
||||
int32_t LSM6DSL_FIFO_Set_Stop_On_Fth(LSM6DSL_Object_t *pObj, uint8_t Status);
|
||||
int32_t LSM6DSL_FIFO_Set_Mode(LSM6DSL_Object_t *pObj, uint8_t Mode);
|
||||
int32_t LSM6DSL_FIFO_Get_Pattern(LSM6DSL_Object_t *pObj, uint16_t *Pattern);
|
||||
int32_t LSM6DSL_FIFO_Get_Data(LSM6DSL_Object_t *pObj, uint8_t *Data);
|
||||
int32_t LSM6DSL_FIFO_Get_Empty_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_FIFO_Get_Overrun_Status(LSM6DSL_Object_t *pObj, uint8_t *Status);
|
||||
int32_t LSM6DSL_FIFO_ACC_Set_Decimation(LSM6DSL_Object_t *pObj, uint8_t Decimation);
|
||||
int32_t LSM6DSL_FIFO_ACC_Get_Axis(LSM6DSL_Object_t *pObj, int32_t *Acceleration);
|
||||
int32_t LSM6DSL_FIFO_GYRO_Set_Decimation(LSM6DSL_Object_t *pObj, uint8_t Decimation);
|
||||
int32_t LSM6DSL_FIFO_GYRO_Get_Axis(LSM6DSL_Object_t *pObj, int32_t *AngularVelocity);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup LSM6DSL_Exported_Variables LSM6DSL Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern LSM6DSL_CommonDrv_t LSM6DSL_COMMON_Driver;
|
||||
extern LSM6DSL_ACC_Drv_t LSM6DSL_ACC_Driver;
|
||||
extern LSM6DSL_GYRO_Drv_t LSM6DSL_GYRO_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
6795
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl_reg.c
Normal file
6795
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl_reg.c
Normal file
File diff suppressed because it is too large
Load Diff
1893
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl_reg.h
Normal file
1893
2P-ProjectPong/Drivers/BSP/Components/lsm6dsl/lsm6dsl_reg.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,296 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for MFXSTM32L152 Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for MFXSTM32L152 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 205px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 24-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes</span></u></b></p><ul><li><span style="font-size: 10pt; font-family: Verdana;">Add Shunt management of MFXSTM32L152 component</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">new mfxstm32l152_IDD_ConfigShuntNbLimit() and mfxstm32l152_IDD_GetShuntUsed() APIs<br></span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">Add mfxstm32l152_WriteReg() API</span></li><li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common driver V4.0.0 or later</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 205px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.0 / 28-April-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes</span></u></b></p><ul>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">mfxstm32l152_IO_Config():</span> remove unnecessary delay</span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">mfxstm32l152_TS_DetectTouch():</span> improve TouchScreen speed</span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">mfxstm32l152_IDD_Config():</span> add configuration of number of measure to be performed, with delay between 2 measures</span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common driver V3.0.0</span></li>
|
||||
</ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 205px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 10-February-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul><li><span style="font-size: 10pt; font-family: Verdana;">Low Power management of MFXSTM32L152 component:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">New mfxstm32l152_DeInit() and mfxstm32l152_WakeUp() API</span></li></ul><ul><li><span style="font-size: 10pt; font-family: Verdana;">mfxstm32l152_LowPower() API completed to be MFXSTM32L152 in Standby mode<br></span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common driver V2.2.0 or later</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 05-February-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul><li><span style="font-size: 10pt; font-family: Verdana;">First official release </span><span style="font-size: 10pt; font-family: Verdana;">of MFXSTM32L152 Component driver</span><span style="font-size: 10pt; font-family: Verdana;">.</span></li><li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">NOTE:</span> This release must be used with BSP Common driver V2.1.0 or later.<br></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 160px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
1584
2P-ProjectPong/Drivers/BSP/Components/mfxstm32l152/mfxstm32l152.c
Normal file
1584
2P-ProjectPong/Drivers/BSP/Components/mfxstm32l152/mfxstm32l152.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,668 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file mfxstm32l152.h
|
||||
* @author MCD Application Team
|
||||
* @version V2.0.0
|
||||
* @date 24-June-2015
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* mfxstm32l152.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MFXSTM32L152_H
|
||||
#define __MFXSTM32L152_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/ts.h"
|
||||
#include "../Common/io.h"
|
||||
#include "../Common/idd.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MFXSTM32L152
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup MFXSTM32L152_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t SYS_CTRL;
|
||||
uint8_t ERROR_SRC;
|
||||
uint8_t ERROR_MSG;
|
||||
uint8_t IRQ_OUT;
|
||||
uint8_t IRQ_SRC_EN;
|
||||
uint8_t IRQ_PENDING;
|
||||
uint8_t IDD_CTRL;
|
||||
uint8_t IDD_PRE_DELAY;
|
||||
uint8_t IDD_SHUNT0_MSB;
|
||||
uint8_t IDD_SHUNT0_LSB;
|
||||
uint8_t IDD_SHUNT1_MSB;
|
||||
uint8_t IDD_SHUNT1_LSB;
|
||||
uint8_t IDD_SHUNT2_MSB;
|
||||
uint8_t IDD_SHUNT2_LSB;
|
||||
uint8_t IDD_SHUNT3_MSB;
|
||||
uint8_t IDD_SHUNT3_LSB;
|
||||
uint8_t IDD_SHUNT4_MSB;
|
||||
uint8_t IDD_SHUNT4_LSB;
|
||||
uint8_t IDD_GAIN_MSB;
|
||||
uint8_t IDD_GAIN_LSB;
|
||||
uint8_t IDD_VDD_MIN_MSB;
|
||||
uint8_t IDD_VDD_MIN_LSB;
|
||||
uint8_t IDD_VALUE_MSB;
|
||||
uint8_t IDD_VALUE_MID;
|
||||
uint8_t IDD_VALUE_LSB;
|
||||
uint8_t IDD_CAL_OFFSET_MSB;
|
||||
uint8_t IDD_CAL_OFFSET_LSB;
|
||||
uint8_t IDD_SHUNT_USED;
|
||||
}IDD_dbgTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup MFXSTM32L152_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief MFX COMMON defines
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register address: chip IDs (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_ID ((uint8_t)0x00)
|
||||
/**
|
||||
* @brief Register address: chip FW_VERSION (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_FW_VERSION_MSB ((uint8_t)0x01)
|
||||
#define MFXSTM32L152_REG_ADR_FW_VERSION_LSB ((uint8_t)0x00)
|
||||
/**
|
||||
* @brief Register address: System Control Register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_SYS_CTRL ((uint8_t)0x40)
|
||||
/**
|
||||
* @brief Register address: Vdd monitoring (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_VDD_REF_MSB ((uint8_t)0x06)
|
||||
#define MFXSTM32L152_REG_ADR_VDD_REF_LSB ((uint8_t)0x07)
|
||||
/**
|
||||
* @brief Register address: Error source
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_ERROR_SRC ((uint8_t)0x03)
|
||||
/**
|
||||
* @brief Register address: Error Message
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_ERROR_MSG ((uint8_t)0x04)
|
||||
|
||||
/**
|
||||
* @brief Reg Addr IRQs: to config the pin that informs Main MCU that MFX events appear
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_MFX_IRQ_OUT ((uint8_t)0x41)
|
||||
/**
|
||||
* @brief Reg Addr IRQs: to select the events which activate the MFXSTM32L152_IRQ_OUT signal
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_SRC_EN ((uint8_t)0x42)
|
||||
/**
|
||||
* @brief Reg Addr IRQs: the Main MCU must read the IRQ_PENDING register to know the interrupt reason
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_PENDING ((uint8_t)0x08)
|
||||
/**
|
||||
* @brief Reg Addr IRQs: the Main MCU must acknowledge it thanks to a writing access to the IRQ_ACK register
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_ACK ((uint8_t)0x44)
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152_REG_ADR_ID choices
|
||||
*/
|
||||
#define MFXSTM32L152_ID_1 ((uint8_t)0x7B)
|
||||
#define MFXSTM32L152_ID_2 ((uint8_t)0x79)
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152_REG_ADR_SYS_CTRL choices
|
||||
*/
|
||||
#define MFXSTM32L152_SWRST ((uint8_t)0x80)
|
||||
#define MFXSTM32L152_STANDBY ((uint8_t)0x40)
|
||||
#define MFXSTM32L152_ALTERNATE_GPIO_EN ((uint8_t)0x08) /* by the way if IDD and TS are enabled they take automatically the AF pins*/
|
||||
#define MFXSTM32L152_IDD_EN ((uint8_t)0x04)
|
||||
#define MFXSTM32L152_TS_EN ((uint8_t)0x02)
|
||||
#define MFXSTM32L152_GPIO_EN ((uint8_t)0x01)
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152_REG_ADR_ERROR_SRC choices
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_ERROR_SRC ((uint8_t)0x04) /* Error raised by Idd */
|
||||
#define MFXSTM32L152_TS_ERROR_SRC ((uint8_t)0x02) /* Error raised by Touch Screen */
|
||||
#define MFXSTM32L152_GPIO_ERROR_SRC ((uint8_t)0x01) /* Error raised by Gpio */
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152_REG_ADR_MFX_IRQ_OUT choices
|
||||
*/
|
||||
#define MFXSTM32L152_OUT_PIN_TYPE_OPENDRAIN ((uint8_t)0x00)
|
||||
#define MFXSTM32L152_OUT_PIN_TYPE_PUSHPULL ((uint8_t)0x01)
|
||||
#define MFXSTM32L152_OUT_PIN_POLARITY_LOW ((uint8_t)0x00)
|
||||
#define MFXSTM32L152_OUT_PIN_POLARITY_HIGH ((uint8_t)0x02)
|
||||
|
||||
/**
|
||||
* @brief REG_ADR_IRQ_SRC_EN, REG_ADR_IRQ_PENDING & REG_ADR_IRQ_ACK choices
|
||||
*/
|
||||
#define MFXSTM32L152_IRQ_TS_OVF ((uint8_t)0x80) /* TouchScreen FIFO Overflow irq*/
|
||||
#define MFXSTM32L152_IRQ_TS_FULL ((uint8_t)0x40) /* TouchScreen FIFO Full irq*/
|
||||
#define MFXSTM32L152_IRQ_TS_TH ((uint8_t)0x20) /* TouchScreen FIFO threshold triggered irq*/
|
||||
#define MFXSTM32L152_IRQ_TS_NE ((uint8_t)0x10) /* TouchScreen FIFO Not Empty irq*/
|
||||
#define MFXSTM32L152_IRQ_TS_DET ((uint8_t)0x08) /* TouchScreen Detect irq*/
|
||||
#define MFXSTM32L152_IRQ_ERROR ((uint8_t)0x04) /* Error message from MFXSTM32L152 firmware irq */
|
||||
#define MFXSTM32L152_IRQ_IDD ((uint8_t)0x02) /* IDD function irq */
|
||||
#define MFXSTM32L152_IRQ_GPIO ((uint8_t)0x01) /* General GPIO irq (only for SRC_EN and PENDING) */
|
||||
#define MFXSTM32L152_IRQ_ALL ((uint8_t)0xFF) /* All global interrupts */
|
||||
#define MFXSTM32L152_IRQ_TS (MFXSTM32L152_IRQ_TS_DET | MFXSTM32L152_IRQ_TS_NE | MFXSTM32L152_IRQ_TS_TH | MFXSTM32L152_IRQ_TS_FULL | MFXSTM32L152_IRQ_TS_OVF )
|
||||
|
||||
|
||||
/**
|
||||
* @brief GPIO: 24 programmable input/output called MFXSTM32L152_GPIO[23:0] are provided
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Reg addr: GPIO DIRECTION (R/W): GPIO pins direction: (0) input, (1) output.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_DIR1 ((uint8_t)0x60) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_DIR2 ((uint8_t)0x61) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_DIR3 ((uint8_t)0x62) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief Reg addr: GPIO TYPE (R/W): If GPIO in output: (0) output push pull, (1) output open drain.
|
||||
* If GPIO in input: (0) input without pull resistor, (1) input with pull resistor.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_TYPE1 ((uint8_t)0x64) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_TYPE2 ((uint8_t)0x65) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_TYPE3 ((uint8_t)0x66) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief Reg addr: GPIO PULL_UP_PULL_DOWN (R/W): discussion open with Jean Claude
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_PUPD1 ((uint8_t)0x68) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_PUPD2 ((uint8_t)0x69) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_PUPD3 ((uint8_t)0x6A) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief Reg addr: GPIO SET (W): When GPIO is in output mode, write (1) puts the corresponding GPO in High level.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPO_SET1 ((uint8_t)0x6C) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPO_SET2 ((uint8_t)0x6D) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPO_SET3 ((uint8_t)0x6E) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief Reg addr: GPIO CLEAR (W): When GPIO is in output mode, write (1) puts the corresponding GPO in Low level.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPO_CLR1 ((uint8_t)0x70) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPO_CLR2 ((uint8_t)0x71) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPO_CLR3 ((uint8_t)0x72) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief Reg addr: GPIO STATE (R): Give state of the GPIO pin.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_STATE1 ((uint8_t)0x10) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_STATE2 ((uint8_t)0x11) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_GPIO_STATE3 ((uint8_t)0x12) /* agpio [0:7] */
|
||||
|
||||
/**
|
||||
* @brief GPIO IRQ_GPIs
|
||||
*/
|
||||
/* GPIOs can INDIVIDUALLY generate interruption to the Main MCU thanks to the MFXSTM32L152_IRQ_OUT signal */
|
||||
/* the general MFXSTM32L152_IRQ_GPIO_SRC_EN shall be enabled too */
|
||||
/**
|
||||
* @brief GPIO IRQ_GPI_SRC1/2/3 (R/W): registers enable or not the feature to generate irq
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC1 ((uint8_t)0x48) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC2 ((uint8_t)0x49) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC3 ((uint8_t)0x4A) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief GPIO IRQ_GPI_EVT1/2/3 (R/W): Irq generated on level (0) or edge (1).
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT1 ((uint8_t)0x4C) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT2 ((uint8_t)0x4D) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT3 ((uint8_t)0x4E) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief GPIO IRQ_GPI_TYPE1/2/3 (R/W): Irq generated on (0) : Low level or Falling edge. (1) : High level or Rising edge.
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE1 ((uint8_t)0x50) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE2 ((uint8_t)0x51) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE3 ((uint8_t)0x52) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief GPIO IRQ_GPI_PENDING1/2/3 (R): irq occurs
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING1 ((uint8_t)0x0C) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING2 ((uint8_t)0x0D) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING3 ((uint8_t)0x0E) /* agpio [0:7] */
|
||||
/**
|
||||
* @brief GPIO IRQ_GPI_ACK1/2/3 (W): Write (1) to acknowledge IRQ event
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK1 ((uint8_t)0x54) /* gpio [0:7] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK2 ((uint8_t)0x55) /* gpio [8:15] */
|
||||
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK3 ((uint8_t)0x56) /* agpio [0:7] */
|
||||
|
||||
|
||||
/**
|
||||
* @brief GPIO: IO Pins definition
|
||||
*/
|
||||
#define MFXSTM32L152_GPIO_PIN_0 ((uint32_t)0x0001)
|
||||
#define MFXSTM32L152_GPIO_PIN_1 ((uint32_t)0x0002)
|
||||
#define MFXSTM32L152_GPIO_PIN_2 ((uint32_t)0x0004)
|
||||
#define MFXSTM32L152_GPIO_PIN_3 ((uint32_t)0x0008)
|
||||
#define MFXSTM32L152_GPIO_PIN_4 ((uint32_t)0x0010)
|
||||
#define MFXSTM32L152_GPIO_PIN_5 ((uint32_t)0x0020)
|
||||
#define MFXSTM32L152_GPIO_PIN_6 ((uint32_t)0x0040)
|
||||
#define MFXSTM32L152_GPIO_PIN_7 ((uint32_t)0x0080)
|
||||
|
||||
#define MFXSTM32L152_GPIO_PIN_8 ((uint32_t)0x0100)
|
||||
#define MFXSTM32L152_GPIO_PIN_9 ((uint32_t)0x0200)
|
||||
#define MFXSTM32L152_GPIO_PIN_10 ((uint32_t)0x0400)
|
||||
#define MFXSTM32L152_GPIO_PIN_11 ((uint32_t)0x0800)
|
||||
#define MFXSTM32L152_GPIO_PIN_12 ((uint32_t)0x1000)
|
||||
#define MFXSTM32L152_GPIO_PIN_13 ((uint32_t)0x2000)
|
||||
#define MFXSTM32L152_GPIO_PIN_14 ((uint32_t)0x4000)
|
||||
#define MFXSTM32L152_GPIO_PIN_15 ((uint32_t)0x8000)
|
||||
|
||||
#define MFXSTM32L152_GPIO_PIN_16 ((uint32_t)0x010000)
|
||||
#define MFXSTM32L152_GPIO_PIN_17 ((uint32_t)0x020000)
|
||||
#define MFXSTM32L152_GPIO_PIN_18 ((uint32_t)0x040000)
|
||||
#define MFXSTM32L152_GPIO_PIN_19 ((uint32_t)0x080000)
|
||||
#define MFXSTM32L152_GPIO_PIN_20 ((uint32_t)0x100000)
|
||||
#define MFXSTM32L152_GPIO_PIN_21 ((uint32_t)0x200000)
|
||||
#define MFXSTM32L152_GPIO_PIN_22 ((uint32_t)0x400000)
|
||||
#define MFXSTM32L152_GPIO_PIN_23 ((uint32_t)0x800000)
|
||||
|
||||
#define MFXSTM32L152_AGPIO_PIN_0 MFXSTM32L152_GPIO_PIN_16
|
||||
#define MFXSTM32L152_AGPIO_PIN_1 MFXSTM32L152_GPIO_PIN_17
|
||||
#define MFXSTM32L152_AGPIO_PIN_2 MFXSTM32L152_GPIO_PIN_18
|
||||
#define MFXSTM32L152_AGPIO_PIN_3 MFXSTM32L152_GPIO_PIN_19
|
||||
#define MFXSTM32L152_AGPIO_PIN_4 MFXSTM32L152_GPIO_PIN_20
|
||||
#define MFXSTM32L152_AGPIO_PIN_5 MFXSTM32L152_GPIO_PIN_21
|
||||
#define MFXSTM32L152_AGPIO_PIN_6 MFXSTM32L152_GPIO_PIN_22
|
||||
#define MFXSTM32L152_AGPIO_PIN_7 MFXSTM32L152_GPIO_PIN_23
|
||||
|
||||
#define MFXSTM32L152_GPIO_PINS_ALL ((uint32_t)0xFFFFFF)
|
||||
|
||||
/**
|
||||
* @brief GPIO: constant
|
||||
*/
|
||||
#define MFXSTM32L152_GPIO_DIR_IN ((uint8_t)0x0)
|
||||
#define MFXSTM32L152_GPIO_DIR_OUT ((uint8_t)0x1)
|
||||
#define MFXSTM32L152_IRQ_GPI_EVT_LEVEL ((uint8_t)0x0)
|
||||
#define MFXSTM32L152_IRQ_GPI_EVT_EDGE ((uint8_t)0x1)
|
||||
#define MFXSTM32L152_IRQ_GPI_TYPE_LLFE ((uint8_t)0x0) /* Low Level Falling Edge */
|
||||
#define MFXSTM32L152_IRQ_GPI_TYPE_HLRE ((uint8_t)0x1) /*High Level Raising Edge */
|
||||
#define MFXSTM32L152_GPI_WITHOUT_PULL_RESISTOR ((uint8_t)0x0)
|
||||
#define MFXSTM32L152_GPI_WITH_PULL_RESISTOR ((uint8_t)0x1)
|
||||
#define MFXSTM32L152_GPO_PUSH_PULL ((uint8_t)0x0)
|
||||
#define MFXSTM32L152_GPO_OPEN_DRAIN ((uint8_t)0x1)
|
||||
#define MFXSTM32L152_GPIO_PULL_DOWN ((uint8_t)0x0)
|
||||
#define MFXSTM32L152_GPIO_PULL_UP ((uint8_t)0x1)
|
||||
|
||||
|
||||
/**
|
||||
* @brief TOUCH SCREEN Registers
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Touch Screen Registers
|
||||
*/
|
||||
#define MFXSTM32L152_TS_SETTLING ((uint8_t)0xA0)
|
||||
#define MFXSTM32L152_TS_TOUCH_DET_DELAY ((uint8_t)0xA1)
|
||||
#define MFXSTM32L152_TS_AVE ((uint8_t)0xA2)
|
||||
#define MFXSTM32L152_TS_TRACK ((uint8_t)0xA3)
|
||||
#define MFXSTM32L152_TS_FIFO_TH ((uint8_t)0xA4)
|
||||
#define MFXSTM32L152_TS_FIFO_STA ((uint8_t)0x20)
|
||||
#define MFXSTM32L152_TS_FIFO_LEVEL ((uint8_t)0x21)
|
||||
#define MFXSTM32L152_TS_XY_DATA ((uint8_t)0x24)
|
||||
|
||||
/**
|
||||
* @brief TS registers masks
|
||||
*/
|
||||
#define MFXSTM32L152_TS_CTRL_STATUS ((uint8_t)0x08)
|
||||
#define MFXSTM32L152_TS_CLEAR_FIFO ((uint8_t)0x80)
|
||||
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd control register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_CTRL ((uint8_t)0x80)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd pre delay register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_PRE_DELAY ((uint8_t)0x81)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd Shunt registers (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT0_MSB ((uint8_t)0x82)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT0_LSB ((uint8_t)0x83)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT1_MSB ((uint8_t)0x84)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT1_LSB ((uint8_t)0x85)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT2_MSB ((uint8_t)0x86)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT2_LSB ((uint8_t)0x87)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT3_MSB ((uint8_t)0x88)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT3_LSB ((uint8_t)0x89)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT4_MSB ((uint8_t)0x8A)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT4_LSB ((uint8_t)0x8B)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd ampli gain register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_GAIN_MSB ((uint8_t)0x8C)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_GAIN_LSB ((uint8_t)0x8D)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd VDD min register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_VDD_MIN_MSB ((uint8_t)0x8E)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_VDD_MIN_LSB ((uint8_t)0x8F)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd value register (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_VALUE_MSB ((uint8_t)0x14)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_VALUE_MID ((uint8_t)0x15)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_VALUE_LSB ((uint8_t)0x16)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd calibration offset register (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_CAL_OFFSET_MSB ((uint8_t)0x18)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_CAL_OFFSET_LSB ((uint8_t)0x19)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd shunt used offset register (R)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNT_USED ((uint8_t)0x1A)
|
||||
|
||||
/**
|
||||
* @brief Register address: shunt stabilisation delay registers (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SH0_STABILIZATION ((uint8_t)0x90)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SH1_STABILIZATION ((uint8_t)0x91)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SH2_STABILIZATION ((uint8_t)0x92)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SH3_STABILIZATION ((uint8_t)0x93)
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SH4_STABILIZATION ((uint8_t)0x94)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd number of measurements register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_NBR_OF_MEAS ((uint8_t)0x96)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd delta delay between 2 measurements register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_MEAS_DELTA_DELAY ((uint8_t)0x97)
|
||||
|
||||
/**
|
||||
* @brief Register address: Idd number of shunt on board register (R/W)
|
||||
*/
|
||||
#define MFXSTM32L152_REG_ADR_IDD_SHUNTS_ON_BOARD ((uint8_t)0x98)
|
||||
|
||||
|
||||
|
||||
/** @defgroup IDD_Control_Register_Defines IDD Control Register Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief IDD control register masks
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_CTRL_REQ ((uint8_t)0x01)
|
||||
#define MFXSTM32L152_IDD_CTRL_SHUNT_NB ((uint8_t)0x0E)
|
||||
#define MFXSTM32L152_IDD_CTRL_VREF_DIS ((uint8_t)0x40)
|
||||
#define MFXSTM32L152_IDD_CTRL_CAL_DIS ((uint8_t)0x80)
|
||||
|
||||
/**
|
||||
* @brief IDD Shunt Number
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_SHUNT_NB_1 ((uint8_t) 0x01)
|
||||
#define MFXSTM32L152_IDD_SHUNT_NB_2 ((uint8_t) 0x02)
|
||||
#define MFXSTM32L152_IDD_SHUNT_NB_3 ((uint8_t) 0x03)
|
||||
#define MFXSTM32L152_IDD_SHUNT_NB_4 ((uint8_t) 0x04)
|
||||
#define MFXSTM32L152_IDD_SHUNT_NB_5 ((uint8_t) 0x05)
|
||||
|
||||
/**
|
||||
* @brief Vref Measurement
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_VREF_AUTO_MEASUREMENT_ENABLE ((uint8_t) 0x00)
|
||||
#define MFXSTM32L152_IDD_VREF_AUTO_MEASUREMENT_DISABLE ((uint8_t) 0x70)
|
||||
|
||||
/**
|
||||
* @brief IDD Calibration
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_AUTO_CALIBRATION_ENABLE ((uint8_t) 0x00)
|
||||
#define MFXSTM32L152_IDD_AUTO_CALIBRATION_DISABLE ((uint8_t) 0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_PreDelay_Defines IDD PreDelay Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief IDD PreDelay masks
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_PREDELAY_UNIT ((uint8_t) 0x80)
|
||||
#define MFXSTM32L152_IDD_PREDELAY_VALUE ((uint8_t) 0x7F)
|
||||
|
||||
|
||||
/**
|
||||
* @brief IDD PreDelay unit
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_PREDELAY_0_5_MS ((uint8_t) 0x00)
|
||||
#define MFXSTM32L152_IDD_PREDELAY_20_MS ((uint8_t) 0x80)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_DeltaDelay_Defines IDD Delta DElay Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief IDD Delta Delay masks
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_DELTADELAY_UNIT ((uint8_t) 0x80)
|
||||
#define MFXSTM32L152_IDD_DELTADELAY_VALUE ((uint8_t) 0x7F)
|
||||
|
||||
|
||||
/**
|
||||
* @brief IDD Delta Delay unit
|
||||
*/
|
||||
#define MFXSTM32L152_IDD_DELTADELAY_0_5_MS ((uint8_t) 0x00)
|
||||
#define MFXSTM32L152_IDD_DELTADELAY_20_MS ((uint8_t) 0x80)
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup MFXSTM32L152_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup MFXSTM32L152_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152 Control functions
|
||||
*/
|
||||
void mfxstm32l152_Init(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_DeInit(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_Reset(uint16_t DeviceAddr);
|
||||
uint16_t mfxstm32l152_ReadID(uint16_t DeviceAddr);
|
||||
uint16_t mfxstm32l152_ReadFwVersion(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_LowPower(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_WakeUp(uint16_t DeviceAddr);
|
||||
|
||||
void mfxstm32l152_EnableITSource(uint16_t DeviceAddr, uint8_t Source);
|
||||
void mfxstm32l152_DisableITSource(uint16_t DeviceAddr, uint8_t Source);
|
||||
uint8_t mfxstm32l152_GlobalITStatus(uint16_t DeviceAddr, uint8_t Source);
|
||||
void mfxstm32l152_ClearGlobalIT(uint16_t DeviceAddr, uint8_t Source);
|
||||
|
||||
void mfxstm32l152_SetIrqOutPinPolarity(uint16_t DeviceAddr, uint8_t Polarity);
|
||||
void mfxstm32l152_SetIrqOutPinType(uint16_t DeviceAddr, uint8_t Type);
|
||||
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152 IO functionalities functions
|
||||
*/
|
||||
void mfxstm32l152_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
uint8_t mfxstm32l152_IO_Config(uint16_t DeviceAddr, uint32_t IO_Pin, IO_ModeTypedef IO_Mode);
|
||||
void mfxstm32l152_IO_WritePin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t PinState);
|
||||
uint32_t mfxstm32l152_IO_ReadPin(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
void mfxstm32l152_IO_EnableIT(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IO_DisableIT(uint16_t DeviceAddr);
|
||||
uint32_t mfxstm32l152_IO_ITStatus(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
void mfxstm32l152_IO_ClearIT(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
|
||||
void mfxstm32l152_IO_InitPin(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Direction);
|
||||
void mfxstm32l152_IO_EnableAF(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IO_DisableAF(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IO_SetIrqTypeMode(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Type);
|
||||
void mfxstm32l152_IO_SetIrqEvtMode(uint16_t DeviceAddr, uint32_t IO_Pin, uint8_t Evt);
|
||||
void mfxstm32l152_IO_EnablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
void mfxstm32l152_IO_DisablePinIT(uint16_t DeviceAddr, uint32_t IO_Pin);
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152 Touch screen functionalities functions
|
||||
*/
|
||||
void mfxstm32l152_TS_Start(uint16_t DeviceAddr);
|
||||
uint8_t mfxstm32l152_TS_DetectTouch(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y);
|
||||
void mfxstm32l152_TS_EnableIT(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_TS_DisableIT(uint16_t DeviceAddr);
|
||||
uint8_t mfxstm32l152_TS_ITStatus (uint16_t DeviceAddr);
|
||||
void mfxstm32l152_TS_ClearIT (uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152 IDD current measurement functionalities functions
|
||||
*/
|
||||
void mfxstm32l152_IDD_Start(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IDD_Config(uint16_t DeviceAddr, IDD_ConfigTypeDef MfxIddConfig);
|
||||
void mfxstm32l152_IDD_ConfigShuntNbLimit(uint16_t DeviceAddr, uint8_t ShuntNbLimit);
|
||||
void mfxstm32l152_IDD_GetValue(uint16_t DeviceAddr, uint32_t *ReadValue);
|
||||
uint8_t mfxstm32l152_IDD_GetShuntUsed(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IDD_EnableIT(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IDD_ClearIT(uint16_t DeviceAddr);
|
||||
uint8_t mfxstm32l152_IDD_GetITStatus(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_IDD_DisableIT(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief MFXSTM32L152 Error management functions
|
||||
*/
|
||||
uint8_t mfxstm32l152_Error_ReadSrc(uint16_t DeviceAddr);
|
||||
uint8_t mfxstm32l152_Error_ReadMsg(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_Error_EnableIT(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_Error_ClearIT(uint16_t DeviceAddr);
|
||||
uint8_t mfxstm32l152_Error_GetITStatus(uint16_t DeviceAddr);
|
||||
void mfxstm32l152_Error_DisableIT(uint16_t DeviceAddr);
|
||||
|
||||
uint8_t mfxstm32l152_ReadReg(uint16_t DeviceAddr, uint8_t RegAddr);
|
||||
void mfxstm32l152_WriteReg(uint16_t DeviceAddr, uint8_t RegAddr, uint8_t Value);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief iobus prototypes (they should be defined in common/stm32_iobus.h)
|
||||
*/
|
||||
void MFX_IO_Init(void);
|
||||
void MFX_IO_DeInit(void);
|
||||
void MFX_IO_ITConfig (void);
|
||||
void MFX_IO_EnableWakeupPin(void);
|
||||
void MFX_IO_Wakeup(void);
|
||||
void MFX_IO_Delay(uint32_t delay);
|
||||
void MFX_IO_Write(uint16_t addr, uint8_t reg, uint8_t value);
|
||||
uint8_t MFX_IO_Read(uint16_t addr, uint8_t reg);
|
||||
uint16_t MFX_IO_ReadMultiple(uint16_t addr, uint8_t reg, uint8_t *buffer, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure */
|
||||
extern TS_DrvTypeDef mfxstm32l152_ts_drv;
|
||||
|
||||
/* IO driver structure */
|
||||
extern IO_DrvTypeDef mfxstm32l152_io_drv;
|
||||
|
||||
/* IDD driver structure */
|
||||
extern IDD_DrvTypeDef mfxstm32l152_idd_drv;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __MFXSTM32L152_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,157 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for N25Q128A Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><br><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 29-May-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-family: Verdana; font-size: 10pt;">First official
|
||||
release</span><span style="font-size: 10pt; font-family: Verdana;"> of </span><span style="font-size: 10pt; font-family: Verdana;">N25Q128A QuadSPI Flash Component</span><span style="font-size: 10pt; font-family: Verdana;"> driver</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"></td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
219
2P-ProjectPong/Drivers/BSP/Components/n25q128a/n25q128a.h
Normal file
219
2P-ProjectPong/Drivers/BSP/Components/n25q128a/n25q128a.h
Normal file
@ -0,0 +1,219 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file n25q128a.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 29-May-2015
|
||||
* @brief This file contains all the description of the N25Q128A QSPI memory.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __N25Q128A_H
|
||||
#define __N25Q128A_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup n25q128a
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Configuration
|
||||
*/
|
||||
#define N25Q128A_FLASH_SIZE 0x1000000 /* 128 MBits => 16MBytes */
|
||||
#define N25Q128A_SECTOR_SIZE 0x10000 /* 256 sectors of 64KBytes */
|
||||
#define N25Q128A_SUBSECTOR_SIZE 0x1000 /* 4096 subsectors of 4kBytes */
|
||||
#define N25Q128A_PAGE_SIZE 0x100 /* 65536 pages of 256 bytes */
|
||||
|
||||
#define N25Q128A_DUMMY_CYCLES_READ 8
|
||||
#define N25Q128A_DUMMY_CYCLES_READ_QUAD 10
|
||||
|
||||
#define N25Q128A_BULK_ERASE_MAX_TIME 250000
|
||||
#define N25Q128A_SECTOR_ERASE_MAX_TIME 3000
|
||||
#define N25Q128A_SUBSECTOR_ERASE_MAX_TIME 800
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Commands
|
||||
*/
|
||||
/* Reset Operations */
|
||||
#define RESET_ENABLE_CMD 0x66
|
||||
#define RESET_MEMORY_CMD 0x99
|
||||
|
||||
/* Identification Operations */
|
||||
#define READ_ID_CMD 0x9E
|
||||
#define READ_ID_CMD2 0x9F
|
||||
#define MULTIPLE_IO_READ_ID_CMD 0xAF
|
||||
#define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
|
||||
|
||||
/* Read Operations */
|
||||
#define READ_CMD 0x03
|
||||
#define FAST_READ_CMD 0x0B
|
||||
#define DUAL_OUT_FAST_READ_CMD 0x3B
|
||||
#define DUAL_INOUT_FAST_READ_CMD 0xBB
|
||||
#define QUAD_OUT_FAST_READ_CMD 0x6B
|
||||
#define QUAD_INOUT_FAST_READ_CMD 0xEB
|
||||
|
||||
/* Write Operations */
|
||||
#define WRITE_ENABLE_CMD 0x06
|
||||
#define WRITE_DISABLE_CMD 0x04
|
||||
|
||||
/* Register Operations */
|
||||
#define READ_STATUS_REG_CMD 0x05
|
||||
#define WRITE_STATUS_REG_CMD 0x01
|
||||
|
||||
#define READ_LOCK_REG_CMD 0xE8
|
||||
#define WRITE_LOCK_REG_CMD 0xE5
|
||||
|
||||
#define READ_FLAG_STATUS_REG_CMD 0x70
|
||||
#define CLEAR_FLAG_STATUS_REG_CMD 0x50
|
||||
|
||||
#define READ_NONVOL_CFG_REG_CMD 0xB5
|
||||
#define WRITE_NONVOL_CFG_REG_CMD 0xB1
|
||||
|
||||
#define READ_VOL_CFG_REG_CMD 0x85
|
||||
#define WRITE_VOL_CFG_REG_CMD 0x81
|
||||
|
||||
#define READ_ENHANCED_VOL_CFG_REG_CMD 0x65
|
||||
#define WRITE_ENHANCED_VOL_CFG_REG_CMD 0x61
|
||||
|
||||
/* Program Operations */
|
||||
#define PAGE_PROG_CMD 0x02
|
||||
#define DUAL_IN_FAST_PROG_CMD 0xA2
|
||||
#define EXT_DUAL_IN_FAST_PROG_CMD 0xD2
|
||||
#define QUAD_IN_FAST_PROG_CMD 0x32
|
||||
#define EXT_QUAD_IN_FAST_PROG_CMD 0x12
|
||||
|
||||
/* Erase Operations */
|
||||
#define SUBSECTOR_ERASE_CMD 0x20
|
||||
#define SECTOR_ERASE_CMD 0xD8
|
||||
#define BULK_ERASE_CMD 0xC7
|
||||
|
||||
#define PROG_ERASE_RESUME_CMD 0x7A
|
||||
#define PROG_ERASE_SUSPEND_CMD 0x75
|
||||
|
||||
/* One-Time Programmable Operations */
|
||||
#define READ_OTP_ARRAY_CMD 0x4B
|
||||
#define PROG_OTP_ARRAY_CMD 0x42
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Registers
|
||||
*/
|
||||
/* Status Register */
|
||||
#define N25Q128A_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
|
||||
#define N25Q128A_SR_WREN ((uint8_t)0x02) /*!< Write enable latch */
|
||||
#define N25Q128A_SR_BLOCKPR ((uint8_t)0x5C) /*!< Block protected against program and erase operations */
|
||||
#define N25Q128A_SR_PRBOTTOM ((uint8_t)0x20) /*!< Protected memory area defined by BLOCKPR starts from top or bottom */
|
||||
#define N25Q128A_SR_SRWREN ((uint8_t)0x80) /*!< Status register write enable/disable */
|
||||
|
||||
/* Nonvolatile Configuration Register */
|
||||
#define N25Q128A_NVCR_LOCK ((uint16_t)0x0001) /*!< Lock nonvolatile configuration register */
|
||||
#define N25Q128A_NVCR_DUAL ((uint16_t)0x0004) /*!< Dual I/O protocol */
|
||||
#define N25Q128A_NVCR_QUAB ((uint16_t)0x0008) /*!< Quad I/O protocol */
|
||||
#define N25Q128A_NVCR_RH ((uint16_t)0x0010) /*!< Reset/hold */
|
||||
#define N25Q128A_NVCR_ODS ((uint16_t)0x01C0) /*!< Output driver strength */
|
||||
#define N25Q128A_NVCR_XIP ((uint16_t)0x0E00) /*!< XIP mode at power-on reset */
|
||||
#define N25Q128A_NVCR_NB_DUMMY ((uint16_t)0xF000) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Volatile Configuration Register */
|
||||
#define N25Q128A_VCR_WRAP ((uint8_t)0x03) /*!< Wrap */
|
||||
#define N25Q128A_VCR_XIP ((uint8_t)0x08) /*!< XIP */
|
||||
#define N25Q128A_VCR_NB_DUMMY ((uint8_t)0xF0) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Enhanced Volatile Configuration Register */
|
||||
#define N25Q128A_EVCR_ODS ((uint8_t)0x07) /*!< Output driver strength */
|
||||
#define N25Q128A_EVCR_VPPA ((uint8_t)0x08) /*!< Vpp accelerator */
|
||||
#define N25Q128A_EVCR_RH ((uint8_t)0x10) /*!< Reset/hold */
|
||||
#define N25Q128A_EVCR_DUAL ((uint8_t)0x40) /*!< Dual I/O protocol */
|
||||
#define N25Q128A_EVCR_QUAD ((uint8_t)0x80) /*!< Quad I/O protocol */
|
||||
|
||||
/* Flag Status Register */
|
||||
#define N25Q128A_FSR_PRERR ((uint8_t)0x02) /*!< Protection error */
|
||||
#define N25Q128A_FSR_PGSUS ((uint8_t)0x04) /*!< Program operation suspended */
|
||||
#define N25Q128A_FSR_VPPERR ((uint8_t)0x08) /*!< Invalid voltage during program or erase */
|
||||
#define N25Q128A_FSR_PGERR ((uint8_t)0x10) /*!< Program error */
|
||||
#define N25Q128A_FSR_ERERR ((uint8_t)0x20) /*!< Erase error */
|
||||
#define N25Q128A_FSR_ERSUS ((uint8_t)0x40) /*!< Erase operation suspended */
|
||||
#define N25Q128A_FSR_READY ((uint8_t)0x80) /*!< Ready or command in progress */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __N25Q128A_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,157 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP N25Q256A Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for N25Q256A Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 02-March-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-family: Verdana; font-size: 10pt;">First official
|
||||
release</span><span style="font-family: Verdana; font-size: 10pt;"></span> </li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"></td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
261
2P-ProjectPong/Drivers/BSP/Components/n25q256a/n25q256a.h
Normal file
261
2P-ProjectPong/Drivers/BSP/Components/n25q256a/n25q256a.h
Normal file
@ -0,0 +1,261 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file n25q256a.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 02-March-2015
|
||||
* @brief This file contains all the description of the N25Q256A QSPI memory.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __N25Q256A_H
|
||||
#define __N25Q256A_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup n25q256a
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q256A_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q256A_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief N25Q256A Configuration
|
||||
*/
|
||||
#define N25Q256A_FLASH_SIZE 0x2000000 /* 256 MBits => 32MBytes */
|
||||
#define N25Q256A_SECTOR_SIZE 0x10000 /* 512 sectors of 64KBytes */
|
||||
#define N25Q256A_SUBSECTOR_SIZE 0x1000 /* 8192 subsectors of 4kBytes */
|
||||
#define N25Q256A_PAGE_SIZE 0x100 /* 131072 pages of 256 bytes */
|
||||
|
||||
#define N25Q256A_DUMMY_CYCLES_READ 8
|
||||
#define N25Q256A_DUMMY_CYCLES_READ_QUAD 10
|
||||
#define N25Q256A_DUMMY_CYCLES_READ_DTR 6
|
||||
#define N25Q256A_DUMMY_CYCLES_READ_QUAD_DTR 8
|
||||
|
||||
#define N25Q256A_BULK_ERASE_MAX_TIME 480000
|
||||
#define N25Q256A_SECTOR_ERASE_MAX_TIME 3000
|
||||
#define N25Q256A_SUBSECTOR_ERASE_MAX_TIME 800
|
||||
|
||||
/**
|
||||
* @brief N25Q256A Commands
|
||||
*/
|
||||
/* Reset Operations */
|
||||
#define RESET_ENABLE_CMD 0x66
|
||||
#define RESET_MEMORY_CMD 0x99
|
||||
|
||||
/* Identification Operations */
|
||||
#define READ_ID_CMD 0x9E
|
||||
#define READ_ID_CMD2 0x9F
|
||||
#define MULTIPLE_IO_READ_ID_CMD 0xAF
|
||||
#define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
|
||||
|
||||
/* Read Operations */
|
||||
#define READ_CMD 0x03
|
||||
#define READ_4_BYTE_ADDR_CMD 0x13
|
||||
|
||||
#define FAST_READ_CMD 0x0B
|
||||
#define FAST_READ_DTR_CMD 0x0D
|
||||
#define FAST_READ_4_BYTE_ADDR_CMD 0x0C
|
||||
|
||||
#define DUAL_OUT_FAST_READ_CMD 0x3B
|
||||
#define DUAL_OUT_FAST_READ_DTR_CMD 0x3D
|
||||
#define DUAL_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x3C
|
||||
|
||||
#define DUAL_INOUT_FAST_READ_CMD 0xBB
|
||||
#define DUAL_INOUT_FAST_READ_DTR_CMD 0xBD
|
||||
#define DUAL_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xBC
|
||||
|
||||
#define QUAD_OUT_FAST_READ_CMD 0x6B
|
||||
#define QUAD_OUT_FAST_READ_DTR_CMD 0x6D
|
||||
#define QUAD_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x6C
|
||||
|
||||
#define QUAD_INOUT_FAST_READ_CMD 0xEB
|
||||
#define QUAD_INOUT_FAST_READ_DTR_CMD 0xED
|
||||
#define QUAD_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xEC
|
||||
|
||||
/* Write Operations */
|
||||
#define WRITE_ENABLE_CMD 0x06
|
||||
#define WRITE_DISABLE_CMD 0x04
|
||||
|
||||
/* Register Operations */
|
||||
#define READ_STATUS_REG_CMD 0x05
|
||||
#define WRITE_STATUS_REG_CMD 0x01
|
||||
|
||||
#define READ_LOCK_REG_CMD 0xE8
|
||||
#define WRITE_LOCK_REG_CMD 0xE5
|
||||
|
||||
#define READ_FLAG_STATUS_REG_CMD 0x70
|
||||
#define CLEAR_FLAG_STATUS_REG_CMD 0x50
|
||||
|
||||
#define READ_NONVOL_CFG_REG_CMD 0xB5
|
||||
#define WRITE_NONVOL_CFG_REG_CMD 0xB1
|
||||
|
||||
#define READ_VOL_CFG_REG_CMD 0x85
|
||||
#define WRITE_VOL_CFG_REG_CMD 0x81
|
||||
|
||||
#define READ_ENHANCED_VOL_CFG_REG_CMD 0x65
|
||||
#define WRITE_ENHANCED_VOL_CFG_REG_CMD 0x61
|
||||
|
||||
#define READ_EXT_ADDR_REG_CMD 0xC8
|
||||
#define WRITE_EXT_ADDR_REG_CMD 0xC5
|
||||
|
||||
/* Program Operations */
|
||||
#define PAGE_PROG_CMD 0x02
|
||||
#define PAGE_PROG_4_BYTE_ADDR_CMD 0x12
|
||||
|
||||
#define DUAL_IN_FAST_PROG_CMD 0xA2
|
||||
#define EXT_DUAL_IN_FAST_PROG_CMD 0xD2
|
||||
|
||||
#define QUAD_IN_FAST_PROG_CMD 0x32
|
||||
#define EXT_QUAD_IN_FAST_PROG_CMD 0x12 /*0x38*/
|
||||
#define QUAD_IN_FAST_PROG_4_BYTE_ADDR_CMD 0x34
|
||||
|
||||
/* Erase Operations */
|
||||
#define SUBSECTOR_ERASE_CMD 0x20
|
||||
#define SUBSECTOR_ERASE_4_BYTE_ADDR_CMD 0x21
|
||||
|
||||
#define SECTOR_ERASE_CMD 0xD8
|
||||
#define SECTOR_ERASE_4_BYTE_ADDR_CMD 0xDC
|
||||
|
||||
#define BULK_ERASE_CMD 0xC7
|
||||
|
||||
#define PROG_ERASE_RESUME_CMD 0x7A
|
||||
#define PROG_ERASE_SUSPEND_CMD 0x75
|
||||
|
||||
/* One-Time Programmable Operations */
|
||||
#define READ_OTP_ARRAY_CMD 0x4B
|
||||
#define PROG_OTP_ARRAY_CMD 0x42
|
||||
|
||||
/* 4-byte Address Mode Operations */
|
||||
#define ENTER_4_BYTE_ADDR_MODE_CMD 0xB7
|
||||
#define EXIT_4_BYTE_ADDR_MODE_CMD 0xE9
|
||||
|
||||
/* Quad Operations */
|
||||
#define ENTER_QUAD_CMD 0x35
|
||||
#define EXIT_QUAD_CMD 0xF5
|
||||
|
||||
/**
|
||||
* @brief N25Q256A Registers
|
||||
*/
|
||||
/* Status Register */
|
||||
#define N25Q256A_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
|
||||
#define N25Q256A_SR_WREN ((uint8_t)0x02) /*!< Write enable latch */
|
||||
#define N25Q256A_SR_BLOCKPR ((uint8_t)0x5C) /*!< Block protected against program and erase operations */
|
||||
#define N25Q256A_SR_PRBOTTOM ((uint8_t)0x20) /*!< Protected memory area defined by BLOCKPR starts from top or bottom */
|
||||
#define N25Q256A_SR_SRWREN ((uint8_t)0x80) /*!< Status register write enable/disable */
|
||||
|
||||
/* Nonvolatile Configuration Register */
|
||||
#define N25Q256A_NVCR_NBADDR ((uint16_t)0x0001) /*!< 3-bytes or 4-bytes addressing */
|
||||
#define N25Q256A_NVCR_SEGMENT ((uint16_t)0x0002) /*!< Upper or lower 128Mb segment selected by default */
|
||||
#define N25Q256A_NVCR_DUAL ((uint16_t)0x0004) /*!< Dual I/O protocol */
|
||||
#define N25Q256A_NVCR_QUAB ((uint16_t)0x0008) /*!< Quad I/O protocol */
|
||||
#define N25Q256A_NVCR_RH ((uint16_t)0x0010) /*!< Reset/hold */
|
||||
#define N25Q256A_NVCR_ODS ((uint16_t)0x01C0) /*!< Output driver strength */
|
||||
#define N25Q256A_NVCR_XIP ((uint16_t)0x0E00) /*!< XIP mode at power-on reset */
|
||||
#define N25Q256A_NVCR_NB_DUMMY ((uint16_t)0xF000) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Volatile Configuration Register */
|
||||
#define N25Q256A_VCR_WRAP ((uint8_t)0x03) /*!< Wrap */
|
||||
#define N25Q256A_VCR_XIP ((uint8_t)0x08) /*!< XIP */
|
||||
#define N25Q256A_VCR_NB_DUMMY ((uint8_t)0xF0) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Extended Address Register */
|
||||
#define N25Q256A_EAR_A24 ((uint8_t)0x01) /*!< Select the lower or upper 128Mb segment */
|
||||
|
||||
/* Enhanced Volatile Configuration Register */
|
||||
#define N25Q256A_EVCR_ODS ((uint8_t)0x07) /*!< Output driver strength */
|
||||
#define N25Q256A_EVCR_VPPA ((uint8_t)0x08) /*!< Vpp accelerator */
|
||||
#define N25Q256A_EVCR_RH ((uint8_t)0x10) /*!< Reset/hold */
|
||||
#define N25Q256A_EVCR_DUAL ((uint8_t)0x40) /*!< Dual I/O protocol */
|
||||
#define N25Q256A_EVCR_QUAD ((uint8_t)0x80) /*!< Quad I/O protocol */
|
||||
|
||||
/* Flag Status Register */
|
||||
#define N25Q256A_FSR_NBADDR ((uint8_t)0x01) /*!< 3-bytes or 4-bytes addressing */
|
||||
#define N25Q256A_FSR_PRERR ((uint8_t)0x02) /*!< Protection error */
|
||||
#define N25Q256A_FSR_PGSUS ((uint8_t)0x04) /*!< Program operation suspended */
|
||||
#define N25Q256A_FSR_VPPERR ((uint8_t)0x08) /*!< Invalid voltage during program or erase */
|
||||
#define N25Q256A_FSR_PGERR ((uint8_t)0x10) /*!< Program error */
|
||||
#define N25Q256A_FSR_ERERR ((uint8_t)0x20) /*!< Erase error */
|
||||
#define N25Q256A_FSR_ERSUS ((uint8_t)0x40) /*!< Erase operation suspended */
|
||||
#define N25Q256A_FSR_READY ((uint8_t)0x80) /*!< Ready or command in progress */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q256A_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __N25Q256A_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,158 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for N25Q512A Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 28-April-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-family: Verdana; font-size: 10pt;">First official
|
||||
release</span><span style="font-family: Verdana; font-size: 10pt;"></span> </li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
261
2P-ProjectPong/Drivers/BSP/Components/n25q512a/n25q512a.h
Normal file
261
2P-ProjectPong/Drivers/BSP/Components/n25q512a/n25q512a.h
Normal file
@ -0,0 +1,261 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file n25q512a.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 28-April-2015
|
||||
* @brief This file contains all the description of the N25Q512A QSPI memory.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __N25Q512A_H
|
||||
#define __N25Q512A_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup n25q512a
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q512A_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q512A_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief N25Q512A Configuration
|
||||
*/
|
||||
#define N25Q512A_FLASH_SIZE 0x4000000 /* 512 MBits => 64MBytes */
|
||||
#define N25Q512A_SECTOR_SIZE 0x10000 /* 1024 sectors of 64KBytes */
|
||||
#define N25Q512A_SUBSECTOR_SIZE 0x1000 /* 16384 subsectors of 4kBytes */
|
||||
#define N25Q512A_PAGE_SIZE 0x100 /* 262144 pages of 256 bytes */
|
||||
|
||||
#define N25Q512A_DUMMY_CYCLES_READ 8
|
||||
#define N25Q512A_DUMMY_CYCLES_READ_QUAD 10
|
||||
#define N25Q512A_DUMMY_CYCLES_READ_DTR 6
|
||||
#define N25Q512A_DUMMY_CYCLES_READ_QUAD_DTR 8
|
||||
|
||||
#define N25Q512A_BULK_ERASE_MAX_TIME 480000
|
||||
#define N25Q512A_SECTOR_ERASE_MAX_TIME 3000
|
||||
#define N25Q512A_SUBSECTOR_ERASE_MAX_TIME 800
|
||||
|
||||
/**
|
||||
* @brief N25Q512A Commands
|
||||
*/
|
||||
/* Reset Operations */
|
||||
#define RESET_ENABLE_CMD 0x66
|
||||
#define RESET_MEMORY_CMD 0x99
|
||||
|
||||
/* Identification Operations */
|
||||
#define READ_ID_CMD 0x9E
|
||||
#define READ_ID_CMD2 0x9F
|
||||
#define MULTIPLE_IO_READ_ID_CMD 0xAF
|
||||
#define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
|
||||
|
||||
/* Read Operations */
|
||||
#define READ_CMD 0x03
|
||||
#define READ_4_BYTE_ADDR_CMD 0x13
|
||||
|
||||
#define FAST_READ_CMD 0x0B
|
||||
#define FAST_READ_DTR_CMD 0x0D
|
||||
#define FAST_READ_4_BYTE_ADDR_CMD 0x0C
|
||||
|
||||
#define DUAL_OUT_FAST_READ_CMD 0x3B
|
||||
#define DUAL_OUT_FAST_READ_DTR_CMD 0x3D
|
||||
#define DUAL_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x3C
|
||||
|
||||
#define DUAL_INOUT_FAST_READ_CMD 0xBB
|
||||
#define DUAL_INOUT_FAST_READ_DTR_CMD 0xBD
|
||||
#define DUAL_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xBC
|
||||
|
||||
#define QUAD_OUT_FAST_READ_CMD 0x6B
|
||||
#define QUAD_OUT_FAST_READ_DTR_CMD 0x6D
|
||||
#define QUAD_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x6C
|
||||
|
||||
#define QUAD_INOUT_FAST_READ_CMD 0xEB
|
||||
#define QUAD_INOUT_FAST_READ_DTR_CMD 0xED
|
||||
#define QUAD_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xEC
|
||||
|
||||
/* Write Operations */
|
||||
#define WRITE_ENABLE_CMD 0x06
|
||||
#define WRITE_DISABLE_CMD 0x04
|
||||
|
||||
/* Register Operations */
|
||||
#define READ_STATUS_REG_CMD 0x05
|
||||
#define WRITE_STATUS_REG_CMD 0x01
|
||||
|
||||
#define READ_LOCK_REG_CMD 0xE8
|
||||
#define WRITE_LOCK_REG_CMD 0xE5
|
||||
|
||||
#define READ_FLAG_STATUS_REG_CMD 0x70
|
||||
#define CLEAR_FLAG_STATUS_REG_CMD 0x50
|
||||
|
||||
#define READ_NONVOL_CFG_REG_CMD 0xB5
|
||||
#define WRITE_NONVOL_CFG_REG_CMD 0xB1
|
||||
|
||||
#define READ_VOL_CFG_REG_CMD 0x85
|
||||
#define WRITE_VOL_CFG_REG_CMD 0x81
|
||||
|
||||
#define READ_ENHANCED_VOL_CFG_REG_CMD 0x65
|
||||
#define WRITE_ENHANCED_VOL_CFG_REG_CMD 0x61
|
||||
|
||||
#define READ_EXT_ADDR_REG_CMD 0xC8
|
||||
#define WRITE_EXT_ADDR_REG_CMD 0xC5
|
||||
|
||||
/* Program Operations */
|
||||
#define PAGE_PROG_CMD 0x02
|
||||
#define PAGE_PROG_4_BYTE_ADDR_CMD 0x12
|
||||
|
||||
#define DUAL_IN_FAST_PROG_CMD 0xA2
|
||||
#define EXT_DUAL_IN_FAST_PROG_CMD 0xD2
|
||||
|
||||
#define QUAD_IN_FAST_PROG_CMD 0x32
|
||||
#define EXT_QUAD_IN_FAST_PROG_CMD 0x12 /*0x38*/
|
||||
#define QUAD_IN_FAST_PROG_4_BYTE_ADDR_CMD 0x34
|
||||
|
||||
/* Erase Operations */
|
||||
#define SUBSECTOR_ERASE_CMD 0x20
|
||||
#define SUBSECTOR_ERASE_4_BYTE_ADDR_CMD 0x21
|
||||
|
||||
#define SECTOR_ERASE_CMD 0xD8
|
||||
#define SECTOR_ERASE_4_BYTE_ADDR_CMD 0xDC
|
||||
|
||||
#define BULK_ERASE_CMD 0xC7
|
||||
|
||||
#define PROG_ERASE_RESUME_CMD 0x7A
|
||||
#define PROG_ERASE_SUSPEND_CMD 0x75
|
||||
|
||||
/* One-Time Programmable Operations */
|
||||
#define READ_OTP_ARRAY_CMD 0x4B
|
||||
#define PROG_OTP_ARRAY_CMD 0x42
|
||||
|
||||
/* 4-byte Address Mode Operations */
|
||||
#define ENTER_4_BYTE_ADDR_MODE_CMD 0xB7
|
||||
#define EXIT_4_BYTE_ADDR_MODE_CMD 0xE9
|
||||
|
||||
/* Quad Operations */
|
||||
#define ENTER_QUAD_CMD 0x35
|
||||
#define EXIT_QUAD_CMD 0xF5
|
||||
|
||||
/**
|
||||
* @brief N25Q512A Registers
|
||||
*/
|
||||
/* Status Register */
|
||||
#define N25Q512A_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
|
||||
#define N25Q512A_SR_WREN ((uint8_t)0x02) /*!< Write enable latch */
|
||||
#define N25Q512A_SR_BLOCKPR ((uint8_t)0x5C) /*!< Block protected against program and erase operations */
|
||||
#define N25Q512A_SR_PRBOTTOM ((uint8_t)0x20) /*!< Protected memory area defined by BLOCKPR starts from top or bottom */
|
||||
#define N25Q512A_SR_SRWREN ((uint8_t)0x80) /*!< Status register write enable/disable */
|
||||
|
||||
/* Non volatile Configuration Register */
|
||||
#define N25Q512A_NVCR_NBADDR ((uint16_t)0x0001) /*!< 3-bytes or 4-bytes addressing */
|
||||
#define N25Q512A_NVCR_SEGMENT ((uint16_t)0x0002) /*!< Upper or lower 128Mb segment selected by default */
|
||||
#define N25Q512A_NVCR_DUAL ((uint16_t)0x0004) /*!< Dual I/O protocol */
|
||||
#define N25Q512A_NVCR_QUAB ((uint16_t)0x0008) /*!< Quad I/O protocol */
|
||||
#define N25Q512A_NVCR_RH ((uint16_t)0x0010) /*!< Reset/hold */
|
||||
#define N25Q512A_NVCR_ODS ((uint16_t)0x01C0) /*!< Output driver strength */
|
||||
#define N25Q512A_NVCR_XIP ((uint16_t)0x0E00) /*!< XIP mode at power-on reset */
|
||||
#define N25Q512A_NVCR_NB_DUMMY ((uint16_t)0xF000) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Volatile Configuration Register */
|
||||
#define N25Q512A_VCR_WRAP ((uint8_t)0x03) /*!< Wrap */
|
||||
#define N25Q512A_VCR_XIP ((uint8_t)0x08) /*!< XIP */
|
||||
#define N25Q512A_VCR_NB_DUMMY ((uint8_t)0xF0) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Extended Address Register */
|
||||
#define N25Q512A_EAR_A24 ((uint8_t)0x01) /*!< Select the lower or upper 128Mb segment */
|
||||
|
||||
/* Enhanced Volatile Configuration Register */
|
||||
#define N25Q512A_EVCR_ODS ((uint8_t)0x07) /*!< Output driver strength */
|
||||
#define N25Q512A_EVCR_VPPA ((uint8_t)0x08) /*!< Vpp accelerator */
|
||||
#define N25Q512A_EVCR_RH ((uint8_t)0x10) /*!< Reset/hold */
|
||||
#define N25Q512A_EVCR_DUAL ((uint8_t)0x40) /*!< Dual I/O protocol */
|
||||
#define N25Q512A_EVCR_QUAD ((uint8_t)0x80) /*!< Quad I/O protocol */
|
||||
|
||||
/* Flag Status Register */
|
||||
#define N25Q512A_FSR_NBADDR ((uint8_t)0x01) /*!< 3-bytes or 4-bytes addressing */
|
||||
#define N25Q512A_FSR_PRERR ((uint8_t)0x02) /*!< Protection error */
|
||||
#define N25Q512A_FSR_PGSUS ((uint8_t)0x04) /*!< Program operation suspended */
|
||||
#define N25Q512A_FSR_VPPERR ((uint8_t)0x08) /*!< Invalid voltage during program or erase */
|
||||
#define N25Q512A_FSR_PGERR ((uint8_t)0x10) /*!< Program error */
|
||||
#define N25Q512A_FSR_ERERR ((uint8_t)0x20) /*!< Erase error */
|
||||
#define N25Q512A_FSR_ERSUS ((uint8_t)0x40) /*!< Erase operation suspended */
|
||||
#define N25Q512A_FSR_READY ((uint8_t)0x80) /*!< Ready or command in progress */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q512A_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __N25Q512A_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,202 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for OTM8009A BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for OTM8009A Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2017 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2
|
||||
/ 27-January-2017 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Update DSI controller timings</span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">CABC LEDPWM frequency adjusted to 19,5kHz<br>
|
||||
</span></li>
|
||||
</ul>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 04-August-2016 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Update DSI controller timings</span></li>
|
||||
</ul>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 03-August-2015 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">First official release</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
454
2P-ProjectPong/Drivers/BSP/Components/otm8009a/otm8009a.c
Normal file
454
2P-ProjectPong/Drivers/BSP/Components/otm8009a/otm8009a.c
Normal file
@ -0,0 +1,454 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file otm8009a.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 27-January-2017
|
||||
* @brief This file provides the LCD Driver for KoD KM-040TMP-02-0621 (WVGA)
|
||||
* DSI LCD Display OTM8009A.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "otm8009a.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup OTM8009A OTM8009A
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* otm8009a IC display driver.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup OTM8009A_Private_Constants OTM8009A Private Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* @brief Constant tables of register settings used to transmit DSI
|
||||
* command packets as power up initialization sequence of the KoD LCD (OTM8009A LCD Driver)
|
||||
*/
|
||||
const uint8_t lcdRegData1[] = {0x80,0x09,0x01,0xFF};
|
||||
const uint8_t lcdRegData2[] = {0x80,0x09,0xFF};
|
||||
const uint8_t lcdRegData3[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE1};
|
||||
const uint8_t lcdRegData4[] = {0x00,0x09,0x0F,0x0E,0x07,0x10,0x0B,0x0A,0x04,0x07,0x0B,0x08,0x0F,0x10,0x0A,0x01,0xE2};
|
||||
const uint8_t lcdRegData5[] = {0x79,0x79,0xD8};
|
||||
const uint8_t lcdRegData6[] = {0x00,0x01,0xB3};
|
||||
const uint8_t lcdRegData7[] = {0x85,0x01,0x00,0x84,0x01,0x00,0xCE};
|
||||
const uint8_t lcdRegData8[] = {0x18,0x04,0x03,0x39,0x00,0x00,0x00,0x18,0x03,0x03,0x3A,0x00,0x00,0x00,0xCE};
|
||||
const uint8_t lcdRegData9[] = {0x18,0x02,0x03,0x3B,0x00,0x00,0x00,0x18,0x01,0x03,0x3C,0x00,0x00,0x00,0xCE};
|
||||
const uint8_t lcdRegData10[] = {0x01,0x01,0x20,0x20,0x00,0x00,0x01,0x02,0x00,0x00,0xCF};
|
||||
const uint8_t lcdRegData11[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData12[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData13[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData14[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData15[] = {0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData16[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData17[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCB};
|
||||
const uint8_t lcdRegData18[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCB};
|
||||
const uint8_t lcdRegData19[] = {0x00,0x26,0x09,0x0B,0x01,0x25,0x00,0x00,0x00,0x00,0xCC};
|
||||
const uint8_t lcdRegData20[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0A,0x0C,0x02,0xCC};
|
||||
const uint8_t lcdRegData21[] = {0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC};
|
||||
const uint8_t lcdRegData22[] = {0x00,0x25,0x0C,0x0A,0x02,0x26,0x00,0x00,0x00,0x00,0xCC};
|
||||
const uint8_t lcdRegData23[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x0B,0x09,0x01,0xCC};
|
||||
const uint8_t lcdRegData24[] = {0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC};
|
||||
const uint8_t lcdRegData25[] = {0xFF,0xFF,0xFF,0xFF};
|
||||
/*
|
||||
* CASET value (Column Address Set) : X direction LCD GRAM boundaries
|
||||
* depending on LCD orientation mode and PASET value (Page Address Set) : Y direction
|
||||
* LCD GRAM boundaries depending on LCD orientation mode
|
||||
* XS[15:0] = 0x000 = 0, XE[15:0] = 0x31F = 799 for landscape mode : apply to CASET
|
||||
* YS[15:0] = 0x000 = 0, YE[15:0] = 0x31F = 799 for portrait mode : : apply to PASET
|
||||
*/
|
||||
const uint8_t lcdRegData27[] = {0x00, 0x00, 0x03, 0x1F, OTM8009A_CMD_CASET};
|
||||
/*
|
||||
* XS[15:0] = 0x000 = 0, XE[15:0] = 0x1DF = 479 for portrait mode : apply to CASET
|
||||
* YS[15:0] = 0x000 = 0, YE[15:0] = 0x1DF = 479 for landscape mode : apply to PASET
|
||||
*/
|
||||
const uint8_t lcdRegData28[] = {0x00, 0x00, 0x01, 0xDF, OTM8009A_CMD_PASET};
|
||||
|
||||
|
||||
const uint8_t ShortRegData1[] = {OTM8009A_CMD_NOP, 0x00};
|
||||
const uint8_t ShortRegData2[] = {OTM8009A_CMD_NOP, 0x80};
|
||||
const uint8_t ShortRegData3[] = {0xC4, 0x30};
|
||||
const uint8_t ShortRegData4[] = {OTM8009A_CMD_NOP, 0x8A};
|
||||
const uint8_t ShortRegData5[] = {0xC4, 0x40};
|
||||
const uint8_t ShortRegData6[] = {OTM8009A_CMD_NOP, 0xB1};
|
||||
const uint8_t ShortRegData7[] = {0xC5, 0xA9};
|
||||
const uint8_t ShortRegData8[] = {OTM8009A_CMD_NOP, 0x91};
|
||||
const uint8_t ShortRegData9[] = {0xC5, 0x34};
|
||||
const uint8_t ShortRegData10[] = {OTM8009A_CMD_NOP, 0xB4};
|
||||
const uint8_t ShortRegData11[] = {0xC0, 0x50};
|
||||
const uint8_t ShortRegData12[] = {0xD9, 0x4E};
|
||||
const uint8_t ShortRegData13[] = {OTM8009A_CMD_NOP, 0x81};
|
||||
const uint8_t ShortRegData14[] = {0xC1, 0x66};
|
||||
const uint8_t ShortRegData15[] = {OTM8009A_CMD_NOP, 0xA1};
|
||||
const uint8_t ShortRegData16[] = {0xC1, 0x08};
|
||||
const uint8_t ShortRegData17[] = {OTM8009A_CMD_NOP, 0x92};
|
||||
const uint8_t ShortRegData18[] = {0xC5, 0x01};
|
||||
const uint8_t ShortRegData19[] = {OTM8009A_CMD_NOP, 0x95};
|
||||
const uint8_t ShortRegData20[] = {OTM8009A_CMD_NOP, 0x94};
|
||||
const uint8_t ShortRegData21[] = {0xC5, 0x33};
|
||||
const uint8_t ShortRegData22[] = {OTM8009A_CMD_NOP, 0xA3};
|
||||
const uint8_t ShortRegData23[] = {0xC0, 0x1B};
|
||||
const uint8_t ShortRegData24[] = {OTM8009A_CMD_NOP, 0x82};
|
||||
const uint8_t ShortRegData25[] = {0xC5, 0x83};
|
||||
const uint8_t ShortRegData26[] = {0xC4, 0x83};
|
||||
const uint8_t ShortRegData27[] = {0xC1, 0x0E};
|
||||
const uint8_t ShortRegData28[] = {OTM8009A_CMD_NOP, 0xA6};
|
||||
const uint8_t ShortRegData29[] = {OTM8009A_CMD_NOP, 0xA0};
|
||||
const uint8_t ShortRegData30[] = {OTM8009A_CMD_NOP, 0xB0};
|
||||
const uint8_t ShortRegData31[] = {OTM8009A_CMD_NOP, 0xC0};
|
||||
const uint8_t ShortRegData32[] = {OTM8009A_CMD_NOP, 0xD0};
|
||||
const uint8_t ShortRegData33[] = {OTM8009A_CMD_NOP, 0x90};
|
||||
const uint8_t ShortRegData34[] = {OTM8009A_CMD_NOP, 0xE0};
|
||||
const uint8_t ShortRegData35[] = {OTM8009A_CMD_NOP, 0xF0};
|
||||
const uint8_t ShortRegData36[] = {OTM8009A_CMD_SLPOUT, 0x00};
|
||||
const uint8_t ShortRegData37[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB565};
|
||||
const uint8_t ShortRegData38[] = {OTM8009A_CMD_COLMOD, OTM8009A_COLMOD_RGB888};
|
||||
const uint8_t ShortRegData39[] = {OTM8009A_CMD_MADCTR, OTM8009A_MADCTR_MODE_LANDSCAPE};
|
||||
const uint8_t ShortRegData40[] = {OTM8009A_CMD_WRDISBV, 0x7F};
|
||||
const uint8_t ShortRegData41[] = {OTM8009A_CMD_WRCTRLD, 0x2C};
|
||||
const uint8_t ShortRegData42[] = {OTM8009A_CMD_WRCABC, 0x02};
|
||||
const uint8_t ShortRegData43[] = {OTM8009A_CMD_WRCABCMB, 0xFF};
|
||||
const uint8_t ShortRegData44[] = {OTM8009A_CMD_DISPON, 0x00};
|
||||
const uint8_t ShortRegData45[] = {OTM8009A_CMD_RAMWR, 0x00};
|
||||
const uint8_t ShortRegData46[] = {0xCF, 0x00};
|
||||
const uint8_t ShortRegData47[] = {0xC5, 0x66};
|
||||
const uint8_t ShortRegData48[] = {OTM8009A_CMD_NOP, 0xB6};
|
||||
const uint8_t ShortRegData49[] = {0xF5, 0x06};
|
||||
const uint8_t ShortRegData50[] = {OTM8009A_CMD_NOP, 0xB1};
|
||||
const uint8_t ShortRegData51[] = {0xC6, 0x06};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
/** @defgroup OTM8009A_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions ---------------------------------------------------------*/
|
||||
/** @defgroup OTM8009A_Exported_Functions OTM8009A Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief DSI IO write short/long command.
|
||||
* @note : Can be surcharged by application code implementation of the function.
|
||||
*/
|
||||
__weak void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams)
|
||||
{
|
||||
/* NOTE : This function Should not be modified, when it is needed,
|
||||
the DSI_IO_WriteCmd could be implemented in the user file
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the LCD KoD display part by communication in DSI mode in Video Mode
|
||||
* with IC Display Driver OTM8009A (see IC Driver specification for more information).
|
||||
* @param hdsi_eval : pointer on DSI configuration structure
|
||||
* @param hdsivideo_handle : pointer on DSI video mode configuration structure
|
||||
* @retval Status
|
||||
*/
|
||||
uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation)
|
||||
{
|
||||
/* Enable CMD2 to access vendor specific commands */
|
||||
/* Enter in command 2 mode and set EXTC to enable address shift function (0x00) */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData1);
|
||||
|
||||
/* Enter ORISE Command 2 */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2); /* Shift address to 0x80 */
|
||||
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData2);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
/* SD_PCH_CTRL - 0xC480h - 129th parameter - Default 0x00 */
|
||||
/* Set SD_PT */
|
||||
/* -> Source output level during porch and non-display area to GND */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData3);
|
||||
OTM8009A_IO_Delay(10);
|
||||
/* Not documented */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData4);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData5);
|
||||
OTM8009A_IO_Delay(10);
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* PWR_CTRL4 - 0xC4B0h - 178th parameter - Default 0xA8 */
|
||||
/* Set gvdd_en_test */
|
||||
/* -> enable GVDD test mode !!! */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData6);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData7);
|
||||
|
||||
/* PWR_CTRL2 - 0xC590h - 146th parameter - Default 0x79 */
|
||||
/* Set pump 4 vgh voltage */
|
||||
/* -> from 15.0v down to 13.0v */
|
||||
/* Set pump 5 vgh voltage */
|
||||
/* -> from -12.0v downto -9.0v */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData8);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);
|
||||
|
||||
/* P_DRV_M - 0xC0B4h - 181th parameter - Default 0x00 */
|
||||
/* -> Column inversion */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData10);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData11);
|
||||
|
||||
/* VCOMDC - 0xD900h - 1st parameter - Default 0x39h */
|
||||
/* VCOM Voltage settings */
|
||||
/* -> from -1.0000v downto -1.2625v */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData12);
|
||||
|
||||
/* Oscillator adjustment for Idle/Normal mode (LPDT only) set to 65Hz (default is 60Hz) */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData14);
|
||||
|
||||
/* Video mode internal */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData16);
|
||||
|
||||
/* PWR_CTRL2 - 0xC590h - 147h parameter - Default 0x00 */
|
||||
/* Set pump 4&5 x6 */
|
||||
/* -> ONLY VALID when PUMP4_EN_ASDM_HV = "0" */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData17);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData18);
|
||||
|
||||
/* PWR_CTRL2 - 0xC590h - 150th parameter - Default 0x33h */
|
||||
/* Change pump4 clock ratio */
|
||||
/* -> from 1 line to 1/2 line */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData19);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData9);
|
||||
|
||||
/* GVDD/NGVDD settings */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData5);
|
||||
|
||||
/* PWR_CTRL2 - 0xC590h - 149th parameter - Default 0x33h */
|
||||
/* Rewrite the default value ! */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData20);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData21);
|
||||
|
||||
/* Panel display timing Setting 3 */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData22);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData23);
|
||||
|
||||
/* Power control 1 */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData24);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData25);
|
||||
|
||||
/* Source driver precharge */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData26);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData15);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData27);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData28);
|
||||
DSI_IO_WriteCmd( 2, (uint8_t *)lcdRegData6);
|
||||
|
||||
/* GOAVST */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
||||
DSI_IO_WriteCmd( 6, (uint8_t *)lcdRegData7);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
||||
DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData8);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
||||
DSI_IO_WriteCmd( 14, (uint8_t *)lcdRegData9);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData10);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData46);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData11);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData12);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData13);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData14);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData15);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData16);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData34);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData17);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData35);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData18);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData2);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData19);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData33);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData20);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData29);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData21);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData30);
|
||||
DSI_IO_WriteCmd( 10, (uint8_t *)lcdRegData22);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData31);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData23);
|
||||
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData32);
|
||||
DSI_IO_WriteCmd( 15, (uint8_t *)lcdRegData24);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/* PWR_CTRL1 - 0xc580h - 130th parameter - default 0x00 */
|
||||
/* Pump 1 min and max DM */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData13);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData47);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData48);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData49);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* CABC LEDPWM frequency adjusted to 19,5kHz */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData50);
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData51);
|
||||
|
||||
/* Exit CMD2 mode */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd( 3, (uint8_t *)lcdRegData25);
|
||||
|
||||
/*************************************************************************** */
|
||||
/* Standard DCS Initialization TO KEEP CAN BE DONE IN HSDT */
|
||||
/*************************************************************************** */
|
||||
|
||||
/* NOP - goes back to DCS std command ? */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
|
||||
/* Gamma correction 2.2+ table (HSDT possible) */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData3);
|
||||
|
||||
/* Gamma correction 2.2- table (HSDT possible) */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
DSI_IO_WriteCmd( 16, (uint8_t *)lcdRegData4);
|
||||
|
||||
/* Send Sleep Out command to display : no parameter */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData36);
|
||||
|
||||
/* Wait for sleep out exit */
|
||||
OTM8009A_IO_Delay(120);
|
||||
|
||||
switch(ColorCoding)
|
||||
{
|
||||
case OTM8009A_FORMAT_RBG565 :
|
||||
/* Set Pixel color format to RGB565 */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData37);
|
||||
break;
|
||||
case OTM8009A_FORMAT_RGB888 :
|
||||
/* Set Pixel color format to RGB888 */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData38);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
/* Send command to configure display in landscape orientation mode. By default
|
||||
the orientation mode is portrait */
|
||||
if(orientation == OTM8009A_ORIENTATION_LANDSCAPE)
|
||||
{
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData39);
|
||||
DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData27);
|
||||
DSI_IO_WriteCmd( 4, (uint8_t *)lcdRegData28);
|
||||
}
|
||||
|
||||
/** CABC : Content Adaptive Backlight Control section start >> */
|
||||
/* Note : defaut is 0 (lowest Brightness), 0xFF is highest Brightness, try 0x7F : intermediate value */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData40);
|
||||
|
||||
/* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData41);
|
||||
|
||||
/* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData42);
|
||||
|
||||
/* defaut is 0 (lowest Brightness), 0xFF is highest Brightness */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData43);
|
||||
|
||||
/** CABC : Content Adaptive Backlight Control section end << */
|
||||
|
||||
/* Send Command Display On */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData44);
|
||||
|
||||
/* NOP command */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData1);
|
||||
|
||||
/* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */
|
||||
/* DSI host from LTDC incoming pixels in video mode */
|
||||
DSI_IO_WriteCmd(0, (uint8_t *)ShortRegData45);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
224
2P-ProjectPong/Drivers/BSP/Components/otm8009a/otm8009a.h
Normal file
224
2P-ProjectPong/Drivers/BSP/Components/otm8009a/otm8009a.h
Normal file
@ -0,0 +1,224 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file otm8009a.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 27-January-2017
|
||||
* @brief This file contains all the constants parameters for the OTM8009A
|
||||
* which is the LCD Driver for KoD KM-040TMP-02-0621 (WVGA)
|
||||
* DSI LCD Display.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __OTM8009A_H
|
||||
#define __OTM8009A_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup otm8009a
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup OTM8009A_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#ifndef __weak
|
||||
#define __weak __attribute__((weak))
|
||||
#endif /* __weak */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/**
|
||||
* @brief LCD_OrientationTypeDef
|
||||
* Possible values of Display Orientation
|
||||
*/
|
||||
#define OTM8009A_ORIENTATION_PORTRAIT ((uint32_t)0x00) /* Portrait orientation choice of LCD screen */
|
||||
#define OTM8009A_ORIENTATION_LANDSCAPE ((uint32_t)0x01) /* Landscape orientation choice of LCD screen */
|
||||
|
||||
/**
|
||||
* @brief Possible values of
|
||||
* pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets
|
||||
*/
|
||||
#define OTM8009A_FORMAT_RGB888 ((uint32_t)0x00) /* Pixel format chosen is RGB888 : 24 bpp */
|
||||
#define OTM8009A_FORMAT_RBG565 ((uint32_t)0x02) /* Pixel format chosen is RGB565 : 16 bpp */
|
||||
|
||||
/**
|
||||
* @brief otm8009a_480x800 Size
|
||||
*/
|
||||
|
||||
/* Width and Height in Portrait mode */
|
||||
#define OTM8009A_480X800_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define OTM8009A_480X800_HEIGHT ((uint16_t)800) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/* Width and Height in Landscape mode */
|
||||
#define OTM8009A_800X480_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */
|
||||
#define OTM8009A_800X480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief OTM8009A_480X800 Timing parameters for Portrait orientation mode
|
||||
*/
|
||||
#define OTM8009A_480X800_HSYNC ((uint16_t)2) /* Horizontal synchronization */
|
||||
#define OTM8009A_480X800_HBP ((uint16_t)34) /* Horizontal back porch */
|
||||
#define OTM8009A_480X800_HFP ((uint16_t)34) /* Horizontal front porch */
|
||||
#define OTM8009A_480X800_VSYNC ((uint16_t)1) /* Vertical synchronization */
|
||||
#define OTM8009A_480X800_VBP ((uint16_t)15) /* Vertical back porch */
|
||||
#define OTM8009A_480X800_VFP ((uint16_t)16) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief OTM8009A_800X480 Timing parameters for Landscape orientation mode
|
||||
* Same values as for Portrait mode in fact.
|
||||
*/
|
||||
#define OTM8009A_800X480_HSYNC OTM8009A_480X800_VSYNC /* Horizontal synchronization */
|
||||
#define OTM8009A_800X480_HBP OTM8009A_480X800_VBP /* Horizontal back porch */
|
||||
#define OTM8009A_800X480_HFP OTM8009A_480X800_VFP /* Horizontal front porch */
|
||||
#define OTM8009A_800X480_VSYNC OTM8009A_480X800_HSYNC /* Vertical synchronization */
|
||||
#define OTM8009A_800X480_VBP OTM8009A_480X800_HBP /* Vertical back porch */
|
||||
#define OTM8009A_800X480_VFP OTM8009A_480X800_HFP /* Vertical front porch */
|
||||
|
||||
|
||||
/* List of OTM8009A used commands */
|
||||
/* Detailed in OTM8009A Data Sheet 'DATA_SHEET_OTM8009A_V0 92.pdf' */
|
||||
/* Version of 14 June 2012 */
|
||||
#define OTM8009A_CMD_NOP 0x00 /* NOP command */
|
||||
#define OTM8009A_CMD_SWRESET 0x01 /* Sw reset command */
|
||||
#define OTM8009A_CMD_RDDMADCTL 0x0B /* Read Display MADCTR command : read memory display access ctrl */
|
||||
#define OTM8009A_CMD_RDDCOLMOD 0x0C /* Read Display pixel format */
|
||||
#define OTM8009A_CMD_SLPIN 0x10 /* Sleep In command */
|
||||
#define OTM8009A_CMD_SLPOUT 0x11 /* Sleep Out command */
|
||||
#define OTM8009A_CMD_PTLON 0x12 /* Partial mode On command */
|
||||
|
||||
#define OTM8009A_CMD_DISPOFF 0x28 /* Display Off command */
|
||||
#define OTM8009A_CMD_DISPON 0x29 /* Display On command */
|
||||
|
||||
#define OTM8009A_CMD_CASET 0x2A /* Column address set command */
|
||||
#define OTM8009A_CMD_PASET 0x2B /* Page address set command */
|
||||
|
||||
#define OTM8009A_CMD_RAMWR 0x2C /* Memory (GRAM) write command */
|
||||
#define OTM8009A_CMD_RAMRD 0x2E /* Memory (GRAM) read command */
|
||||
|
||||
#define OTM8009A_CMD_PLTAR 0x30 /* Partial area command (4 parameters) */
|
||||
|
||||
#define OTM8009A_CMD_TEOFF 0x34 /* Tearing Effect Line Off command : command with no parameter */
|
||||
|
||||
#define OTM8009A_CMD_TEEON 0x35 /* Tearing Effect Line On command : command with 1 parameter 'TELOM' */
|
||||
|
||||
/* Parameter TELOM : Tearing Effect Line Output Mode : possible values */
|
||||
#define OTM8009A_TEEON_TELOM_VBLANKING_INFO_ONLY 0x00
|
||||
#define OTM8009A_TEEON_TELOM_VBLANKING_AND_HBLANKING_INFO 0x01
|
||||
|
||||
#define OTM8009A_CMD_MADCTR 0x36 /* Memory Access write control command */
|
||||
|
||||
/* Possible used values of MADCTR */
|
||||
#define OTM8009A_MADCTR_MODE_PORTRAIT 0x00
|
||||
#define OTM8009A_MADCTR_MODE_LANDSCAPE 0x60 /* MY = 0, MX = 1, MV = 1, ML = 0, RGB = 0 */
|
||||
|
||||
#define OTM8009A_CMD_IDMOFF 0x38 /* Idle mode Off command */
|
||||
#define OTM8009A_CMD_IDMON 0x39 /* Idle mode On command */
|
||||
|
||||
#define OTM8009A_CMD_COLMOD 0x3A /* Interface Pixel format command */
|
||||
|
||||
/* Possible values of COLMOD parameter corresponding to used pixel formats */
|
||||
#define OTM8009A_COLMOD_RGB565 0x55
|
||||
#define OTM8009A_COLMOD_RGB888 0x77
|
||||
|
||||
#define OTM8009A_CMD_RAMWRC 0x3C /* Memory write continue command */
|
||||
#define OTM8009A_CMD_RAMRDC 0x3E /* Memory read continue command */
|
||||
|
||||
#define OTM8009A_CMD_WRTESCN 0x44 /* Write Tearing Effect Scan line command */
|
||||
#define OTM8009A_CMD_RDSCNL 0x45 /* Read Tearing Effect Scan line command */
|
||||
|
||||
/* CABC Management : ie : Content Adaptive Back light Control in IC OTM8009a */
|
||||
#define OTM8009A_CMD_WRDISBV 0x51 /* Write Display Brightness command */
|
||||
#define OTM8009A_CMD_WRCTRLD 0x53 /* Write CTRL Display command */
|
||||
#define OTM8009A_CMD_WRCABC 0x55 /* Write Content Adaptive Brightness command */
|
||||
#define OTM8009A_CMD_WRCABCMB 0x5E /* Write CABC Minimum Brightness command */
|
||||
|
||||
/**
|
||||
* @brief OTM8009A_480X800 frequency divider
|
||||
*/
|
||||
#define OTM8009A_480X800_FREQUENCY_DIVIDER 2 /* LCD Frequency divider */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup OTM8009A_Exported_Macros OTM8009A Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup OTM8009A_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t *pParams);
|
||||
uint8_t OTM8009A_Init(uint32_t ColorCoding, uint32_t orientation);
|
||||
void OTM8009A_IO_Delay(uint32_t Delay);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __OTM8009A_480X800_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
426
2P-ProjectPong/Drivers/BSP/Components/ov2640/Release_Notes.html
Normal file
426
2P-ProjectPong/Drivers/BSP/Components/ov2640/Release_Notes.html
Normal file
@ -0,0 +1,426 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for OV2640 Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for OV2640 Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">ov2640.h: change "\" by "/" in the include path to fix compilation issue under Linux</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 19-June-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Align driver
|
||||
with the STM32Cube BSP architecture by removing check for
|
||||
initialization in ov2640_Init() and ov2640_ReadID() functions</span></li>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">Comments clean up and typo corrections</span></li>
|
||||
</ul>
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release </span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
1351
2P-ProjectPong/Drivers/BSP/Components/ov2640/ov2640.c
Normal file
1351
2P-ProjectPong/Drivers/BSP/Components/ov2640/ov2640.c
Normal file
File diff suppressed because it is too large
Load Diff
226
2P-ProjectPong/Drivers/BSP/Components/ov2640/ov2640.h
Normal file
226
2P-ProjectPong/Drivers/BSP/Components/ov2640/ov2640.h
Normal file
@ -0,0 +1,226 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ov2640.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 02-December-2014
|
||||
* @brief This file contains all the functions prototypes for the ov2640.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __OV2640_H
|
||||
#define __OV2640_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/camera.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ov2640
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup OV2640_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup OV2640_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief OV2640 ID
|
||||
*/
|
||||
#define OV2640_ID 0x26
|
||||
/**
|
||||
* @brief OV2640 Registers
|
||||
*/
|
||||
/* OV2640 Registers definition when DSP bank selected (0xFF = 0x00) */
|
||||
#define OV2640_DSP_R_BYPASS 0x05
|
||||
#define OV2640_DSP_Qs 0x44
|
||||
#define OV2640_DSP_CTRL 0x50
|
||||
#define OV2640_DSP_HSIZE1 0x51
|
||||
#define OV2640_DSP_VSIZE1 0x52
|
||||
#define OV2640_DSP_XOFFL 0x53
|
||||
#define OV2640_DSP_YOFFL 0x54
|
||||
#define OV2640_DSP_VHYX 0x55
|
||||
#define OV2640_DSP_DPRP 0x56
|
||||
#define OV2640_DSP_TEST 0x57
|
||||
#define OV2640_DSP_ZMOW 0x5A
|
||||
#define OV2640_DSP_ZMOH 0x5B
|
||||
#define OV2640_DSP_ZMHH 0x5C
|
||||
#define OV2640_DSP_BPADDR 0x7C
|
||||
#define OV2640_DSP_BPDATA 0x7D
|
||||
#define OV2640_DSP_CTRL2 0x86
|
||||
#define OV2640_DSP_CTRL3 0x87
|
||||
#define OV2640_DSP_SIZEL 0x8C
|
||||
#define OV2640_DSP_HSIZE2 0xC0
|
||||
#define OV2640_DSP_VSIZE2 0xC1
|
||||
#define OV2640_DSP_CTRL0 0xC2
|
||||
#define OV2640_DSP_CTRL1 0xC3
|
||||
#define OV2640_DSP_R_DVP_SP 0xD3
|
||||
#define OV2640_DSP_IMAGE_MODE 0xDA
|
||||
#define OV2640_DSP_RESET 0xE0
|
||||
#define OV2640_DSP_MS_SP 0xF0
|
||||
#define OV2640_DSP_SS_ID 0x7F
|
||||
#define OV2640_DSP_SS_CTRL 0xF8
|
||||
#define OV2640_DSP_MC_BIST 0xF9
|
||||
#define OV2640_DSP_MC_AL 0xFA
|
||||
#define OV2640_DSP_MC_AH 0xFB
|
||||
#define OV2640_DSP_MC_D 0xFC
|
||||
#define OV2640_DSP_P_STATUS 0xFE
|
||||
#define OV2640_DSP_RA_DLMT 0xFF
|
||||
|
||||
/* OV2640 Registers definition when sensor bank selected (0xFF = 0x01) */
|
||||
#define OV2640_SENSOR_GAIN 0x00
|
||||
#define OV2640_SENSOR_COM1 0x03
|
||||
#define OV2640_SENSOR_REG04 0x04
|
||||
#define OV2640_SENSOR_REG08 0x08
|
||||
#define OV2640_SENSOR_COM2 0x09
|
||||
#define OV2640_SENSOR_PIDH 0x0A
|
||||
#define OV2640_SENSOR_PIDL 0x0B
|
||||
#define OV2640_SENSOR_COM3 0x0C
|
||||
#define OV2640_SENSOR_COM4 0x0D
|
||||
#define OV2640_SENSOR_AEC 0x10
|
||||
#define OV2640_SENSOR_CLKRC 0x11
|
||||
#define OV2640_SENSOR_COM7 0x12
|
||||
#define OV2640_SENSOR_COM8 0x13
|
||||
#define OV2640_SENSOR_COM9 0x14
|
||||
#define OV2640_SENSOR_COM10 0x15
|
||||
#define OV2640_SENSOR_HREFST 0x17
|
||||
#define OV2640_SENSOR_HREFEND 0x18
|
||||
#define OV2640_SENSOR_VSTART 0x19
|
||||
#define OV2640_SENSOR_VEND 0x1A
|
||||
#define OV2640_SENSOR_MIDH 0x1C
|
||||
#define OV2640_SENSOR_MIDL 0x1D
|
||||
#define OV2640_SENSOR_AEW 0x24
|
||||
#define OV2640_SENSOR_AEB 0x25
|
||||
#define OV2640_SENSOR_W 0x26
|
||||
#define OV2640_SENSOR_REG2A 0x2A
|
||||
#define OV2640_SENSOR_FRARL 0x2B
|
||||
#define OV2640_SENSOR_ADDVSL 0x2D
|
||||
#define OV2640_SENSOR_ADDVHS 0x2E
|
||||
#define OV2640_SENSOR_YAVG 0x2F
|
||||
#define OV2640_SENSOR_REG32 0x32
|
||||
#define OV2640_SENSOR_ARCOM2 0x34
|
||||
#define OV2640_SENSOR_REG45 0x45
|
||||
#define OV2640_SENSOR_FLL 0x46
|
||||
#define OV2640_SENSOR_FLH 0x47
|
||||
#define OV2640_SENSOR_COM19 0x48
|
||||
#define OV2640_SENSOR_ZOOMS 0x49
|
||||
#define OV2640_SENSOR_COM22 0x4B
|
||||
#define OV2640_SENSOR_COM25 0x4E
|
||||
#define OV2640_SENSOR_BD50 0x4F
|
||||
#define OV2640_SENSOR_BD60 0x50
|
||||
#define OV2640_SENSOR_REG5D 0x5D
|
||||
#define OV2640_SENSOR_REG5E 0x5E
|
||||
#define OV2640_SENSOR_REG5F 0x5F
|
||||
#define OV2640_SENSOR_REG60 0x60
|
||||
#define OV2640_SENSOR_HISTO_LOW 0x61
|
||||
#define OV2640_SENSOR_HISTO_HIGH 0x62
|
||||
|
||||
/**
|
||||
* @brief OV2640 Features Parameters
|
||||
*/
|
||||
#define OV2640_BRIGHTNESS_LEVEL0 0x40 /* Brightness level -2 */
|
||||
#define OV2640_BRIGHTNESS_LEVEL1 0x30 /* Brightness level -1 */
|
||||
#define OV2640_BRIGHTNESS_LEVEL2 0x20 /* Brightness level 0 */
|
||||
#define OV2640_BRIGHTNESS_LEVEL3 0x10 /* Brightness level +1 */
|
||||
#define OV2640_BRIGHTNESS_LEVEL4 0x00 /* Brightness level +2 */
|
||||
|
||||
#define OV2640_BLACK_WHITE_BW 0x18 /* Black and white effect */
|
||||
#define OV2640_BLACK_WHITE_NEGATIVE 0x40 /* Negative effect */
|
||||
#define OV2640_BLACK_WHITE_BW_NEGATIVE 0x58 /* BW and Negative effect */
|
||||
#define OV2640_BLACK_WHITE_NORMAL 0x00 /* Normal effect */
|
||||
|
||||
#define OV2640_CONTRAST_LEVEL0 0x3418 /* Contrast level -2 */
|
||||
#define OV2640_CONTRAST_LEVEL1 0x2A1C /* Contrast level -2 */
|
||||
#define OV2640_CONTRAST_LEVEL2 0x2020 /* Contrast level -2 */
|
||||
#define OV2640_CONTRAST_LEVEL3 0x1624 /* Contrast level -2 */
|
||||
#define OV2640_CONTRAST_LEVEL4 0x0C28 /* Contrast level -2 */
|
||||
|
||||
#define OV2640_COLOR_EFFECT_ANTIQUE 0xA640 /* Antique effect */
|
||||
#define OV2640_COLOR_EFFECT_BLUE 0x40A0 /* Blue effect */
|
||||
#define OV2640_COLOR_EFFECT_GREEN 0x4040 /* Green effect */
|
||||
#define OV2640_COLOR_EFFECT_RED 0xC040 /* Red effect */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup OV2640_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void ov2640_Init(uint16_t DeviceAddr, uint32_t resolution);
|
||||
void ov2640_Config(uint16_t DeviceAddr, uint32_t feature, uint32_t value, uint32_t BR_value);
|
||||
uint16_t ov2640_ReadID(uint16_t DeviceAddr);
|
||||
|
||||
void CAMERA_IO_Init(void);
|
||||
void CAMERA_IO_Write(uint8_t addr, uint8_t reg, uint8_t value);
|
||||
uint8_t CAMERA_IO_Read(uint8_t addr, uint8_t reg);
|
||||
void CAMERA_Delay(uint32_t delay);
|
||||
|
||||
/* CAMERA driver structure */
|
||||
extern CAMERA_DrvTypeDef ov2640_drv;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __OV2640_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@ -0,0 +1,158 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for S25FL512S Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 03-August-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">First official release<span class="Apple-converted-space"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span class="Apple-converted-space"></span></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
261
2P-ProjectPong/Drivers/BSP/Components/s25fl512s/s25fl512s.h
Normal file
261
2P-ProjectPong/Drivers/BSP/Components/s25fl512s/s25fl512s.h
Normal file
@ -0,0 +1,261 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file s25fl512s.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 03-August-2015
|
||||
* @brief This file contains all the description of the S25FL512S QSPI memory.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __S25FL512S_H
|
||||
#define __S25FL512S_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup s25fl512s
|
||||
* @brief This file provides a set of definitions for the Spansion
|
||||
* S25FL512S memory (configuration, commands, registers).
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup S25FL512S_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup S25FL512S_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* S25FL512SAGMFI01 Spansion Memory */
|
||||
/**
|
||||
* @brief S25FL512S Configuration
|
||||
*/
|
||||
#define S25FL512S_FLASH_SIZE 0x4000000 /* 512 MBits => 64MBytes */
|
||||
#define S25FL512S_SECTOR_SIZE 0x40000 /* 256 sectors of 256KBytes */
|
||||
#define S25FL512S_PAGE_SIZE 0x200 /* 131072 pages of 512 bytes */
|
||||
|
||||
#define S25FL512S_BULK_ERASE_MAX_TIME 460000
|
||||
#define S25FL512S_SECTOR_ERASE_MAX_TIME 2600
|
||||
|
||||
|
||||
/**
|
||||
* @brief S25FL512S Commands
|
||||
*/
|
||||
/* Reset Operations */
|
||||
#define S25FL512S_SOFTWARE_RESET_CMD 0xF0
|
||||
#define S25FL512S_MODE_BIT_RESET_CMD 0xFF
|
||||
|
||||
/* Identification Operations */
|
||||
#define S25FL512S_READ_ID_CMD 0x90
|
||||
#define S25FL512S_READ_ID_CMD2 0x9F
|
||||
#define S25FL512S_READ_ELECTRONIC_SIGNATURE 0xAB
|
||||
#define S25FL512S_READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
|
||||
|
||||
/* Register Operations */
|
||||
#define S25FL512S_READ_STATUS_REG1_CMD 0x05
|
||||
#define S25FL512S_READ_STATUS_REG2_CMD 0x07
|
||||
#define S25FL512S_READ_CONFIGURATION_REG1_CMD 0x35
|
||||
#define S25FL512S_WRITE_STATUS_CMD_REG_CMD 0x01
|
||||
#define S25FL512S_WRITE_DISABLE_CMD 0x04
|
||||
#define S25FL512S_WRITE_ENABLE_CMD 0x06
|
||||
#define S25FL512S_CLEAR_STATUS_REG1_CMD 0x30
|
||||
#define S25FL512S_READ_AUTOBOOT_REG_CMD 0x14
|
||||
#define S25FL512S_WRITE_AUTOBOOT_REG_CMD 0x15
|
||||
#define S25FL512S_READ_BANK_REG_CMD 0x16
|
||||
#define S25FL512S_WRITE_BANK_REG_CMD 0x17
|
||||
#define S25FL512S_ACCESS_BANK_REG_CMD 0xB9
|
||||
#define S25FL512S_READ_DATA_LEARNING_PATTERN_CMD 0x41
|
||||
#define S25FL512S_PGM_NV_DATA_LEARNING_REG_CMD 0x43
|
||||
#define S25FL512S_WRITE_VOL_DATA_LEARNING_REG_CMD 0x4A
|
||||
|
||||
/* Read Operations */
|
||||
#define S25FL512S_READ_CMD 0x03
|
||||
#define S25FL512S_READ_4_BYTE_ADDR_CMD 0x13
|
||||
|
||||
#define S25FL512S_FAST_READ_CMD 0x0B
|
||||
#define S25FL512S_FAST_READ_4_BYTE_ADDR_CMD 0x0C
|
||||
#define S25FL512S_FAST_READ_DDR_CMD 0x0D
|
||||
#define S25FL512S_FAST_READ__DDR_4_BYTE_ADDR_CMD 0x0E
|
||||
|
||||
#define S25FL512S_DUAL_OUT_FAST_READ_CMD 0x3B
|
||||
#define S25FL512S_DUAL_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x3C
|
||||
|
||||
#define S25FL512S_QUAD_OUT_FAST_READ_CMD 0x6B
|
||||
#define S25FL512S_QUAD_OUT_FAST_READ_4_BYTE_ADDR_CMD 0x6C
|
||||
|
||||
#define S25FL512S_DUAL_INOUT_FAST_READ_CMD 0xBB
|
||||
#define S25FL512S_DUAL_INOUT_FAST_READ_DTR_CMD 0xBD
|
||||
#define S25FL512S_DUAL_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xBC
|
||||
#define S25FL512S_DDR_DUAL_INOUT_READ_4_BYTE_ADDR_CMD 0xBE
|
||||
|
||||
#define S25FL512S_QUAD_INOUT_FAST_READ_CMD 0xEB
|
||||
#define S25FL512S_QUAD_INOUT_FAST_READ_4_BYTE_ADDR_CMD 0xEC
|
||||
#define S25FL512S_QUAD_INOUT_FAST_READ_DDR_CMD 0xED
|
||||
#define S25FL512S_QUAD_INOUT_READ_DDR_4_BYTE_ADDR_CMD 0xEE
|
||||
|
||||
|
||||
/* Program Operations */
|
||||
#define S25FL512S_PAGE_PROG_CMD 0x02
|
||||
#define S25FL512S_PAGE_PROG_4_BYTE_ADDR_CMD 0x12
|
||||
|
||||
#define S25FL512S_QUAD_IN_FAST_PROG_CMD 0x32
|
||||
#define S25FL512S_QUAD_IN_FAST_PROG_ALTERNATE_CMD 0x38
|
||||
#define S25FL512S_QUAD_IN_FAST_PROG_4_BYTE_ADDR_CMD 0x34
|
||||
|
||||
#define S25FL512S_PROGRAM_SUSPEND_CMD 0x85
|
||||
#define S25FL512S_PROGRAM_RESUME_CMD 0x8A
|
||||
|
||||
/* Erase Operations */
|
||||
#define S25FL512S_SECTOR_ERASE_CMD 0xD8
|
||||
#define S25FL512S_SECTOR_ERASE_4_BYTE_ADDR_CMD 0xDC
|
||||
|
||||
#define S25FL512S_BULK_ERASE_CMD 0x60
|
||||
#define S25FL512S_BULK_ERASE_ALTERNATE_CMD 0xC7
|
||||
|
||||
#define S25FL512S_PROG_ERASE_SUSPEND_CMD 0x75
|
||||
#define S25FL512S_PROG_ERASE_RESUME_CMD 0x7A
|
||||
|
||||
/* One-Time Programmable Operations */
|
||||
#define S25FL512S_PROG_OTP_ARRAY_CMD 0x42
|
||||
#define S25FL512S_READ_OTP_ARRAY_CMD 0x4B
|
||||
|
||||
/* Advanced Sector Protection Operations */
|
||||
#define S25FL512S_READ_DYB_CMD 0xE0
|
||||
#define S25FL512S_WRITE_DYB_CMD 0xE1
|
||||
|
||||
#define S25FL512S_READ_PPB_CMD 0xE2
|
||||
#define S25FL512S_PROGRAM_PPB_CMD 0xE3
|
||||
#define S25FL512S_ERASE_PPB_CMD 0xE4
|
||||
|
||||
#define S25FL512S_READ_ASP_CMD 0x2B
|
||||
#define S25FL512S_PROGRAM_ASP_CMD 0x2F
|
||||
|
||||
#define S25FL512S_READ_PPB_LOCKBIT_CMD 0xA7
|
||||
#define S25FL512S_WRITE_PPB_LOCKBIT_CMD 0xA6
|
||||
|
||||
#define S25FL512S_READ_PASSWORD_CMD 0xE7
|
||||
#define S25FL512S_PROGRAM_PASSWORD_CMD 0xE8
|
||||
#define S25FL512S_UNLOCK_PASSWORD_CMD 0xE9
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief S25FL512S Registers
|
||||
*/
|
||||
/* Status Register-1 */
|
||||
#define S25FL512S_SR1_WIP ((uint8_t)0x01) /*!< Write in progress, device busy */
|
||||
#define S25FL512S_SR1_WREN ((uint8_t)0x02) /*!< Write Registers, program or commands are accepted */
|
||||
#define S25FL512S_SR1_BP0 ((uint8_t)0x04) /*!< Sector0 protected from Program or Erase */
|
||||
#define S25FL512S_SR1_BP1 ((uint8_t)0x08) /*!< Sector1 protected from Program or Erase */
|
||||
#define S25FL512S_SR1_BP2 ((uint8_t)0x10) /*!< Sector2 protected from Program or Erase */
|
||||
#define S25FL512S_SR1_ERERR ((uint8_t)0x20) /*!< Erase error */
|
||||
#define S25FL512S_SR1_PGERR ((uint8_t)0x40) /*!< Program error */
|
||||
#define S25FL512S_SR1_SRWD ((uint8_t)0x80) /*!< Status Register Write Disable */
|
||||
|
||||
/* Status Register-2 */
|
||||
#define S25FL512S_SR2_PS ((uint8_t)0x01) /*!< Program in Suspend mode */
|
||||
#define S25FL512S_SR2_ES ((uint8_t)0x02) /*!< Erase Suspend Mode */
|
||||
|
||||
/* Configuration Register CR1 */
|
||||
#define S25FL512S_CR1_FREEZE ((uint8_t)0x01) /*!< Block protection and OTP locked */
|
||||
#define S25FL512S_CR1_QUAD ((uint8_t)0x02) /*!< Quad mode enable */
|
||||
#define S25FL512S_CR1_BPNV ((uint8_t)0x08) /*!< BP2-0 bits of Status Reg are volatile */
|
||||
#define S25FL512S_CR1_TBPROT ((uint8_t)0x20) /*!< BPstarts at bottom */
|
||||
#define S25FL512S_CR1_LC_MASK ((uint8_t)0xC0) /*!< Latency Code mask */
|
||||
#define S25FL512S_CR1_LC0 ((uint8_t)0x00) /*!< Latency Code = 0 */
|
||||
#define S25FL512S_CR1_LC1 ((uint8_t)0x40) /*!< Latency Code = 1 */
|
||||
#define S25FL512S_CR1_LC2 ((uint8_t)0x80) /*!< Latency Code = 2 */
|
||||
#define S25FL512S_CR1_LC3 ((uint8_t)0xC0) /*!< Latency Code = 3 */
|
||||
|
||||
/* AutoBoot Register */
|
||||
#define S25FL512S_AB_EN ((uint32_t)0x00000001) /*!< AutoBoot Enabled */
|
||||
#define S25FL512S_AB_SD_MASK ((uint32_t)0x000001FE) /*!< AutoBoot Start Delay mask */
|
||||
#define S25FL512S_AB_SA_MASK ((uint32_t)0xFFFFFE00) /*!< AutoBoot Start Address mask */
|
||||
|
||||
/* Bank Address Register */
|
||||
#define S25FL512S_BA_BA24 ((uint8_t)0x01) /*!< A24 for 512 Mb device */
|
||||
#define S25FL512S_BA_BA25 ((uint8_t)0x02) /*!< A25 for 512 Mb device */
|
||||
#define S25FL512S_BA_EXTADD ((uint8_t)0x80) /*!< 4 bytes addressing required from command */
|
||||
|
||||
/* ASP Register */
|
||||
#define S25FL512S_ASP_PSTMLB ((uint16_t)0x0002) /*!< Persistent protection mode not permanently enabled */
|
||||
#define S25FL512S_ASP_PWSMLB ((uint16_t)0x0003) /*!< Password protection mode not permanently enabled */
|
||||
|
||||
/* PPB Lock Register */
|
||||
#define S25FL512S_PPBLOCK ((uint8_t)0x01) /*!< PPB array may be programmed or erased */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup S25FL512S_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __S25FL512S_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
1081
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/Release_Notes.html
Normal file
1081
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/Release_Notes.html
Normal file
File diff suppressed because it is too large
Load Diff
3450
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/s5k5cag.c
Normal file
3450
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/s5k5cag.c
Normal file
File diff suppressed because it is too large
Load Diff
148
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/s5k5cag.h
Normal file
148
2P-ProjectPong/Drivers/BSP/Components/s5k5cag/s5k5cag.h
Normal file
@ -0,0 +1,148 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file s5k5cag.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 05-March-2015
|
||||
* @brief This file contains all the functions prototypes for the s5k5cag.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __S5K5CAG_H
|
||||
#define __S5K5CAG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/camera.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup s5k5cag
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief S5K5CAG ID
|
||||
*/
|
||||
#define S5K5CAG_ID ((uint16_t)0x05CA)
|
||||
/**
|
||||
* @brief S5K5CAG Registers
|
||||
*/
|
||||
#define S5K5CAG_INFO_CHIPID1 ((uint16_t)0x0040)
|
||||
#define S5K5CAG_INFO_CHIPID2 ((uint16_t)0x0042)
|
||||
#define S5K5CAG_INFO_SVNVERSION ((uint16_t)0x0048)
|
||||
#define S5K5CAG_INFO_DATE ((uint16_t)0x004E)
|
||||
|
||||
/**
|
||||
* @brief S5K5CAG Features Parameters
|
||||
*/
|
||||
#define S5K5CAG_BRIGHTNESS_LEVEL0 ((uint16_t)0xFF00) /* Brightness level -2 */
|
||||
#define S5K5CAG_BRIGHTNESS_LEVEL1 ((uint16_t)0xFFC0) /* Brightness level -1 */
|
||||
#define S5K5CAG_BRIGHTNESS_LEVEL2 ((uint16_t)0x0000) /* Brightness level 0 */
|
||||
#define S5K5CAG_BRIGHTNESS_LEVEL3 ((uint16_t)0x0050) /* Brightness level +1 */
|
||||
#define S5K5CAG_BRIGHTNESS_LEVEL4 ((uint16_t)0x0080) /* Brightness level +2 */
|
||||
|
||||
#define S5K5CAG_BLACK_WHITE_BW ((uint16_t)0x0001) /* Black and white effect */
|
||||
#define S5K5CAG_BLACK_WHITE_NEGATIVE ((uint16_t)0x0003) /* Negative effect */
|
||||
#define S5K5CAG_BLACK_WHITE_BW_NEGATIVE ((uint16_t)0x0002) /* BW and Negative effect */
|
||||
#define S5K5CAG_BLACK_WHITE_NORMAL ((uint16_t)0x0000) /* Normal effect */
|
||||
|
||||
#define S5K5CAG_CONTRAST_LEVEL0 ((uint16_t)0xFF80) /* Contrast level -2 */
|
||||
#define S5K5CAG_CONTRAST_LEVEL1 ((uint16_t)0xFFC0) /* Contrast level -1 */
|
||||
#define S5K5CAG_CONTRAST_LEVEL2 ((uint16_t)0x0000) /* Contrast level 0 */
|
||||
#define S5K5CAG_CONTRAST_LEVEL3 ((uint16_t)0x0050) /* Contrast level -1 */
|
||||
#define S5K5CAG_CONTRAST_LEVEL4 ((uint16_t)0x0080) /* Contrast level -2 */
|
||||
|
||||
#define S5K5CAG_COLOR_EFFECT_NONE ((uint16_t)0x0000) /* No color effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_ANTIQUE ((uint16_t)0x0004) /* Antique effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_BLUE ((uint16_t)0x0001) /* Blue effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_GREEN ((uint16_t)0x0002) /* Green effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_RED ((uint16_t)0x0003) /* Red effect */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void s5k5cag_Init(uint16_t DeviceAddr, uint32_t resolution);
|
||||
void s5k5cag_Config(uint16_t DeviceAddr, uint32_t feature, uint32_t value, uint32_t BR_value);
|
||||
uint16_t s5k5cag_ReadID(uint16_t DeviceAddr);
|
||||
|
||||
void CAMERA_IO_Init(void);
|
||||
void CAMERA_IO_Write(uint8_t addr, uint16_t reg, uint16_t value);
|
||||
uint16_t CAMERA_IO_Read(uint8_t addr, uint16_t reg);
|
||||
void CAMERA_Delay(uint32_t delay);
|
||||
|
||||
/* CAMERA driver structure */
|
||||
extern CAMERA_DrvTypeDef s5k5cag_drv;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __S5K5CAG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user